]>
git.saurik.com Git - wxWidgets.git/blob - samples/bombs/bombs.h
1 ///////////////////////////////////////////////////////////////////////////////
4 // Author: P. Foggia 1996
8 // Copyright: (c) 1996 P. Foggia
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
18 * Forward declarations of all top-level window classes.
20 class BombsFrameClass
;
21 class AboutFrameClass
;
24 * Class representing the entire Application
26 class AppClass
: public wxApp
29 BombsFrameClass
*BombsFrame
;
38 class BombsCanvasClass
;
40 class BombsFrameClass
: public wxFrame
45 // Subwindows for reference within the program.
46 BombsCanvasClass
*BombsCanvas
;
49 // Constructor and destructor
50 BombsFrameClass(wxFrame
*parent
, const wxString
& title
, const wxPoint
& pos
, const wxSize
& size
, long style
);
51 ~BombsFrameClass(void);
53 void OnCloseWindow(wxCloseEvent
& event
);
54 void OnExit(wxCommandEvent
& event
);
55 void OnRestart(wxCommandEvent
& event
);
56 void OnAbout(wxCommandEvent
& event
);
57 void OnEasy(wxCommandEvent
& event
);
58 void OnMedium(wxCommandEvent
& event
);
59 void OnDifficult(wxCommandEvent
& event
);
67 #define BOMBSFRAMECLASS_FILE 1
73 #define BOMBSFRAMECLASS_GAME 4
81 #define IDM_DIFFICULT 8
83 class BombsCanvasClass
: public wxWindow
88 int field_width
, field_height
;
91 // Constructor and destructor
92 BombsCanvasClass(wxFrame
*parent
, const wxPoint
& pos
= wxDefaultPosition
, const wxSize
& size
= wxDefaultSize
, long style
= 0);
93 ~BombsCanvasClass(void);
95 void OnPaint(wxPaintEvent
& event
);
96 void DrawField(wxDC
*, int xc1
, int yc1
, int xc2
, int yc2
);
97 void Refresh(int xc1
, int yc1
, int xc2
, int yc2
);
98 void OnEvent(wxMouseEvent
& event
);
99 void UpdateFieldSize();
101 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 * BombsCanvasClass::x_cell and y_cell
116 #define BOMBS_FONT wxFont(14, wxROMAN, wxNORMAL, wxNORMAL)
118 #endif /* mutual exclusion */