10#if !defined(OWL_GADGETWI_H)
14#if defined(BI_HAS_PRAGMA_ONCE)
54 virtual void Insert(
TGadget& gadget, TPlacement = After,
56 virtual void InsertFrom(
TGadgetList& list, TPlacement = After,
66 virtual void Inserted(
TGadget& gadget);
67 virtual void Removed(
TGadget& gadget);
73 uint GadgetCount()
const;
77 TGadget* GadgetWithId(
int id)
const;
95 explicit TGadgetWindowFont(
int pointSize,
bool bold =
false,
bool italic =
false);
137 TTileDirection direction = Horizontal,
138 TFont* font =
nullptr,
145 auto Create() ->
bool override;
149 void SetMargins(
const TMargins& margins);
157 TTileDirection GetDirection()
const;
158 virtual void SetDirection(TTileDirection direction);
160 void SetRectangularDimensions(
int width,
int height,
int rowMargin= -1);
162 const TFont& GetFont()
const;
163 uint GetFontHeight()
const;
167 auto GetTooltip() const ->
TTooltip* override;
168 void EnableTooltip(
bool enable=true) override;
171 bool GetWantTooltip() const;
172 void SetWantTooltip(
bool wantTooltip);
176 bool GadgetSetCapture(
TGadget& gadget);
177 void GadgetReleaseCapture(
TGadget& gadget);
187 void SetHintMode(THintMode hintMode);
188 THintMode GetHintMode();
189 void SetHintCommand(
int id);
202 static void EnableFlatStyle(
uint style = FlatDefault);
203 static uint GetFlatStyle();
207 bool IsThemed()
const;
208 void EnableThemeBackground(
bool enable =
true);
209 bool IsThemeBackgroundEnabled()
const;
210 bool IsBackgroundThemed()
const;
215 void Insert(
TGadget&, TPlacement = After,
TGadget* sibling =
nullptr)
override;
216 void InsertFrom(
TGadgetList&, TPlacement = After,
TGadget* sibling =
nullptr)
override;
222 void Inserted(
TGadget&)
override;
223 void Removed(
TGadget&)
override;
227 virtual void SetCelArray(
TCelArray* sharedCels);
228 virtual TCelArray& GetCelArray(
int minX = 0,
int minY = 0);
233 auto IdleAction(
long idleCount) ->
bool override;
241 void GadgetChangedSize(
TGadget& gadget);
245 virtual void LayoutSession();
249 void SetShrinkWrap(
bool shrinkWrapWidth,
bool shrinkWrapHeight);
253 virtual void GetDesiredSize(
TSize& size);
258 virtual void PaintGadgets(
TDC& dc,
bool erase,
TRect& rect);
262 virtual void GetInnerRect(
TRect& rect);
264 int LayoutUnitsToPixels(
int units);
266 void GetMargins(
const TMargins& margins,
267 int& left,
int& right,
int& top,
int& bottom);
268 void UseDesiredSize();
331 bool ShrinkWrapWidth : 8;
332 bool ShrinkWrapHeight : 8;
333 uint WideAsPossible : 8;
334 bool DirtyLayout : 8;
344 static uint FlatStyle;
345 bool ThemeBackgroundMode;
367#define EV_WM_CREATETOOLTIP OWL_EV_(WM_OWLCREATETTIP, EvCreateTooltips)
379 TFont* font =
nullptr,
468 int& left,
int& right,
int& top,
int& bottom)
470 margins.
GetPixels(left, right, top, bottom, FontHeight);
498 WantTooltip = wantTooltip;
Pointer to an array of type T.
TCelArray is a horizontal array of cels (a unit of animation) created by slicing a portion of or an e...
Base class for an extensible interface for auto enabling/disabling of commands (menu items,...
TDC is the root class for GDI DC wrappers.
TFont derived from TGdiObject provides constructors for creating font objects from explicit informati...
TFont(HFONT handle, TAutoDelete autoDelete=NoAutoDelete)
TFont encapsulates an HFONT.
TGadgetControl(TWindow *parent=nullptr, TGadget *soleGadget=nullptr, TFont *font=nullptr, TModule *module=nullptr)
Constructs a control out of a gadget.
TGadget is the base class for the following derived gadget classes:
TGadget * NextGadget()
Returns the next gadget in the list of gadgets.
TGadgetList is a list of gadgets with management functions.
uint GadgetCount() const
Returns the number of gadgets in the list.
TGadget * NextGadget(TGadget &gadget) const
Returns the next gadget in the list relative to a given gadget.
TPlacement
Enumerates the placement of a gadget.
TGadget * FirstGadget() const
Returns the first gadget of the list.
Gadget layout information used during the layout process.
TAPointer< TRect > GadgetBounds
TLayoutInfo(int gadgetCount)
TGadgetWindowFont()
Constructs a font based on TDefaultGuiFont.
Derived from TWindow, TGadgetWindow maintains a list of tiled gadgets for a window and lets you dynam...
uint GetFontHeight() const
Returns the height of the font being used by this gadget window.
TGadget * GadgetGetCaptured()
Retrieves gadget with capture.
void EvMouseMove(uint modKeys, const TPoint &point)
Forward mouse moves to the gadget that has captured the mouse, if any.
static uint GetFlatStyle()
Returns the flat style.
THintMode GetHintMode()
Returns the current hint mode of this gadget window.
void SetupWindow() override
Overrides TWindow::SetupWindow to create tooltips for the gadget window.
bool EvWindowPosChanging(WINDOWPOS &windowPos)
Intercepts window size changes to make sure that this gadget window follows its own sizing rules.
TFlatStyle
Enumerates the flat styles settings of the gadget.
@ NonFlatNormal
No Flat style - default.
@ FlatDefault
System automatically select apropriated style.
@ FlatXPTheme
Windows XP theme styles.
@ FlatGrayButtons
Adds Gray buttons effect to FlatStandard.
@ FlatSingleDiv
Adds single divider ala IE 4.01.
@ FlatHotText
Adds hot text effect like.
@ FlatStandard
Flat style IE 3.0 - base style.
void EvRButtonUp(uint modKeys, const TPoint &point)
Pass RButton messages to the gadget at the mouse location or the one with capture.
void CleanupWindow() override
virtual TRect TileGadgets()
Tiles the Gadgets in the current direction.
void EvSysColorChange()
Responds to WM_SYSCOLORCHANGE to let the gadgets update their UI colors, and to let this gadget windo...
void EvLButtonDown(uint modKeys, const TPoint &point)
Responds to a left button-down mouse message by forwarding the event to the gadget (if it is enabled)...
void EvCommandEnable(TCommandEnabler &) override
When the gadget window receives a WM_COMMAND_ENABLE message, it is likely from a gadget or control wi...
auto EvCommand(uint id, HWND hWndCtl, uint notifyCode) -> TResult override
When the gadget window receives a WM_COMMAND message, it is likely from a gadget or control within a ...
void EvLButtonUp(uint modKeys, const TPoint &point)
Responds to a left button-up mouse message by forwarding the event to the gadget that has the capture...
void SetHintMode(THintMode hintMode)
Sets the mode of the hint text.
const TFont & GetFont() const
Returns the font being used by this gadget window.
bool GetWantTooltip() const
void EvRButtonDown(uint modKeys, const TPoint &point)
Pass RButton messages to the gadget at the mouse location or the one with Capture.
void EvLButtonDblClk(uint modKeys, const TPoint &point)
Passes double clicks through as if they were just a second click; finishes the first click,...
TGadgetWindow(TWindow *parent=nullptr, TTileDirection direction=Horizontal, TFont *font=nullptr, TModule *module=nullptr)
Creates a TGadgetWindow interface object with the default tile direction and font and passes module w...
bool PreProcessMsg(MSG &msg) override
Relays 'interesting' messages to the tooltip window.
virtual void PositionGadget(TGadget *previous, TGadget *next, TPoint &point)
Virtual called by TileGadgets() for each gadget in order to give derived classes a chance to modify t...
void SetWantTooltip(bool wantTooltip)
TTileDirection
Enumeration describing how gadgets should be laid out within the gadget window.
@ Vertical
Arrange gadgets in a column.
@ Rectangular
Arrange gadgets in rows and columns (2-D grid).
@ Horizontal
Arrange gadgets in a row.
TTileDirection GetDirection() const
Returns the direction of tiling for this gadget window.
THintMode
Hint mode settings & action used by contained gadgets.
@ EnterHints
Hints when the mouse passes over a gadget.
@ PressHints
Hints when a button is pressed.
virtual void LayoutGadgets(TTileDirection dir, TLayoutInfo &layout)
Calculate the layout of the Gadgets in a given direction.
void Paint(TDC &, bool erase, TRect &) override
Puts the font into the device context and calls PaintGadgets.
ObjectWindows dynamic-link libraries (DLLs) construct an instance of TModule, which acts as an object...
TPoint is a support class, derived from tagPOINT.
TRect is a mathematical class derived from tagRect.
The tagSIZE struct is defined as.
TWindow, derived from TEventHandler and TStreamableBase, provides window-specific behavior and encaps...
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...
virtual TTooltip * GetTooltip() const
Base class TGadget and simple derived TSeparatorGadget.
Definition of abstract GDI object class and derived classes.
Object Windows Library (OWLNext Core).
LRESULT TResult
Result type.
Used by the TGadgetWindow and TGadget classes, TMargins contains the measurements of the margins for ...
void GetPixels(int &left, int &right, int &top, int &bottom, int fontHeight) const
Base window class TWindow definition, including HWND encapsulation.