]>
git.saurik.com Git - wxWidgets.git/blob - demos/bombs/bombs.h
1 ///////////////////////////////////////////////////////////////////////////////
4 // Author: P. Foggia 1996
5 // Modified by: Wlodzimierz Skiba (ABX) since 2003
7 // Copyright: (c) 1996 P. Foggia
8 // Licence: wxWindows licence
9 ///////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_DEMOS_BOMBS_BOMBS_H_
12 #define _WX_DEMOS_BOMBS_BOMBS_H_
19 * Class representing the entire Application
21 class BombsApp
: public wxApp
24 virtual bool OnInit();
37 class BombsFrame
: public wxFrame
41 BombsFrame(BombsGame
*bombsGame
);
43 void NewGame(int level
, bool query
);
47 void OnNewGame(wxCommandEvent
& event
);
48 void OnEasyGame(wxCommandEvent
& event
);
49 void OnMediumGame(wxCommandEvent
& event
);
50 void OnHardGame(wxCommandEvent
& event
);
52 void OnEasyCorner(wxCommandEvent
& event
);
54 void OnExit(wxCommandEvent
& event
);
56 void OnAbout(wxCommandEvent
& event
);
62 // Subwindows for reference within the program.
63 BombsCanvas
*m_canvas
;
68 // App specific menu identifiers
71 bombsID_LEVEL
= wxID_HIGHEST
,
78 class BombsCanvas
: public wxPanel
82 // Constructor and destructor
84 BombsCanvas(wxFrame
*parent
, BombsGame
*game
);
86 void UpdateGridSize();
88 wxSize
GetGridSizeInPixels() const;
90 virtual ~BombsCanvas();
94 void OnPaint(wxPaintEvent
& event
);
95 void DrawField(wxDC
*, int xc1
, int yc1
, int xc2
, int yc2
);
96 void RefreshField(int xc1
, int yc1
, int xc2
, int yc2
);
97 void Uncover(int x
, int y
);
98 void OnMouseEvent(wxMouseEvent
& event
);
99 void OnChar(wxKeyEvent
& event
);
105 // Cell size in pixels
109 DECLARE_EVENT_TABLE()
112 /* The following sizes should probably be redefined */
113 /* dimensions of a scroll unit, in pixels */
117 /* the dimensions of a cell, in scroll units are in
118 * BombsCanvas::x_cell and y_cell
122 #define BOMBS_FONT wxFont(12, wxSWISS, wxNORMAL, wxNORMAL)
124 #define BOMBS_FONT wxFont(14, wxROMAN, wxNORMAL, wxNORMAL)
127 #endif // #ifndef _WX_DEMOS_BOMBS_BOMBS_H_