]>
git.saurik.com Git - wxWidgets.git/blob - src/generic/propdlg.cpp
0d37afa37130249a264629fa6cfd32972b36f4ff
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxPropertySheetDialog
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
13 #pragma implementation "propdlg.h"
16 // For compilers that support precompilation, includes "wx.h".
17 #include "wx/wxprec.h"
26 #include "wx/button.h"
30 #include "wx/msgdlg.h"
33 #include "wx/bookctrl.h"
34 #include "wx/generic/propdlg.h"
36 //-----------------------------------------------------------------------------
37 // wxPropertySheetDialog
38 //-----------------------------------------------------------------------------
40 IMPLEMENT_DYNAMIC_CLASS(wxPropertySheetDialog
, wxDialog
)
42 bool wxPropertySheetDialog::Create(wxWindow
* parent
, wxWindowID id
, const wxString
& title
,
43 const wxPoint
& pos
, const wxSize
& sz
, long style
,
46 if (!wxDialog::Create(parent
, id
, title
, pos
, sz
, style
, name
))
49 wxBoxSizer
*topSizer
= new wxBoxSizer( wxVERTICAL
);
52 // This gives more space around the edges
53 m_innerSizer
= new wxBoxSizer( wxVERTICAL
);
59 topSizer
->Add(m_innerSizer
, 1, wxGROW
|wxALL
, extraSpace
);
61 m_bookCtrl
= CreateBookCtrl();
62 AddBookCtrl(m_innerSizer
);
67 void wxPropertySheetDialog::Init()
73 // Layout the dialog, to be called after pages have been created
74 void wxPropertySheetDialog::LayoutDialog()
77 GetSizer()->Fit(this);
82 // Creates the buttons, if any
83 void wxPropertySheetDialog::CreateButtons(int flags
)
85 #if defined(__WXWINCE__) && defined(__SMARTPHONE__)
86 SetLeftMenu(wxID_CANCEL
);
88 #elif !defined(__WXWINCE__)
89 wxSizer
* sizer
= CreateButtonSizer(flags
);
90 m_innerSizer
->Add( sizer
, 0, wxGROW
|wxALIGN_CENTER_VERTICAL
|wxTOP
|wxBOTTOM
, 5);
94 // Creates the book control
95 wxBookCtrlBase
* wxPropertySheetDialog::CreateBookCtrl()
98 #if defined(__POCKETPC__) && wxUSE_NOTEBOOK
99 style
|= wxNB_BOTTOM
|wxNB_FLAT
;
101 style
|= wxBC_DEFAULT
;
103 return new wxBookCtrl(this, wxID_ANY
, wxDefaultPosition
, wxDefaultSize
, style
);
106 // Adds the book control to the inner sizer.
107 void wxPropertySheetDialog::AddBookCtrl(wxSizer
* sizer
)
109 #if defined(__POCKETPC__) && wxUSE_NOTEBOOK
110 // The book control has to be sized larger than the dialog because of a border bug
112 sizer
->Add( m_bookCtrl
, 1, wxGROW
|wxALIGN_CENTER_VERTICAL
|wxLEFT
|wxTOP
|wxRIGHT
, -3 );
114 sizer
->Add( m_bookCtrl
, 1, wxGROW
|wxALIGN_CENTER_VERTICAL
|wxALL
, 5 );