Base class for custom draw notification supported by selected controls. More...
#include <mgui/customdraw.h>

Public Types | |
| enum | DRAWSTAGE { DRAWSTAGE_PrePaint = 0x00000001, DRAWSTAGE_PostPaint = 0x00000002, DRAWSTAGE_PreErase = 0x00000003, DRAWSTAGE_PostErase = 0x00000004, DRAWSTAGE_CtrlPrePaint = DRAWSTAGE_PrePaint, DRAWSTAGE_CtrlPostPaint = DRAWSTAGE_PostPaint, DRAWSTAGE_CtrlPreErase = DRAWSTAGE_PreErase, DRAWSTAGE_CtrlPostErase = DRAWSTAGE_PostErase, DRAWSTAGE_Item = 0x00010000, DRAWSTAGE_ItemPrePaint = DRAWSTAGE_Item | DRAWSTAGE_PrePaint, DRAWSTAGE_ItemPostPaint = DRAWSTAGE_Item | DRAWSTAGE_PostPaint, DRAWSTAGE_ItemPreErase = DRAWSTAGE_Item | DRAWSTAGE_PreErase, DRAWSTAGE_ItemPostErase = DRAWSTAGE_Item | DRAWSTAGE_PostErase, DRAWSTAGE_SubItem = 0x00020000, DRAWSTAGE_SubItemPrePaint = DRAWSTAGE_SubItem | DRAWSTAGE_ItemPrePaint, DRAWSTAGE_SubItemPostPaint = DRAWSTAGE_SubItem | DRAWSTAGE_ItemPostPaint } |
| enum | ITEMSTATE { ITEMSTATE_Normal = 0x0000, ITEMSTATE_Selected = 0x0001, ITEMSTATE_Grayed = 0x0002, ITEMSTATE_Disabled = 0x0004, ITEMSTATE_Checked = 0x0008, ITEMSTATE_Focus = 0x0010, ITEMSTATE_Default = 0x0020, ITEMSTATE_Hot = 0x0040, ITEMSTATE_Marked = 0x0080, ITEMSTATE_Indeterminant = 0x0100 } |
| enum | RETVALUE { RETVALUE_DoDefault = 0x00, RETVALUE_SkipDefault = 0x04, RETVALUE_NotifyPostPaint = 0x10, RETVALUE_NotifyItemDraw = 0x20, RETVALUE_NotifySubItemDraw = 0x20, RETVALUE_NotifyPostErase = 0x40 } |
Public Member Functions | |
| MGD::CONTEXT * | GetDrawingContext () const |
| DRAWSTAGE | GetDrawStage () const |
| ID | GetID () const |
| ITEMSTATE | GetItemState () const |
| const LRECT2D & | GetRect () const |
| void | SetDrawStage (DRAWSTAGE drawstage) |
Protected Member Functions | |
| CUSTOMDRAW (DRAWSTAGE drawstage, ITEMSTATE itemstate, INT32 ItemNumber, ID id, const LRECT2D &rect) | |
| CUSTOMDRAW () | |
| ~CUSTOMDRAW () | |
| INT32 | GetItemNumber () const |
| void | SetBase (ITEMSTATE itemstate, INT32 ItemNumber, ID id, const LRECT2D &rect) |
| void | SetDrawingContext (MGD::CONTEXT *pDC) |
| void | SetRect (INT32 xinit, INT32 yinit, INT32 xlast, INT32 ylast) |
Base class for custom draw notification supported by selected controls.
Custom draw allows an application to easily change selected drawing aspects or manually draw selected items without having to do a full owner draw.
At the beginning of each 'paint' cycle, the control's v_OnCustomDraw function will be called with a CUSTOMDRAW-derived class instance having its drawing stage set to DRAWSTAGE_PrePaint. The value the application returns from this first notification dictates how and when the control sends subsequent custom draw notifications fo rthe rest of that paint cycle. The application can return a combination of the following flags in response to this first notification.
RETVALUE_DoDefault Control will draw itself, no additional notifications will be sent for this paint cycle. RETVALUE_NotifyItemDraw v_OnCustomDraw will be called for any item-specific drawing, before and after items are drawn. RETVALUE_NotifyPostPaint v_OnCustomDraw will be called when painting cycle for entire control is complete RETVALUE_SkipDefault Control will not perform any painting at all
If the application returns RETVALUE_NotifyItemDraw for the initial prepaint notification, notifications will be sent for each items it draws during that paint cycle. These item-specific notifications will have a drawing stage of DRAWSTAGE_ItemPrePaint. Notification for when it it finished drawing the item may then be requested by returning RETVALUE_NotifyPostPaint. Otherwise return RETVALUE_DoDefault and no post-paint notification will be sent. If the application draws the entire item, return RETVALUE_SkipDefault and the control will not draw any portion of the item.
Drawing stage.
Values to return from control-specific v_OnCustomDraw override.
The values the application can return depend on the current drawing stage.
| MGUI::CUSTOMDRAW::CUSTOMDRAW | ( | ) | [protected] |
| MGUI::CUSTOMDRAW::CUSTOMDRAW | ( | DRAWSTAGE | drawstage, | |
| ITEMSTATE | itemstate, | |||
| INT32 | ItemNumber, | |||
| ID | id, | |||
| const LRECT2D & | rect | |||
| ) | [protected] |
| MGUI::CUSTOMDRAW::~CUSTOMDRAW | ( | ) | [inline, protected] |
| MGD::CONTEXT* MGUI::CUSTOMDRAW::GetDrawingContext | ( | ) | const [inline] |
| DRAWSTAGE MGUI::CUSTOMDRAW::GetDrawStage | ( | ) | const [inline] |
| ID MGUI::CUSTOMDRAW::GetID | ( | ) | const [inline] |
| INT32 MGUI::CUSTOMDRAW::GetItemNumber | ( | ) | const [inline, protected] |
| ITEMSTATE MGUI::CUSTOMDRAW::GetItemState | ( | ) | const [inline] |
| const LRECT2D& MGUI::CUSTOMDRAW::GetRect | ( | ) | const [inline] |
| void MGUI::CUSTOMDRAW::SetBase | ( | ITEMSTATE | itemstate, | |
| INT32 | ItemNumber, | |||
| ID | id, | |||
| const LRECT2D & | rect | |||
| ) | [protected] |
| void MGUI::CUSTOMDRAW::SetDrawingContext | ( | MGD::CONTEXT * | pDC | ) | [inline, protected] |
| void MGUI::CUSTOMDRAW::SetDrawStage | ( | DRAWSTAGE | drawstage | ) | [inline] |
| void MGUI::CUSTOMDRAW::SetRect | ( | INT32 | xinit, | |
| INT32 | yinit, | |||
| INT32 | xlast, | |||
| INT32 | ylast | |||
| ) | [inline, protected] |
1.6.1