SimpleWindow
载入中...
搜索中...
未找到
ColorDialog.h
1#pragma once
2
3#include "Window.h"
4
5namespace sw
6{
10 enum class ColorDialogFlags : DWORD {
11 // Causes the dialog box to display all available colors in the set of basic colors.
12 AnyColor = 0x00000100,
13
14 // Enables the hook procedure specified in the lpfnHook member of this structure.
15 // This flag is used only to initialize the dialog box.
16 EnableHook = 0x00000010,
17
18 // The hInstance and lpTemplateName members specify a dialog box template to use in
19 // place of the default template. This flag is used only to initialize the dialog box.
20 EnableTemplate = 0x00000020,
21
22 // The hInstance member identifies a data block that contains a preloaded dialog box
23 // template. The system ignores the lpTemplateName member if this flag is specified.
24 // This flag is used only to initialize the dialog box.
25 EnableTemplateHandle = 0x00000040,
26
27 // Causes the dialog box to display the additional controls that allow the user to
28 // create custom colors. If this flag is not set, the user must click the Define Custom
29 // Color button to display the custom color controls.
30 FullOpen = 0x00000002,
31
32 // Disables the Define Custom Color button.
33 PreventFullOpen = 0x00000004,
34
35 // Causes the dialog box to use the color specified in the rgbResult member as the
36 // initial color selection.
37 RgbInit = 0x00000001,
38
39 // Causes the dialog box to display the Help button. The hwndOwner member must specify
40 // the window to receive the HELPMSGSTRING registered messages that the dialog box sends
41 // when the user clicks the Help button.
42 ShowHelp = 0x00000008,
43
44 // Causes the dialog box to display only solid colors in the set of basic colors.
45 SolidColor = 0x00000080,
46 };
47
51 _SW_ENUM_ENABLE_BIT_OPERATIONS(ColorDialogFlags);
52
56 class ColorDialog : public IDialog
57 {
58 private:
62 CHOOSECOLORW _cc{};
63
64 public:
69
74
79
85
86 public:
91
95 virtual void Close() override;
96
100 virtual void Show() override;
101
106 virtual int ShowDialog(Window *owner = nullptr) override;
107
112 virtual int ShowDialog(Window &owner);
113
114 protected:
118 CHOOSECOLORW *GetChooseColorStruct();
119 };
120}
颜色选择对话框
Definition ColorDialog.h:57
const Property< COLORREF * > CustomColors
自定义颜色数组,包含16个COLORREF元素
Definition ColorDialog.h:84
ColorDialog()
初始化ColorDialog
const Property< bool > FullOpen
是否显示完整的颜色选择界面
Definition ColorDialog.h:78
virtual void Show() override
ColorDialog默认不支持该函数,调用该函数不会执行任何操作
virtual int ShowDialog(Window *owner=nullptr) override
显示对话框,并指定所有者窗口
const Property< Color > SelectedColor
选择的颜色,默认值为黑色
Definition ColorDialog.h:73
virtual int ShowDialog(Window &owner)
显示对话框,并指定所有者窗口
CHOOSECOLORW * GetChooseColorStruct()
获取颜色选择对话框的配置结构体指针
const Property< ColorDialogFlags > Flags
对话框标志
Definition ColorDialog.h:68
virtual void Close() override
ColorDialog默认不支持该函数,调用该函数不会执行任何操作
对话框接口
Definition IDialog.h:11
属性
Definition Property.h:1743
窗口
Definition Window.h:35