Hide

SftTabs/DLL 6.5 - Tab Control

Display
Print

CSftTabsPage

Standard constructor.

C++

public:
 CSftTabsPage::CSftTabsPage(UINT id, CWnd* pParent);
 CSftTabsPage::CSftTabsPage(LPCTSTR lpszResource, CWnd* pParent);

Parameters

id

ID of the dialog resource used to create the dialog.

lpszResource

A null-terminated string containing the name of the dialog resource used to create the dialog.

pParent

A pointer to the parent window's CWnd based object. This parameter may not be NULL. The parent window must be an object derived from CSftTabsPage or CSftTabsDialog.

Comments

A page attached to a tab control is created automatically by SftTabs/DLL in response to user input or under program control by calls such as CSftTabsDialog::InitializeTabControl or SetCurrentTab. All pages created by SftTabs/DLL are created as modeless dialogs.

Example

This example creates several CSftTabsPage objects which are attached to the tab control:

BOOL CMainDlg::OnInitDialog()
{
    int index;
    SFTTABS_TAB Tab;

    /* Associate the tab control created from the dialog */
    /* resource with the C++ object. */
    m_Tab.SubclassDlgItem(IDC_TAB, this /* parent window */);

    /* You could use DDX/DDV instead and add the following */
    /* line to the DoDataExchange function of the tab */
    /* control's parent window (remove the //). */
    // DDX_Control(pDX, IDC_TAB, m_Tab);

    /* Initialization is faster if we set redraw off */
    m_Tab.SetRedraw(FALSE);

    /* We are using new features */
    m_Tab.SetVersion(SFTTABS_6_5);

    index = m_Tab.AddTab(_T("The First One"));
    m_Tab.SetToolTip(index, _T("Demonstrates tabbing into and out of the tab page"));
    Tab = Tab0;
    Tab.graph.item.hBitmap = (HBITMAP) m_SampleBitmap.m_hObject;
    m_Tab.SetTabInfo(index, &Tab);
    m_Tab.SetTabDialog(index, new CPage1(this)); /* tab page */

    ... additional tab initialization ...

    index = m_Tab.AddTab(_T("Si&xth"));
    m_Tab.SetToolTip(index, _T("A page with nested tab controls and pages"));
    m_Tab.SetTabInfo(index, &Tab5);
    m_Tab.SetTabDialog(index, new CPage6(this)); /* tab page */

    m_Tab.SetControlInfo(&CtlInit);

    // Make sure to turn redraw back on
    m_Tab.SetRedraw(TRUE);
    m_Tab.InvalidateRect(NULL, TRUE);

    // If you are not using the sheet/page classes, remove the ...
    // Initialize tab control
    InitializeTabControl(0, &m_Tab, NULL);

    return FALSE; // if this is a dialog's OnInitDialog member function
}

See Also C/C++ API | C++ Classes | Notifications


Last Updated 08/13/2020 - (email)
© 2024 Softel vdm, Inc.