|
OWLNext 7.0
Borland's Object Windows Library for the modern age
|
TUIFace assists in painting UI elements in various states. More...
#include <owl/uihelper.h>
Public Types | |
| enum | TState { Normal , Down , Indeterm , Disabled , Default } |
| Enumeration describing the state of the bitmap to be drawn. More... | |
Public Member Functions | |
| TUIFace (const TRect &faceRect, const TBitmap &bm, const TColor &bgndColor=TColor::Sys3dFace, const TColor &fillColor=TColor::Sys3dFace) | |
| Initializes the button face with a bitmap. | |
| TUIFace (const TRect &faceRect, const tstring &text, const TColor &fillColor=TColor::Sys3dFace, uint format=0) | |
| Initializes the button face with a text string. | |
| TUIFace (const TRect &faceRect, const TIcon &icon, const TColor &bgndColor=TColor::Sys3dFace, const TColor &fillColor=TColor::Sys3dFace) | |
| Initializes the button face with an icon. | |
| void | Paint (TDC &dc, const TPoint &dstPt, TState state, bool pressed, bool fillFace=true) |
| Paint the face of a button onto a DC. | |
| void | Paint (TDC &dc, const TRect &srcRect, const TPoint &dstPt, TState state, bool pressed, bool fillFace=true) |
| Paint a portion of the source bitmap onto a DC. | |
| void | PaintMask (TDC &dc, const TPoint &pt) |
| Paint the mask onto a DC. | |
Static Public Member Functions | |
| static bool | Draw (TDC &dc, HBRUSH hbr, LPARAM lp, WPARAM wp, int x, int y, int cx, int cy, uint flags) |
| Encapsulates and emulate the 32-bit DrawState API. | |
| static void | PaintBm (const TBitmap &glyph, const TRect &glyphSrcRect, TDC &dc, const TRect &faceRect, const TPoint &dstPt, TState state, bool pressed, bool fillFace, const TColor &maskColor, const TColor &fillColor) |
| Internal bitmap painting function. | |
| static void | PaintIcon (const TIcon &icon, const TRect &glyphSrcRect, TDC &dc, const TRect &faceRect, const TPoint &dstPt, TState state, bool pressed, bool fillFace, const TColor &maskColor, const TColor &fillColor) |
| Internal static helper function that can be used alone. | |
| static void | PaintText (const tstring &text, TDC &dc, const TRect &faceRect, const TPoint &dstPt, TState state, bool pressed, bool fillFace, const TColor &fillColor, uint16 format) |
| Internal static helper function that can be used alone. | |
| static void | PaintMaskBm (const TBitmap &glyph, TDC &dc, const TPoint &pt, const TColor &maskColor) |
| Internal static helper function that can be used alone. | |
| static void | BuildMask (TDC &maskDC, const TPoint &maskDst, const TSize &maskSize, TDC &glyphDC, const TRect &glyphRect, const TColor &maskColor) |
| Internal static helper function that can be used alone. | |
| static void | FillBackground (TDC &dc, TDC &maskDC, const TRect &dstRect, const TBrush &brush) |
| Internal static helper function that can be used alone. | |
| static void | DitherBackground (TDC &dc, TDC &maskDC, const TRect &dstRect) |
| Internal static helper function that can be used alone. | |
| static int | DrawTextEtched (TDC &dc, const tstring &str, int count, const TRect &rect, uint16 format) |
| Internal static helper function that can be used alone. | |
| static THatch8x8Brush & | GetDitherBrush () |
| Internal static helper function that can be used alone. | |
| static TBitmap & | GetGlyphMask (const TSize &minSize) |
| Internal static helper function that can be used alone. | |
TUIFace assists in painting UI elements in various states.
Definition at line 367 of file uihelper.h.
| enum owl::TUIFace::TState |
Enumeration describing the state of the bitmap to be drawn.
Definition at line 372 of file uihelper.h.
|
inline |
Initializes the button face with a bitmap.
Definition at line 522 of file uihelper.h.
|
inline |
Initializes the button face with a text string.
Definition at line 534 of file uihelper.h.
|
inline |
Initializes the button face with an icon.
Definition at line 546 of file uihelper.h.
|
static |
Internal static helper function that can be used alone.
Build a monochrome mask bitmap for the glyph that has 1's where color maskedColor is and 0's everywhere else.
Definition at line 153 of file uiface.cpp.
References owl::TDC::BitBlt(), owl::TRect::Height(), owl::TColor::None, owl::TDC::PatBlt(), owl::TDC::SetBkColor(), and owl::TRect::Width().
Internal static helper function that can be used alone.
Tiles the rectangle with a even dithered (checkerboard) pattern maskDC determines the stencil area of dither
Definition at line 192 of file uiface.cpp.
References FillBackground(), and GetDitherBrush().
|
static |
Encapsulates and emulate the 32-bit DrawState API.
Definition at line 478 of file uiface.cpp.
|
static |
Internal static helper function that can be used alone.
An extension to ::DrawText that draws etched text by writing twice, the first one offset down & right in a light color, and the second not offset
Definition at line 203 of file uiface.cpp.
References owl::TDC::DrawText(), owl::TRect::OffsetBy(), owl::TDC::SetBkMode(), owl::TDC::SetTextColor(), owl::TColor::Sys3dHilight, and owl::TColor::Sys3dShadow.
|
static |
Internal static helper function that can be used alone.
Paint onto a given DC withing a given rect using a monochrome BM in a dc as a stencil and an arbitrary brush
Definition at line 172 of file uiface.cpp.
References owl::TPoint::TPoint(), owl::TDC::BitBlt(), owl::TColor::Black, owl::TDC::RestoreBrush(), owl::RopDSPDxax, owl::TDC::SelectObject(), owl::TDC::SetBkColor(), owl::TDC::SetTextColor(), and owl::TColor::White.
|
static |
Internal static helper function that can be used alone.
Return a brush created using a hatched [checkerboard] pattern of the button highlight color. This brush is commonly used for rendering 'indeterminate' or 'mixed-value' appearances.
Definition at line 124 of file uiface.cpp.
Internal static helper function that can be used alone.
Return a reference to a static monochrome bitmap. The optional TSize pointer allows the routine to ensure that the bitmap is big enough for a given use.
Definition at line 138 of file uiface.cpp.
| void owl::TUIFace::Paint | ( | TDC & | dc, |
| const TPoint & | pt, | ||
| TState | state, | ||
| bool | pressed, | ||
| bool | fillFace = true ) |
Paint the face of a button onto a DC.
Assumes the entire bitmap is the face.
Definition at line 431 of file uiface.cpp.
References owl::TPoint::TPoint(), owl::TRect::TRect(), CHECK, PaintBm(), PaintIcon(), and PaintText().
| void owl::TUIFace::Paint | ( | TDC & | dc, |
| const TRect & | srcRect, | ||
| const TPoint & | pt, | ||
| TState | state, | ||
| bool | pressed, | ||
| bool | fillFace = true ) |
Paint a portion of the source bitmap onto a DC.
This allows one bitmap to be the source for multiple TUIFaces.
Definition at line 454 of file uiface.cpp.
References CHECK, PaintBm(), PaintIcon(), and PaintText().
|
static |
Internal bitmap painting function.
Definition at line 222 of file uiface.cpp.
References owl::TPoint::TPoint(), owl::TDC::BitBlt(), owl::TColor::Black, BuildMask(), CONST_CAST, Disabled, DitherBackground(), Down, FillBackground(), GetGlyphMask(), Indeterm, owl::TDC::MaskBlt(), owl::TColor::None, owl::TPoint::Offset(), owl::TRect::Offset(), owl::TDC::RestoreBitmap(), owl::RopPSDPxax, owl::TDC::SelectObject(), owl::TDC::SetBkColor(), owl::TDC::SetTextColor(), owl::TRect::Size(), owl::TColor::Sys3dHilight, owl::TColor::Sys3dShadow, owl::TRect::TopLeft(), and owl::TColor::White.
|
static |
Internal static helper function that can be used alone.
Definition at line 315 of file uiface.cpp.
References owl::TIcon::GetInfo(), and PaintBm().
Paint the mask onto a DC.
Definition at line 543 of file uiface.cpp.
References CHECK, and PaintMaskBm().
|
static |
Internal static helper function that can be used alone.
Paint the mask onto a DC.
Definition at line 506 of file uiface.cpp.
References owl::TPoint::TPoint(), owl::TRect::TRect(), owl::TDC::BitBlt(), BuildMask(), GetGlyphMask(), owl::TDC::SelectObject(), owl::TDC::SetBkColor(), owl::TBitmap::Size(), owl::TRect::Size(), owl::TColor::Sys3dHilight, and owl::TRect::TopLeft().
|
static |
Internal static helper function that can be used alone.
Definition at line 331 of file uiface.cpp.
References owl::TBrush::TBrush(), BuildMask(), Default, Disabled, DitherBackground(), Down, owl::TDC::DrawText(), DrawTextEtched(), owl::TDC::GetBkColor(), GetGlyphMask(), owl::TDC::GetTextColor(), owl::TDC::GrayString(), Indeterm, Normal, owl::TPoint::Offset(), owl::TDC::SetBkColor(), owl::TDC::SetBkMode(), owl::TRect::Size(), and owl::TDC::TextRect().