]> git.saurik.com Git - wxWidgets.git/blob - demos/forty/forty.h
Don't do the wx cleanup if wxPython didn't do the initialization.
[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 // RCS-ID: $Id$
8 // Copyright: (c) 1993-1998 Chris Breeze
9 // Licence: wxWindows licence
10 //---------------------------------------------------------------------------
11 // Last modified: 22nd July 1998 - ported to wxWindows 2.0
12 /////////////////////////////////////////////////////////////////////////////
13 #ifndef _FORTY_H_
14 #define _FORTY_H_
15
16 class FortyApp: public wxApp
17 {
18 public:
19 FortyApp();
20 ~FortyApp();
21 bool OnInit();
22
23 static const wxColour& BackgroundColour();
24 static const wxColour& TextColour();
25 static const wxBrush& BackgroundBrush();
26
27 private:
28 static wxColour* m_backgroundColour;
29 static wxColour* m_textColour;
30 static wxBrush* m_backgroundBrush;
31 };
32
33 class FortyCanvas;
34 class FortyFrame: public wxFrame
35 {
36 public:
37 FortyFrame(wxFrame* frame, char* title, int x, int y, int w, int h,bool largecards);
38 virtual ~FortyFrame();
39
40 void OnCloseWindow(wxCloseEvent& event);
41
42 // Menu callbacks
43 void NewGame(wxCommandEvent& event);
44 void Exit(wxCommandEvent& event);
45 void About(wxCommandEvent& event);
46 void Undo(wxCommandEvent& event);
47 void Redo(wxCommandEvent& event);
48 void Scores(wxCommandEvent& event);
49 void ToggleRightButtonUndo(wxCommandEvent& event);
50 void ToggleHelpingHand(wxCommandEvent& event);
51 void ToggleCardSize(wxCommandEvent& event);
52
53 FortyCanvas* GetCanvas() { return m_canvas; }
54
55 DECLARE_EVENT_TABLE()
56
57 private:
58 enum MenuCommands { NEW_GAME = 10, SCORES, EXIT,
59 UNDO, REDO,
60 RIGHT_BUTTON_UNDO, HELPING_HAND, LARGE_CARDS,
61 ABOUT };
62
63 wxMenuBar* m_menuBar;
64 FortyCanvas* m_canvas;
65 };
66
67 #endif