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

toolbar buttons

 Post Reply Post Reply
Author
Message
gdlindo View Drop Down
Newbie
Newbie


Joined: 31 October 2003
Location: United States
Status: Offline
Points: 9
Post Options Post Options   Thanks (0) Thanks(0)   Quote gdlindo Quote  Post ReplyReply Direct Link To This Post Topic: toolbar buttons
    Posted: 31 October 2003 at 10:54am
I'm trying to add my own buttons to a property grid toolbar.  I'm using version 8.0.  How can I change the existing property grid toolbar, or use my own?
Back to Top
kstowell View Drop Down
Admin Group
Admin Group


Joined: 25 January 2003
Location: MIchigan, USA
Status: Offline
Points: 496
Post Options Post Options   Thanks (0) Thanks(0)   Quote kstowell Quote  Post ReplyReply Direct Link To This Post Posted: 01 November 2003 at 1:51pm

Hello,

Take a look at the GUI_VisualStudio7 sample in the GUI_samples directory that comes with Xtreme Toolkit Pro.  If you do not have Xtreme Toolkit Pro, you can download the evaluation version which comes with the sample.

Cheers,
Codejock Support

Back to Top
gdlindo View Drop Down
Newbie
Newbie


Joined: 31 October 2003
Location: United States
Status: Offline
Points: 9
Post Options Post Options   Thanks (0) Thanks(0)   Quote gdlindo Quote  Post ReplyReply Direct Link To This Post Posted: 03 November 2003 at 8:54am
Thanks for the reply, but I'm either still not getting it or not doing a good job of explaining my problem.  Take for example the Properties Window in the MS Visual Studio .NET IDE.  It has a property grid with a toolbar.  The toolbar has the default buttons for arranging the grid categorized or alphabetic.  The ShowToolBar() function in your library does the same.  However, the MS Properties Window toolbar also has buttons for Properties, Events, Messages, etc.  That's what I need to do - add more buttons to the toolbar.  If I could replace the toolbar entirely with one of my own, that would work also, but I need more functionality than just the two default sort buttons.  I hope this is a clearer explanation of my problem.
Back to Top
kstowell View Drop Down
Admin Group
Admin Group


Joined: 25 January 2003
Location: MIchigan, USA
Status: Offline
Points: 496
Post Options Post Options   Thanks (0) Thanks(0)   Quote kstowell Quote  Post ReplyReply Direct Link To This Post Posted: 03 November 2003 at 1:55pm

Hello,

Which version do you need help with MFC, ActiveX or .NET?

Thanks,
Codejock Support

Back to Top
gdlindo View Drop Down
Newbie
Newbie


Joined: 31 October 2003
Location: United States
Status: Offline
Points: 9
Post Options Post Options   Thanks (0) Thanks(0)   Quote gdlindo Quote  Post ReplyReply Direct Link To This Post Posted: 03 November 2003 at 2:04pm
MFC, thanks.
Back to Top
kstowell View Drop Down
Admin Group
Admin Group


Joined: 25 January 2003
Location: MIchigan, USA
Status: Offline
Points: 496
Post Options Post Options   Thanks (0) Thanks(0)   Quote kstowell Quote  Post ReplyReply Direct Link To This Post Posted: 04 November 2003 at 5:15pm

Hello,

I have attached a sample project that illustrates how to do this.  You may need to change the stdafx.h for either Xtreme Suite or Xtreme Toolkit Pro, for example:

Add the following line to your StdAfx.h file:

Xtreme Toolkit Pro users:

#include <XTToolkitPro.h> // Xtreme Toolkit Pro components

Xtreme Suite users:

#include <XTSuitePro.h> // Xtreme Suite components

Let me know if this helps!

Cheers,
Codejock Support

Download: 34D_PropertyGridSample.zip

Back to Top
ddyer View Drop Down
Groupie
Groupie
Avatar

Joined: 01 December 2003
Location: United States
Status: Offline
Points: 40
Post Options Post Options   Thanks (0) Thanks(0)   Quote ddyer Quote  Post ReplyReply Direct Link To This Post Posted: 01 December 2003 at 2:36pm

Ok so basically the propertygrid doesn't support user-added buttons per-se.  You just don't use the propertygrid toolbar and create/manage your own toolbar.

You should clarify that on the propertygrid  web page.

Back to Top
Russ View Drop Down
Groupie
Groupie
Avatar

Joined: 21 September 2003
Location: Russian Federation
Status: Offline
Points: 28
Post Options Post Options   Thanks (0) Thanks(0)   Quote Russ Quote  Post ReplyReply Direct Link To This Post Posted: 04 December 2003 at 12:51pm
Well I was looking for the same solution too.. Was quite puzzled with GetToolBar button method at first. What this might be used for? Thanks.
Back to Top
cbatt View Drop Down
Newbie
Newbie


Joined: 24 April 2006
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote cbatt Quote  Post ReplyReply Direct Link To This Post Posted: 24 April 2006 at 6:42pm
I'm new to toolbars.  Basically, I have a property grid in a dialog box (part of a wizard) and I want to customize the toolbar.  I followed the sample posted as closely as possible but the toolbar is not displayed.  I only have a license to the property grid, so I don't think I have CXTPToolBar, so I'm using MFC CToolBar instead.  Code looks like:

virtual BOOL OnInitDialog()
    {
        CPropertyPage::OnInitDialog();

        CRect rc;
        m_placeholder.GetWindowRect( &rc );
        ScreenToClient( &rc );

        if ( m_pgrid.Create( rc, this, IDC_PROPERTY_GRID ) )
        {
         &nbs p;  m_pgrid.ShowHelp( FALSE );
            // Create grid items...
        }

        if( m_toolbar.Create( &m_pgrid, WS_TABSTOP|WS_VISIBLE|WS_CHILD|CBRS_TOOLTIPS ) )
        {
         &nbs p;   m_toolbar.LoadToolBar( IDR_TOOLBAR_GRID );
        }
        return 1;  // Let the system set the focus
    }

The toolbar is created and loaded successfully, but doesn't show up in the property grid window.  Obviously, I'm missing something important... any help would be appreciated.
Back to Top
cbatt View Drop Down
Newbie
Newbie


Joined: 24 April 2006
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote cbatt Quote  Post ReplyReply Direct Link To This Post Posted: 04 May 2006 at 12:38pm
So, I guess to answer my own question, I just put a toolbar on the property page and turned off the property grid's toolbar.  Its unfortunate that the property grid's toolbar can't be more easily customized.  
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.172 seconds.