![]() |
PropertyGrid Toolbar |
Post Reply ![]() |
Author | |
ddlittle ![]() Senior Member ![]() Joined: 19 February 2004 Location: United States Status: Offline Points: 132 |
![]() ![]() ![]() ![]() ![]() 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!
|
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
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 |
|
![]() |
|
ddlittle ![]() Senior Member ![]() Joined: 19 February 2004 Location: United States Status: Offline Points: 132 |
![]() ![]() ![]() ![]() ![]() |
Thanks, Oleg --- I knew it was in there *somewhere*, the problem is just in the finding the right example!
![]() - David
|
|
![]() |
|
cglane ![]() Newbie ![]() Joined: 13 July 2005 Status: Offline Points: 1 |
![]() ![]() ![]() ![]() ![]() |
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..
|
|
![]() |
|
ddlittle ![]() Senior Member ![]() Joined: 19 February 2004 Location: United States Status: Offline Points: 132 |
![]() ![]() ![]() ![]() ![]() |
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;
}
|
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |