SimpleWindow
载入中...
搜索中...
未找到
FontDialog.h
1#pragma once
2
3#include "Color.h"
4#include "EnumBit.h"
5#include "Font.h"
6#include "IDialog.h"
7#include "Property.h"
8
9namespace sw
10{
14 enum class FontDialogFlags : DWORD {
19 Apply = 0x00000200,
20
24 ANSIOnly = 0x00000400,
25
30 Both = 0x00000003,
31
37 Effects = 0x00000100,
38
40 EnableHook = 0x00000008,
41
44 EnableTemplate = 0x00000010,
45
48 EnableTemplateHandle = 0x00000020,
49
51 FixedPitchOnly = 0x00004000,
52
55 ForceFontExist = 0x00010000,
56
59 InavtiveFonts = 0x02000000,
60
62 InitToLogFontStruct = 0x00000040,
63
65 LimitSize = 0x00002000,
66
68 NoOemFonts = 0x00000800,
69
73 NoFaceSel = 0x00080000,
74
77 NoScriptSel = 0x00800000,
78
80 NoSimulations = 0x00001000,
81
85 NoSizeSel = 0x00200000,
86
90 NoStyleSel = 0x00100000,
91
93 NoVectorFonts = 0x00000800,
94
96 NoVertFonts = 0x01000000,
97
102 PrinterFonts = 0x00000002,
103
106 ScalableOnly = 0x00020000,
107
110 ScreenFonts = 0x00000001,
111
114 ScriptsOnly = 0x00000400,
115
118 SelectScript = 0x00400000,
119
122 ShowHelp = 0x00000004,
123
125 TrueTypeOnly = 0x00040000,
126
132 UseStyle = 0x00000080,
133
138 WYSIWYG = 0x00008000,
139 };
140
144 _SW_ENUM_ENABLE_BIT_OPERATIONS(FontDialogFlags);
145
149 class FontDialog : public IDialog
150 {
151 private:
155 sw::Font _font;
156
160 CHOOSEFONTW _cf{};
161
162 public:
167
172
177
182
187
192
197
198 public:
203
207 virtual void Close() override;
208
212 virtual void Show() override;
213
218 virtual int ShowDialog(Window *owner = nullptr) override;
219
224 virtual int ShowDialog(Window &owner);
225
226 protected:
231 };
232}
字体选择对话框
Definition FontDialog.h:150
virtual int ShowDialog(Window *owner=nullptr) override
显示对话框,并指定所有者窗口
const Property< Color > SelectedColor
选择的颜色
Definition FontDialog.h:196
const Property< sw::Font > Font
选择的字体
Definition FontDialog.h:171
virtual int ShowDialog(Window &owner)
显示对话框,并指定所有者窗口
const Property< sw::FontWeight > FontWeight
选择的字体粗细
Definition FontDialog.h:186
const Property< std::wstring > FontName
选择的字体名称
Definition FontDialog.h:176
FontDialog()
初始化FontDialog
virtual void Close() override
FontDialog默认不支持该函数,调用该函数不会执行任何操作
const Property< FontDialogFlags > Flags
对话框的配置标志
Definition FontDialog.h:166
const Property< bool > ShowEffects
是否显示效果选项(下划线、删除线、颜色)
Definition FontDialog.h:191
CHOOSEFONTW * GetChooseFontStruct()
获取选择字体对话框的配置结构体
virtual void Show() override
FontDialog默认不支持该函数,调用该函数不会执行任何操作
const Property< double > FontSize
选择的字体大小
Definition FontDialog.h:181
字体类
Definition Font.h:137
对话框接口
Definition IDialog.h:11
值转换器接口
Definition IValueConverter.h:14
窗口
Definition Window.h:32
SimpleWindow框架的顶级命名空间,所有公共类型、控件、枚举和工具函数均定义于此。
Definition Alignment.h:4
FontDialogFlags
https://learn.microsoft.com/en-us/windows/win32/api/commdlg/ns-commdlg-choosefonta
Definition FontDialog.h:14
@ FixedPitchOnly
ChooseFont should enumerate and allow selection of only fixed-pitch fonts.
@ NoSimulations
ChooseFont should not display or allow selection of font simulations.
@ LimitSize
ChooseFont should select only font sizes within the range specified by the nSizeMin and nSizeMax memb...
@ NoVectorFonts
ChooseFont should not allow vector font selections.
@ NoVertFonts
Causes the Font dialog box to list only horizontally oriented fonts.
@ InitToLogFontStruct
ChooseFont should use the structure pointed to by the lpLogFont member to initialize the dialog box c...
@ NoOemFonts
Same as the CF_NOVECTORFONTS flag.
@ TrueTypeOnly
指示字体映射器仅从 TrueType 字体中进行选择。 如果系统中没有安装 TrueType 字体,字体映射器将返回到默认行为。