Gui-builder - add work with menu(MenuBar,Menu,MenuItem)

Started by Kvaz1r, 10 August 2019, 21:58:03

Kvaz1r

It's a very common controls so it would be great have opportunity use them from builder.

texus

The MenuBar widget is a bit more complicated than most widgets. I would somehow need to provide an interface to set the menus and their items. I would also need to serialize the menus (including potential submenus) into a single string, preferable without newlines.

The serialization problem could easily be solved if I just use the same format that I currently use for saving a MenuBar to a text file and just replace the newlines with spaces, although maybe there are better alternatives.
The thing that will take more work is providing a form where you can change the properties without having the manually type in the serialized string by hand. The thing I have in mind is something similar to how items of a ListBox are set, but with a TreeView to display the menus. The ability to enable and disable any item complicates this a bit more.

I recently added ChatBox and TreeView widgets to the gui builder, but only because they could be added without a way to set their items at design time. For a menu bar, being able to set the menus at design time is more important so I really do need to provide a way to input the menus. Unfortunately I currently don't have the motivation to actually implement it, I haven't been able to get myself to work on any non-trivial features in TGUI lately.