<< Return to Main Index

< Return to Class Index

CGXDateTimeCtrl::m_DrawCtrlWnd

CGXCaptiveDateTimeCtrl m_DrawCtrlWnd;

Remarks

This control is used by CGXDateTimeCtrl internally for drawing the cells. When the cell is active the grid would move the control to the correct coordinates defined by the current cell’s boundaries. With inactive cells, however, the image needs to be rendered in the absence of the control. This control is used to help format the text to be rendered in a faithful image.

The following code snippet from CGXDateTimeCtrl::Draw shows how this control takes on all the attributes of the cell being rendered. These attributes would then help to render a correct representation of the control image in an inactive state using helper drawing functions.

// Use the captive draw control

m_DrawCtrlWnd.SetValue(style.GetIncludeValue() ?                   style.GetValueRef() : _T(""));

SetFormat(m_DrawCtrlWnd, style);

// We call our version of Layout gadgets that is

// sensitive to the rect that we draw in

// and knows how to use the dc we have already initialized

m_DrawCtrlWnd.LayoutGadgets(pDC, rectClip);

Once we have the layout of the gadgets resolved we would then use the helper functions that would render the gadgets to a device context (e.g., call DrawListGadget to draw a list gadget to the DC).

See Also

CGXDateTimeCtrl::m_TextCtrlWnd

CGXDateTimeCtrl

Class Overview | Class Members