## Dialogs and controls

Labels

Most controls no longer have labels and values as they used to in 1.xx. Instead, labels should be created separately using wxStaticText (the new name for wxMessage). This will need some reworking of dialogs, unfortunately; programmatic dialog creation that doesn't use constraints will be especially hard-hit. Perhaps take this opportunity to make more use of dialog resources or constraints. Or consider using the wxPropertyListView class which can do away with dialog layout issues altogether by presenting a list of editable properties.

Constructors

All window constructors have two main changes, apart from the label issue mentioned above. Windows now have integer identifiers; and position and size are now passed as wxPoint and wxSize objects. In addition, some windows have a wxValidator argument.

Show versus ShowModal

If you have used or overridden the wxDialog::Show function in the past, you may find that modal dialogs no longer work as expected. This is because the function for modal showing is now wxDialog:ShowModal. This is part of a more fundamental change in which a control may tell the dialog that it caused the dismissal of a dialog, by calling wxDialog::EndModal or wxWindow::SetReturnCode. Using this information, ShowModal now returns the id of the control that caused dismissal, giving greater feedback to the application than just TRUE or FALSE.

If you overrode or called wxDialog::Show, use ShowModal and test for a returned identifier, commonly wxID_OK or wxID_CANCEL.

wxItem

This is renamed wxControl.

wxText, wxMultiText and wxTextWindow

These classes no longer exist and are replaced by the single class wxTextCtrl. Multi-line text items are created using the wxTE_MULTILINE style.

wxButton

Bitmap buttons are now a separate class, instead of being part of wxBitmap.

wxMessage

Bitmap messages are now a separate class, wxStaticBitmap, and wxMessage is renamed wxStaticText.

wxGroupBox

wxGroupBox is renamed wxStaticBox.

wxForm

Note that wxForm is no longer supported in wxWindows 2.0. Consider using the wxPropertyFormView class instead, which takes standard dialogs and panels and associates controls with property objects. You may also find that the new validation method, combined with dialog resources, is easier and more flexible than using wxForm.