23# if defined(BI_COMP_BORLANDC)
50 void SetText(LPCTSTR);
55 TButtonGadget* Gadget;
59# if defined(BI_COMP_BORLANDC)
68TButtonGadgetEnabler::Enable(
bool enable)
71 Gadget->SetEnabled(enable);
78TButtonGadgetEnabler::SetText(LPCTSTR)
91TButtonGadgetEnabler::SetCheck(
int state)
115 SharingGlyph(sharedGlyph)
122 GlyphIndex = glyphResIdOrIndex.
GetInt();
126 ResId = glyphResIdOrIndex.
IsString() ?
127 strnewdup(glyphResIdOrIndex) : (LPCTSTR)glyphResIdOrIndex;
133 BitmapOrigin.x = BitmapOrigin.y = 0;
152 if (ResId.IsString())
153 delete[] (LPSTR)(LPCTSTR)ResId;
203#if defined(BI_COMP_GNUC)
244#if defined(BI_COMP_GNUC)
245 TState state = first->State;
248 if (first->State ==
Down) {
273#if defined(BI_COMP_GNUC)
275 if (newState != state) {
277 if (newState !=
static_cast<TState>(State)) {
296 TRACEX(OwlGadget, 1,
_T(
"TButtonGadget::SetBounds() enter @") <<
this <<
297 _T(
" bounds ") << bounds);
307 BitmapOrigin.x = innerRect.left + (innerRect.
Width() - bitmapSize.cx) / 2;
308 BitmapOrigin.y = innerRect.top + (innerRect.
Height() - bitmapSize.cy) / 2;
309 TRACEX(OwlGadget, 1,
_T(
"TButtonGadget::SetBounds() leave @") <<
this <<
310 _T(
" bounds ") << bounds);
325 TRACEX(OwlGadget, 1,
_T(
"TButtonGadget::GetDesiredSize() enter @") <<
this <<
326 _T(
" size ") << size);
332 if (!CelArray && GlyphIndex < 0)
336 TRACEX(OwlGadget, 1,
_T(
"TButtonGadget::GetDesiredSize() leave @") <<
this <<
337 _T(
" size ") << size);
411 celArray.
Replace(GlyphIndex, *glyph);
413 GlyphIndex = celArray.
Add(*glyph);
424 SharingGlyph =
false;
482 bool down = ok && (Pressed || State ==
Down);
491 int state = down ? TS_PRESSED : hover ? TS_HOT : 0;
539 bool pressed =
false;
552 pressed = hover ? true : Pressed;
565 face.
Paint(dc, srcRect, dstPt, state, pressed,
false);
622#if defined(BI_COMP_GNUC)
629#if defined(BI_COMP_GNUC)
638#if defined(BI_COMP_GNUC)
646#if defined(BI_COMP_GNUC)
669#if defined(BI_COMP_GNUC)
Definition of a bitmap Cel array class.
#define PRECONDITION(condition)
#define TRACEX(group, level, message)
TCelArray is a horizontal array of cels (a unit of animation) created by slicing a portion of or an e...
int NumRows() const
Return NRows, the number of rows in this CelArray.
TSize CelSize() const
Return the size of the celarray.
void SetCurRow(int raw)
Sets NCurRow to row.
TCelArray(TBitmap *bmp, int numCels, TSize celSize=TSize(), TPoint offset=TPoint(), int numRows=1, TAutoDelete=AutoDelete)
Constructs a TCelArray from a bitmap by slicing the bitmap into a horizontal array of cels of a speci...
bool Replace(int index, const TBitmap &image)
Replace a cel in this CelArray.
int Add(const TBitmap &image)
Add new cel(s) to the CelArray - return index of new addition.
TRect CelRect(int cel) const
Returns the upper left and lower right corner of a given cell from the current row,...
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.
TCommandEnabler(uint id, HWND hWndReceiver=0)
Constructs the TCommandEnabler object with the specified command ID.
TDC is the root class for GDI DC wrappers.
Pseudo-GDI object Device Independent Bitmap (DIB) class.
void MapUIColors(uint mapColors, const TColor *bkColor=nullptr)
Maps the UI colors to the value specified in the parameter, mapColors, which is one of the values of ...
TDib()
Protected ctor- derived classes need to fill in handle & get info.
int Width() const
Returns the width of the DIB.
int Height() const
Returns the height of the DIB.
bool IsHaveMouse() const
Return true if mouse inside gadget.
TRect & GetBounds()
Returns the boundary rectangle for the gadget.
virtual void LButtonDown(uint modKeys, const TPoint &point)
Captures the mouse if TrackMouse is set.
virtual void MouseMove(uint modKeys, const TPoint &point)
Mouse is moving over this gadget.
virtual void MouseEnter(uint modKeys, const TPoint &point)
Mouse is entering this 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.
virtual void MouseLeave(uint modKeys, const TPoint &point)
Mouse is leaving this gadget.
TGadget(int id=0, TBorderStyle borderStyle=None)
Construct a gadget with a given id and border style.
virtual bool PtIn(const TPoint &point)
Default behavior returns true if the point is within the receiver's bounding rect.
void SetInMouse(bool state)
Sets if mouse inside gadget or not.
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.
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 SysColorChange()
Called when the system colors have been changed so that gadgets can rebuild and repaint,...
void SetTrackMouse(bool track)
@ Recessed
Recessed into the window.
@ None
No border painted at all.
@ ButtonUp
Button in up position.
@ Raised
Raised above the gadget window.
@ ButtonDn
Button in down position.
virtual void SetEnabled(bool enabled)
Enables or disables keyboard and mouse input for the gadget.
void Update()
Paint now if possible.
virtual void GetDesiredSize(TSize &size)
Request by the gadget window to query the gadget's desired size.
TGadget * NextGadget()
Returns the next gadget in the list of gadgets.
virtual void PaintBorder(TDC &dc)
Self sent by method Paint().
virtual void LButtonUp(uint modKeys, const TPoint &point)
Releases the mouse capture if TrackMouse is set.
int GetId() const
Gets the ID for the gadget.
TGadget * NextGadget(TGadget &gadget) const
Returns the next gadget in the list relative to a given gadget.
TGadget * GadgetGetCaptured()
Retrieves gadget with capture.
void SetHintCommand(int id)
(id <= 0) to clear
static uint GetFlatStyle()
Returns the flat style.
@ FlatGrayButtons
Adds Gray buttons effect to FlatStandard.
@ FlatStandard
Flat style IE 3.0 - base style.
virtual TCelArray & GetCelArray(int minX=0, int minY=0)
Gets the Shared CelArray for this gadget window.
@ EnterHints
Hints when the mouse passes over a gadget.
@ PressHints
Hints when a button is pressed.
TPoint is a support class, derived from tagPOINT.
TRect is a mathematical class derived from tagRect.
int Height() const
Returns the height of this rectangle (bottom - top).
const TPoint & TopLeft() const
Returns the upperleft point.
int Width() const
Returns the width of this rectangle (right - left).
WORD GetInt() const
Returns the encapsulated numerical identifier, provided this resource identifier encodes a numerical ...
bool IsString() const
Returns true if this resource identifier encodes a string pointer.
The tagSIZE struct is defined as.
TSize()
Default constructor that does nothing.
Encapsulates a themed part.
void DrawBackground(HDC, const TRect &dest)
Paints the background of the themed part.
TUIFace assists in painting UI elements in various states.
TState
Enumeration describing the state of the bitmap to be drawn.
@ 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.
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.
DIAG_DECLARE_GROUP(OwlThread)
#define TYPESAFE_DOWNCAST(object, toClass)
Definition of TSystem, a system information provider class.
Microsoft UxTheme Library Encapsulation.
Definition of the UI Helper Classes: TUIHandle, TUIBorder, TUIFace, TUIPart.
Definition of TUIMetric, a UI metrics provider class.