18#include <owl/glyphbtn.rh>
20#if defined(__BORLANDC__)
87 dstDC.SelectObject(*
this);
90 dstDC.RestoreBitmap();
91 srcDC.RestoreBitmap();
184 int X,
int Y,
int W,
int H,
224 xGlyph = yGlyph = -1;
354 if (::GetClassInfo(0,
_T(
"BUTTON"), &
wndClass)) {
475 const auto i =
icon.GetInfo();
480 const auto r =
TRect{{0, 0},
bmp.Size()};
685 else if (IsThemed() &&
rect.Contains(
point))
866#if defined(__DEBUG) || defined(__TRACE) || defined(__WARN)
942 if (
rect.Width() > 2 &&
rect.Height() > 2) {
948 rect.Inflate(-1, -1);
952 rect.Inflate(-1, -1);
1117 if (!
textRect.IsNull() && xText >= 0 && yText >= 0)
1119 if (!
glyphRect.IsNull() && xGlyph >= 0 && yGlyph >= 0)
1278 if (style != LayStyle) {
1292 if (x != xText || y != yText) {
1307 if (x != xGlyph || y != yGlyph) {
Definition of a bitmap Cel array class.
#define PRECONDITION(condition)
#define DIAG_DECLARE_GROUP(group)
#define TRACEX(group, level, message)
TBitmap is the GDI bitmap class derived from TGdiObject.
int Width() const
Returns the width of this bitmap using GDI's GetObject.
int Height() const
Returns the height of this bitmap using GDI's GetObject.
The GDI Brush class is derived from TGdiObject.
TBtnBitmap is an enhanced version of TBitmap with the ability to update the face color of a bitmap to...
static void MapColor(TDC &dc, TDC &srcDC, const TColor &toColor, const TColor &fromColor, int width, int height)
Helper routine used to map the face color of the underlying bitmap.
TBtnBitmap(HINSTANCE hInstance, TResId resId, const TColor &faceColor=TColor::LtGray)
Loads the specified bitmap and updates the face color, if necessary.
void UpdateFaceColor()
Updates the face color of the associated bitmap to the current system setting.
TColor FaceColor
Current face color of bitmap.
TCelArray is a horizontal array of cels (a unit of animation) created by slicing a portion of or an e...
TSize CelSize() const
Return the size of the celarray.
bool BitBlt(int index, TDC &dc, int x, int y, uint32 rop=SRCCOPY)
Draws the cel at index onto the DC at position x and y.
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,...
A device context class derived from TWindowDC, TClientDC provides access to the client area owned by ...
Class wrapper for management of color values.
static const TColor SysBtnText
The symbolic system color value for the text on buttons.
static const TColor SysWindowFrame
The symbolic system color value for the frame around each window.
static const TColor LtGray
Static TColor object with fixed Value set by RGB(192, 192, 192).
static const TColor Sys3dShadow
The symbolic system color value for the shadow regions of 3-dimensional display elements (for edges f...
static const TColor Sys3dFace
The symbolic system color value for the face color of 3-dimensional display elements.
TDC is the root class for GDI DC wrappers.
void SelectObject(const TBrush &brush)
Selects the given GDI brush object into this DC.
bool FillRect(int x1, int y1, int x2, int y2, const TBrush &brush)
Fills the given rectangle on this DC using the specified brush.
void RestorePen()
Restores the original GDI pen object to this DC.
bool DrawFocusRect(int x1, int y1, int x2, int y2)
Draws the given rectangle on this DC in the style used to indicate focus.
bool Rectangle(int x1, int y1, int x2, int y2)
Draws and fills a rectangle of the given size on this DC with the current pen and brush objects.
void RestoreBrush()
Restores the original GDI brush object to this DC.
virtual void RestoreFont()
Restores the original GDI font object to this DC.
virtual void SelectStockObject(int index)
Selects into the DC a predefined stock pen, brush, font, or palette.
bool BitBlt(int dstX, int dstY, int w, int h, const TDC &srcDC, int srcX, int srcY, uint32 rop=SRCCOPY)
Performs a bit-block transfer from srcDc (the given source DC) to this DC (the destination DC).
virtual TColor SetTextColor(const TColor &color)
Sets the current text color of this DC to the given color value.
int SetBkMode(int mode)
Sets the background mode to the given mode argument, which can be either OPAQUE or TRANSPARENT.
int DrawText(const tstring &str, int count, const TRect &, uint16 format=0)
Overload for const TRect& For obvious reasons, this overload does not support the DT_CALCRECT format ...
Encapsulates the system font used for a specific GUI element, e.g. icon, caption, menu,...
TFont derived from TGdiObject provides constructors for creating font objects from explicit informati...
bool IsGDIObject() const
Returns true if this represents a real GDI object.
TIcon, derived from TGdiObject, represents the GDI object icon class.
A device context (DC) class derived from TCreatedDC, TMemoryDC provides access to a memory DC.
ObjectWindows dynamic-link libraries (DLLs) construct an instance of TModule, which acts as an object...
A DC class that wraps begin and end paint calls for use in an WM_PAINT response function.
PAINTSTRUCT Ps
The paint structure associated with this TPaintDC object.
TPen is derived from TGdiObject.
TPoint is a support class, derived from tagPOINT.
TRect is a mathematical class derived from tagRect.
The tagSIZE struct is defined as.
static TThemeModule & GetInstance()
Returns the module instance.
Encapsulates a themed part.
Assists in drawing borders of many styles.
@ ButtonDn
Button in down position.
@ ButtonUp
Button in up position.
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)
void Paint(TDC &dc, const TPoint &dstPt, TState state, bool pressed, bool fillFace=true)
Paint the face of a button onto a DC.
Type-safe encapsulation of a Windows class name, a union between ATOM and LPCTSTR.
TWindow, derived from TEventHandler and TStreamableBase, provides window-specific behavior and encaps...
HWND GetParentH() const
Return the handle of the parent.
HWND SetFocus()
Sets the keyboard focus to current window and activates the window that receives the focus by sending...
HWND SetCapture()
Sets the mouse capture to the current window.
static HWND GetCapture()
Returns the handle of the window that has captured the mouse.
tstring GetWindowText() const
String-aware overload.
virtual void GetWindowClass(WNDCLASS &wndClass)
Redefined by derived classes, GetWindowClass fills the supplied MS-Windows registration class structu...
TWindow * GetParent() const
Retrieves the OWL object of the parent window. If none exists, returns 0.
TWindow * GetParentO() const
Return the OWL's parent for this window.
static void ReleaseCapture()
Releases the mouse capture from this window.
TModule * GetModule() const
Returns a pointer to the module object.
bool TrackMouseEvent(uint flags=TME_HOVER|TME_LEAVE, int hoverTime=HOVER_DEFAULT)
Posts messages when the mouse pointer leaves a window or hovers over a window for a specified amount ...
uint32 GetStyle() const
Gets the style bits of the underlying window or the 'Style' member of the attribute structure associa...
TRect GetClientRect() const
Gets the coordinates of the window's client area (the area in a window you can use for drawing).
int GetDlgCtrlID() const
Returns the ID of the control.
void SendNotification(int id, int notifyCode, HWND hCtl, TMsgId=WM_COMMAND)
Repacks a command message (msg) so that a child window (hCtl) can send a message to its parent regard...
void EvSysColorChange()
Respond to WM_SYSCOLORCHANGE by broadcasting it to all children.
HFONT GetWindowFont()
Gets the font the control uses to draw text.
TResult SendMessage(TMsgId, TParam1=0, TParam2=0) const
Sends a message (msg) to a specified window or windows.
HWND THandle
TWindow encapsulates an HWND.
virtual void Invalidate(bool erase=true)
Invalidates (mark for painting) the entire client area of a window.
HWND GetHandle() const
Returns the handle of the window.
int GetWindowTextLength() const
Returns the length, in characters, of the specified window's title.
Definition of windowing system color classes.
Definition of classes for CommonControl encapsulation.
#define DEFINE_RESPONSE_TABLE1(cls, base)
Macro to define a response table for a class with one base.
Definition of abstract GDI object class and derived classes.
Definition of class TGlyphButton.
TAutoDelete
Flag for Handle ctors to control Handle deletion in dtor.
Object Windows Library (OWLNext Core)
const int BUTTONSTATE_PUSHED
const int FaceToFocusRectDelta
const int BUTTONSTATE_FOCUS
const uint32 BUTTONSTYLE_MASK
LPARAM TParam2
Second parameter type.
const int BUTTONSTATE_HOT
auto GetCommCtrlVersion() -> DWORD
Returns the version number of the Common Control library (ComCtl32.dll).
WPARAM TParam1
First parameter type.
LRESULT CALLBACK BButtonProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
LRESULT TResult
Result type.
TModule & GetGlobalModule()
Definition of TSystem, a system information provider class.
Microsoft UxTheme Library Encapsulation.
Definition of the UI Helper Classes: TUIHandle, TUIBorder, TUIFace, TUIPart.
#define EV_MESSAGE(message, method)
Response table entry for raw message handling Uses a dispatcher that just forwards WPARAM and LPARAM.