How can I subclass the CGXTabBeam when the associated CGXTabWnd is embedded in a dialog?
Here is a sample OnInitDialog function that you can replace in dlgsamp3.cpp in gridapp to see how it's working.
BOOL CSample3Dialog::OnInitDialog()
{
CDialog::OnInitDialog();
CWnd* pGridFrame = GetDlgItem(IDC_GRIDWND3);
if (pGridFrame)
{
// Retrive the size of the frame and convert the co-ordinated to
// use the Dialog co-ordinates (from screen co-ordinates).
CRect rect;
pGridFrame->GetWindowRect( &rect );
ScreenToClient(&rect);
DWORD dwFlags =
WS_TABSTOP | WS_BORDER | WS_VISIBLE;
#if _MFC_VER >= 0x0400
// draw grid with sunken borders
dwFlags |= WS_EX_CLIENTEDGE;
#endif
// CGXTabWnd* m_pTabWnd
m_pTabWnd = new CGXTabWnd(RUNTIME_CLASS(CGXTabBeam)); // here you can use CMyTabBeam instead
m_pTabWnd->CWnd::Create(NULL, NULL,
dwFlags,
rect,
this,
21000);
m_wndGrid.Create(
WS_CHILD,
rect,
m_pTabWnd,
21000);
m_pTabWnd->AttachWnd(&m_wndGrid, _T("Grid 1"));
m_wndGrid.Initialize();
m_wndGrid.SetRowCount(256);
m_wndGrid.SetColCount(52);
// minimumn, maximum value
m_wndGrid.SetStyleRange(CGXRange().SetTable(), CGXStyle()
.SetUserAttribute(GX_IDS_UA_VALID_MIN, _T("0"))
.SetUserAttribute(GX_IDS_UA_VALID_MAX, _T("100"))
.SetUserAttribute(GX_IDS_UA_VALID_MSG, _T("Please enter a value between 0 and 100!"))
);
m_wndGrid.SetCurrentCell(1,1);
return FALSE;
}
return TRUE; // return TRUE unless you set the focus to a control
}