00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef __RT_WXDIALOGS_H__
00019 #define __RT_WXDIALOGS_H__
00020
00021 #include <wx/wx.h>
00022 #include "robbase.h"
00023 #include "robglob.h"
00024
00025 #include "robwxstruct.h"
00026
00027 class ImprovedListCtrl;
00028
00029 class TourSetupDialog : public wxDialog, public rt::ErrorHandler
00030 {
00031 public:
00032 TourSetupDialog(TourSetupInfo* data);
00033
00034
00035 virtual void handleBotError(const rt::Bot* affectedBot, rt::ExecReturnType type) const {}
00036 virtual void handleLoadError(const lrt::String& affectedFile, const lrt::String& message) const;
00037 virtual void handleSystemError(int num, const lrt::String& message) const {}
00038
00039 DECLARE_EVENT_TABLE()
00040 private:
00041
00042 wxString GetItemText(wxListCtrl* ctrl, long row, int col);
00043 void GetItemInfo(wxListCtrl* ctrl, long row, int col, wxListItem& info);
00044 lrt::Vector<long> GetSelectedItems(wxListCtrl* ctrl);
00045 void SelectOnly(wxListCtrl* ctrl, long row);
00046
00047 void AddBot(const wxString&);
00048 void SwapBots(long b1, long b2);
00049
00050 void OnAdd(wxCommandEvent&);
00051 void OnRemove(wxCommandEvent&);
00052 void OnMoveUp(wxCommandEvent&);
00053 void OnMoveDown(wxCommandEvent&);
00054 void OnOptionSet(wxCommandEvent&);
00055
00056 void OnOK(wxCommandEvent&);
00057
00058 wxString robotPath;
00059 TourSetupInfo* data;
00060 rt::Globals assemblyGlob;
00061 mutable lrt::String loadErrors;
00062 };
00063
00064 class wxCheckListBox;
00065
00066 class BotErrFilterDialog : public wxDialog
00067 {
00068 public:
00069 BotErrFilterDialog();
00070 bool Filter(int errnum) { if(allowAny) return allowSpecific[-errnum]; else return false; }
00071
00072 virtual bool Destroy() { StoreSettings(); return wxDialog::Destroy(); }
00073
00074 DECLARE_EVENT_TABLE()
00075 private:
00076 void LoadSettings();
00077 void StoreSettings();
00078
00079 void OnToggleAny(wxCommandEvent&);
00080 void OnToggleSpecific(wxCommandEvent&);
00081
00082 void OnCloseButton(wxCommandEvent&) { StoreSettings(); Hide(); }
00083 void OnCloseWindow(wxCloseEvent&) { StoreSettings(); Hide(); }
00084
00085 bool allowAny;
00086 lrt::Array<bool> allowSpecific;
00087
00088 wxCheckBox* anyCB;
00089 wxCheckListBox* specificCLB;
00090 };
00091
00092 class BotPainter;
00093
00094 class ProgramColourDialog : public wxDialog
00095 {
00096 public:
00097 ProgramColourDialog(const BotPainter& prevSettings);
00098 ~ProgramColourDialog();
00099
00100 BotPainter& GetPainter() { return *painter; }
00101
00102 private:
00103 BotPainter* painter;
00104 };
00105
00106
00107 class DebugDialog : public wxDialog
00108 {
00109 public:
00110 DebugDialog(DebugInfo& initialInfo);
00111 ~DebugDialog();
00112
00113 void HandleUpdate(DebugInfo& newInfo, bool first = false);
00114 void HandleProgramColourChange();
00115
00116 DECLARE_EVENT_TABLE()
00117 private:
00118 void StoreSettings();
00119 void LoadSettings();
00120
00121 void FindWindows();
00122 void SetupColumns();
00123 void SetLCLength(wxListCtrl* lc, long numEntries);
00124
00125 void UpdateTaskData(DebugInfo& info, bool force = false);
00126 void UpdateInstrList(DebugInfo& info);
00127 void UpdateBankImageList();
00128
00129 void OnTask(wxCommandEvent&);
00130 void OnFollow(wxCommandEvent&);
00131 void OnBankList(wxListEvent&);
00132
00133 void OnCloseWindow(wxCloseEvent&);
00134
00135 DebugInfo info;
00136
00137
00138 wxCheckBox* followCB;
00139 wxSlider* taskSL;
00140
00141 ImprovedListCtrl* bankLC;
00142 wxListBox* instrLB;
00143 ImprovedListCtrl* unnamedVarLC;
00144 lrt::Array<wxStaticText*> namedVarT;
00145 wxPanel* colourP;
00146 wxPanel* taskViewP;
00147 wxStaticText* programT;
00148 wxStaticText* taskNumT;
00149 wxStaticText* curInstrT;
00150 wxStaticText* curBankT;
00151 wxStaticText* curInstrTextT;
00152
00153
00154 int curBank, curTask;
00155 bool follow;
00156 };
00157
00158 #endif
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178