109 LayoutStyle(lTextRight),
430 if((Style&
sBitmap)==0 || Index < 0)
475 size.cy = std::max((
int)size.cy, 16);
519 if(((Style&
sBitmap)==0 || Index < 0) && CheckPainter==0)
528 (this->*CheckPainter)(dc,
rect);
586 font = Proxy->GetFont();
1006 rect.Inflate(-2,-2);
1079 rect.Inflate(-2,-2);
1115 rect.Inflate(-2,-2);
1187 rect.Inflate(-2,-2);
1266 rect.Inflate(-2,-2);
1387 for(
int i = 0;
i < (
int)items.Size();
i++){
1411 while ((--
nItem)>=0) {
1453 int count = ::GetMenuItemCount(
hMenu);
1493 if (index != items.NPOS)
1494 return items[index];
1496 const auto n =
static_cast<int>(items.Size());
1497 for (index = 0; index !=
n; ++index)
1500 if (
m &&
m->GetCmdId() ==
static_cast<int>(
cmdId))
1503 return index <
n ? items[index] :
nullptr;
Definition of a bitmap Cel array class.
#define PRECONDITION(condition)
TBitmap is the GDI bitmap class derived from TGdiObject.
TBtnBitmap is an enhanced version of TBitmap with the ability to update the face color of a bitmap to...
virtual void Measure(MEASUREITEMSTRUCT &drawItem)
Calculates the area required to display the button and text.
virtual int Compare(COMPAREITEMSTRUCT &drawItem)
Does an lstrcmp on Text from the instances contained in drawItem.
bool IsSelected()
Returns true if (Flags & ODS_SELECTED)==0; false otherwise.
@ lTextTop
Text top, bitmap bottom.
@ lTextRight
Text right, bitmap left.
@ lTextBottom
Text bottom, bitmap top.
@ lTextLeft
Text left, bitmap right.
virtual void PaintBitmap(TDC &rc, TRect &rect)
Paint the bitmap.
TStyle GetStyle() const
Returns Style: Bitmap only, Text only, or Bitmap and Text.
virtual void PaintText(TDC &rc, TRect &rect)
Paint the text.
bool IsChecked()
Returns true if (Flags & ODS_CHECKED)==0; false otherwise.
void SetFont(TFont *font)
Deletes Font and then assigns font to Font.
bool IsGrayed()
Returns true if (Flags & ODS_GRAYED)==0; false otherwise.
virtual void PaintBorder(TDC &rc, TRect &rect)
Paint the border of the gadget based on the BorderStyle member.
virtual TColor GetBkColor()
If selected returns TColor::SysActiveCaption; otherwise returns TColor::SysWindow.
virtual void Layout(const TRect &src, TRect &textRect, TRect &bmpRect)
Layout Text and Bitmap.
bool IsFocused()
Returns true if (Flags & ODS_FOCUS)==0; false otherwise.
~TButtonTextDrawItem()
Destroys a TButtonTextDrawItem object. If DeleteCel is true, deletes CelArray.
TButtonTextDrawItem(TDrawItemProxy *proxy=0)
Constructs a TButtonTextDrawItem with proxy as it's parent.
virtual void Draw(DRAWITEMSTRUCT &drawItem)
Extracts information from drawItem and calls Paint.
void SetText(LPCTSTR text)
Deletes Text and clears the text style.
virtual TColor GetTextColor()
If selected, returns TColor::Sys3dHilight if a 3d User interface is in use or TColor::SysGrayText oth...
void SetCelArray(TCelArray *celarray, TAutoDelete del=AutoDelete)
If DeleteCel is true, CelArray is deleted.
@ aRight
Aligns the text at the right edge of the bounding rectangle.
@ aLeft
Aligns the text at the left edge of the bounding rectangle.
@ aCenter
Aligns the text horizontally at the center of the bounding rectangle.
TStyle
TStyle contains values that defines how the button will be displayed.
@ sText
Only text is displayed.
@ sBitmap
Only the bitmap is displayed.
int GetIndex() const
Returns Index, the index of Bitmap in the Proxy CellArray or -1.
virtual void Paint(TDC &rc, TRect &rect)
Paint function.
bool IsEnabled()
Returns true if (Flags & ODS_DISABLED)==0; false otherwise.
LPCTSTR GetText() const
Returns Text, the text do display on the button.
virtual void GetTextSize(TSize &size)
Calculates the size of the rectangle need to paint the text.
virtual void GetButtonSize(TSize &btnSize)
Calculates the size of button.
void SetIndex(int index)
Index is set to index and the sBitmap style is cleared from Style.
TCelArray is a horizontal array of cels (a unit of animation) created by slicing a portion of or an e...
Class wrapper for management of color values.
static const TColor SysMenuText
The symbolic system color value for the text shown on menus.
static const TColor SysActiveCaption
The symbolic system color value for the caption of the active window.
static const TColor Sys3dHilight
The symbolic system color value for highlighted 3-dimensional display elements (for edges facing the ...
static const TColor LtGray
Static TColor object with fixed Value set by RGB(192, 192, 192).
static const TColor SysWindowText
The symbolic system color value for text in every window.
static const TColor SysMenu
The symbolic system color value for the background of menus.
static const TColor SysWindow
The symbolic system color value for the background of each window.
TDC is the root class for GDI DC wrappers.
bool MoveTo(int x, int y)
Moves the current position of this DC to the given x- and y-coordinates or to the given point.
TColor SetPixel(int x, int y, const TColor &color)
Sets the color of the pixel at the given location to the given color and returns the pixel's previous...
void SelectObject(const TBrush &brush)
Selects the given GDI brush object into this DC.
bool GetTextExtent(const tstring &str, int stringLen, TSize &size) const
Computes the extent (width and height) in logical units of the text line consisting of stringLen char...
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 TextRect(int x1, int y1, int x2, int y2)
Fills the given rectangle, clipping any text to the rectangle.
bool DrawFocusRect(int x1, int y1, int x2, int y2)
Draws the given rectangle on this DC in the style used to indicate focus.
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.
bool LineTo(int x, int y)
Draws a line on this DC using the current pen object.
virtual TColor SetTextColor(const TColor &color)
Sets the current text color of this DC to the given color value.
Proxy parent for TDrawItem.
void SetCelArray(TCelArray *celarray, TAutoDelete del=AutoDelete)
If DeleteCel is true, deletes CelArray.
void SetFont(TFont *font)
Deletes Font and sets it to font.
void RegisterItem(TDrawItem *item)
For automatic deletion of items.
virtual ~TDrawItemProxy()
Deletes Font. If DeleteCel is true, delets CelArray.
virtual TCelArray * GetCelArray()
virtual TFont * GetFont()
TIPtrArray< TDrawItem * > TDrawItemArray
TDrawItemArray & GetItems()
Returns ItemArray.
TDrawItemProxy(TFont *font=0)
Constructs a TDrawItemProxy object using the specified font.
TFont derived from TGdiObject provides constructors for creating font objects from explicit informati...
Derived from TFont, TGadgetWindowFont is the default font used by TGadgetWindow.
ObjectWindows dynamic-link libraries (DLLs) construct an instance of TModule, which acts as an object...
TPen is derived from TGdiObject.
TPoint is a support class, derived from tagPOINT.
TRect is a mathematical class derived from tagRect.
Derived from TWindowDC, TScreenDC is a DC class that provides direct access to the screen bitmap.
The tagSIZE struct is defined as.
Assists in drawing borders of many styles.
TEdge
Enumeration describing the type of edge to be drawn.
@ RaisedInner
Raised inner edge only.
@ SunkenInner
Sunken inner edge only.
void Paint(TDC &dc) const
Paints this UIBorder object onto a given device context.
@ Recessed
Status field style recessed.
TUIFace assists in painting UI elements in various states.
static THatch8x8Brush & GetDitherBrush()
Internal static helper function that can be used alone.
@ Disabled
Disabled or Unavailable state (embossed 3d no color)
@ Indeterm
Indeterminant, or mixed-value state.
Definitions of classes TDrawItemProxy, TDrawItem,TButtonTextDrawItem, TDrawMenuItem,...
Definition of TGadgetList, TGadgetWindow & TGadgetWindowFont A list holding gadgets,...
Definition of class TGlyphButton.
TAutoDelete
Flag for Handle ctors to control Handle deletion in dtor.
char * strnewdup(const char *s, size_t minAllocSize=0)
Object Windows Library (OWLNext Core)
uint32 MkUint32(uint16 lo, uint16 hi)
LPARAM TParam2
Second parameter type.
#define TYPESAFE_DOWNCAST(object, toClass)
Defines classes handling Windows resources.
Definition of container classes used and made available by OWL.
Definition of the UI Helper Classes: TUIHandle, TUIBorder, TUIFace, TUIPart.
Definition of TUIMetric, a UI metrics provider class.