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 » CExtPropertyGridCtrl question Collapse All
Subject Author Date
Kevin McGarigal Jan 26, 2006 - 7:59 PM

Hi,

I have a CExtPropertyGridCtrl that contains a number of CExtPropertyValue derived items. While Apply() does a great job at handling changes in the associated combo box of each item I also need to act when the selection changes between items to update other parts of the dialog box.
I couldn’t find in the documentation a way to intercept the selection change notification (if it is sent to the parent dialog) or another method to hook into the change (callback, virtual function).
Any suggestion on how this can be accomplished would be much appreciated,

Thank you

Technical Support Jan 27, 2006 - 10:36 AM

The CExtPropertyGridCtrl window is designed to be a container for several child windows including CExtPropertyGridWnd-derived tree grid windows which are kind of our CExtGridWnd generic grid window. The CExtPropertyGridWnd class implements the CExtGridWnd::FocusSet() virtual method which sets the new focused item and synchronizes focused items in other tree grid windows in the property grid control. Finally, the CExtPropertyGridCtrl::RedrawFocusDepentChildren() virtual method is invoked to redraw any window inside the property grid control which depend on the focused item in the currently active tree grid window. The CExtPropertyGridCtrl::RedrawFocusDepentChildren() virtual method is also invoked when you change the active tree grid window by clicking toolbar buttons. We think you need to override the CExtPropertyGridCtrl::RedrawFocusDepentChildren() virtual method in your CExtPropertyGridCtrl-derived class. In this method, invoke the parent method and analyze the focus in the active tree grid window. Call the CExtPropertyGridCtrl::GetActiveGrid() method to get a pointer to the currently active CExtPropertyGridWnd tree grid window. Then you can get the focused item and corresponding property item which can be either CExtPropertyCategory or CExtPropertyValue item:

CExtPropertyGridWnd * pTreeGridWnd =
        pPropertyGridCtrl->GetActveGrid();
    ASSERT_VALID( pTreeGridWnd );
LONG nFocusedRowIndex = pTreeGridWnd->FocusGet().y;
    if( nFocusedRowIndex < 0 )
        return . . .
HTREEITEM hTreeItem =
        pTreeGridWnd->ItemGetByVisibleRowIndex( nFocusedRowIndex );
    ASSERT( hTreeItem != NULL );
CExtPropertyItem * pPropertyItem =
        pTreeGridWnd->PropertyItemFromTreeItem( hTreeItem );
    ASSERT_VALID( pPropertyItem );