9#if !defined(OWL_GADGET_H)
13#if defined(BI_HAS_PRAGMA_ONCE)
27#define IDG_FIRST 30000
29#define IDG_MESSAGE IDG_FIRST + 0
30#define IDG_STATUS_EXT IDG_FIRST + 1
31#define IDG_STATUS_CAPS IDG_FIRST + 2
32#define IDG_STATUS_NUM IDG_FIRST + 3
33#define IDG_STATUS_SCRL IDG_FIRST + 4
34#define IDG_STATUS_OVR IDG_FIRST + 5
35#define IDG_STATUS_REC IDG_FIRST + 6
36#define IDG_SIZEGRIP IDG_FIRST + 7
37#define IDG_FLATHANDLE IDG_FIRST + 8
55 enum TUnits {Pixels, LayoutUnits, BorderUnits};
64 TMargins() {Units = LayoutUnits; Left = Right = Top = Bottom = 0;}
67 {Units =
u; Left =
l; Right =
r; Top = t; Bottom =
b;}
69 void GetPixels(
int& left,
int& right,
int& top,
int& bottom,
int fontHeight)
const;
161 void SetBorders(
const TBorders&
borders);
162 TBorders& GetBorders();
167 void SetBorderStyle(TBorderStyle
bs);
168 TBorderStyle GetBorderStyle()
const;
172 const TRect& GetBounds()
const;
174 virtual void SetEnabled(
bool enabled);
175 bool GetEnabled()
const;
177 virtual void SetVisible(
bool visible);
178 bool IsVisible()
const;
180 bool IsWindowVisible()
const;
182 void SetEndOfRow(
bool eor);
183 bool IsEndOfRow()
const;
185 bool IsWideAsPossible()
const;
186 void SetWideAsPossible(
bool wide =
true);
195 void SetSize(
const TSize& size);
199 virtual void GetDesiredSize(
TSize& size);
204 void GetOuterSizes(
int& left,
int& right,
int& top,
int& bottom);
212 virtual void SetBounds(
const TRect&
rect);
215 virtual void CommandEnable();
216 virtual void SysColorChange();
229 virtual void Created();
230 virtual void Inserted();
231 virtual void Moved();
232 virtual void Removed();
234 bool IsHaveMouse()
const;
235 void SetInMouse(
bool state);
237 bool GetTrackMouse()
const;
238 void SetTrackMouse(
bool track);
240 void Invalidate(
bool erase =
true);
250 virtual void Paint(
TDC& dc);
255 virtual void PaintBorder(
TDC& dc);
277 void ChangeBorderStyle(TBorderStyle
bs);
299 TBorderStyle BorderStyle;
307 bool ShrinkWrapWidth;
308 bool ShrinkWrapHeight;
333 TGadget(
const TGadget&);
378 virtual void Paint(
TDC& dc);
379 virtual void GetDesiredSize(
TSize& size);
460 return Flags & Enabled;
479 return Flags & Visible;
487 return MouseInGadget;
493 MouseInGadget = state;
524 return Flags & EndOfRow;
551 return WideAsPossible;
558 WideAsPossible =
wide;
TDC is the root class for GDI DC wrappers.
A gadget that is used on the far right of a status bar to provide re-sizing grip for the host window.
TGadget is the base class for the following derived gadget classes:
bool IsHaveMouse() const
Return true if mouse inside gadget.
TRect & GetBounds()
Returns the boundary rectangle for the gadget.
bool IsWideAsPossible() const
Indicates whether the gadget width will be adjusted by the gadget window to be as wide as possible in...
void SetWideAsPossible(bool wide=true)
Sets the flag that indicates whether the gadget width will be adjusted by the gadget window to be as ...
void SetEndOfRow(bool eor)
Sets the end of row property for the gadget.
TBorders & GetBorders()
Gets the gadget's borders measured in border units that are based on SM_CXBORDER and SM_CYBORDER.
bool GetTrackMouse() const
void SetInMouse(bool state)
Sets if mouse inside gadget or not.
bool IsVisible() const
Returns true if the gadget is visible.
void ChangeBorderStyle(TBorderStyle bs)
Simply changes the border style without recalculating the gadget size.
TGadgetWindow * GetGadgetWindow()
Return a pointer to the owning or parent window for the gadget.
bool GetEnabled() const
Determines whether keyboard and mouse input have been enabled for the specified gadget.
bool IsEndOfRow() const
Returns true if this gadget is at the end of a row.
TBorderStyle GetBorderStyle() const
Gets the style for the gadget's borders.
void SetTrackMouse(bool track)
TBorderStyle
Gadget border styles.
@ Embossed
Painted with an embossed border.
@ WndRecessed
Input field and other window are recessed.
@ Recessed
Recessed into the window.
@ None
No border painted at all.
@ WndRaised
Inner and outer edge of the window are raised.
@ ButtonUp
Button in up position.
@ Plain
Plain window frame.
@ Grooved
Grouping groove.
@ Raised
Raised above the gadget window.
@ WellSet
Well option set (auto grows + 1)
@ ButtonDn
Button in down position.
virtual void SetVisible(bool visible)
Changes the visibility of the gadget.
TGadget * NextGadget()
Returns the next gadget in the list of gadgets.
TMargins & GetMargins()
Gets the margin dimensions.
int GetId() const
Gets the ID for the gadget.
TGadgetList is a list of gadgets with management functions.
Derived from TWindow, TGadgetWindow maintains a list of tiled gadgets for a window and lets you dynam...
TPoint is a support class, derived from tagPOINT.
TRect is a mathematical class derived from tagRect.
TSeparatorGadget is a simple class you can use to create a separator between gadgets.
void SetShowSep(bool show=true)
TSizeGripGadget is a gadget that is used on the far right of a status bar to provide re-sizing grip f...
The tagSIZE struct is defined as.
Definition of GDI DC encapsulation classes: TDC, TWindowDC, TScreenDC, TDesktopDC,...
#define IDG_SIZEGRIP
The ID for a size grip gadget.
#define IDG_FLATHANDLE
The ID for a flat bar handle.
Object Windows Library (OWLNext Core)
Used by the TGadgetWindow and TGadget classes, TMargins contains the measurements of the margins for ...
TMargins(TUnits u, int l, int r, int t, int b)
Base window class TWindow definition, including HWND encapsulation.