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.
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::TColor::None.
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 469 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::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::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 PaintBm(), PaintIcon(), PaintText(), and owl::TBitmap::Size().
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 449 of file uiface.cpp.
References PaintBm(), PaintIcon(), and PaintText().
|
static |
Internal bitmap painting function.
Definition at line 222 of file uiface.cpp.
References owl::TDC::BitBlt(), owl::TColor::Black, BuildMask(), CONST_CAST, Disabled, DitherBackground(), Down, FillBackground(), GetGlyphMask(), Indeterm, owl::TDC::MaskBlt(), owl::TColor::None, owl::RopPSDPxax, owl::TDC::SelectObject(), owl::TDC::SetBkColor(), owl::TColor::Sys3dHilight, owl::TColor::Sys3dShadow, and owl::TColor::White.
|
static |
Internal static helper function that can be used alone.
Definition at line 315 of file uiface.cpp.
References PaintBm().
|
static |
Internal static helper function that can be used alone.
Paint the mask onto a DC.
Definition at line 497 of file uiface.cpp.
References owl::TDC::BitBlt(), BuildMask(), GetGlyphMask(), and owl::TColor::Sys3dHilight.
|
static |
Internal static helper function that can be used alone.
Definition at line 331 of file uiface.cpp.
References BuildMask(), Default, Disabled, DitherBackground(), Down, DrawTextEtched(), GetGlyphMask(), Indeterm, and Normal.