]> git.saurik.com Git - wxWidgets.git/blame - include/wx/generic/propdlg.h
Applied patch [ 1166587 ] [wxMSW] Removes all flicker from wxStaticBox
[wxWidgets.git] / include / wx / generic / propdlg.h
CommitLineData
3c9287bb
JS
1/////////////////////////////////////////////////////////////////////////////
2// Name: wx/generic/propdlg.h
3// Purpose: wxPropertySheetDialog
4// Author: Julian Smart
5// Modified by:
6// Created: 2005-03-12
7// RCS-ID: $Id$
8// Copyright: (c) Julian Smart
9// Licence: wxWindows licence
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_PROPDLG_H_
13#define _WX_PROPDLG_H_
14
15#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
16#pragma interface "propdlg.h"
17#endif
18
19class WXDLLEXPORT wxBookCtrlBase;
20
21//-----------------------------------------------------------------------------
22// wxPropertySheetDialog
23// A platform-independent properties dialog.
24//
25// * on PocketPC, a flat-look 'property sheet' notebook will be used, with
26// no OK/Cancel/Help buttons
27// * on other platforms, a normal notebook will be used, with standard buttons
28//
29// To use this class, call Create from your derived class.
30// Then create pages and add to the book control. Finally call CreateButtons and
31// LayoutDialog.
32//
33// For example:
34//
35// MyPropertySheetDialog::Create(...)
36// {
37// wxPropertySheetDialog::Create(...);
38//
39// // Add page
40// wxPanel* panel = new wxPanel(GetBookCtrl(), ...);
41// GetBookCtrl()->AddPage(panel, wxT("General"));
42//
43// CreateButtons();
44// LayoutDialog();
45// }
46//
47// Override CreateBookCtrl and AddBookCtrl to create and add a different
48// kind of book control.
49//-----------------------------------------------------------------------------
50
c27bcbd5 51class WXDLLIMPEXP_ADV wxPropertySheetDialog : public wxDialog
3c9287bb
JS
52{
53public:
54 wxPropertySheetDialog() : wxDialog() { Init(); }
55
56 wxPropertySheetDialog(wxWindow* parent, wxWindowID id,
57 const wxString& title,
58 const wxPoint& pos = wxDefaultPosition,
59 const wxSize& sz = wxDefaultSize,
60 long style = wxDEFAULT_DIALOG_STYLE,
61 const wxString& name = wxDialogNameStr)
62 {
63 Init();
64 Create(parent, id, title, pos, sz, style, name);
65 }
66
67 bool Create(wxWindow* parent, wxWindowID id,
68 const wxString& title,
69 const wxPoint& pos = wxDefaultPosition,
70 const wxSize& sz = wxDefaultSize,
71 long style = wxDEFAULT_DIALOG_STYLE,
72 const wxString& name = wxDialogNameStr);
73
74 void Init();
75
76//// Accessors
77
78 // Set and get the notebook
79 void SetBookCtrl(wxBookCtrlBase* book) { m_bookCtrl = book; }
80 wxBookCtrlBase* GetBookCtrl() const { return m_bookCtrl; }
81
82 // Set and get the inner sizer
83 void SetInnerSize(wxSizer* sizer) { m_innerSizer = sizer; }
84 wxSizer* GetInnerSizer() const { return m_innerSizer ; }
85
86/// Operations
87
88 // Creates the buttons (none on PocketPC)
89 virtual void CreateButtons(int flags = wxOK|wxCANCEL);
90
91 // Lay out the dialog, to be called after pages have been created
92 virtual void LayoutDialog();
93
94/// Implementation
95
96 // Creates the book control. If you want to use a different kind of
97 // control, override.
98 virtual wxBookCtrlBase* CreateBookCtrl();
99
100 // Adds the book control to the inner sizer.
101 virtual void AddBookCtrl(wxSizer* sizer);
102
103protected:
104 wxBookCtrlBase* m_bookCtrl;
105 wxSizer* m_innerSizer; // sizer for extra space
106
107 DECLARE_DYNAMIC_CLASS(wxPropertySheetDialog)
108};
109
110#endif // _WX_PROPDLG_H_
111