KeyWorksRW / wxUiEditor

RAD tool used to create and maintain wxWidgets UI elements.
Apache License 2.0
67 stars 8 forks source link

Add support for adding one or more buttons to wxInfoBar #8

Open KeyWorksRW opened 4 years ago

KeyWorksRW commented 4 years ago

Description:

wxInfoBar allows for the addition of one or more buttons. We could support adding at least one button by providing a dropdown of stock ids. We would also need to add an event handler property to process wxEVT_BUTTON for each custom button id added.

KeyWorksRW commented 3 years ago

The wxEVT_COMMAND_BUTTON_CLICKED must be processed for this to work, not wxEVT_BUTTON.

wxUiEditor uses this in the derived class for the GridBagItemBase dialog, and it does not use a stock id.

A better approach would probably be to create an abstract generator -- with a infobar_btn type. This could support both stock and custom ids, as well as adding the wxEVT_COMMAND_BUTTON_CLICKED event handler. The wxInfoBar generator would need it's own type which would support infobar_btn children. Code generation would simply be to generate infoBar->AddButon(...) and if requested, infoBar->Bind(wxEVT_COMMAND_BUTTON_CLICKED, ...);