Print Page | Close Window

PropertyGrid Toolbar

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Property Grid
Forum Description: Topics Related to Codejock Property Grid
URL: http://forum.codejock.com/forum_posts.asp?TID=5793
Printed Date: 28 November 2024 at 6:29pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: PropertyGrid Toolbar
Posted By: ddlittle
Subject: PropertyGrid Toolbar
Date Posted: 14 December 2006 at 10:18am
Is there a way to add buttons to the property grid toolbar?  I want a "reset to defaults" and "accept changes" and I don't want to wait until the user closes the box to ask them what they want to do....
 
Thanks!



Replies:
Posted By: Oleg
Date Posted: 14 December 2006 at 1:35pm

Hi, you can just use custom Toolbars as we do in most our samples. See GUI_Whidbey or DrawClient sample.



-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: ddlittle
Date Posted: 14 December 2006 at 4:46pm
Thanks, Oleg --- I knew it was in there *somewhere*, the problem is just in the finding the right example!
 
- David


Posted By: cglane
Date Posted: 03 January 2007 at 1:21am
David, did you have any luck with this? 
 
I have not been able to do what Oleg suggests as the toolbar on the CXTPPropertyGrid is a CXTPPropertyGridToolBar.  This has limited functionality compared with the toolbar used in the examples (CXTPToolBar). 
 
To get arround this problem I have a CWnd upon which I place the CXTPPropertyGrid Control.  I then create a toolbar on the Cwnd but load propertygrid toolbar "XTP_IDR_PROPERTYGRID_TOOLBAR".  I then add my custom controls to the toolbar.  You will need to do a bit of message fowarding to the property grid.
 
It is a bit doogy but hey it works..
 
Craig..

 



Posted By: ddlittle
Date Posted: 03 January 2007 at 10:28am
Hi, Craig,
 
Yes, Oleg's example worked fine - I just turned off the property grid's toolbar and inserted my on.  The "real" work is all done in the WM_SIZE handler, where it moves the property grid down depending on the height of the toolbar. 
 
I also have a CWnd-derived window, which has a CXTPPropertyGrid-derived member.  In my CWnd, I have an OnGridNotify that forwards messages to the grid (function follows).  It doesn't seem like much of a hack, and like you say, it works.
 
Regards,
 
- David
 
LRESULT CC2PaneModelProperties::OnGridNotify( WPARAM wParam, LPARAM lParam )
{
     if(m_gridModelPropertyEdit.GetSafeHwnd())
     {
          return m_gridModelPropertyEdit.OnGridNotify(wParam,lParam);
     }
     return 0;
}



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net