00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef _AUXFRAMES_H
00028 #define _AUXFRAMES_H
00029
00030 #include "wx/frame.h"
00031 #include "wx/listctrl.h"
00032 #include "wx/textctrl.h"
00033 #include "wx/stattext.h"
00034 #include "wx/listbox.h"
00035 #include "wx/button.h"
00036
00037 #include "searchpanel.h"
00038 #include "gfxboard.h"
00039 #include "gfxresult.h"
00040
00041 #define MIN_FRAME_ID 0
00042 #define MAX_FRAME_ID 9
00043
00044 typedef enum {
00045 ID_Frame_Verif = MIN_FRAME_ID + 0,
00046 ID_Frame_Search = MIN_FRAME_ID + 1,
00047 ID_Frame_Plus1 = MIN_FRAME_ID + 2,
00048 ID_Frame_Racc = MIN_FRAME_ID + 3,
00049 ID_Frame_Benj = MIN_FRAME_ID + 4,
00050 ID_Frame_Bag = MIN_FRAME_ID + 5,
00051 ID_Frame_Board = MIN_FRAME_ID + 6,
00052 ID_Frame_Game = MIN_FRAME_ID + 7,
00053 ID_Frame_Result = MIN_FRAME_ID + 8
00054 } frames_id_t;
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072 class AuxFrame: public wxFrame
00073 {
00074 protected:
00075 int show;
00076 frames_id_t frameid;
00077 wxString name, classname;
00078 ConfigDB config;
00079
00080 public:
00081 AuxFrame (wxFrame*, int, wxString, wxString);
00082 ~AuxFrame();
00083
00084 typedef enum {
00085 REFRESH,
00086 FORCE_REFRESH
00087 } refresh_t;
00088
00089 void SwitchDisplay();
00090 void Reload();
00091 virtual void Refresh(refresh_t force = REFRESH) {};
00092 };
00093
00094
00095
00096
00097
00098 class AuxFrameList: public AuxFrame
00099 {
00100 protected:
00101 bool noresult;
00102 string savedword;
00103 Game *game;
00104 wxButton *button;
00105 wxListBox *listbox;
00106 void Waiting();
00107 virtual void refresh() = 0;
00108 public:
00109 AuxFrameList(wxFrame*, int, wxString, wxString, Game*);
00110 void OnCopy(wxCommandEvent& event);
00111 void Refresh(refresh_t force = REFRESH);
00112 DECLARE_EVENT_TABLE()
00113 };
00114
00115
00116
00117
00118
00119 class AuxFrameText: public AuxFrame
00120 {
00121 protected:
00122 wxTextCtrl *textbox;
00123 public:
00124 AuxFrameText(wxFrame*, int, wxString, wxString, int);
00125 };
00126
00127
00128
00129
00130
00131 class BoardFrame: public AuxFrame
00132 {
00133 protected:
00134 GfxBoard *board;
00135 public:
00136 BoardFrame(wxFrame*, Game&);
00137 void Refresh(refresh_t force = REFRESH);
00138 };
00139
00140
00141
00142
00143
00144 class BagFrame: public AuxFrame
00145 {
00146 private:
00147 Game& m_game;
00148 wxListCtrl *tiles;
00149 public:
00150 BagFrame(wxFrame*, Game&);
00151 void Refresh(refresh_t force = REFRESH);
00152 };
00153
00154
00155
00156
00157
00158 class SearchFrame: public AuxFrame
00159 {
00160 private:
00161 SearchPanel *panel;
00162 public:
00163 SearchFrame(wxFrame*, Dictionary);
00164 void Refresh(refresh_t force = REFRESH);
00165 };
00166
00167
00168
00169
00170
00171 class VerifFrame: public AuxFrame
00172 {
00173 protected:
00174 Dictionary dic;
00175 wxTextCtrl *word;
00176 wxStaticText *result;
00177 void verif();
00178 public:
00179 VerifFrame(wxFrame*, Dictionary);
00180 void OnText(wxCommandEvent& event);
00181 void Refresh(refresh_t force = REFRESH);
00182 DECLARE_EVENT_TABLE()
00183 };
00184
00185
00186
00187
00188
00189 class Plus1Frame: public AuxFrameList
00190 {
00191 protected:
00192 virtual void refresh();
00193 public:
00194 Plus1Frame(wxFrame* p, Game* g) : AuxFrameList(p, ID_Frame_Plus1, wxT("Tirage + 1"), FRAMEPLUS1, g) {};
00195 };
00196
00197
00198
00199
00200
00201 class BenjFrame: public AuxFrameList
00202 {
00203 protected:
00204 virtual void refresh();
00205 public:
00206 BenjFrame(wxFrame* p, Game* g) : AuxFrameList(p, ID_Frame_Benj, wxT("benjamins"), FRAMEBENJ, g) {};
00207 };
00208
00209
00210
00211
00212
00213 class RaccFrame: public AuxFrameList
00214 {
00215 protected:
00216 virtual void refresh();
00217 public:
00218 RaccFrame(wxFrame* p, Game* g) : AuxFrameList(p, ID_Frame_Racc, wxT("raccords"), FRAMERACC, g) {};
00219 };
00220
00221
00222
00223
00224
00225 class GameFrame: public AuxFrameText
00226 {
00227 protected:
00228 Game& m_game;
00229 public:
00230 GameFrame(wxFrame*, Game&);
00231 void Refresh(refresh_t force = REFRESH);
00232 };
00233
00234
00235
00236
00237
00238 class ResultFrame: public AuxFrame
00239 {
00240 protected:
00241 GfxResult *reslist;
00242 public:
00243 ResultFrame(wxFrame*, Game*);
00244 void Search();
00245 int GetSelected();
00246 void Refresh(refresh_t force = REFRESH);
00247 void OnSize(wxSizeEvent& e);
00248 DECLARE_EVENT_TABLE()
00249 };
00250
00251 #endif
00252
00253
00254
00255
00256
00257