50 c->ShowWindow(visible ? SW_SHOW : SW_HIDE);
61 TRACEX(OwlGadget, 1,
"TControlGadget::SetBounds() enter @" << (
void*)
this <<
62 " bounds = " << bounds);
67 Control->SetWindowPos(
nullptr, Bounds, SWP_NOACTIVATE|SWP_NOZORDER|SWP_NOSIZE);
69 TRACEX(OwlGadget, 1,
"TControlGadget::SetBounds() leave @" << (
void*)
this <<
70 " bounds = " << bounds);
82 TRACEX(OwlGadget, 1,
"TControlGadget::GetDesiredSize() enter @" << (
void*)
this <<
87 if(Control->GetHandle()){
88 TRect rect = Control->GetWindowRect();
90 size.cx += rect.
Width();
96 size.cx += Control->GetWindowAttr().W;
98 size.cy += Control->GetWindowAttr().H;
100 TRACEX(OwlGadget, 1,
"TControlGadget::GetDesiredSize() leave @" << (
void*)
this <<
118 Control->ShowWindow(SW_SHOWNA);
129 if (Control->GetHandle()) {
146 TRACEX(OwlGadget, 1,
"TControlGadget::Inserted @" << (
void*)
this);
151 if (!Control->GetHandle())
156 Control->ShowWindow(SW_SHOWNA);
169 TRACEX(OwlGadget, 1,
"TControlGadget::Removed @" << (
void*)
this);
170 Control->ShowWindow(SW_HIDE);
171 Control->SetParent(
nullptr);
199 if (Control->GetHandle())
200 Control->InvalidateRect(rect, erase);
210 if (Control->GetHandle())
211 Control->UpdateWindow();
#define PRECONDITION(condition)
#define TRACEX(group, level, message)
void SetBounds(const TRect &) override
Calls TGadget::SetBounds and passes the dimensions of the control gadget's rectangle.
TWindow * GetControl() const
Return the control that is simulating a gadget.
void Inserted() override
Called when the control gadget is inserted in the parent window.
void InvalidateRect(const TRect &rect, bool erase=true)
Invalidate a rectangle within this gadget by invalidating the rect in the control window in addition ...
void Created() override
Virtual called after the window holding a gadget has been created.
TControlGadget(TWindow &control, TBorderStyle=None)
Creates a TControlGadget object associated with the specified TControl window.
void Removed() override
Called when the control gadget is removed from the parent window.
void SetVisible(bool visible) override
Sets the visibility of this gadget and the encapsulated control.
void Update()
Updates the client area of the specified window by immediately sending a WM_PAINT message.
void GetDesiredSize(TSize &) override
Calls TGadget::GetDesiredSize and passes the size of the control gadget.
~TControlGadget() override
Destroys a TControlGadget object and removes it from the associated window.
TGadget(int id=0, TBorderStyle borderStyle=None)
Construct a gadget with a given id and border style.
void InvalidateRect(const TRect &rect, bool erase=true)
Invalidate a rectangle in our containing window.
TGadgetWindow * GetGadgetWindow()
Return a pointer to the owning or parent window for the gadget.
virtual void SetBounds(const TRect &rect)
Called by the gadget window to inform the gadget of a change in its bounding rectangle.
TBorderStyle
Gadget border styles.
virtual void SetVisible(bool visible)
Changes the visibility of the gadget.
virtual void GetDesiredSize(TSize &size)
Request by the gadget window to query the gadget's desired size.
int GetId() const
Gets the ID for the gadget.
auto GetTooltip() const -> TTooltip *override
Returns Tooltip.
TRect is a mathematical class derived from tagRect.
int Height() const
Returns the height of this rectangle (bottom - top).
int Width() const
Returns the width of this rectangle (right - left).
The tagSIZE struct is defined as.
TWindow, derived from TEventHandler and TStreamableBase, provides window-specific behavior and encaps...
bool ModifyStyle(uint32 offBits, uint32 onBits, uint swpFlags=0)
Modifies the style bits of the window.
HWND GetHandle() const
Returns the handle of the window.
Class TControlGadget definition.
Definition of TGadgetList, TGadgetWindow & TGadgetWindowFont A list holding gadgets,...
Object Windows Library (OWLNext Core).
DIAG_DECLARE_GROUP(OwlThread)