canvas.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. class Card;
  15. class Game;
  16. class ScoreFile;
  17. class PlayerSelectionDialog;
  18. class FortyCanvas: public wxScrolledWindow
  19. {
  20. public:
  21. FortyCanvas(wxWindow* parent, const wxPoint& pos, const wxSize& size);
  22. virtual ~FortyCanvas();
  23. virtual void OnDraw(wxDC& dc);
  24. bool OnCloseCanvas();
  25. void OnMouseEvent(wxMouseEvent& event);
  26. void SetCursorStyle(int x, int y);
  27. void NewGame();
  28. void Undo();
  29. void Redo();
  30. ScoreFile* GetScoreFile() const { return m_scoreFile; }
  31. void UpdateScores();
  32. void EnableHelpingHand(bool enable) { m_helpingHand = enable; }
  33. void EnableRightButtonUndo(bool enable) { m_rightBtnUndo = enable; }
  34. void LayoutGame();
  35. void ShowPlayerDialog();
  36. DECLARE_EVENT_TABLE()
  37. private:
  38. wxFont* m_font;
  39. Game* m_game;
  40. ScoreFile* m_scoreFile;
  41. wxCursor* m_arrowCursor;
  42. wxCursor* m_handCursor;
  43. bool m_helpingHand;
  44. bool m_rightBtnUndo;
  45. wxString m_player;
  46. PlayerSelectionDialog* m_playerDialog;
  47. bool m_leftBtnDown;
  48. };
  49. #endif