Contents Up Previous Next

wxPropertySheetDialog

This class represents a property sheet dialog: a tabbed dialog for showing settings. It is optimized to show flat tabs on PocketPC devices, and can be customized to use different controllers instead of the default notebook style.

To use this class, call wxPropertySheetDialog::Create from your own Create function. Then call CreateButtons, and create pages, adding them to the book control. Finally call LayoutDialog.

For example:

bool MyPropertySheetDialog::Create(...)
{
    if (!wxPropertySheetDialog::Create(...))
        return false;

    CreateButtons(wxOK|wxCANCEL|wxHELP);

    // Add page
    wxPanel* panel = new wxPanel(GetBookCtrl(), ...);
    GetBookCtrl()->AddPage(panel, wxT("General"));

    LayoutDialog();
    return true;
}
If necessary, override CreateBookCtrl and AddBookCtrl to create and add a different kind of book control. You would then need to use two-step construction for the dialog. Or, change the style of book control by calling SetSheetStyle before calling Create.

The dialogs sample shows this class being used with notebook and toolbook controllers (for Windows-style and Mac-style settings dialogs).

Derived from

wxDialog
wxWindow
wxEvtHandler
wxObject

Include files

<wx/propdlg.h> <wx/generic/propdlg.h>

Members

wxPropertySheetDialog::wxPropertySheetDialog
wxPropertySheetDialog::AddBookCtrl
wxPropertySheetDialog::Create
wxPropertySheetDialog::CreateBookCtrl
wxPropertySheetDialog::CreateButtons
wxPropertySheetDialog::GetBookCtrl
wxPropertySheetDialog::GetInnerSizer
wxPropertySheetDialog::GetSheetStyle
wxPropertySheetDialog::LayoutDialog
wxPropertySheetDialog::SetBookCtrl
wxPropertySheetDialog::SetInnerSizer
wxPropertySheetDialog::SetSheetStyle


wxPropertySheetDialog::wxPropertySheetDialog

wxPropertySheetDialog(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE, const wxString& name = "dialogBox")

Constructor.


wxPropertySheetDialog::AddBookCtrl

virtual void AddBookCtrl(wxSizer* sizer)

Override this if you wish to add the book control in a way different from the standard way (for example, using different spacing).


wxPropertySheetDialog::Create

bool Create(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE, const wxString& name = "dialogBox")

Call this from your own Create function, before adding buttons and pages.


wxPropertySheetDialog::CreateBookCtrl

virtual wxBookCtrlBase* CreateBookCtrl()

Override this if you wish to create a different kind of book control; by default, the value passed to SetSheetStyle is used to determine the control. The default behaviour is to create a notebook except on Smartphone, where a choicebook is used.


wxPropertySheetDialog::CreateButtons

void CreateButtons(int flags=wxOK|wxCANCEL)

Call this to create the buttons for the dialog. This calls wxDialog::CreateButtonSizer, and the flags are the same. On PocketPC, no buttons are created.


wxPropertySheetDialog::GetBookCtrl

wxBookCtrlBase* GetBookCtrl() const

Returns the book control that will contain your settings pages.


wxPropertySheetDialog::GetInnerSizer

wxSizer* GetInnerSizer() const

Returns the inner sizer that contains the book control and button sizer.


wxPropertySheetDialog::GetSheetStyle

long GetSheetStyle() const

Returns the sheet style. See SetSheetStyle for permissable values.


wxPropertySheetDialog::LayoutDialog

void LayoutDialog(int centreFlags=wxBOTH)

Call this to lay out the dialog. On PocketPC, this does nothing, since the dialog will be shown full-screen, and the layout will be done when the dialog receives a size event.


wxPropertySheetDialog::SetBookCtrl

void SetBookCtrl(wxBookCtrlBase* bookCtrl)

Sets the book control used for the dialog. You will normally not need to use this.


wxPropertySheetDialog::SetInnerSizer

void SetInnerSizer(wxSizer* sizer)

Sets the inner sizer that contains the book control and button sizer. You will normally not need to use this.


wxPropertySheetDialog::SetSheetStyle

void SetSheetStyle(long style)

You can customize the look and feel of the dialog by setting the sheet style. It is a bit list of the following values:

wxPROPSHEET_DEFAULT Uses the default look and feel for the controller window, normally a notebook except on Smartphone where a choice control is used.
wxPROPSHEET_NOTEBOOK Uses a notebook for the controller window.
wxPROPSHEET_TOOLBOOK Uses a toolbook for the controller window.
wxPROPSHEET_CHOICEBOOK Uses a choicebook for the controller window.
wxPROPSHEET_LISTBOOK Uses a listbook for the controller window.
wxPROPSHEET_TREEBOOK Uses a treebook for the controller window.
wxPROPSHEET_SHRINKTOFIT Shrinks the dialog window to fit the currently selected page (common behaviour for property sheets on Mac OS X).