174 int left, right, top, bottom;
178 size.cx +=
newW + left + right - Bounds.Width();
181 if (ShrinkWrapHeight)
281 TDynamicTextGadget* Gadget;
284void TDynamicTextGadgetEnabler::Enable(
bool enable)
291void TDynamicTextGadgetEnabler::SetText(
LPCTSTR text)
#define PRECONDITION(condition)
Class wrapper for management of color values.
static const TColor SysBtnText
The symbolic system color value for the text on buttons.
static const TColor Sys3dHilight
The symbolic system color value for highlighted 3-dimensional display elements (for edges facing the ...
static const TColor Sys3dFace
The symbolic system color value for the face color of 3-dimensional display elements.
Base class for an extensible interface for auto enabling/disabling of commands (menu items,...
uint GetId() const
Retrieves the id of the command.
virtual void Enable(bool enable=true)
Enables or disables the command sender.
TDC is the root class for GDI DC wrappers.
void SelectObject(const TBrush &brush)
Selects the given GDI brush object into this DC.
bool TextRect(int x1, int y1, int x2, int y2)
Fills the given rectangle, clipping any text to the rectangle.
virtual TColor SetBkColor(const TColor &color)
Sets the current background color of this DC to the given color value or the nearest available.
virtual void RestoreFont()
Restores the original GDI font object to this DC.
virtual TColor SetTextColor(const TColor &color)
Sets the current text color of this DC to the given color value.
Small class will send EvEnable to window, You can set text by handling EvCommandEnable message.
TDynamicTextGadget(int id=0, TBorderStyle=Recessed, TAlign=Left, uint numChars=10, LPCTSTR text=0, TFont *font=0)
virtual void CommandEnable()
TFont derived from TGdiObject provides constructors for creating font objects from explicit informati...
int GetHeight() const
Returns the height of the font.
TSize GetTextExtent(const tstring &text) const
Returns the extent of a given string using this particular font.
int GetMaxWidth() const
Returns the maximum width of the characters in the font.
TGadget is the base class for the following derived gadget classes:
void GetOuterSizes(int &left, int &right, int &top, int &bottom)
Get the four total outer sizes in pixels which consists of the margins plus the borders.
void GetInnerRect(TRect &rect)
Computes the area of the gadget's rectangle excluding the borders and margins.
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.
bool GetEnabled() const
Determines whether keyboard and mouse input have been enabled for the specified gadget.
void SetShrinkWrap(bool shrinkWrapWidth, bool shrinkWrapHeight)
Simple set accessor to set whether shrinkwrapping is performed horizontally and/or vertically.
TBorderStyle
Gadget border styles.
virtual void SetEnabled(bool enabled)
Enables or disables keyboard and mouse input for the gadget.
virtual void GetDesiredSize(TSize &size)
Request by the gadget window to query the gadget's desired size.
virtual void PaintBorder(TDC &dc)
Self sent by method Paint().
static uint GetFlatStyle()
Returns the flat style.
@ FlatXPTheme
Windows XP theme styles.
void GadgetChangedSize(TGadget &gadget)
Used to notify the gadget window that a gadget has changed its size, GadgetChangedSize calls LayoutSe...
const TFont & GetFont() const
Returns the font being used by this gadget window.
TPoint is a support class, derived from tagPOINT.
TRect is a mathematical class derived from tagRect.
The tagSIZE struct is defined as.
Derived from TGadget, TTextGadget is a text gadget object.
TAlign
Enumerates the text-alignment attributes.
~TTextGadget()
Destruct this text gadget and delete the text it is holding.
void Invalidate()
Invalidate the working portion of this gadget–in this case just the InnerRect.
LPCTSTR GetText() const
Returns the text for the gadget.
void Paint(TDC &dc)
Paint the text gadget by painting gadget borders, & then painting text in the InnerRect.
virtual TColor GetEnabledColor() const
void GetDesiredSize(TSize &size)
Respond to the virtual call to let this gadget's Window know how big this text gadget wants to be bas...
void ResetTextColor()
Resets the text color of the gadget to the default TColor::SysBtnText.
void ResetBkgndColor()
Resets the background color of the gadget to the default TColor::Sys3dFace.
void SetFont(const TFont &, bool repaint=true)
Sets the font to be used by the gadget.
void SetText(LPCTSTR text)
Set the text for this gadget.
TTextGadget(int id=0, TBorderStyle=Recessed, TAlign=Left, uint numChars=10, LPCTSTR text=0, TFont *font=0)
Constructs a TTextGadget object with the specified ID, border style, and alignment.
const TFont & GetFont() const
Returns the effective font used to render the text for this gadget.
TUIFace assists in painting UI elements in various states.
@ Disabled
Disabled or Unavailable state (embossed 3d no color)
static const TUIMetric CxFixedFrame
TResult HandleMessage(TMsgId, TParam1=0, TParam2=0)
Dispatches the given message using the response table.
HWND THandle
TWindow encapsulates an HWND.
#define WM_COMMAND_ENABLE
Definition of TGadgetList, TGadgetWindow & TGadgetWindowFont A list holding gadgets,...
char * strnewdup(const char *s, size_t minAllocSize=0)
Object Windows Library (OWLNext Core)
LPARAM TParam2
Second parameter type.
Definition of text gadget class TGadget.
Definition of the UI Helper Classes: TUIHandle, TUIBorder, TUIFace, TUIPart.
Definition of TUIMetric, a UI metrics provider class.