forty.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: forty.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 _FORTY_H_
  13. #define _FORTY_H_
  14. class FortyApp: public wxApp
  15. {
  16. public:
  17. FortyApp(){}
  18. virtual ~FortyApp();
  19. bool OnInit();
  20. static const wxColour& BackgroundColour();
  21. static const wxColour& TextColour();
  22. static const wxBrush& BackgroundBrush();
  23. const wxString& GetHelpFile() const { return m_helpFile; }
  24. private:
  25. static wxColour* m_backgroundColour;
  26. static wxColour* m_textColour;
  27. static wxBrush* m_backgroundBrush;
  28. wxString m_helpFile;
  29. };
  30. DECLARE_APP(FortyApp)
  31. class FortyCanvas;
  32. class FortyFrame: public wxFrame
  33. {
  34. public:
  35. FortyFrame(wxFrame* frame, const wxString& title, const wxPoint& pos, const wxSize& size, bool largecards);
  36. virtual ~FortyFrame(){};
  37. void OnCloseWindow(wxCloseEvent& event);
  38. // Menu callbacks
  39. void NewGame(wxCommandEvent& event);
  40. void Exit(wxCommandEvent& event);
  41. void About(wxCommandEvent& event);
  42. void Help(wxCommandEvent& event);
  43. void Undo(wxCommandEvent& event);
  44. void Redo(wxCommandEvent& event);
  45. void Scores(wxCommandEvent& event);
  46. void ToggleRightButtonUndo(wxCommandEvent& event);
  47. void ToggleHelpingHand(wxCommandEvent& event);
  48. void ToggleCardSize(wxCommandEvent& event);
  49. FortyCanvas* GetCanvas() { return m_canvas; }
  50. DECLARE_EVENT_TABLE()
  51. private:
  52. enum MenuCommands {
  53. SCORES = 10,
  54. RIGHT_BUTTON_UNDO,
  55. HELPING_HAND,
  56. LARGE_CARDS
  57. };
  58. wxMenuBar* m_menuBar;
  59. FortyCanvas* m_canvas;
  60. };
  61. //----------------------------------------------------------------------------
  62. // stAboutDialog
  63. //----------------------------------------------------------------------------
  64. class FortyAboutDialog: public wxDialog
  65. {
  66. public:
  67. // constructors and destructors
  68. FortyAboutDialog( wxWindow *parent, wxWindowID id, const wxString &title,
  69. const wxPoint& pos = wxDefaultPosition,
  70. const wxSize& size = wxDefaultSize,
  71. long style = wxDEFAULT_DIALOG_STYLE );
  72. bool AddControls(wxWindow* parent);
  73. };
  74. #define ID_ABOUT_HTML_WINDOW 1000
  75. #endif