This is a suggestion for a small improvement to DialogBlocks.
I sometimes want to transform one object to another type during
refactoring. For example,
- Convert a wxBoxSizer to a wxStaticBoxSizer or wxFlexGridSizer.
- Convert a wxToggleButton to a wxCheckBox.
- Convert a wxTextCtrl to a wxSpinCtrl.
- Convert a wxChoice to a wxListBox.
- etc.
Yes, I could delete the object and create a new one, but properties
need to be reset (e.g. name).
The problem may be more severe for transizers since one needs to
individually move each contained object from the original to the new
sizer, and there's no way to select and move multiple objects
simultaneously. A similar issue occurs in moving an entire row in a
wxFlexGridSizer: the contained objects must be moved individually,
during which the ordering is temporarily odd.
The desire to transform controls is related to a more general concern
about wxWidgets. Classification of object types in wxWidgets (e.g.
wxToggleButton and wxCheckBox) can appear too implementation specific.
At a high level, it matters not whether the object appears as a
button or checkbox but that it represents a Boolean state. Ideally,
swapping a wxToggleButton with a wxCheckBox should require zero code
change (in fact, my application has a layer above wxWidgets that does
this type of thing). This is not only my observation but was one
general complaint about most GUI toolkits noted in the book GUI
Bloopers by Jeff Johnson. To its credit, wxWidgets does partly move
in this direction though--e.g. wxControlWithItems.
Possibly a implementation of the object transform concept would be to
allow one to right click on an existing object and select "Convert
To..." from the context menu.
Another suggestion is that the context help on the object types could
be more clear. For example, "Add wxRadioBox" displays "Add a
wxRadioBox" on the status bar. It would be more useful to briefly
answer the most obvious question of how it differs from a
wxRadioButton. Similar things might be said about other objects.
Yes, I could look it up. The problem may get worse though as more and
more control types are added.
--davidm