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 » CExtPropertyGridToolBar Feature Request Collapse All
Subject Author Date
Svetlozar Kostadinov Jun 26, 2007 - 9:44 AM

Hello Prof-UIS Team,

I think it should be useful if CExtPropertyGridToolBar had a default Tool Button for reseting all grid cells to their default values. Maybe if it’s possible this button could be aligned at the right side of the bar. Consider this suggestion.

Regards!

Technical Support Jun 27, 2007 - 12:01 PM

You could initialize the toolbar inside the property grid control with your own buttons and handle their clicks. You should implement a CExtPropertyGridCtrl-derived class and override the OnPgcCreateBars() virtual method in it. This method should invoke the method of the parent class for creating all the bars inside the property grid control and then add any needed toolbar buttons. The CExtPPVW < CExtPropertyGridCtrl > class in Prof-UIS implements an extended version of the property grid control which is able to print and print preview the displayed property tree and here is how this method is implemented in it:

bool CExtPPVW < CExtPropertyGridCtrl > :: OnPgcCreateBars()
{
      ASSERT_VALID( this );
      if( ! CExtPPVW_Base < CExtPropertyGridCtrl > :: OnPgcCreateBars() )
            return false;
CWnd * pWnd = GetChildByRTC( RUNTIME_CLASS(CExtPropertyGridToolBar) );
      if( pWnd != NULL )
      {
            ASSERT_VALID( pWnd );
            CExtPropertyGridToolBar * pToolBar = STATIC_DOWNCAST( CExtPropertyGridToolBar, pWnd );
            VERIFY( pToolBar->InsertButton( -1 ) );
            VERIFY( pToolBar->InsertButton( -1, ID_EXT_PPV_QUICK_PRINT ) );
            VERIFY( pToolBar->InsertButton( -1, ID_EXT_PPV_PRINT_PREVIEW ) );
      }
      return true;
}
The CExtPropertyGridToolBar toolbar will send the command and command updating requests to your CExtPropertyGridCtrl-derived class. So you also need to override the OnCmdMsg() virtual method for handling your toolbar buttons or implement message map based handler methods for them.