Print Page | Close Window

Add or Remove buttons disabled?

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=22564
Printed Date: 17 November 2024 at 9:08pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Add or Remove buttons disabled?
Posted By: bharper
Subject: Add or Remove buttons disabled?
Date Posted: 28 March 2015 at 6:14am
Hello,
 
I have just purchased the commandbars control and am having problems with the customising. The menu items on the Add and Remove sections are disabled. Can you please advise how I enable these buttons?
 
Screen shot below.
 
kind regards,
Brian Harper
 



Replies:
Posted By: mcmastl
Date Posted: 21 April 2015 at 2:17pm
Hi Brian Harper,
Make sure you have included the CommandBars message handlers in your .CPP file, for example:

ON_COMMAND(XTP_ID_CUSTOMIZE, OnCustomize)

and 

void CMainFrame::OnCustomize()
{
// Get a pointer to the command bars object.
CXTPCommandBars* pCommandBars = GetCommandBars();
if (pCommandBars == NULL)
return;

// Instantiate the customize dialog.
CXTPCustomizeSheet dlg(pCommandBars);

// Add the options page to the customize dialog.
CXTPCustomizeOptionsPage pageOptions(&dlg);
dlg.AddPage(&pageOptions);

// Add the commands page to the customize dialog.
CXTPCustomizeCommandsPage* pPageCommands = dlg.GetCommandsPage();
pPageCommands->AddCategories(IDR_MAINFRAME, TRUE);

// Initialize the commands page page.
pPageCommands->InsertAllCommandsCategory();
pPageCommands->InsertBuiltInMenus(IDR_MAINFRAME);
pPageCommands->InsertNewMenuCategory();

// Display the customize dialog.
dlg.DoModal();
}

if you are still having trouble please let us know.


-------------
Luke McMasters, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: bharper
Date Posted: 22 April 2015 at 4:18am
Yes that code is there otherwise the customize options wouldn't even display. I have a sample project i can send if you want to see the problem?

Kind regards,
Brian



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