46 int x,
int y,
int w,
int h,
58 Attr.Style = WS_CHILD | WS_VISIBLE | WS_GROUP | WS_TABSTOP;
69 int x,
int y,
int w,
int h,
81 Attr.Style = WS_CHILD | WS_VISIBLE | WS_GROUP | WS_TABSTOP;
103 memset(&Attr, 0x0,
sizeof(Attr));
104 Attr.Id = resourceId;
107 TRACEX(OwlControl,
OWL_CDLEVEL,
"TControl constructed from resource @" << (
void*)
this);
121 memset(&Attr, 0x0,
sizeof(Attr));
122 Attr.Id = resourceId;
125 TRACEX(OwlControl,
OWL_CDLEVEL,
"TControl constructed from resource @" << (
void*)
this);
139 " to handle" <<
static_cast<void*
>(handle));
188 COMPAREITEMSTRUCT i(compareInfo);
202 TRACEX(OwlControl, 1,
"TControl::CompareItem() @" << (
void*)
this);
203 if (!
GetHandle() || compareInfo.itemData1 == compareInfo.itemData2)
205 if(compareInfo.itemData1){
208 return item->
Compare(compareInfo);
220 DELETEITEMSTRUCT i(deleteInfo);
233 TRACEX(OwlControl, 1,
"TControl::DeleteItem() @" << (
void*)
this);
257 TRACEX(OwlControl, 1,
"TControl::MeasureItem() @" << (
void*)
this);
258 if(measureInfo.itemData){
272 DRAWITEMSTRUCT i(drawInfo);
289 switch (drawInfo.itemAction) {
312 TRACEX(OwlControl, 1,
"TControl::ODADrawEntire() @" << (
void*)
this);
313 if(drawInfo.itemData && drawInfo.itemID != (
uint16)-1){
316 item->
Draw(drawInfo);
328 TRACEX(OwlControl, 1,
"TControl::ODAFocus() @" << (
void*)
this);
329 if(drawInfo.itemData){
332 item->
Draw(drawInfo);
344 TRACEX(OwlControl, 1,
"TControl::ODASelect() @" << (
void*)
this);
345 if(drawInfo.itemData){
348 item->
Draw(drawInfo);
355#if OWL_PERSISTENT_STREAMS
369 static_cast<void>(nu);
379TControl::Streamer::Write(
opstream& os)
const
#define TRACEX(group, level, message)
TControl unifies its derived control classes, such as TScrollBar, TControlGadget, and TButton.
auto EvEraseBkgnd(HDC) -> bool
Provides special handling for predefined controls.
void EvPaint()
Intercept WM_PAINT to redirect from TWindow to the underlying control if this Owl object is just a wr...
virtual void MeasureItem(MEASUREITEMSTRUCT &measureInfo)
Function called when a WM_MEASUREITEM is sent to parent on our behalf.
virtual void ODAFocus(DRAWITEMSTRUCT &drawInfo)
Responds to a notification sent to a drawable control when the focus has shifted to or from the contr...
virtual void ODASelect(DRAWITEMSTRUCT &drawInfo)
Responds to a notification sent to a drawable control when the selection state of the control changes...
virtual void ODADrawEntire(DRAWITEMSTRUCT &drawInfo)
Responds to a notification message sent to a drawable control when the control needs to be drawn.
void EvMeasureItem(uint ctrlId, MEASUREITEMSTRUCT &meas)
Handles WM_MEASUREITEM message (for owner draw controls) by calling the corresponding virtual functio...
void EvDeleteItem(uint ctrlId, const DELETEITEMSTRUCT &del)
Handles WM_DELETEITEM message (for owner draw controls) by calling the corresponding virtual function...
virtual void DrawItem(DRAWITEMSTRUCT &drawInfo)
Function called when a WM_DRAWITEM is sent to parent on our behalf.
void EvDrawItem(uint ctrlId, const DRAWITEMSTRUCT &draw)
Handles WM_DRAWITEM message (for owner draw controls) by calling the corresponding virtual function.
TControl(TWindow *parent, int id, LPCTSTR title, int x, int y, int w, int h, TModule *module=nullptr)
Invokes TWindow's constructor, passing it parent (parent window), title (caption text),...
int EvCompareItem(uint ctrlId, const COMPAREITEMSTRUCT &comp)
Handles WM_COMPAREITEM message (for owner draw controls) by calling the corresponding virtual functio...
virtual void DeleteItem(DELETEITEMSTRUCT &deleteInfo)
Function called when a WM_DELETEITEM is sent to parent on our behalf.
virtual int CompareItem(COMPAREITEMSTRUCT &compareInfo)
Function called when a WM_COMPAREITEM is sent to parent on our behalf.
virtual void Measure(MEASUREITEMSTRUCT &)
virtual void Draw(DRAWITEMSTRUCT &)
virtual int Compare(COMPAREITEMSTRUCT &)
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...
bool EvEraseBkgnd(HDC)
Handler for WM_ERASEBKGND.
void EvPaint()
Response method for an incoming WM_PAINT message.
TWindow(TWindow *parent, LPCTSTR title=nullptr, TModule *module=nullptr)
Adds this to the child list of parent if nonzero, and calls EnableAutoCreate so that this will be cre...
void Init(TWindow *parent, LPCTSTR title, TModule *module)
Normal initialization of a default constructed TWindow.
void SetFlag(uint mask)
Sets the specified TWindow wfXxxx constant flags (for example wfAlias, wfTransfer,...
void EnableTransfer()
Enables the transfer mechanism, which allows state data to be transferred between the window and a tr...
TResult DefaultProcessing()
Handles default processing of events, which includes continued processing of menu/accelerators comman...
bool IsFlagSet(uint mask)
Returns the state of the bit flag in Attr.Flags whose mask is supplied.
HWND THandle
TWindow encapsulates an HWND.
HWND GetHandle() const
Returns the handle of the window.
ipstream, a specialized input stream derivative of pstream, is the base class for reading (extracting...
Base class for writing streamable objects.
Definition of class TControl.
#define DEFINE_RESPONSE_TABLE1(cls, base)
Macro to define a response table for a class with one base.
void ReadBaseObject(Base *base, ipstream &in)
void WriteBaseObject(Base *base, opstream &out)
@ wfPredefinedClass
Window class used belongs to a predefined Windows class and was not defined by OWL.
@ wfFromResource
Handle comes from HWND created from resource.
Object Windows Library (OWLNext Core).
DIAG_DEFINE_GROUP_INIT(OWL_INI, OwlApp, 1, 0)
TDrawItem * ItemData2DrawItem(ULONG_PTR data)
Handles WM_DRAWITEM message (for owner draw controls & menus) by forwarding message to control itself...
IMPLEMENT_STREAMABLE1(TApplication, TModule)