]> git.saurik.com Git - wxWidgets.git/blob - include/wx/mac/notebook.h
Added some more files
[wxWidgets.git] / include / wx / mac / notebook.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: notebook.h
3 // Purpose: MSW/GTK compatible notebook (a.k.a. property sheet)
4 // Author: AUTHOR
5 // Modified by:
6 // RCS-ID: $Id$
7 // Copyright: (c) AUTHOR
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
10
11 #ifndef _WX_NOTEBOOK_H_
12 #define _WX_NOTEBOOK_H_
13
14 #ifdef __GNUG__
15 #pragma interface "notebook.h"
16 #endif
17
18 // ----------------------------------------------------------------------------
19 // headers
20 // ----------------------------------------------------------------------------
21 #include "wx/dynarray.h"
22 #include "wx/event.h"
23 #include "wx/control.h"
24
25 // ----------------------------------------------------------------------------
26 // types
27 // ----------------------------------------------------------------------------
28
29 // fwd declarations
30 class WXDLLEXPORT wxImageList;
31 class WXDLLEXPORT wxWindow;
32
33 // ----------------------------------------------------------------------------
34 // wxNotebook
35 // ----------------------------------------------------------------------------
36
37 // @@@ this class should really derive from wxTabCtrl, but the interface is not
38 // exactly the same, so I can't do it right now and instead we reimplement
39 // part of wxTabCtrl here
40 class wxNotebook : public wxNotebookBase
41 {
42 public:
43 // ctors
44 // -----
45 // default for dynamic class
46 wxNotebook();
47 // the same arguments as for wxControl (@@@ any special styles?)
48 wxNotebook(wxWindow *parent,
49 wxWindowID id,
50 const wxPoint& pos = wxDefaultPosition,
51 const wxSize& size = wxDefaultSize,
52 long style = 0,
53 const wxString& name = "notebook");
54 // Create() function
55 bool Create(wxWindow *parent,
56 wxWindowID id,
57 const wxPoint& pos = wxDefaultPosition,
58 const wxSize& size = wxDefaultSize,
59 long style = 0,
60 const wxString& name = "notebook");
61 // dtor
62 ~wxNotebook();
63
64 // accessors
65 // ---------
66 // set the currently selected page, return the index of the previously
67 // selected one (or -1 on error)
68 // NB: this function will _not_ generate wxEVT_NOTEBOOK_PAGE_xxx events
69 int SetSelection(int nPage);
70 // get the currently selected page
71 int GetSelection() const { return m_nSelection; }
72
73 // set/get the title of a page
74 bool SetPageText(int nPage, const wxString& strText);
75 wxString GetPageText(int nPage) const;
76
77 // sets/returns item's image index in the current image list
78 int GetPageImage(int nPage) const;
79 bool SetPageImage(int nPage, int nImage);
80
81 // control the appearance of the notebook pages
82 // set the size (the same for all pages)
83 void SetPageSize(const wxSize& size);
84 // set the padding between tabs (in pixels)
85 void SetPadding(const wxSize& padding);
86 // sets the size of the tabs (assumes all tabs are the same size)
87 void SetTabSize(const wxSize& sz);
88
89 /*
90 // get number of pages in the dialog
91 int GetPageCount() const;
92
93 // cycle thru the tabs
94 void AdvanceSelection(bool bForward = TRUE);
95
96
97 // currently it's always 1 because wxGTK doesn't support multi-row
98 // tab controls
99 int GetRowCount() const;
100 */
101 // operations
102 // ----------
103 // remove all pages
104 bool DeleteAllPages();
105 // the same as AddPage(), but adds it at the specified position
106 bool InsertPage(int nPage,
107 wxNotebookPage *pPage,
108 const wxString& strText,
109 bool bSelect = FALSE,
110 int imageId = -1);
111 /*
112 // get the panel which represents the given page
113 wxNotebookPage *GetPage(int nPage) { return m_aPages[nPage]; }
114 */
115 // callbacks
116 // ---------
117 void OnSize(wxSizeEvent& event);
118 void OnSelChange(wxNotebookEvent& event);
119 void OnSetFocus(wxFocusEvent& event);
120 void OnNavigationKey(wxNavigationKeyEvent& event);
121
122
123 // implementation
124 // --------------
125
126 #if wxUSE_CONSTRAINTS
127 virtual void SetConstraintSizes(bool recurse = TRUE);
128 virtual bool DoPhase(int nPhase);
129
130 #endif
131
132 // base class virtuals
133 // -------------------
134 virtual void Command(wxCommandEvent& event);
135 protected:
136 virtual wxNotebookPage *DoRemovePage(int page) ;
137 virtual void MacHandleControlClick( ControlHandle control , SInt16 controlpart ) ;
138 // common part of all ctors
139 void Init();
140
141 // helper functions
142 void ChangePage(int nOldSel, int nSel); // change pages
143 void MacSetupTabs();
144
145 // wxImageList *m_pImageList; // we can have an associated image list
146 // wxArrayPages m_aPages; // array of pages
147
148 int m_nSelection; // the current selection (-1 if none)
149
150 DECLARE_DYNAMIC_CLASS(wxNotebook)
151 DECLARE_EVENT_TABLE()
152 };
153
154
155 #endif // _WX_NOTEBOOK_H_