Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - Add or Remove buttons disabled?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Add or Remove buttons disabled?

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


Joined: 28 March 2015
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote bharper Quote  Post ReplyReply Direct Link To This Post Topic: Add or Remove buttons disabled?
    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
 
Back to Top
mcmastl View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 April 2015
Status: Offline
Points: 79
Post Options Post Options   Thanks (0) Thanks(0)   Quote mcmastl Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
bharper View Drop Down
Newbie
Newbie


Joined: 28 March 2015
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote bharper Quote  Post ReplyReply Direct Link To This Post 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
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.