53 SetRGBMsgId = ::RegisterWindowMessage(SETRGBSTRING);
55 memset(&Cc, 0,
sizeof Cc);
56 Cc.lStructSize =
sizeof Cc;
59 Cc.Flags = CC_ENABLEHOOK | Data.Flags;
61 Cc.lpTemplateName = templateId;
62 Cc.Flags |= CC_ENABLETEMPLATE;
65 Cc.Flags &= ~CC_ENABLETEMPLATE;
66 Cc.lpfnHook =
nullptr;
68 Cc.rgbResult = Data.Color;
69 Cc.lpCustColors =
reinterpret_cast<COLORREF *
>(Data.CustColors);
71 TRACEX(OwlCommDialog,
OWL_CDLEVEL,
"TChooseColorDialog constructed @" << (
void*)
this);
80 TRACEX(OwlCommDialog,
OWL_CDLEVEL,
"TChooseColorDialog destructed @" << (
void*)
this);
106 int ret = ChooseColor(&Cc);
108 Data.Flags = Cc.Flags;
110 Data.Color = Cc.rgbResult;
113 Data.Error = CommDlgExtendedError();
115 return ret ? IDOK : IDCANCEL;
#define TRACEX(group, level, message)
Definition of Choose Color Common Dialog class.
Defines information necessary to initialize the dialog box with the user's color selection.
uint32 Flags
Flags can be a combination of the following values that control the appearance and functionality of t...
TColor * CustColors
Points to an array of 16 colors.
std::vector< TColor > CustColorsArray
TData & operator=(const TData &other)
uint32 Error
If the dialog box is successfully executed, Error is 0.
TColor Color
Specifies the color that is initially selected when the dialog box is created.
TData(uint32 flags=0, bool allocCustColor=false)
Wrapper for the Choose-Color common dialog.
static uint SetRGBMsgId
Registered messages this class sends (to itself).
void Init(TResId templateId)
~TChooseColorDialog() override
Destructor does nothing in non diagnostic versions of the library.
auto DialogFunction(TMsgId, TParam1, TParam2) -> INT_PTR override
Override the virtual DialogFunction.
TChooseColorDialog(TWindow *parent, TData &data, TResId templateId=0, LPCTSTR title=0, TModule *module=0)
Initialize the choose color common dialog data members.
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)