<< Return to Main Index

< Return to Class Index

CGXWndWrapper::CGXWndWrapper

CGXWndWrapper(CGXGridCore* pGrid, CWnd* pWnd, BOOL bNeedDestroy = FALSE, BOOL bCanActivate = FALSE, BOOL bInvertBorders = TRUE);

pGrid

Pointer to the parent grid.

pWnd

Pointer to the CWnd-derived object which you want to use as cell in the grid.

bNeedDestroy

Specifies if the object referenced by pWnd shall be destroyed when the GGXWndWrapper object is destroyed. If TRUE, object will be destroyed. If FALSE, object will not be destroyed.

bCanActivate

Specifies if control can be activated. If TRUE, control can be activated and will receive mouse and keyboard messages. If FALSE, control cannot be activated.

bInvertBorders

pecifies if borders shall be inverted for the current cell. If TRUE, borders will be drawn inverted when the control is the current cell. If FALSE, borders will never be inverted.

Remarks

Constructs a wrapper control object.

You need to register this object in the grid with CGXGridCore::RegisterControl before you can use it in cells (see example).

Example

This example shows how you can register a wrapper control object in the grid:

// CGXWndWrapper allows you to register any CWnd you want.

// create window object
CGXTabBeam* pBeam = new CGXTabBeam;
pBeam->Create(WS_CHILD | WS_CLIPSIBLINGS, CRect(0,0,0,0), this, IDS_CTRL_TABBEAM);

// some initialization
pBeam->InsertTab(FALSE, "Tab 1");
pBeam->InsertTab(FALSE, "Tab 2");
pBeam->InsertTab(FALSE, "Tab 3");
pBeam->DisplayScrollBtns(FALSE);

// register wrapper control object
RegisterControl(IDS_CTRL_TABBEAM, new CGXWndWrapper(this, pBeam, TRUE, TRUE, TRUE)); 

See Also

CGXGridCore::RegisterControl

CGXWndWrapper

Class Overview | Class Members