Print Page | Close Window

toolbar buttons

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=205
Printed Date: 21 November 2024 at 4:37pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: toolbar buttons
Posted By: gdlindo
Subject: toolbar buttons
Date 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?



Replies:
Posted By: kstowell
Date 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



Posted By: gdlindo
Date 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.


Posted By: kstowell
Date Posted: 03 November 2003 at 1:55pm

Hello,

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

Thanks,
Codejock Support



Posted By: gdlindo
Date Posted: 03 November 2003 at 2:04pm
MFC, thanks.


Posted By: kstowell
Date 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: http://forum.codejock.com/uploads/Administrator/34D_PropertyGridSample.zip - 34D_PropertyGridSample.zip



Posted By: ddyer
Date 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.



Posted By: Russ
Date 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.


Posted By: cbatt
Date 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.


Posted By: cbatt
Date 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.  



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