]>
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
8 // Copyright: (c) 1996 P. Foggia
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_DEMOS_BOMBS_BOMBS_H_
13 #define _WX_DEMOS_BOMBS_BOMBS_H_
20 * Class representing the entire Application
22 class BombsApp
: public wxApp
25 virtual bool OnInit();
38 class BombsFrame
: public wxFrame
42 BombsFrame(BombsGame
*bombsGame
);
44 void NewGame(int level
, bool query
);
48 void OnNewGame(wxCommandEvent
& event
);
49 void OnEasyGame(wxCommandEvent
& event
);
50 void OnMediumGame(wxCommandEvent
& event
);
51 void OnHardGame(wxCommandEvent
& event
);
53 void OnEasyCorner(wxCommandEvent
& event
);
55 void OnExit(wxCommandEvent
& event
);
57 void OnAbout(wxCommandEvent
& event
);
63 // Subwindows for reference within the program.
64 BombsCanvas
*m_canvas
;
69 // App specific menu identifiers
72 bombsID_LEVEL
= wxID_HIGHEST
,
79 class BombsCanvas
: public wxPanel
83 // Constructor and destructor
85 BombsCanvas(wxFrame
*parent
, BombsGame
*game
);
87 void UpdateGridSize();
89 wxSize
GetGridSizeInPixels() const;
91 virtual ~BombsCanvas();
95 void OnPaint(wxPaintEvent
& event
);
96 void DrawField(wxDC
*, int xc1
, int yc1
, int xc2
, int yc2
);
97 void RefreshField(int xc1
, int yc1
, int xc2
, int yc2
);
98 void Uncover(int x
, int y
);
99 void OnMouseEvent(wxMouseEvent
& event
);
100 void OnChar(wxKeyEvent
& event
);
106 // Cell size in pixels
110 DECLARE_EVENT_TABLE()
113 /* The following sizes should probably be redefined */
114 /* dimensions of a scroll unit, in pixels */
118 /* the dimensions of a cell, in scroll units are in
119 * BombsCanvas::x_cell and y_cell
123 #define BOMBS_FONT wxFont(12, wxSWISS, wxNORMAL, wxNORMAL)
125 #define BOMBS_FONT wxFont(14, wxROMAN, wxNORMAL, wxNORMAL)
128 #endif // #ifndef _WX_DEMOS_BOMBS_BOMBS_H_