Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » How to get events from controls on tab container CExtTabPageContainerFlatWnd? Collapse All
Subject Author Date
Daljit Singh Jun 18, 2006 - 11:39 PM

I am developing an application which has a dialog. On that dialog, I created a tab container. This tab container has two tabs. One has the tree control (CExtWFF<CTreeCtrl>) on it. The dialog box is not getting any notification message (like TVN_SELCHANGED, NM_CLICK) from the tree control. If I use the tree control directly on the dialog then it works. Could you please suggest any solution. Is it a problem? is there any other way of doing. Here is an example how I am using. Please let me know what is wrong.

Thanks.






BEGIN_MESSAGE_MAP(CPolicyEditor, CExtResizableDialog)
    //{{AFX_MSG_MAP(CPolicyEditor)
    NOTIFY(TVN_SELCHANGED, IDC_TREE_POLICY_EDITOR2, OnSelchangedTreePolicyEditor)
    ON_NOTIFY(NM_CLICK, IDC_TREE_POLICY_EDITOR2, OnClickTreePolicyEditor)
    //}}AFX_MSG_MAP
END_MESSAGE_MAP()

CExtTabPageContainerFlatWnd m_tabPolicyEditor;
CExtWFF<CTreeCtrl> m_policytree;


//The following codes are called in OnInitDialog()
m_tabPolicyEditor.Create(
this,
CRect(0,0,0,0));

if( !m_policytree.Create(
            WS_CHILD | WS_VISIBLE|WS_VSCROLL|WS_HSCROLL|WS_TABSTOP
            |TVS_HASBUTTONS|TVS_HASLINES|TVS_LINESATROOT
            |TVS_INFOTIP|TVS_DISABLEDRAGDROP
             | TVS_SHOWSELALWAYS,

            CRect(0,0,0,0),
            //rect,
            &m_tabPolicyEditor,
            //this,
            UINT(IDC_TREE_POLICY_EDITOR2)
            )
        )
{
     TRACE0("Failed to create TreeCtrl\n");
    return FALSE;        // fail to create
}

HICON hIcon = (HICON)::LoadImage( ::AfxGetInstanceHandle(), MAKEINTRESOURCE(IDI_TREE), IMAGE_ICON, 16, 16, 0 );
     VERIFY( m_tabPolicyEditor.PageInsert( &m_policytree, _T("Parameters"), hIcon, true ) );
hIcon = (HICON)::LoadImage( ::AfxGetInstanceHandle(), MAKEINTRESOURCE(IDI_LIST), IMAGE_ICON, 16, 16, 0 );
     VERIFY( m_tabPolicyEditor.PageInsert( &m_listProperties, _T("Parent Policy"), hIcon, true ) );

Technical Support Jun 19, 2006 - 10:37 AM

The notification messages are sent to the parent window only. The tree window inside the tab page has the tab page container window as the parent and not the dialog. That is why your dialog does not receive notification messages. So just create a CTreeCtrl-derived class and handle all the tree events inside this class.