forked from cztomczak/cefpython
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDialogTemplate.h
More file actions
68 lines (44 loc) · 1.68 KB
/
DialogTemplate.h
File metadata and controls
68 lines (44 loc) · 1.68 KB
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
#pragma once
// DialogTemplate - taken from here:
// http://www.flipcode.com/archives/Dialog_Template.shtml
// http://www.flipcode.com/archives/An_assert_Replacement.shtml
#include <windows.h>
class DialogTemplate
{
public:
DialogTemplate(LPCSTR caption, DWORD style, DWORD exStyle, int x, int y, int w, int h,
LPCSTR font, WORD fontSize);
void AddComponent(LPCSTR type, LPCSTR caption, DWORD style, DWORD exStyle,
int x, int y, int w, int h, WORD id);
void AddButton(LPCSTR caption, DWORD style, DWORD exStyle, int x, int y,
int w, int h, WORD id);
void AddEditBox(LPCSTR caption, DWORD style, DWORD exStyle, int x, int y,
int w, int h, WORD id);
void AddStatic(LPCSTR caption, DWORD style, DWORD exStyle, int x, int y,
int w, int h, WORD id);
void AddListBox(LPCSTR caption, DWORD style, DWORD exStyle, int x, int y,
int w, int h, WORD id);
void AddScrollBar(LPCSTR caption, DWORD style, DWORD exStyle, int x, int y,
int w, int h, WORD id);
void AddComboBox(LPCSTR caption, DWORD style, DWORD exStyle, int x, int y,
int w, int h, WORD id);
operator const DLGTEMPLATE*() const
{
return dialogTemplate;
}
virtual ~DialogTemplate()
{
free(dialogTemplate);
}
protected:
void AddStandardComponent(WORD type, LPCSTR caption, DWORD style,
DWORD exStyle, int x, int y, int w, int h, WORD id);
void AlignData(int size);
void AppendString(LPCSTR string);
void AppendData(void* data, int dataLength);
void EnsureSpace(int length);
private:
DLGTEMPLATE* dialogTemplate;
int totalBufferLength;
int usedBufferLength;
};