OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
uiface.cpp
Go to the documentation of this file.
1//----------------------------------------------------------------------------
2// ObjectWindows
3// Copyright (c) 1995, 1996 by Borland International, All Rights Reserved
4//
5/// \file
6/// Implements TUIFace
7//----------------------------------------------------------------------------
8#include <owl/pch.h>
9#include <owl/defs.h>
10#include <owl/uihelper.h>
11#include <owl/gdiobjec.h>
12
13#if defined(BI_MULTI_THREAD_RTL)
14#include <owl/thread.h>
15#endif
16
17
18
19namespace owl {
20
22
23const long RopPSDPxax = 0x00B8074AL; //
24const long RopDSPDxax = 0x00E20746L; //
25
26struct TUIFaceData
27#if defined(BI_MULTI_THREAD_RTL)
28 : public TLocalObject
29#endif
30{
31 TUIFaceData()
33 DitherColor(TColor::Sys3dHilight)
34 {
35 }
36 ~TUIFaceData()
37 {
38 }
39
40 THatch8x8Brush& GetDitherBrush();
41 TBitmap& GetGlyphMask(const TSize& minSize);
42
43 THatch8x8Brush Brush;
44 TColor DitherColor;
45 TSize MaskSize; // Current mask size
46 TPointer<TBitmap> MaskBm; // Current mask bm
47
48#if defined(BI_MULTI_THREAD_RTL)
49// TMRSWSection Lock;
50#endif
51};
52
53//
54// Static instance of the colors
55//
56static TUIFaceData& GetUIFaceData()
57{
58#if defined(BI_MULTI_THREAD_RTL)
59 static TTlsContainer<TUIFaceData> uiFaceData;
60 return uiFaceData.Get();
61#else
62 static TUIFaceData uiFaceData;
63 return uiFaceData;
64#endif
65};
66
67namespace
68{
69 //
70 // Ensure singleton initialization at start-up (single-threaded, safe).
71 //
72 TUIFaceData& InitUIFaceData = GetUIFaceData();
73}
74
75#if defined(BI_MULTI_THREAD_RTL)
76#define LOCKBRUSH //TMRSWSection::TLock Lock(GetUIFaceData().Lock);
77#else
78#define LOCKBRUSH
79#endif
80
81
82THatch8x8Brush& TUIFaceData::GetDitherBrush()
83{
85
86 // Reconstruct the brush in case the system colors have changed
87 // since the brush was constructed
88 //
89 if (DitherColor != TColor::Sys3dHilight) {
92 DitherColor = TColor::Sys3dHilight;
93 }
94 return Brush;
95}
96//
97TBitmap& TUIFaceData::GetGlyphMask(const TSize& minSize)
98{
100 // Start off with no bitmap, allocate below with requested or default size
101 //
102 // (Re)allocate mask bitmap if we need a bigger one
103 //
104 if (minSize.cx > MaskSize.cx || minSize.cy > MaskSize.cy) {
105 if (MaskSize.cx < minSize.cx)
106 MaskSize.cx = minSize.cx;
107 if (MaskSize.cy < minSize.cy)
108 MaskSize.cy = minSize.cy;
109 MaskBm = new TBitmap(MaskSize.cx, MaskSize.cy, 1, 1, nullptr);
110 }
111 return *MaskBm;
112}
113
114/// Internal static helper function that can be used alone.
115//
116/// Return a brush created using a hatched [checkerboard] pattern of the button
117/// highlight color. This brush is commonly used for rendering 'indeterminate'
118/// or 'mixed-value' appearances.
119///
120/// \note Automatically reconstructs the brush if the relevant system color
121/// changed during a session...
122//
125{
126 // Return ref. to static brush
127 //
128 return GetUIFaceData().GetDitherBrush();
129}
130
131/// Internal static helper function that can be used alone.
132//
133/// Return a reference to a static monochrome bitmap. The optional TSize
134/// pointer allows the routine to ensure that the bitmap is big enough for a
135/// given use.
136//
137TBitmap&
139{
140 return GetUIFaceData().GetGlyphMask(minSize);
141}
142
143/// Internal static helper function that can be used alone.
144//
145/// Build a monochrome mask bitmap for the glyph that has 1's where color
146/// maskedColor is and 0's everywhere else.
147///
148/// \note Assumes DC's are already setup - i.e. maskDC has the destination
149/// monochrome bitmap selected in it and glyphDC has the image selected
150/// in it..
151//
152void
153TUIFace::BuildMask(TDC& maskDC, const TPoint& maskDst, const TSize& maskSize,
154 TDC& glyphDC, const TRect& glyphRect,
155 const TColor& maskedColor)
156{
157 maskDC.PatBlt(0, 0, maskSize.cx, maskSize.cy, WHITENESS);
158 if (maskedColor != TColor::None) {
159 TColor bkColor = glyphDC.SetBkColor(maskedColor);
160 maskDC.BitBlt(maskDst.x, maskDst.y, glyphRect.Width(), glyphRect.Height(),
161 glyphDC, glyphRect.left, glyphRect.top, SRCCOPY);
162 glyphDC.SetBkColor(bkColor);
163 }
164}
165
166/// Internal static helper function that can be used alone.
167//
168/// Paint onto a given DC withing a given rect using a monochrome BM in a dc as
169/// a stencil and an arbitrary brush
170//
171void
172TUIFace::FillBackground(TDC& dc, TDC& maskDC, const TRect& dstRect,
173 const TBrush& brush)
174{
175 dc.SelectObject(brush);
176 TColor txtClr = dc.SetTextColor(TColor::Black);
177 TColor bkClr = dc.SetBkColor(TColor::White);
178
179 dc.BitBlt(dstRect, maskDC, TPoint(0, 0), RopDSPDxax);
180
181 dc.SetTextColor(txtClr);
182 dc.SetBkColor(bkClr);
183 dc.RestoreBrush();
184}
185
186/// Internal static helper function that can be used alone.
187//
188/// Tiles the rectangle with a even dithered (checkerboard) pattern
189/// maskDC determines the stencil area of dither
190//
191void
192TUIFace::DitherBackground(TDC& dc, TDC& maskDC, const TRect& dstRect)
193{
194 FillBackground(dc, maskDC, dstRect, GetDitherBrush());
195}
196
197/// Internal static helper function that can be used alone.
198//
199/// An extension to ::DrawText that draws etched text by writing twice, the
200/// first one offset down & right in a light color, and the second not offset
201//
202int
203TUIFace::DrawTextEtched(TDC& dc, const tstring& str, int count,
204 const TRect& rect, uint16 format)
205{
206 int mode = dc.SetBkMode(TRANSPARENT);
208 int height = dc.DrawText(str, count, rect.OffsetBy(1, 1), format);
209 if (!(format & DT_CALCRECT)) {
211 height = dc.DrawText(str, count, rect, format);
212 }
213 dc.SetTextColor(txtColor);
214 dc.SetBkMode(mode);
215 return height;
216}
217
218//
219/// Internal bitmap painting function
220//
221void
222TUIFace::PaintBm(const TBitmap& glyph, const TRect& glyphSrcRect,
223 TDC& dc, const TRect& faceRect, const TPoint& dstPoint,
224 TState state, bool pressed, bool fillFace,
225 const TColor& maskColor, const TColor& fillColor)
226{
227 // Select our glyph in a working memory DC.
228 //
229 TMemoryDC memDC(CONST_CAST(TBitmap&,glyph));
232
233 // Calculate the glyph's destination rect.
234 // Calculate the rect to fill in, depending on fill-face flag.
235 //
236 TRect glyphDstRect(faceRect.TopLeft() + dstPoint, glyphSrcRect.Size());
237 glyphDstRect &= faceRect;
238 TPoint dstPt(dstPoint);
239
240 // When the glyph is down, offset it's origin one pixel to the lower right.
241 // Make sure the glyph rect doesn't hang outside the face.
242 //
243 if (pressed || state == Down) {
244 dstPt.Offset(1,1);
245 glyphDstRect.Offset(1,1);
246 glyphDstRect &= faceRect;
247 }
248
249 // Build the mask. The mask is always the size of the face, while
250 // the glyph may be offset (given by dstPt) within the mask.
251 //
252 TBitmap& mask = GetGlyphMask(faceRect.Size());
253 TMemoryDC maskDC(mask);
254 BuildMask(maskDC, dstPt, faceRect.Size(), memDC, glyphSrcRect, maskColor);
255
256 // Draw according the specified state.
257 //
258 if (state == Disabled)
259 {
260 // Convert the highlight color to 1's on the mask.
261 // This in effect makes all the highlighted (white) areas transparent
262 // and hence more readable.
263 //
265 maskDC.BitBlt(glyphSrcRect, memDC, TPoint(0,0), SRCPAINT);
266
267 // Gray the image using the standard button shadow color.
268 // (glyphDstRect in dc <-- dstPt in maskDC)
269 //
270 TBrush shadowBrush(TColor::Sys3dShadow);
271 dc.SelectObject(shadowBrush);
273 dc.BitBlt(glyphDstRect, maskDC, dstPt, RopPSDPxax);
274 dc.SetBkColor(bg);
275 }
276 else // not Disabled
277 {
278 // Do a transparent blit using the mask.
279 // (glyphDstRect in dc <-- glyphSrcRect.TopLeft in memDC/mask)
280 //
281 const uint32 DSTCOPY = 0x00AA0029; // Undocumented ROP
282 dc.MaskBlt
283 (
284 glyphDstRect,
285 memDC, glyphSrcRect.TopLeft(),
286 mask, dstPt,
287 MAKEROP4(DSTCOPY, SRCCOPY)
288 );
289 }
290
291 // Do any filling determined by the state and fill arguments.
292 //
293 if (state == Indeterm)
294 {
295 // Dither the background everywhere except where the glyph is.
296 // (faceRect in dc <-- masked dithering)
297 //
298 DitherBackground(dc, maskDC, faceRect);
299 }
300 else if (fillFace && fillColor != TColor::None)
301 {
302 // Fill background around mask with given button face color.
303 // (faceRect in dc <-- masked fill)
304 //
305 TBrush btnFaceBrush(fillColor);
306 FillBackground(dc, maskDC, faceRect, btnFaceBrush);
307 }
308
309 maskDC.RestoreBitmap();
310}
311
312
313/// Internal static helper function that can be used alone.
314void
315TUIFace::PaintIcon(const TIcon& icon, const TRect& glyphSrcRect,
316 TDC& dc, const TRect& faceRect, const TPoint& dstPt,
317 TState state, bool pressed, bool fillFace,
318 const TColor& maskColor, const TColor& fillColor)
319{
320 // Note that this code will not work for a B/W icon!
321 //
322 const auto i = icon.GetInfo();
323 PaintBm(i.Color, glyphSrcRect,dc, faceRect, dstPt, state, pressed, fillFace,
324 maskColor, fillColor);
325}
326
327//
328/// Internal static helper function that can be used alone.
329//
330void
331TUIFace::PaintText(const tstring& text, TDC& dstDC, const TRect& faceRect,
332 const TPoint& dstPnt, TState state, bool pressed,
333 bool fillFace, const TColor& fillColor, uint16 format)
334{
335 TRect textDstRect(faceRect);
336 TPoint dstPt(dstPnt);
337
338 int mode = dstDC.SetBkMode(fillFace ? OPAQUE : TRANSPARENT);
339
340 if(pressed || state == Down){
341 dstPt.Offset(1,1);
342 textDstRect.left++;
343 if(format & DT_CENTER)
344 textDstRect.left++;
345 textDstRect.top++;
346 if(format & DT_VCENTER)
347 textDstRect.top++;
348 }
349
350 // Draw according the specified state
351 //
352 switch (state) {
353
354 case Normal: {
355 TColor bkColor;
356 if (fillFace){
357 bkColor = dstDC.SetBkColor(fillColor);
358 dstDC.TextRect(faceRect);
359 }
360 dstDC.DrawText(text,-1, textDstRect, format);
361 if (fillFace)
362 dstDC.SetBkColor(bkColor);
363 break;
364 }
365
366 case Down: {
367
368 dstDC.SetBkMode(TRANSPARENT);
369
370 TColor bkColor = dstDC.GetBkColor();
371 if (fillFace){
372 bkColor = dstDC.SetBkColor(fillColor);
373 if(pressed)
374 dstDC.TextRect(faceRect);
375 }
376
377 // Build a mask of the glyph & dither the background around the glyph
378 //
379 if(!pressed){
380
381 TMemoryDC memDC(dstDC);
382 TMemoryDC maskDC(GetGlyphMask(faceRect.Size()));
383 BuildMask(maskDC, dstPt, faceRect.Size(), memDC, faceRect,
384 fillFace?fillColor:bkColor);
385 DitherBackground(dstDC, maskDC, faceRect);
386 dstDC.DrawText(text, -1, textDstRect, format);
387 }
388 else
389 dstDC.DrawText(text, -1, textDstRect, format);
390
391 if (fillFace)
392 dstDC.SetBkColor(bkColor);
393 break;
394 }
395
396 case Indeterm: {
397 TColor bkColor;
398 if (fillFace){
399 bkColor = dstDC.SetBkColor(fillColor);
400 dstDC.TextRect(faceRect);
401 }
402 dstDC.GrayString(TBrush(dstDC.GetTextColor()),nullptr,text, -1, textDstRect);
403 if (fillFace)
404 dstDC.SetBkColor(bkColor);
405 break;
406 }
407
408 case Disabled: {
409 TColor bkColor;
410 if (fillFace){
411 bkColor = dstDC.SetBkColor(fillColor);
412 dstDC.TextRect(faceRect);
413 }
414 TUIFace::DrawTextEtched(dstDC, text, -1, textDstRect, format);
415 if (fillFace)
416 dstDC.SetBkColor(bkColor);
417 break;
418 }
419 case Default:
420 dstDC.DrawText(text,-1, textDstRect, format);
421 break;
422 }
423 dstDC.SetBkMode(mode);
424}
425
426//
427/// Paint the face of a button onto a DC.
428/// Assumes the entire bitmap is the face.
429//
430void
431TUIFace::Paint(TDC& dc, const TPoint& pt, TState state, bool pressed,
432 bool fillFace)
433{
434 if (SourceType==sText)
435 PaintText(Text, dc, Rect, pt, state, pressed, fillFace, FillColor, static_cast<uint16>(Format));
436 else if (SourceType==sBitmap) {
437 CHECK(Bm);
438 PaintBm(*Bm, TRect(TPoint(0,0),Bm->Size()), dc, Rect, pt, state, pressed,
439 fillFace, BkgndColor, FillColor);
440 }
441 else if (SourceType==sIcon) {
442 CHECK(Icon);
443 const auto iconSize = Icon->GetInfo().Color.Size();
444 PaintIcon(*Icon, TRect(TPoint(0,0),iconSize), dc, Rect, pt, state, pressed,
445 fillFace, BkgndColor, FillColor);
446 }
447}
448
449//
450/// Paint a portion of the source bitmap onto a DC.
451/// This allows one bitmap to be the source for multiple TUIFaces.
452//
453void
454TUIFace::Paint(TDC& dc, const TRect& srcRect, const TPoint& pt, TState state,
455 bool pressed, bool fillFace)
456{
457 if (SourceType==sText)
458 PaintText(Text, dc, Rect, pt, state, pressed, fillFace, FillColor, static_cast<uint16>(Format));
459 else if (SourceType==sBitmap) {
460 CHECK(Bm);
461 PaintBm(*Bm, srcRect, dc, Rect, pt, state, pressed,
462 fillFace, BkgndColor, FillColor);
463 }
464 else if (SourceType==sIcon) {
465 CHECK(Icon);
466 PaintIcon(*Icon, srcRect, dc, Rect, pt, state, pressed,
467 fillFace, BkgndColor, FillColor);
468 }
469}
470
471#if !defined(BI_COMP_GNUC)
472#pragma warn -par
473#endif
474//
475/// Encapsulates and emulate the 32-bit DrawState API.
476//
477bool
478TUIFace::Draw(TDC& dc, HBRUSH hbr, LPARAM lp, WPARAM wp,
479 int x, int y, int cx, int cy, uint flags)
480{
481 static bool hasDrawState = true;
482
483 // Try once to see if the API call is available. If not, do ourselves.
484 //
485 if (hasDrawState) {
486 if (::DrawState(dc, hbr, nullptr, lp, wp, x, y, cx, cy, flags))
487 return true;
488 if (::GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
489 hasDrawState = false; // No DrawState(). Don't try again, just emulate
490 else
491 return false; // Some other error, just return
492 }
493
494 return false;
495}
496#if !defined(BI_COMP_GNUC)
497#pragma warn .par
498#endif
499
500/// Internal static helper function that can be used alone.
501//
502// !CQ needs updating
503/// Paint the mask onto a DC.
504//
505void
506TUIFace::PaintMaskBm(const TBitmap& glyph, TDC& dc, const TPoint& pt,
507 const TColor& maskColor)
508{
509 // Create a DC to hold the image bitmap
510 //
511 TMemoryDC memDC;
512 memDC.SelectObject(glyph);
513
514 // Create a DC to hold an "AND mask" of image and build the mask
515 //
516 TMemoryDC maskDC;
517 maskDC.SelectObject(GetGlyphMask(glyph.Size()));
518
519 // Rectangle to hold mask of glyph
520 //
521 TRect maskRect(TPoint(0,0), glyph.Size());
522
523 // Build the mask
524 //
525 BuildMask(maskDC, TPoint(0, 0), glyph.Size(), memDC, maskRect, maskColor);
526
527 // Make sure area under highlight color ends up fill color
528 //
529 // dc.TextRect(maskRect, FillColor);
530
531 // Inactivate mask--convert the highlight color to 1's on existing mask
532 //
534 maskDC.BitBlt(maskRect, memDC, maskRect.TopLeft(), SRCPAINT);
535
536 dc.BitBlt(TRect(pt, maskRect.Size()), maskDC, TPoint(0,0));
537}
538
539//
540/// Paint the mask onto a DC.
541//
542void
544{
545 // ::DrawState()...
546
547 if(SourceType==sBitmap) {
548 CHECK(Bm);
549 PaintMaskBm(*Bm, dc, pt, BkgndColor);
550 }
551 //else if (SourceType==sText)
552 // PaintMaskText(Text, dc, pt);
553}
554
555
556} // OWL namespace
557/* ========================================================================== */
#define CHECK(condition)
Definition checks.h:239
TBitmap is the GDI bitmap class derived from TGdiObject.
Definition gdiobjec.h:510
TSize Size() const
The width and height of the bitmap in pixels.
Definition bitmap.cpp:300
The GDI Brush class is derived from TGdiObject.
Definition gdiobjec.h:180
TBrush(HBRUSH handle, TAutoDelete autoDelete=NoAutoDelete)
TBrush encapsulates an HBRUSH.
Definition brush.cpp:253
Class wrapper for management of color values.
Definition color.h:245
static const TColor Sys3dHilight
The symbolic system color value for highlighted 3-dimensional display elements (for edges facing the ...
Definition color.h:344
static const TColor None
not-a-color
Definition color.h:318
static const TColor Sys3dShadow
The symbolic system color value for the shadow regions of 3-dimensional display elements (for edges f...
Definition color.h:340
static const TColor Sys3dFace
The symbolic system color value for the face color of 3-dimensional display elements.
Definition color.h:339
static const TColor White
Static TColor object with fixed Value set by RGB(255, 255, 255).
Definition color.h:314
static const TColor Black
Static TColor object with fixed Value set by RGB(0, 0, 0).
Definition color.h:305
TDC is the root class for GDI DC wrappers.
Definition dc.h:64
void RestoreBitmap()
Restores the original GDI bitmap object into this DC.
Definition dc.cpp:272
TColor GetBkColor() const
Returns the current background color of this DC.
Definition dc.h:1099
void SelectObject(const TBrush &brush)
Selects the given GDI brush object into this DC.
Definition dc.cpp:113
bool TextRect(int x1, int y1, int x2, int y2)
Fills the given rectangle, clipping any text to the rectangle.
Definition dc.h:1878
virtual TColor SetBkColor(const TColor &color)
Sets the current background color of this DC to the given color value or the nearest available.
Definition dc.cpp:405
virtual bool GrayString(const TBrush &brush, GRAYSTRINGPROC outputFunc, const tstring &str, int count, const TRect &r)
Draws in the given rectangle (r) up to count characters of gray text from string using the given brus...
Definition dc.cpp:835
void RestoreBrush()
Restores the original GDI brush object to this DC.
Definition dc.cpp:233
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).
Definition dc.h:2421
virtual TColor SetTextColor(const TColor &color)
Sets the current text color of this DC to the given color value.
Definition dc.cpp:417
TColor GetTextColor() const
Returns the current text color of this DC.
Definition dc.h:1213
int SetBkMode(int mode)
Sets the background mode to the given mode argument, which can be either OPAQUE or TRANSPARENT.
Definition dc.h:1116
bool PatBlt(int x, int y, int w, int h, uint32 rop=PATCOPY)
Definition dc.h:2448
bool MaskBlt(const TRect &dst, const TDC &srcDC, const TPoint &src, const TBitmap &maskBm, const TPoint &maskPos, uint32 rop=SRCCOPY)
Copies a bitmap from the given source DC to this DC.
Definition dc.h:2576
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 ...
Definition dc.cpp:653
Derived from TBrush, THatch8x8Brush defines a small, 8x8, monochrome, configurable hatch brush.
Definition gdiobjec.h:250
static const uint8 Hatch11F1[8]
The static array Hatch11F1[8] holds the logical hatched brush pattern of one pixel on and one pixel o...
Definition gdiobjec.h:272
void Reconstruct(const uint8 hatch[], const TColor &fgColor, const TColor &bgColor)
Reconstructs the hatched brush with a new pattern or new set of colors.
Definition brush.cpp:463
TIcon, derived from TGdiObject, represents the GDI object icon class.
Definition gdiobjec.h:670
auto GetInfo() const -> TInfo
Retrieves information about this icon.
Definition icon.cpp:120
A device context (DC) class derived from TCreatedDC, TMemoryDC provides access to a memory DC.
Definition dc.h:784
TPoint is a support class, derived from tagPOINT.
Definition geometry.h:87
TPoint()
Constructs an uninitialized point.
Definition geometry.h:413
TPoint & Offset(int dx, int dy)
Offsets this point by the given delta arguments.
Definition geometry.h:551
Smart pointer to a single object. Provides member access operator ->.
Definition pointer.h:73
TRect is a mathematical class derived from tagRect.
Definition geometry.h:308
int Height() const
Returns the height of this rectangle (bottom - top).
Definition geometry.h:1048
TRect OffsetBy(int dx, int dy) const
Returns a rectangle with the corners offset by the given delta values.
Definition geometry.h:1234
TRect & Offset(int dx, int dy)
Changes this rectangle so its corners are offset by the given delta values.
Definition geometry.cpp:114
const TPoint & TopLeft() const
Returns the upperleft point.
Definition geometry.h:983
int Width() const
Returns the width of this rectangle (right - left).
Definition geometry.h:1039
TRect()
Default constructor that does nothing.
Definition geometry.h:889
TSize Size() const
Returns the size of rectangle.
Definition geometry.h:1057
The tagSIZE struct is defined as.
Definition geometry.h:234
static TBitmap & GetGlyphMask(const TSize &minSize)
Internal static helper function that can be used alone.
Definition uiface.cpp:138
void PaintMask(TDC &dc, const TPoint &pt)
Paint the mask onto a DC.
Definition uiface.cpp:543
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.
Definition uiface.cpp:478
static THatch8x8Brush & GetDitherBrush()
Internal static helper function that can be used alone.
Definition uiface.cpp:124
static int DrawTextEtched(TDC &dc, const tstring &str, int count, const TRect &rect, uint16 format)
Internal static helper function that can be used alone.
Definition uiface.cpp:203
static void PaintMaskBm(const TBitmap &glyph, TDC &dc, const TPoint &pt, const TColor &maskColor)
Internal static helper function that can be used alone.
Definition uiface.cpp:506
static void FillBackground(TDC &dc, TDC &maskDC, const TRect &dstRect, const TBrush &brush)
Internal static helper function that can be used alone.
Definition uiface.cpp:172
static void DitherBackground(TDC &dc, TDC &maskDC, const TRect &dstRect)
Internal static helper function that can be used alone.
Definition uiface.cpp:192
TState
Enumeration describing the state of the bitmap to be drawn.
Definition uihelper.h:372
@ Disabled
Disabled or Unavailable state (embossed 3d no color).
Definition uihelper.h:376
@ Indeterm
Indeterminant, or mixed-value state.
Definition uihelper.h:375
@ Default
Default btn state (bold).
Definition uihelper.h:377
@ Down
Down or Option set state (hilit background, +1,+1).
Definition uihelper.h:374
@ Normal
Normal state.
Definition uihelper.h:373
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.
Definition uiface.cpp:331
void Paint(TDC &dc, const TPoint &dstPt, TState state, bool pressed, bool fillFace=true)
Paint the face of a button onto a DC.
Definition uiface.cpp:431
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.
Definition uiface.cpp:315
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.
Definition uiface.cpp:153
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.
Definition uiface.cpp:222
Definition of abstract GDI object class and derived classes.
Object Windows Library (OWLNext Core).
Definition animctrl.h:22
const long RopDSPDxax
Definition glyphbtn.cpp:32
unsigned long uint32
Definition number.h:34
const long RopPSDPxax
Definition uiface.cpp:23
OWL_DIAGINFO
Definition animctrl.cpp:14
unsigned short uint16
Definition number.h:33
std::string tstring
Definition defs.h:79
unsigned int uint
Definition number.h:25
General definitions used by all ObjectWindows programs.
#define CONST_CAST(targetType, object)
Definition defs.h:273
#define LOCKBRUSH
Definition uiface.cpp:78
Definition of the UI Helper Classes: TUIHandle, TUIBorder, TUIFace, TUIPart.