39 memset(&Cf, 0,
sizeof(CHOOSEFONT));
40 Cf.lStructSize =
sizeof(CHOOSEFONT);
43 Cf.Flags = CF_ENABLEHOOK | Data.Flags;
45 Cf.lpTemplateName = templateId;
46 Cf.Flags |= CF_ENABLETEMPLATE;
49 Cf.Flags &= ~CF_ENABLETEMPLATE;
50 Cf.lpfnHook =
nullptr;
53 Cf.lpLogFont = &Data.LogFont;
54 Cf.iPointSize = Data.PointSize;
55 Cf.rgbColors = Data.Color;
56 Cf.lpszStyle = Data.Style;
57 Cf.nFontType = Data.FontType;
58 Cf.nSizeMin = Data.SizeMin;
59 Cf.nSizeMax = Data.SizeMax;
61 TRACEX(OwlCommDialog,
OWL_CDLEVEL,
"TChooseFontDialog constructed @" << (
void*)
this);
72 TRACEX(OwlCommDialog,
OWL_CDLEVEL,
"TChooseFontDialog destructed @" << (
void*)
this);
99 int ret = ChooseFont(&Cf);
101 Data.Flags = Cf.Flags;
103 Data.PointSize = Cf.iPointSize;
104 Data.Color = Cf.rgbColors;
105 Data.Style = Cf.lpszStyle;
106 Data.FontType = Cf.nFontType;
109 Data.Error = CommDlgExtendedError();
111 return ret ? IDOK : IDCANCEL;
#define TRACEX(group, level, message)
Definition of Choose Font Common Dialog class.
Defines information necessary to initialize the dialog box with the user's font selection.
Encapsulates the Choose-Font common dialog.
auto DialogFunction(TMsgId, TParam1, TParam2) -> INT_PTR override
Override the virtual DialogFunction.
TChooseFontDialog(TWindow *parent, TData &data, TResId templateId=0, LPCTSTR title=nullptr, TModule *module=nullptr)
Initialize the ChooseFont data members.
~TChooseFontDialog() override
Destructor for this object does nothing in the non-diagnostic versions of the library.
Derived from TDialog, TCommonDialog is the abstract base class for TCommonDialog objects.
TCommonDialog(TWindow *parent, LPCTSTR title=nullptr, TModule *module=nullptr)
Invokes a TWindow constructor, passing the parent window parent, and constructs a common dialog box t...
virtual INT_PTR DialogFunction(TMsgId, TParam1, TParam2)
Override this to process messages within the dialog function.
static INT_PTR CALLBACK StdDlgProc(HWND, UINT, WPARAM, LPARAM) noexcept
Callback procs for hooking TDialog to native window.
ObjectWindows dynamic-link libraries (DLLs) construct an instance of TModule, which acts as an object...
TWindow, derived from TEventHandler and TStreamableBase, provides window-specific behavior and encaps...
virtual int DoExecute()
Do actual modal execution using the Begin/End Modal support of TApplication.
TWindow * GetParentO() const
Return the OWL's parent for this window.
TModule * GetModule() const
Returns a pointer to the module object.
HWND GetHandle() const
Returns the handle of the window.
#define DEFINE_RESPONSE_TABLE1(cls, base)
Macro to define a response table for a class with one base.
Object Windows Library (OWLNext Core).
UINT TMsgId
Message ID type.
LPARAM TParam2
Second parameter type.
WPARAM TParam1
First parameter type.
DIAG_DECLARE_GROUP(OwlThread)