]>
git.saurik.com Git - wxWidgets.git/blob - demos/bombs/bombs.h
1 ///////////////////////////////////////////////////////////////////////////////
4 // Author: P. Foggia 1996
5 // Modified by: Wlodzimierz Skiba (ABX) 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 OnNewEasyGame(wxCommandEvent
& event
);
49 void OnNewMediumGame(wxCommandEvent
& event
);
50 void OnNewHardGame(wxCommandEvent
& event
);
52 void OnExit(wxCommandEvent
& event
);
54 void OnAbout(wxCommandEvent
& event
);
58 // Subwindows for reference within the program.
59 BombsCanvas
*m_canvas
;
64 // App specific menu identifiers
67 bombsID_NEWGAME
= wxID_HIGHEST
,
73 class BombsCanvas
: public wxPanel
77 // Constructor and destructor
79 BombsCanvas(wxFrame
*parent
, BombsGame
*game
);
81 void UpdateGridSize();
83 wxSize
GetGridSizeInPixels() const;
89 void OnPaint(wxPaintEvent
& event
);
90 void DrawField(wxDC
*, int xc1
, int yc1
, int xc2
, int yc2
);
91 void RefreshField(int xc1
, int yc1
, int xc2
, int yc2
);
92 void Uncover(int x
, int y
);
93 void OnMouseEvent(wxMouseEvent
& event
);
94 void OnChar(wxKeyEvent
& event
);
100 // Cell size in pixels
104 DECLARE_EVENT_TABLE()
107 /* The following sizes should probably be redefined */
108 /* dimensions of a scroll unit, in pixels */
112 /* the dimensions of a cell, in scroll units are in
113 * BombsCanvas::x_cell and y_cell
117 #define BOMBS_FONT wxFont(12, wxSWISS, wxNORMAL, wxNORMAL)
119 #define BOMBS_FONT wxFont(14, wxROMAN, wxNORMAL, wxNORMAL)
122 #endif // #ifndef _WX_DEMOS_BOMBS_BOMBS_H_