wxMessageBox off the main thread lost result code.
[wxWidgets.git] / demos / forty / forty.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: forty.h
3 // Purpose: Forty Thieves patience game
4 // Author: Chris Breeze
5 // Modified by:
6 // Created: 21/07/97
7 // Copyright: (c) 1993-1998 Chris Breeze
8 // Licence: wxWindows licence
9 //---------------------------------------------------------------------------
10 // Last modified: 22nd July 1998 - ported to wxWidgets 2.0
11 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _FORTY_H_
13 #define _FORTY_H_
14
15 class FortyApp: public wxApp
16 {
17 public:
18 FortyApp(){}
19 virtual ~FortyApp();
20 bool OnInit();
21
22 static const wxColour& BackgroundColour();
23 static const wxColour& TextColour();
24 static const wxBrush& BackgroundBrush();
25 const wxString& GetHelpFile() const { return m_helpFile; }
26
27 private:
28 static wxColour* m_backgroundColour;
29 static wxColour* m_textColour;
30 static wxBrush* m_backgroundBrush;
31 wxString m_helpFile;
32 };
33
34 DECLARE_APP(FortyApp)
35
36 class FortyCanvas;
37 class FortyFrame: public wxFrame
38 {
39 public:
40 FortyFrame(wxFrame* frame, const wxString& title, const wxPoint& pos, const wxSize& size, bool largecards);
41 virtual ~FortyFrame(){};
42
43 void OnCloseWindow(wxCloseEvent& event);
44
45 // Menu callbacks
46 void NewGame(wxCommandEvent& event);
47 void Exit(wxCommandEvent& event);
48 void About(wxCommandEvent& event);
49 void Help(wxCommandEvent& event);
50 void Undo(wxCommandEvent& event);
51 void Redo(wxCommandEvent& event);
52 void Scores(wxCommandEvent& event);
53 void ToggleRightButtonUndo(wxCommandEvent& event);
54 void ToggleHelpingHand(wxCommandEvent& event);
55 void ToggleCardSize(wxCommandEvent& event);
56
57 FortyCanvas* GetCanvas() { return m_canvas; }
58
59 DECLARE_EVENT_TABLE()
60
61 private:
62 enum MenuCommands {
63 SCORES = 10,
64 RIGHT_BUTTON_UNDO,
65 HELPING_HAND,
66 LARGE_CARDS
67 };
68
69 wxMenuBar* m_menuBar;
70 FortyCanvas* m_canvas;
71 };
72
73 //----------------------------------------------------------------------------
74 // stAboutDialog
75 //----------------------------------------------------------------------------
76
77 class FortyAboutDialog: public wxDialog
78 {
79 public:
80 // constructors and destructors
81 FortyAboutDialog( wxWindow *parent, wxWindowID id, const wxString &title,
82 const wxPoint& pos = wxDefaultPosition,
83 const wxSize& size = wxDefaultSize,
84 long style = wxDEFAULT_DIALOG_STYLE );
85
86 bool AddControls(wxWindow* parent);
87 };
88
89 #define ID_ABOUT_HTML_WINDOW 1000
90
91 #endif