1 |
/* Eliot */ |
/* Eliot */ |
2 |
/* Copyright (C) 1999 Antoine Fraboulet */ |
/* Copyright (C) 1999 Antoine Fraboulet */ |
|
/* Antoine.Fraboulet@free.fr */ |
|
3 |
/* */ |
/* */ |
4 |
/* This program is free software; you can redistribute it and/or modify */ |
/* This file is part of Eliot. */ |
5 |
|
/* */ |
6 |
|
/* Eliot is free software; you can redistribute it and/or modify */ |
7 |
/* it under the terms of the GNU General Public License as published by */ |
/* it under the terms of the GNU General Public License as published by */ |
8 |
/* the Free Software Foundation; either version 2 of the License, or */ |
/* the Free Software Foundation; either version 2 of the License, or */ |
9 |
/* (at your option) any later version. */ |
/* (at your option) any later version. */ |
10 |
/* */ |
/* */ |
11 |
/* This program is distributed in the hope that it will be useful, */ |
/* Eliot is distributed in the hope that it will be useful, */ |
12 |
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ |
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ |
13 |
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ |
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ |
14 |
/* GNU General Public License for more details. */ |
/* GNU General Public License for more details. */ |
19 |
|
|
20 |
/* $Id$ */ |
/* $Id$ */ |
21 |
|
|
22 |
// -*- C++ -*- |
/** |
23 |
|
* \file mainframe.h |
24 |
|
* \brief Main frame for the Eliot GUI |
25 |
|
* \author Antoine Fraboulet |
26 |
|
* \date 2005 |
27 |
|
*/ |
28 |
|
|
29 |
#ifndef _MAINFRAME_H |
#ifndef _MAINFRAME_H |
30 |
#define _MAINFRAME_H |
#define _MAINFRAME_H |
31 |
|
|
33 |
#include "game.h" |
#include "game.h" |
34 |
#include "auxframes.h" |
#include "auxframes.h" |
35 |
|
|
36 |
|
/** |
37 |
|
* Main Eliot Frame, contains the menu and game main window |
38 |
|
*/ |
39 |
|
|
40 |
class MainFrame: public wxFrame |
class MainFrame: public wxFrame |
41 |
{ |
{ |
42 |
private: |
private: |
43 |
|
|
44 |
Dictionary m_dic; |
Dictionary m_dic; |
45 |
Game *m_game; |
Game *m_game; |
46 |
ConfigDB config; |
ConfigDB config; |
47 |
AuxFrame *auxframes_ptr[MAX_FRAME_ID]; |
AuxFrame *auxframes_ptr[MAX_FRAME_ID]; |
48 |
|
|
49 |
wxTextCtrl *rack; |
wxTextCtrl *rack; |
50 |
wxListCtrl *results; |
#ifdef ENABLE_RESLIST_IN_MAIN |
51 |
|
GfxResult *reslist; |
52 |
|
#endif |
53 |
wxButton *b_play; |
wxButton *b_play; |
54 |
wxButton *b_rackrandomset; |
wxButton *b_rackrandomset; |
55 |
wxButton *b_rackrandomnew; |
wxButton *b_rackrandomnew; |
56 |
wxButton *b_search; |
wxButton *b_search; |
57 |
wxButton *b_back; |
wxButton *b_back; |
|
wxStatusBar *statusbar; |
|
58 |
|
|
59 |
void Play(int); |
wxStatusBar *statusbar; |
|
void Search(); |
|
60 |
|
|
61 |
void InitFrames(); |
void InitFrames(); |
62 |
void InitMenu(); |
void InitMenu(); |
63 |
void UpdateStatusBar(); |
void UpdateStatusBar(); |
|
void UpdateFrames(refresh_t force = REFRESH); |
|
64 |
|
|
65 |
public: |
public: |
66 |
MainFrame(wxPoint,wxSize); |
MainFrame(wxPoint,wxSize); |
67 |
virtual ~MainFrame(); |
virtual ~MainFrame(); |
68 |
|
|
69 |
|
// ******* |
70 |
|
// Actions |
71 |
|
// ******* |
72 |
|
void SetRack(PlayedRack::set_rack_mode, wxString = wxT("")); |
73 |
|
void Search(); |
74 |
|
void Play(int); |
75 |
|
void TestPlay(int); |
76 |
|
|
77 |
|
void UpdateFrames(refresh_t force = REFRESH); |
78 |
|
|
79 |
// ***** |
// ***** |
80 |
// Menus |
// Menus |
81 |
// ***** |
// ***** |
106 |
void OnSetRack (wxCommandEvent& event); |
void OnSetRack (wxCommandEvent& event); |
107 |
void OnSearch (wxCommandEvent& event); |
void OnSearch (wxCommandEvent& event); |
108 |
void OnPlayBack (wxCommandEvent& event); |
void OnPlayBack (wxCommandEvent& event); |
109 |
|
void OnTextEnter(wxCommandEvent& event); |
110 |
|
|
111 |
// ******* |
// ******* |
112 |
// Objects |
// Objects |
113 |
// ******* |
// ******* |
|
void OnListCtrlSelected (wxListEvent& event); |
|
|
void OnListCtrlActivated (wxListEvent& event); |
|
|
|
|
114 |
void OnCloseWindow (wxCloseEvent& event); |
void OnCloseWindow (wxCloseEvent& event); |
115 |
|
|
116 |
DECLARE_EVENT_TABLE() |
DECLARE_EVENT_TABLE() |