Define _CRT_NONSTDC_NO_WARNINGS for zlib compilation with MSVC.
[wxWidgets.git] / demos / forty / canvas.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: canvas.h
3 // Purpose: Forty Thieves patience game
4 // Author: Chris Breeze
5 // Modified by:
6 // Created: 21/07/97
7 // Copyright: (c) 1993-1998 Chris Breeze
8 // Licence: wxWindows licence
9 //---------------------------------------------------------------------------
10 // Last modified: 22nd July 1998 - ported to wxWidgets 2.0
11 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _CANVAS_H_
13 #define _CANVAS_H_
14
15 class Card;
16 class Game;
17 class ScoreFile;
18 class PlayerSelectionDialog;
19
20 class FortyCanvas: public wxScrolledWindow
21 {
22 public:
23 FortyCanvas(wxWindow* parent, const wxPoint& pos, const wxSize& size);
24 virtual ~FortyCanvas();
25
26 virtual void OnDraw(wxDC& dc);
27 bool OnCloseCanvas();
28 void OnMouseEvent(wxMouseEvent& event);
29 void SetCursorStyle(int x, int y);
30
31 void NewGame();
32 void Undo();
33 void Redo();
34
35 ScoreFile* GetScoreFile() const { return m_scoreFile; }
36 void UpdateScores();
37 void EnableHelpingHand(bool enable) { m_helpingHand = enable; }
38 void EnableRightButtonUndo(bool enable) { m_rightBtnUndo = enable; }
39 void LayoutGame();
40 void ShowPlayerDialog();
41
42 DECLARE_EVENT_TABLE()
43
44 private:
45 wxFont* m_font;
46 Game* m_game;
47 ScoreFile* m_scoreFile;
48 wxCursor* m_arrowCursor;
49 wxCursor* m_handCursor;
50 bool m_helpingHand;
51 bool m_rightBtnUndo;
52 wxString m_player;
53 PlayerSelectionDialog* m_playerDialog;
54 bool m_leftBtnDown;
55 };
56
57 #endif