I attached my code for adding a test MainMenuBar.
The toolbar load correctly.
At runtime, I can add items on mainbar but not in sub menu (like under file).
How I can allow this customization ?
I can''t add my file (1k size) ... a message appear saying "File size need to be < 2048k" !
Then, here''s my code :
Bar* bar = new Bar(mainFrameBarManager, S"MainMenu");
bar->BarStyle = (BarStyle)(BarStyle::IsMainMenu | BarStyle::AllowQuickCustomizing | BarStyle::DrawDragBorder |
BarStyle::RotateWhenVertical | BarStyle::Visible);
ParentBarItem* parentBarItem = new ParentBarItem();
parentBarItem->Customizable = true;
parentBarItem->CategoryIndex = 0;
parentBarItem->ID = S"&File";
parentBarItem->Text = S"&File";
AdministratorFebruary 24, 2005 10:06 PM UTC
XPMenus should allow you to add BarItems to a ParentBarItem by default. If you drag the BarItem you want to add over the ParentBarItem, it''s menu should open. You can then drop the BarItem into it. This works almost exactly the same way as in the designer.
Please let me know if you have any further questions.
MBMartin BonnevilleFebruary 25, 2005 01:42 PM UTC
If I drag the BarItem I want to add over the ParentBarItem, it''s menu open.
But I can''t then drop the BarItem into it.
AdministratorFebruary 25, 2005 03:42 PM UTC
Have you tried dragging the BarItem over the open menu and then dropping it? If not, I''d recommend trying it. Otherwise, could you send me a sample that demonstrates this problem so that I could investigate it? Thank you for your cooperation.
MBMartin BonnevilleFebruary 25, 2005 04:44 PM UTC
I found my error, I need to add the ParentBarItem
in MainFrameBarManager items. Not on ly in Bar items.