make wxRearrangeDialog more customizable and add an example of customizing it to the dialogs sample

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57690 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2008-12-31 14:26:52 +00:00
parent 5b8b2c84f7
commit 5a5f305a0f
5 changed files with 317 additions and 15 deletions

View File

@@ -317,6 +317,52 @@ public:
const wxPoint& pos = wxDefaultPosition,
const wxString& name = wxRearrangeDialogNameStr);
/**
Customize the dialog by adding extra controls to it.
This function adds the given @a win to the dialog, putting it just
below the part occupied by wxRearrangeCtrl. It must be called after
creating the dialog and you will typically need to process the events
generated by the extra controls for them to do something useful.
For example:
@code
class MyRearrangeDialog : public wxRearrangeDialog
{
public:
MyRearrangeDialog(wxWindow *parent, ...)
: wxRearrangeDialog(parent, ...)
{
wxPanel *panel = new wxPanel(this);
wxSizer *sizer = new wxBoxSizer(wxHORIZONTAL);
sizer->Add(new wxStaticText(panel, wxID_ANY,
"Column width in pixels:"));
sizer->Add(new wxTextCtrl(panel, wxID_ANY, ""));
panel->SetSizer(sizer);
AddExtraControls(panel);
}
... code to update the text control with the currently selected
item width and to react to its changes omitted ...
};
@endcode
See also the complete example of a custom rearrange dialog in the
dialogs sample.
@param win
The window containing the extra controls. It must have this dialog
as its parent.
*/
void AddExtraControls(wxWindow *win);
/**
Return the list control used by the dialog.
@see wxRearrangeCtrl::GetList()
*/
wxRearrangeList *GetList() const;
/**
Return the array describing the order of items after it was modified by
the user.