ScummVM API documentation
pawn.h
1/* ScummVM - Graphic Adventure Engine
2 *
3 * ScummVM is the legal property of its developers, whose names
4 * are too numerous to list here. Please refer to the COPYRIGHT
5 * file distributed with this source distribution.
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 *
20 */
21
22#ifndef BAGEL_METAGAME_GTL_PAWN_H
23#define BAGEL_METAGAME_GTL_PAWN_H
24
25#include "bagel/hodjnpodj/metagame/bgen/invent.h"
26#include "bagel/hodjnpodj/metagame/bgen/item.h"
27
28namespace Bagel {
29namespace HodjNPodj {
30namespace Metagame {
31namespace Gtl {
32
33#define PAWN_SPEC "art\\mlscroll.bmp" // path for pawn's DIB on disk
34#define PAWN_DX 502
35#define PAWN_DY 395
36#define PAWN_CURL_DX 500
37#define PAWN_CURL_DY 50
38#define PAWN_BORDER_DX 60
39#define PAWN_BORDER_DY 60
40
41#define PAWN_TITLEZONE_DX 100
42#define PAWN_TITLEZONE_DY 40
43#define PAWN_TITLEZONE_DDY -10
44
45#define PAWN_TEXTZONE_DX 75
46#define PAWN_TEXTZONE_DY 40
47#define PAWN_TEXTZONE_DDY 20
48#define PAWN_TEXTZONE_DDDY 5
49
50#define PAWN_COSTZONE_DX 75
51#define PAWN_COSTZONE_DY 20
52#define PAWN_COSTZONE_DDY 20
53#define PAWN_COSTZONE_DDDY 5
54
55#define PAWN_BITMAP_DX 59
56#define PAWN_BITMAP_DY 59
57#define PAWN_BITMAP_DDX 5
58#define PAWN_BITMAP_DDY 5
59
60#define IDD_PAWN_DIALOG 940
61#define IDC_PAWN_OKAY 940
62
63#define IDC_PAWN_DOLLAR 941
64
65#define PAWN_TEXT_COLOR RGB(128,0,128)
66#define PAWN_MORE_COLOR RGB(0,0,0)
67#define PAWN_BLURB_COLOR RGB(0,0,255)
68
69class CPawnShop : public CDialog {
70private:
71 bool bFirstTime = true; // flag for first time information is displayed
72
73public:
74 CPawnShop(CWnd* pParent, CPalette *pPalette, CInventory *pGeneralStore, CInventory *pInventory);
75
76 int SelectedItem(CPoint point);
77
78 static void UpdatePawn(CDC *pDC);
79 static void UpdateContent(CDC *pDC);
80 static void UpdateItem(CDC *pDC, CItem *pItem, int nX, int nY);
81 static void UpdatePage(CDC *pDC);
82 static void UpdateCrowns(CDC *pDC);
83 static void ClearDialogImage();
84 static void RefreshBackground();
85 static void ShowWaitCursor();
86 static void DoArrowCursor();
87
88 // Included to stop warning about the static DoWaitCursor hiding inherited version
89 void DoWaitCursor(int nCode) override {
91 }
92
93private:
94 bool SetupKeyboardHook();
95 void RemoveKeyboardHook();
96
97 bool CreateWorkAreas(CDC *pDC);
98
99private:
100 bool m_bKeyboardHook = false; // whether keyboard hook present
101 CRect OkayRect; // rectangle bounding the OKAY button
102 CRect PawnRect; // x/y (left/right) and dx/dy (right/bottom) for the pawn window
103 CRect ScrollTopRect, // area spanned by upper scroll curl
104 ScrollBotRect; // area spanned by lower scroll curl
105
106// Dialog Data
107 //{{AFX_DATA(CPawnShop)
108 enum { IDD = IDD_PAWN_DIALOG };
109 // NOTE: the ClassWizard will add data members here
110 //}}AFX_DATA
111
112// Implementation
113protected:
114 virtual void DoDataExchange(CDataExchange *pDX) override; // DDX/DDV support
115
116 // Generated message map functions
117 //{{AFX_MSG(CPawnShop)
118 afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
119 virtual bool OnInitDialog() override;
120 afx_msg bool OnEraseBkgnd(CDC *pDC);
121 virtual void OnOK() override;
122 virtual void OnCancel() override;
123 afx_msg void OnDestroy();
124 afx_msg void OnPaint();
125 afx_msg void OnShowWindow(bool bShow, unsigned int nStatus);
126 afx_msg void OnSize(unsigned int nType, int cx, int cy);
127 afx_msg void OnMouseMove(unsigned int nFlags, CPoint point);
128 afx_msg bool OnSetCursor(CWnd *pWnd, unsigned int nHitTest, unsigned int message);
129 afx_msg void OnLButtonDown(unsigned int nFlags, CPoint point);
130 afx_msg void OnActivate(unsigned int nState, CWnd *pWndOther, bool bMinimized) override;
131 //}}AFX_MSG
132 DECLARE_MESSAGE_MAP()
133};
134
135} // namespace Gtl
136} // namespace Metagame
137} // namespace HodjNPodj
138} // namespace Bagel
139
140#endif
void DoWaitCursor(int nCode) override
Definition: pawn.h:89
virtual void DoWaitCursor(int nCode)
Definition: afxwin.h:721
Definition: afxwin.h:1599
Definition: afxwin.h:667
Definition: atltypes.h:79
Definition: atltypes.h:131
Definition: afxwin.h:1141
Definition: minwindef.h:292
Definition: afxwin.h:1116