-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPropCtrl.h
399 lines (295 loc) · 7.85 KB
/
PropCtrl.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
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
#pragma once
#include "CheckBox.h"
#include "Static.h"
#include "EditText.h"
#include "ComboBox.h"
#include "Button.h"
class XPropCtrl : public XStatic
{
public:
virtual afx_msg void OnSize(UINT nType, int cx, int cy) = 0;
};
extern long BaseHeight;
class XPropCtrlBase : public XPropCtrl
{
DECLARE_MESSAGE_MAP()
protected:
XStatic PropName;
CFont* CurrentFont;
bool bCreated;
public:
XPropCtrlBase();
virtual ~XPropCtrlBase();
protected:
virtual afx_msg void OnSize(UINT nType, int cx, int cy);
virtual afx_msg void EditChange(UINT uID);
BOOL Create(const RECT& rect, CWnd* pParentWnd, const char* Name);
};
class XPropCtrlText : public XPropCtrlBase
{
DECLARE_MESSAGE_MAP()
private:
XStatic PropBack;
XEditText PropText;
std::string* LinkStr;
long PropID;
public:
virtual ~XPropCtrlText() = default;
BOOL Create(const RECT& rect, CWnd* pParentWnd, const char* Name);
void SetStr(std::string& RefStr);
protected:
virtual afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void EditChange(UINT uID);
};
class XPropCtrlComboBox : public XPropCtrlBase
{
DECLARE_MESSAGE_MAP()
private:
std::vector<std::string> ValList;
XComboBox PropCombo;
long PropComboID;
std::string* LinkIter;
public:
virtual ~XPropCtrlComboBox() = default;
BOOL Create(const RECT& rect, CWnd* pParentWnd, const char* Name, std::string List);
void SetValue(std::string& RefIter);
protected:
virtual afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void EditChange(UINT uID);
};
class XPropCtrlNumeric : public XPropCtrlBase
{
DECLARE_MESSAGE_MAP()
private:
XStatic PropBack;
XEditText PropText;
int* LinkVal;
long PropID;
public:
virtual ~XPropCtrlNumeric() = default;
BOOL Create(const RECT& rect, CWnd* pParentWnd, const char* Name);
void SetValue(int& RefStr);
protected:
virtual afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void EditChange(UINT uID);
};
class XPropCtrlNumericU32 : public XPropCtrlBase
{
DECLARE_MESSAGE_MAP()
private:
XStatic PropBack;
XEditUnsigned PropText;
unsigned int* LinkVal;
long PropID;
public:
virtual ~XPropCtrlNumericU32() = default;
BOOL Create(const RECT& rect, CWnd* pParentWnd, const char* Name);
void SetValue(unsigned int& RefStr);
protected:
virtual afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void EditChange(UINT uID);
};
class XPropCtrlNumericU16 : public XPropCtrlBase
{
DECLARE_MESSAGE_MAP()
private:
XStatic PropBack;
XEditUnsigned PropText;
std::uint16_t* LinkVal;
long PropID;
public:
virtual ~XPropCtrlNumericU16() = default;
BOOL Create(const RECT& rect, CWnd* pParentWnd, const char* Name);
void SetValue(std::uint16_t& RefStr);
protected:
virtual afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void EditChange(UINT uID);
};
class XPropCtrlNumericU8 : public XPropCtrlBase
{
DECLARE_MESSAGE_MAP()
private:
XStatic PropBack;
XEditUnsigned PropText;
std::uint8_t* LinkVal;
long PropID;
public:
virtual ~XPropCtrlNumericU8() = default;
BOOL Create(const RECT& rect, CWnd* pParentWnd, const char* Name);
void SetValue(std::uint8_t& RefStr);
protected:
virtual afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void EditChange(UINT uID);
};
class XPropCtrlNumericS8 : public XPropCtrlBase
{
DECLARE_MESSAGE_MAP()
private:
XStatic PropBack;
XEditUnsigned PropText;
std::int8_t* LinkVal;
long PropID;
public:
virtual ~XPropCtrlNumericS8() = default;
BOOL Create(const RECT& rect, CWnd* pParentWnd, const char* Name);
void SetValue(std::int8_t& RefStr);
protected:
virtual afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void EditChange(UINT uID);
};
class XPropCtrlNumericS16 : public XPropCtrlBase
{
DECLARE_MESSAGE_MAP()
private:
XStatic PropBack;
XEditUnsigned PropText;
std::int16_t* LinkVal;
long PropID;
public:
virtual ~XPropCtrlNumericS16() = default;
BOOL Create(const RECT& rect, CWnd* pParentWnd, const char* Name);
void SetValue(std::int16_t& RefStr);
protected:
virtual afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void EditChange(UINT uID);
};
class XPropCtrlNumericFloat : public XPropCtrlBase
{
DECLARE_MESSAGE_MAP()
private:
XStatic PropBack;
XEditFloat PropText;
float* LinkVal;
long PropID;
public:
virtual ~XPropCtrlNumericFloat() = default;
BOOL Create(const RECT& rect, CWnd* pParentWnd, const char* Name);
void SetValue(float& RefStr);
protected:
virtual afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void EditChange(UINT uID);
};
class XPropCtrlCheck : public XPropCtrlBase
{
DECLARE_MESSAGE_MAP()
private:
XStatic PropBack;
XCheckBox Box;
bool* LinkVal;
long PropID;
public:
virtual ~XPropCtrlCheck() = default;
BOOL Create(const RECT& rect, CWnd* pParentWnd, const char* Name);
void SetValue(bool& RefStr);
protected:
virtual afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void EditChange(UINT uID);
};
class XPropCtrlButton : public XPropCtrlBase
{
DECLARE_MESSAGE_MAP()
private:
XButton Button;
std::function<void()> LinkVal;
long PropID;
public:
virtual ~XPropCtrlButton() = default;
BOOL Create(const RECT& rect, CWnd* pParentWnd, const char* Name, const char* ButtonName);
void SetValue(std::function<void()> RefValue);
protected:
virtual afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void ButtonPush(UINT uID);
};
class XPropCtrlButton2 : public XPropCtrlBase
{
DECLARE_MESSAGE_MAP()
private:
XButton Button1;
XButton Button2;
std::function<void()> LinkVal1;
std::function<void()> LinkVal2;
long PropButton1ID;
long PropButton2ID;
public:
virtual ~XPropCtrlButton2() = default;
BOOL Create(const RECT& rect, CWnd* pParentWnd, const char* Name, const char* ButtonName1, const char* Button2);
void SetValue(std::function<void()> RefValue1, std::function<void()> RefValue2);
protected:
virtual afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void ButtonPush(UINT uID);
};
class XPropCtrlButton3 : public XPropCtrlBase
{
DECLARE_MESSAGE_MAP()
private:
XButton Button1;
XButton Button2;
XButton Button3;
std::function<void()> LinkVal1;
std::function<void()> LinkVal2;
std::function<void()> LinkVal3;
long PropButton1ID;
long PropButton2ID;
long PropButton3ID;
public:
virtual ~XPropCtrlButton3() = default;
BOOL Create(const RECT& rect, CWnd* pParentWnd, const char* Name, const char* ButtonName1, const char* ButtonName2, const char* ButtonName3);
void SetValue(std::function<void()> RefValue1, std::function<void()> RefValue2, std::function<void()> RefValue3);
protected:
virtual afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void ButtonPush(UINT uID);
};
#if 0
class XPropCtrlNumericFV3 : public XPropCtrlBase
{
DECLARE_MESSAGE_MAP()
private:
XStatic PropBack;
XEditFloat PropX;
XEditFloat PropY;
XEditFloat PropZ;
Fvector* LinkVal;
long FVID[3] = {};
public:
virtual ~XPropCtrlNumericFV3() = default;
BOOL Create(const RECT& rect, CWnd* pParentWnd, const char* Name);
void SetValue(Fvector& RefStr);
protected:
virtual afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void EditChange(UINT uID);
};
class XPropCtrlNumericFV4 : public XPropCtrlBase
{
DECLARE_MESSAGE_MAP()
private:
XStatic PropBack;
XEditFloat PropX;
XEditFloat PropY;
XEditFloat PropZ;
XEditFloat PropW;
Fvector4* LinkVal;
long FVID[4] = {};
public:
virtual ~XPropCtrlNumericFV4() = default;
BOOL Create(const RECT& rect, CWnd* pParentWnd, const char* Name);
void SetValue(Fvector4& RefStr);
protected:
virtual afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void EditChange(UINT uID);
};
#endif
class XPropCtrlColor : public XPropCtrlBase
{
DECLARE_MESSAGE_MAP()
private:
CMFCColorButton ClrButton;
COLORREF* LinkVal;
long PropID;
public:
virtual ~XPropCtrlColor() = default;
BOOL Create(const RECT& rect, CWnd* pParentWnd, const char* Name);
void SetValue(COLORREF& RefValue);
protected:
virtual afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void ButtonPush(UINT uID);
};