MGUI::CUSTOMDRAW Class Reference

Base class for custom draw notification supported by selected controls. More...

#include <mgui/customdraw.h>

Inheritance diagram for MGUI::CUSTOMDRAW:

Inheritance graph
[legend]
List of all members.

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::CONTEXTGetDrawingContext () const
DRAWSTAGE GetDrawStage () const
ID GetID () const
ITEMSTATE GetItemState () const
const LRECT2DGetRect () const
void SetDrawStage (DRAWSTAGE drawstage)

Protected Member Functions

 CUSTOMDRAW (DRAWSTAGE drawstage, ITEMSTATE itemstate, INT32 ItemNumber, ID id, const LRECT2D &rect)
 CUSTOMDRAW ()
INT32 GetItemNumber () const
void SetBase (const NMCUSTOMDRAW *pNM)
void SetBase (ITEMSTATE itemstate, INT32 ItemNumber, ID id, const LRECT2D &rect)
void SetDrawingContext (MGD::CONTEXT *pDC)
 ~CUSTOMDRAW ()

Detailed Description

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.

Definition at line 61 of file customdraw.h.


Member Enumeration Documentation

enum MGUI::CUSTOMDRAW::DRAWSTAGE
 

Drawing stage.

Enumeration values:
DRAWSTAGE_PrePaint 
DRAWSTAGE_PostPaint 
DRAWSTAGE_PreErase 
DRAWSTAGE_PostErase 
DRAWSTAGE_CtrlPrePaint 
DRAWSTAGE_CtrlPostPaint 
DRAWSTAGE_CtrlPreErase 
DRAWSTAGE_CtrlPostErase 
DRAWSTAGE_Item 
DRAWSTAGE_ItemPrePaint 
DRAWSTAGE_ItemPostPaint 
DRAWSTAGE_ItemPreErase 
DRAWSTAGE_ItemPostErase 
DRAWSTAGE_SubItem 
DRAWSTAGE_SubItemPrePaint 
DRAWSTAGE_SubItemPostPaint 

Definition at line 66 of file customdraw.h.

enum MGUI::CUSTOMDRAW::ITEMSTATE
 

Item state.

Enumeration values:
ITEMSTATE_Normal 
ITEMSTATE_Selected 
ITEMSTATE_Grayed 
ITEMSTATE_Disabled 
ITEMSTATE_Checked 
ITEMSTATE_Focus 
ITEMSTATE_Default 
ITEMSTATE_Hot 
ITEMSTATE_Marked 
ITEMSTATE_Indeterminant 

Definition at line 87 of file customdraw.h.

enum MGUI::CUSTOMDRAW::RETVALUE
 

Values to return from control-specific v_OnCustomDraw override.

The values the application can return depend on the current drawing stage.

Enumeration values:
RETVALUE_DoDefault  Let control do all drawing, valid for DRAWSTAGE_...PrePaint.
RETVALUE_SkipDefault  Indicate item was completely drawn manually, valid for DRAWSTAGE_...PrePaint.
RETVALUE_NotifyPostPaint  Request notification after painting item, valid for DRAWSTAGE_...PrePaint.
RETVALUE_NotifyItemDraw  Request notification before/after drawing each item, valid for DRAWSTAGE_CtrlPrePaint.
RETVALUE_NotifySubItemDraw  Request notification before/after drawing each subitem, valid for DRAWSTAGE_CtrlPrePaint.
RETVALUE_NotifyPostErase  Request notification after erasing item, valid for DRAWSTAGE_CtrlPrePaint.

Definition at line 102 of file customdraw.h.


Constructor & Destructor Documentation

MGUI::CUSTOMDRAW::CUSTOMDRAW  )  [protected]
 

Reimplemented in MGUI::CTRL_TREE::CUSTOMDRAW.

MGUI::CUSTOMDRAW::CUSTOMDRAW DRAWSTAGE  drawstage,
ITEMSTATE  itemstate,
INT32  ItemNumber,
ID  id,
const LRECT2D rect
[protected]
 

MGUI::CUSTOMDRAW::~CUSTOMDRAW  )  [inline, protected]
 

Reimplemented in MGUI::CTRL_TREE::CUSTOMDRAW.

Definition at line 143 of file customdraw.h.


Member Function Documentation

MGD::CONTEXT* MGUI::CUSTOMDRAW::GetDrawingContext  )  const [inline]
 

Definition at line 111 of file customdraw.h.

DRAWSTAGE MGUI::CUSTOMDRAW::GetDrawStage  )  const [inline]
 

Definition at line 114 of file customdraw.h.

ID MGUI::CUSTOMDRAW::GetID  )  const [inline]
 

Definition at line 117 of file customdraw.h.

INT32 MGUI::CUSTOMDRAW::GetItemNumber  )  const [inline, protected]
 

Definition at line 146 of file customdraw.h.

ITEMSTATE MGUI::CUSTOMDRAW::GetItemState  )  const [inline]
 

Definition at line 120 of file customdraw.h.

const LRECT2D& MGUI::CUSTOMDRAW::GetRect  )  const [inline]
 

Definition at line 123 of file customdraw.h.

void MGUI::CUSTOMDRAW::SetBase const NMCUSTOMDRAW *  pNM  )  [protected]
 

void MGUI::CUSTOMDRAW::SetBase ITEMSTATE  itemstate,
INT32  ItemNumber,
ID  id,
const LRECT2D rect
[protected]
 

void MGUI::CUSTOMDRAW::SetDrawingContext MGD::CONTEXT pDC  )  [inline, protected]
 

Definition at line 162 of file customdraw.h.

void MGUI::CUSTOMDRAW::SetDrawStage DRAWSTAGE  drawstage  )  [inline]
 

Definition at line 126 of file customdraw.h.


The documentation for this class was generated from the following file:
Generated on Tue Dec 14 13:20:48 2004 for TNTsdk by  doxygen 1.3.8-20040913