Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Property Grid
  New Posts New Posts RSS Feed - PropertyGrid Toolbar
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

PropertyGrid Toolbar

 Post Reply Post Reply
Author
Message
ddlittle View Drop Down
Senior Member
Senior Member


Joined: 19 February 2004
Location: United States
Status: Offline
Points: 132
Post Options Post Options   Thanks (0) Thanks(0)   Quote ddlittle Quote  Post ReplyReply Direct Link To This Post Topic: PropertyGrid Toolbar
    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!
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
ddlittle View Drop Down
Senior Member
Senior Member


Joined: 19 February 2004
Location: United States
Status: Offline
Points: 132
Post Options Post Options   Thanks (0) Thanks(0)   Quote ddlittle Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
cglane View Drop Down
Newbie
Newbie


Joined: 13 July 2005
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote cglane Quote  Post ReplyReply Direct Link To This Post 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..

 

Back to Top
ddlittle View Drop Down
Senior Member
Senior Member


Joined: 19 February 2004
Location: United States
Status: Offline
Points: 132
Post Options Post Options   Thanks (0) Thanks(0)   Quote ddlittle Quote  Post ReplyReply Direct Link To This Post 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;
}
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.156 seconds.