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