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
69 void GetPixels(
int& left,
int& right,
int& top,
int& bottom,
int fontHeight)
const;
141 TGadget(
int id = 0, TBorderStyle borderStyle = None);
161 void SetBorders(
const TBorders& borders);
162 TBorders& GetBorders();
164 void SetMargins(
const TMargins& margins);
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);
191 void SetShrinkWrap(
bool shrinkWrapWidth,
bool shrinkWrapHeight);
195 void SetSize(
const TSize& size);
199 virtual void GetDesiredSize(
TSize& size);
204 void GetOuterSizes(
int& left,
int& right,
int& top,
int& bottom);
208 void GetInnerRect(
TRect& rect);
212 virtual void SetBounds(
const TRect& rect);
214 virtual bool IdleAction(
long idleCount);
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);
241 void InvalidateRect(
const TRect& rect,
248 virtual bool PtIn(
const TPoint& point);
250 virtual void Paint(
TDC& dc);
255 virtual void PaintBorder(
TDC& dc);
263 virtual void MouseEnter(
uint modKeys,
const TPoint& point);
264 virtual void MouseMove(
uint modKeys,
const TPoint& point);
265 virtual void MouseLeave(
uint modKeys,
const TPoint& point);
269 virtual void LButtonDown(
uint modKeys,
const TPoint& point);
270 virtual void RButtonDown(
uint modKeys,
const TPoint& point);
274 virtual void LButtonUp(
uint modKeys,
const TPoint& point);
275 virtual void RButtonUp(
uint modKeys,
const TPoint& point);
277 void ChangeBorderStyle(TBorderStyle bs);
299 TBorderStyle BorderStyle;
307 bool ShrinkWrapWidth;
308 bool ShrinkWrapHeight;
333 TGadget(
const TGadget&);
334 TGadget& operator =(
const TGadget&);
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.
TFlatHandleGadget(int id=IDG_FLATHANDLE)
virtual void Paint(TDC &dc)
virtual void GetDesiredSize(TSize &size)
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.
friend class TGadgetWindow
bool GetTrackMouse() const
TGadget(int id=0, TBorderStyle borderStyle=None)
Construct a gadget with a given id and border style.
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.
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(int size=0, int id=0, bool showseparator=true)
Used for both the width and the height of the separator, the default size is TUIMetric::CxSizeFrame t...
void Inserted()
This is an overridden virtual, called after a gadget is inserted into a window.
void SetShowSep(bool show=true)
void Paint(TDC &dc)
Draws the resize gadget.
TSizeGripGadget(int id=IDG_SIZEGRIP)
Constructs a gadget that can be grabbed to resize the frame.
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.