1998-07-24 15:43:32 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: canvas.h
|
|
|
|
// Purpose: Forty Thieves patience game
|
|
|
|
// Author: Chris Breeze
|
|
|
|
// Modified by:
|
|
|
|
// Created: 21/07/97
|
|
|
|
// Copyright: (c) 1993-1998 Chris Breeze
|
2004-06-02 05:14:59 -04:00
|
|
|
// Licence: wxWindows licence
|
1998-07-24 15:43:32 -04:00
|
|
|
//---------------------------------------------------------------------------
|
2004-05-25 07:20:37 -04:00
|
|
|
// Last modified: 22nd July 1998 - ported to wxWidgets 2.0
|
1998-07-24 15:43:32 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
#ifndef _CANVAS_H_
|
|
|
|
#define _CANVAS_H_
|
|
|
|
|
|
|
|
class Card;
|
|
|
|
class Game;
|
|
|
|
class ScoreFile;
|
|
|
|
class PlayerSelectionDialog;
|
|
|
|
|
|
|
|
class FortyCanvas: public wxScrolledWindow
|
|
|
|
{
|
|
|
|
public:
|
2004-06-02 05:14:59 -04:00
|
|
|
FortyCanvas(wxWindow* parent, const wxPoint& pos, const wxSize& size);
|
|
|
|
virtual ~FortyCanvas();
|
1998-07-24 15:43:32 -04:00
|
|
|
|
2018-09-21 13:46:49 -04:00
|
|
|
virtual void OnDraw(wxDC& dc) wxOVERRIDE;
|
2004-06-02 05:14:59 -04:00
|
|
|
bool OnCloseCanvas();
|
|
|
|
void OnMouseEvent(wxMouseEvent& event);
|
|
|
|
void SetCursorStyle(int x, int y);
|
1998-07-24 15:43:32 -04:00
|
|
|
|
2004-06-02 05:14:59 -04:00
|
|
|
void NewGame();
|
|
|
|
void Undo();
|
|
|
|
void Redo();
|
1998-07-24 15:43:32 -04:00
|
|
|
|
2004-06-02 05:14:59 -04:00
|
|
|
ScoreFile* GetScoreFile() const { return m_scoreFile; }
|
|
|
|
void UpdateScores();
|
|
|
|
void EnableHelpingHand(bool enable) { m_helpingHand = enable; }
|
|
|
|
void EnableRightButtonUndo(bool enable) { m_rightBtnUndo = enable; }
|
|
|
|
void LayoutGame();
|
|
|
|
void ShowPlayerDialog();
|
1998-07-24 15:43:32 -04:00
|
|
|
|
2015-04-23 07:49:01 -04:00
|
|
|
wxDECLARE_EVENT_TABLE();
|
1998-07-24 15:43:32 -04:00
|
|
|
|
|
|
|
private:
|
2004-06-02 05:14:59 -04:00
|
|
|
wxFont* m_font;
|
|
|
|
Game* m_game;
|
|
|
|
ScoreFile* m_scoreFile;
|
|
|
|
wxCursor* m_arrowCursor;
|
|
|
|
wxCursor* m_handCursor;
|
|
|
|
bool m_helpingHand;
|
|
|
|
bool m_rightBtnUndo;
|
|
|
|
wxString m_player;
|
|
|
|
PlayerSelectionDialog* m_playerDialog;
|
|
|
|
bool m_leftBtnDown;
|
1998-07-24 15:43:32 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|