34#if defined(BI_COMP_BORLANDC)
38class TButtonTextGadgetEnabler
39 :
public TCommandEnabler
49 virtual void Enable(
bool);
51 void SetText(
const tstring& s) {SetText(s.c_str());}
52 virtual void SetCheck(
int);
56 TButtonTextGadget* Gadget;
59#if defined(BI_COMP_BORLANDC)
67TButtonTextGadgetEnabler::Enable(
bool enable)
87TButtonTextGadgetEnabler::SetCheck(
int state)
114 LayoutStyle(lTextBottom),
155 if (
text == Text)
return;
162 while (parent && !frame){
240 if(LayoutStyle != style){
264 if ((Style &
sText) && Text.length() == 0)
294 size.cx +=
tm.tmAveCharWidth * NumChars;
295 size.cy +=
tm.tmHeight + 2;
306 TRACEX(
OwlGadget, 1,
_T(
"TButtonTextGadget::GetDesiredSize() enter @") <<
this <<
307 _T(
" size ") << size);
334 TRACEX(
OwlGadget, 1,
_T(
"TButtonTextGadget::GetDesiredSize() leave @") <<
this <<
335 _T(
" size ") << size);
398 else if(Style ==
sText)
Definition of classes TButtonTextGadget.
Definition of a bitmap Cel array class.
#define PRECONDITION(condition)
#define DIAG_DECLARE_GROUP(group)
#define TRACEX(group, level, message)
virtual void CommandEnable()
Initiates a command enable for this button gadget.
TStyle GetStyle() const
Returns the Style for the gadget.
virtual void Layout(TRect &srcRect, TRect &textRect, TRect &btnRect)
Layout button and text in the control area.
void SetLayoutStyle(const TLayoutStyle style, bool repaint=true)
If the style stored in LayoutStyle is not the same as the new style, SetLayoutStyle sets LayoutStyle ...
virtual void SetBounds(const TRect &rect)
If (Style & sBitmap) calls TButtonGadget::SetBounds; otherwise calls TGadget::SetBounds to set the bo...
TStyle
TStyle contains values that defines how gadget will be displayed:
@ sBitmap
Only the bitmap is displayed.
@ sText
Only text is displayed.
TAlign
Enumerates the text-alignment attributes.
@ aCenter
Aligns the text horizontally at the center of the bounding rectangle.
@ aLeft
Aligns the text at the left edge of the bounding rectangle.
@ aRight
Aligns the text at the right edge of the bounding rectangle.
void SetStyle(const TStyle style, bool repaint=true)
If the style stored in Style is not the same as the new style, SetStyle sets Style to the new style,...
virtual ~TButtonTextGadget()
Destroys a TButtonTextGadget object.
virtual void Created()
Calls TButtonGadget::Created and if Text == 0 and (Style & sText) retrieves text from menu or resourc...
const TFont & GetFont() const
Returns the effective font used to render the text for this gadget.
void SetAlign(const TAlign align, bool repaint=true)
If the align stored in Style is not the same as the new align, SetAlign sets Align to the new align,...
virtual void PaintText(TDC &dc, TRect &rect, const tstring &text)
Paint Text.
void SetText(const tstring &text, bool repaint=true)
Sets the text of the gadget.
TButtonTextGadget(int id, TResId glyphResIdOrIndex, TStyle style=sBitmapText, TType type=Command, bool enabled=false, TState state=Up, bool sharedGlyph=false, uint numChars=4)
Constructs a TButtonTextGadget object using the specified bitmap ID, button gadget ID,...
virtual void SysColorChange()
Respond to a WM_SYSCOLORCHANGE, in this case to rebuild the CelArray with possibly new 3d colors.
void SetFont(const TFont &, bool repaint=true)
Sets the font to be used by the gadget.
TLayoutStyle
TLayoutStyle contains values that defines how bitmap and text will be layout.
@ lTextTop
Text top, bitmap bottom.
@ lTextBottom
Text bottom, bitmap top.
@ lTextRight
Text right, bitmap left.
@ lTextLeft
Text left, bitmap right.
virtual void GetDesiredSize(TSize &size)
Calls TButtonGadget::GetDesiredSize if (Style & sBitmap); calls TGadget::GetDesiredSize and adds the ...
void GetTextSize(TSize &size)
virtual void Paint(TDC &dc)
Calls TGadget::PaintBorder to perform the actual painting of the border of the control.
TSize CelSize() const
Return the size of the celarray.
Class wrapper for management of color values.
static const TColor LtBlue
Static TColor object with fixed Value set by RGB(0, 0, 255).
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.
uint GetId() const
Retrieves the id of the command.
virtual void Enable(bool enable=true)
Enables or disables the command sender.
TCommandEnabler(uint id, HWND hWndReceiver=0)
Constructs the TCommandEnabler object with the specified command ID.
TDC is the root class for GDI DC wrappers.
void SelectObject(const TBrush &brush)
Selects the given GDI brush object into this DC.
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.
TDecoratedFrame automatically positions its client window (you must supply a client window) so that i...
virtual tstring GetHintText(uint id, THintText hintType) const
Retrieves the text specified by the resource id.
TFont derived from TGdiObject provides constructors for creating font objects from explicit informati...
TEXTMETRIC GetTextMetrics(TDC &dc) const
Retrieves information about this font when selected in the specified dc.
bool IsHaveMouse() const
Return true if mouse inside gadget.
void Invalidate(bool erase=true)
Used to invalidate the active (usually nonborder) portion of the gadget, Invalidate calls InvalidateR...
void GetInnerRect(TRect &rect)
Computes the area of the gadget's rectangle excluding the borders and margins.
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.
bool GetEnabled() const
Determines whether keyboard and mouse input have been enabled for the specified gadget.
virtual void Created()
This is the virtual called after the window holding a gadget has been created.
virtual void SysColorChange()
Called when the system colors have been changed so that gadgets can rebuild and repaint,...
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.
@ FlatHotText
Adds hot text effect like.
@ FlatStandard
Flat style IE 3.0 - base style.
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.
virtual TCelArray & GetCelArray(int minX=0, int minY=0)
Gets the Shared CelArray for 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.
TUIFace assists in painting UI elements in various states.
@ Disabled
Disabled or Unavailable state (embossed 3d no color)
@ Indeterm
Indeterminant, or mixed-value state.
@ Down
Down or Option set state (hilit background, +1,+1)
void Paint(TDC &dc, const TPoint &dstPt, TState state, bool pressed, bool fillFace=true)
Paint the face of a button onto a DC.
TWindow, derived from TEventHandler and TStreamableBase, provides window-specific behavior and encaps...
TWindow * GetParentO() const
Return the OWL's parent for this window.
TResult HandleMessage(TMsgId, TParam1=0, TParam2=0)
Dispatches the given message using the response table.
HWND THandle
TWindow encapsulates an HWND.
Definition of class TDecoratedFrame, a TFrameWindow that can manage decorations around the client win...
#define WM_COMMAND_ENABLE
Definition of TGadgetList, TGadgetWindow & TGadgetWindowFont A list holding gadgets,...
@ htTooltip
Shorter text displayed in a tooltip.
Object Windows Library (OWLNext Core)
LPARAM TParam2
Second parameter type.
Definition of the UI Helper Classes: TUIHandle, TUIBorder, TUIFace, TUIPart.