1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/osx/notebook.h
3 // Purpose: MSW/GTK compatible notebook (a.k.a. property sheet)
4 // Author: Stefan Csomor
6 // Copyright: (c) Stefan Csomor
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
10 #ifndef _WX_NOTEBOOK_H_
11 #define _WX_NOTEBOOK_H_
13 // ----------------------------------------------------------------------------
15 // ----------------------------------------------------------------------------
18 // ----------------------------------------------------------------------------
20 // ----------------------------------------------------------------------------
23 class WXDLLIMPEXP_FWD_CORE wxImageList
;
24 class WXDLLIMPEXP_FWD_CORE wxWindow
;
26 // ----------------------------------------------------------------------------
28 // ----------------------------------------------------------------------------
30 class WXDLLIMPEXP_CORE wxNotebook
: public wxNotebookBase
35 // default for dynamic class
37 // the same arguments as for wxControl (@@@ any special styles?)
38 wxNotebook(wxWindow
*parent
,
40 const wxPoint
& pos
= wxDefaultPosition
,
41 const wxSize
& size
= wxDefaultSize
,
43 const wxString
& name
= wxNotebookNameStr
)
44 { Create( parent
, id
, pos
, size
, style
, name
); }
46 bool Create(wxWindow
*parent
,
48 const wxPoint
& pos
= wxDefaultPosition
,
49 const wxSize
& size
= wxDefaultSize
,
51 const wxString
& name
= wxNotebookNameStr
);
53 virtual ~wxNotebook();
57 // set the currently selected page, return the index of the previously
58 // selected one (or wxNOT_FOUND on error)
59 // NB: this function will _not_ generate wxEVT_NOTEBOOK_PAGE_xxx events
60 int SetSelection(size_t nPage
) { return DoSetSelection(nPage
, SetSelection_SendEvent
); }
62 // changes selected page without sending events
63 int ChangeSelection(size_t nPage
) { return DoSetSelection(nPage
); }
65 // set/get the title of a page
66 bool SetPageText(size_t nPage
, const wxString
& strText
);
67 wxString
GetPageText(size_t nPage
) const;
69 // sets/returns item's image index in the current image list
70 int GetPageImage(size_t nPage
) const;
71 bool SetPageImage(size_t nPage
, int nImage
);
73 // control the appearance of the notebook pages
74 // set the size (the same for all pages)
75 virtual void SetPageSize(const wxSize
& size
);
76 // set the padding between tabs (in pixels)
77 virtual void SetPadding(const wxSize
& padding
);
78 // sets the size of the tabs (assumes all tabs are the same size)
79 virtual void SetTabSize(const wxSize
& sz
);
82 virtual int HitTest(const wxPoint
& pt
, long *flags
= NULL
) const;
84 // calculate size for wxNotebookSizer
85 wxSize
CalcSizeFromPage(const wxSize
& sizePage
) const;
86 wxRect
GetPageRect() const ;
91 bool DeleteAllPages();
92 // the same as AddPage(), but adds it at the specified position
93 bool InsertPage(size_t nPage
,
94 wxNotebookPage
*pPage
,
95 const wxString
& strText
,
97 int imageId
= NO_IMAGE
);
101 void OnSize(wxSizeEvent
& event
);
102 void OnSelChange(wxBookCtrlEvent
& event
);
103 void OnSetFocus(wxFocusEvent
& event
);
104 void OnNavigationKey(wxNavigationKeyEvent
& event
);
109 #if wxUSE_CONSTRAINTS
110 virtual void SetConstraintSizes(bool recurse
= true);
111 virtual bool DoPhase(int nPhase
);
115 // base class virtuals
116 // -------------------
117 virtual void Command(wxCommandEvent
& event
);
118 // osx specific event handling common for all osx-ports
120 virtual bool OSXHandleClicked( double timestampsec
);
123 virtual wxNotebookPage
*DoRemovePage(size_t page
) ;
124 // common part of all ctors
128 void ChangePage(int nOldSel
, int nSel
); // change pages
131 int DoSetSelection(size_t nPage
, int flags
= 0);
136 DECLARE_DYNAMIC_CLASS(wxNotebook
)
137 DECLARE_EVENT_TABLE()
141 #endif // _WX_NOTEBOOK_H_