-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcontrols.h
executable file
·287 lines (235 loc) · 7.05 KB
/
controls.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
#ifndef __CONTROLS_H__
#define __CONTROLS_H__
#include "tools.h"
#include "VG88Common.h"
#define LABEL_HEIGHT 8
#define LABEL_WIDTH 85
#define CTRL_AMPKNOB1 1
#define CTRL_AMPKNOB2 2
#define CTRL_SWITCH1 3
#define CTRL_VFADER1 4
#define CTRL_HFADER1 5
#define CTRL_VGKNOB1 6
#define CTRL_VGKNOB2 7
#define CTRL_VGKNOB3 11
#define CTRL_GTKNOB1 12
#define CTRL_SELECTOR 13
#define CTRL_MIC1 14
#define CTRL_MIC2 15
#define CTRL_VFADERORGAN 16
#define CTRL_EDIT1 1
#define CTRL_EDIT2 2
class CVGList;
class CControl : public CWnd
{
public:
CControl();
virtual ~CControl();
BOOL CreateControl(LPCTSTR lpszCaption, DWORD dwStyle,
const RECT& rect, CWnd* pParentWnd, UINT nID, unsigned long cwndStyle = 0);
void AttachVGData(CVGData *vgData);
virtual void Paint(CDC *pDc) = 0;
CFont *m_font;
CVGData *m_vgData;
DWORD m_dwStyle;
CVGList *m_listValue;
char m_sens;
int m_bitmapImageCount;
int m_imageWidth;
int m_imageHeight;
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CControl)
protected:
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
//}}AFX_VIRTUAL
// Generated message map functions
protected:
//{{AFX_MSG(CControl)
afx_msg int OnCreate (LPCREATESTRUCT);
afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnSetFocus(CWnd* pOldWnd);
afx_msg void OnKillFocus(CWnd* pNewWnd);
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
afx_msg void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags);
afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
#define DATA_NONE 0
#define DATA_BOTTOM 1
#define DATA_TOP 2
#define DATA_RIGHT 3
#define DATA_TOPLEFT 4
class CVGKnob: public CControl
{
public:
CVGKnob();
BOOL CreateControl(LPCTSTR lpszCaption, DWORD dwStyle,
int x, int y, CWnd* pParentWnd, UINT nID);
BOOL CreateImageControl(LPCTSTR lpszCaption, int x, int y, CMaskedBitmap *bitmap, int imageCount, CWnd* pParentWnd, UINT nID);
void OnMouseAction(CPoint);
void Paint(CDC *pDc);
CMaskedBitmap *m_knob; // Contain images for all possibles values
BOOL m_emptyImage; // True if the image contain one supplementary position for NULL
char m_labelPosition;
char m_dataPosition;
BOOL m_bTracking;
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CVGKnob)
protected:
//}}AFX_VIRTUAL
// Generated message map functions
protected:
//{{AFX_MSG(CVGKnob)
afx_msg void OnPaint();
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
class CVGButton: public CControl
{
public:
CVGButton();
BOOL CreateControl(LPCTSTR lpszCaption, DWORD dwStyle,
int x, int y, CWnd* pParentWnd, UINT nID);
void Paint(CDC *pDc);
CMaskedBitmap *m_button;
char m_dataPosition;
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CVGButton)
protected:
//}}AFX_VIRTUAL
// Generated message map functions
protected:
//{{AFX_MSG(CVGButton)
afx_msg void OnPaint();
afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
class CVGEdit: public CControl
{
public:
CVGEdit();
BOOL CreateControl(LPCTSTR lpszCaption, DWORD dwStyle,
int x, int y, CWnd* pParentWnd, UINT nID);
BOOL CreateControl(LPCTSTR lpszCaption, int labelEdit, DWORD dwStyle,
int x, int y, CWnd* pParentWnd, UINT nID);
void Paint(CDC *pDc);
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CVGEdit)
//}}AFX_VIRTUAL
// Generated message map functions
protected:
//{{AFX_MSG(CVGEdit)
afx_msg void OnPaint();
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnKillFocus(CWnd* pNewWnd);
afx_msg void OnSetFocus(CWnd* pOldWnd);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
class CVGPickupPos: public CControl
{
public:
CVGData *m_pickup;
CVGData *m_frontPickuType;
CVGData *m_frontPickupPosition;
CVGData *m_frontPickupAngle;
CVGData *m_rearPickuType;
CVGData *m_rearPickupPosition;
CVGData *m_rearPickupAngle;
CRgn m_rearTop, m_rearMid, m_rearBot;
CRgn m_frontTop, m_frontMid, m_frontBot;
BOOL m_bTracking;
CVGPickupPos();
void AttachVGData(CVGData *, CVGData *, CVGData *, CVGData *, CVGData *, CVGData *, CVGData *);
BOOL CreateControl(LPCTSTR lpszCaption, DWORD dwStyle,
int x, int y, CWnd* pParentWnd, UINT nID);
void OnMouseAction(CPoint);
void Paint(CDC *pDc);
CMaskedBitmap m_backImage;
CMaskedBitmap m_pickupSingle1;
CMaskedBitmap m_pickupDouble1;
CMaskedBitmap m_pickupSingle2;
CMaskedBitmap m_pickupDouble2;
// Generated message map functions
protected:
//{{AFX_MSG(CVGPickupPos)
afx_msg void OnPaint();
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
class CVGSection: public CControl
{
public:
CVGSection();
BOOL CreateControl(LPCTSTR lpszCaption, int y, CWnd* pParentWnd, UINT nID);
void Paint(CDC *pDc);
CMaskedBitmap *m_section; // Contain images for all possibles values
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CVGSection)
protected:
//}}AFX_VIRTUAL
// Generated message map functions
protected:
//{{AFX_MSG(CVGSection)
afx_msg void OnPaint();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
class CListBoxCustom : public CListBox
{
public:
//{{AFX_MSG(CListBoxCustom)
afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
class CVGList: public CControl
{
public:
CVGList();
BOOL CreateControl(LPCTSTR lpszCaption, DWORD dwStyle,
int x, int y, int width, int height, CControl* pParentWnd, UINT nID);
//void OnMouseAction(CPoint);
void Paint(CDC *pDc);
CBrush m_brush;
BOOL m_bTracking;
CListBoxCustom m_listBox;
CControl *m_parent;
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CVGList)
protected:
virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
//}}AFX_VIRTUAL
//virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
// Generated message map functions
protected:
//{{AFX_MSG(CVGList)
afx_msg void OnPaint();
afx_msg void OnSelChange();
afx_msg void OnKillFocus();
afx_msg void OnDblClk();
afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
#endif