Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

robwxdlgs.h

00001 /*
00002  * robwxdlgs.h
00003  * 
00004  * Copyright (c) 2000-2004 by Florian Fischer (florianfischer@gmx.de)
00005  * and Martin Trautmann (martintrautmann@gmx.de) 
00006  * 
00007  * This file may be distributed and/or modified under the terms of the 
00008  * GNU General Public License version 2 as published by the Free Software 
00009  * Foundation. 
00010  * 
00011  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00012  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00013  * 
00014  */
00015 
00016 // visualization: dialogs
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         // helpey functions because it's just insanely complex to do in wxWin
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); // evt_debug_update
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); // makes sure that exactly numEntries exist in lc
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         // wxComponentPointers
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         // status
00154         int curBank, curTask;
00155         bool follow;
00156 };
00157 
00158 #endif
00159 
00160 
00161 //#define DD_INSTRSET 10014
00162 //#define DD_MOBILE 10015
00163 //#define DD_GENERATION 10016
00164 //#define DD_ACTIVE 10017
00165 //#define DD_XPOS 10018
00166 //#define DD_YPOS 10019
00167 //#define DD_COLOUR 10020
00168 //#define DD_FOLLOW 10021
00169 //#define DD_BANKS 10022
00170 //#define DD_PROGRAM 10023
00171 //#define DD_TASK 10024
00172 //#define DD_TASKNUM 10025
00173 //#define DD_CURINSTR 10026
00174 //#define DD_CURBANK 10027
00175 //#define DD_BOTPAINT 10028
00176 //#define DD_CURINSTRTEXT 10029
00177 //#define DD_INSTR 10030
00178 //#define DD_VARIABLES 10031

This is the RoboTour API documentation version 0.1 • Copyright (C) by Florian Fischer