00001 /* Eliot */ 00002 /* Copyright (C) 1999 Antoine Fraboulet */ 00003 /* Antoine.Fraboulet@free.fr */ 00004 /* */ 00005 /* This program is free software; you can redistribute it and/or modify */ 00006 /* it under the terms of the GNU General Public License as published by */ 00007 /* the Free Software Foundation; either version 2 of the License, or */ 00008 /* (at your option) any later version. */ 00009 /* */ 00010 /* This program is distributed in the hope that it will be useful, */ 00011 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ 00012 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ 00013 /* GNU General Public License for more details. */ 00014 /* */ 00015 /* You should have received a copy of the GNU General Public License */ 00016 /* along with this program; if not, write to the Free Software */ 00017 /* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 00018 00019 /** 00020 * \file mainframe.h 00021 * \brief Main frame for the Eliot GUI 00022 * \author Antoine Fraboulet 00023 * \date 2005 00024 */ 00025 00026 #ifndef _MAINFRAME_H_ 00027 #define _MAINFRAME_H_ 00028 00029 #include "dic.h" 00030 #include "game.h" 00031 #include "auxframes.h" 00032 00033 class MainFrame: public wxFrame 00034 { 00035 private: 00036 00037 Dictionary m_dic; 00038 Game *m_game; 00039 ConfigDB config; 00040 AuxFrame *auxframes_ptr[MAX_FRAME_ID]; 00041 00042 wxTextCtrl *rack; 00043 #ifdef ENABLE_RESLIST_IN_MAIN 00044 GfxResult *reslist; 00045 #endif 00046 00047 wxButton *b_play; 00048 wxButton *b_rackrandomset; 00049 wxButton *b_rackrandomnew; 00050 wxButton *b_search; 00051 wxButton *b_back; 00052 00053 wxStatusBar *statusbar; 00054 00055 void InitFrames(); 00056 void InitMenu(); 00057 void UpdateStatusBar(); 00058 00059 public: 00060 MainFrame(wxPoint,wxSize); 00061 virtual ~MainFrame(); 00062 00063 // ******* 00064 // Actions 00065 // ******* 00066 void SetRack(Game::set_rack_mode, wxString = wxT("")); 00067 void Search(); 00068 void Play(int); 00069 void TestPlay(int); 00070 00071 void UpdateFrames(AuxFrame::refresh_t force = AuxFrame::REFRESH); 00072 00073 // ***** 00074 // Menus 00075 // ***** 00076 void OnMenuGameNew (wxCommandEvent& event); 00077 void OnMenuGameOpen (wxCommandEvent& event); 00078 void OnMenuGameSave (wxCommandEvent& event); 00079 void OnMenuGamePrint (wxCommandEvent& event); 00080 void OnMenuGamePrintPreview (wxCommandEvent& event); 00081 void OnMenuGamePrintPS (wxCommandEvent& event); 00082 00083 void OnMenuConfGameDic (wxCommandEvent& event); 00084 void OnMenuConfGameSearch (wxCommandEvent& event); 00085 00086 void OnMenuConfPrint (wxCommandEvent& event); 00087 00088 void OnMenuConfAspectFont (wxCommandEvent& event); 00089 void OnMenuConfAspectBoardColour (wxCommandEvent& event); 00090 00091 void OnMenuShowFrame (wxCommandEvent& event); 00092 00093 void OnMenuQuitApropos (wxCommandEvent& event); 00094 void OnMenuQuitConfirm (wxCommandEvent& event); 00095 00096 // ******* 00097 // Buttons 00098 // ******* 00099 void OnPlay (wxCommandEvent& event); 00100 void OnSetRack (wxCommandEvent& event); 00101 void OnSearch (wxCommandEvent& event); 00102 void OnPlayBack (wxCommandEvent& event); 00103 void OnTextEnter(wxCommandEvent& event); 00104 00105 // ******* 00106 // Objects 00107 // ******* 00108 void OnCloseWindow (wxCloseEvent& event); 00109 00110 DECLARE_EVENT_TABLE() 00111 }; 00112 00113 #endif 00114 00115 /// Local Variables: 00116 /// mode: c++ 00117 /// mode: hs-minor 00118 /// c-basic-offset: 4 00119 /// End: