Author Topic: Any Tutorials On Creating Menus & Adding Menu Items Via wxSmith Exclusively  (Read 6155 times)

Offline level10

  • Single posting newcomer
  • *
  • Posts: 8
I'd like to know if full menus with their associated menu items can be created using wxSmith exclusively via the GUI interface. Neither the "Tools" menu bar at the bottom of the wxSmith GUI interface window or the C::B main "wxSmith" menu supply a selection to add a "wxMenuItem" object to a menu object in the C::B "Resource" window. Additionally, none of the current documentation on C::B, or wxSmith appears to even address menu creation at all. I've also looked at the code in the samples, and they work, but I see no obvious way to manipulate the sample code using wxSmith.

I've also tried "copying" (ctrl-C) and "pasting" (ctrl-V) the default wxMenuItem objects, "About" and "Quit" that are supplied automatically when a new Frame based project is created, but without any luck. These wxMenuItem objects won't duplicate, so I can't just make a copy in the GUI editor's resource window and change the necessary properties. Incidently, this would be a nice feature if the editor could be made to work this way.

Now, back to the main issue. At this point, any menu support my code contains is coded purely by hand using the wxWidgets classes: "wxMenuBar", "wxMenu", and  "wxMenuItem". This appears to be my only option at the moment. I'd really like to use the wxSmith GUI to build menus visually, tweaking the appropriate properties as required, rather than "hand-code" all of my application's menu support.

Any help would be greatly appreciated.
Thanks.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
In wxSmith try to double-click on the MenuBar symbol belonging to your frame.
Or if it's a new frame click on the wxMenuBar icon in the tools tab to create a MenuBar first.

Then you can edit the MenuBar and its Menus and SubMenu and of course the MenuItems.
To create a new Menu (or MenuItem) just click new. With "<" and ">" you can move a Menu or a Menuitem one level higher or deeper.

Just try it out, it's more easy than it might look like in the first moment.

Offline level10

  • Single posting newcomer
  • *
  • Posts: 8
Thanks a lot. I'll get right on it. This is great, full C::Bs and wxSmith support!