]> git.saurik.com Git - wxWidgets.git/blob - src/mac/carbon/tabctrl.cpp
introduction of m_peer
[wxWidgets.git] / src / mac / carbon / tabctrl.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: tabctrl.cpp
3 // Purpose: wxTabCtrl
4 // Author: Stefan Csomor
5 // Modified by:
6 // Created: 1998-01-01
7 // RCS-ID: $Id$
8 // Copyright: (c) Stefan Csomor
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifdef __GNUG__
13 #pragma implementation "tabctrl.h"
14 #endif
15
16 #include "wx/defs.h"
17
18 #include "wx/control.h"
19 #include "wx/tabctrl.h"
20 #include "wx/mac/uma.h"
21
22 #if !USE_SHARED_LIBRARY
23 IMPLEMENT_DYNAMIC_CLASS(wxTabCtrl, wxControl)
24
25 BEGIN_EVENT_TABLE(wxTabCtrl, wxControl)
26 END_EVENT_TABLE()
27 #endif
28
29 wxTabCtrl::wxTabCtrl()
30 {
31 m_imageList = NULL;
32 }
33
34 bool wxTabCtrl::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size,
35 long style, const wxString& name)
36 {
37 m_macIsUserPane = FALSE ;
38
39 if ( !wxControl::Create(parent, id, pos, size,
40 style, wxDefaultValidator, name) )
41 return false;
42
43 m_imageList = NULL;
44
45 Rect bounds = wxMacGetBoundsForControl( this , pos , size ) ;
46
47 UInt16 tabstyle = kControlTabDirectionNorth ;
48 ControlTabSize tabsize = kControlTabSizeLarge ;
49 if ( GetWindowVariant() == wxWINDOW_VARIANT_SMALL )
50 tabsize = kControlTabSizeSmall ;
51 else if ( GetWindowVariant() == wxWINDOW_VARIANT_MINI )
52 {
53 if (UMAGetSystemVersion() >= 0x1030 )
54 tabsize = 3 ;
55 else
56 tabsize = kControlSizeSmall;
57 }
58
59 m_peer = new wxMacControl() ;
60 verify_noerr ( CreateTabsControl( MAC_WXHWND(parent->MacGetTopLevelWindowRef()) , &bounds ,
61 tabsize , tabstyle, 0, NULL, *m_peer ) );
62
63
64 MacPostControlCreate(pos,size) ;
65 return TRUE ;
66 }
67
68 wxTabCtrl::~wxTabCtrl()
69 {
70 }
71
72 void wxTabCtrl::Command(wxCommandEvent& event)
73 {
74 }
75
76 // Delete all items
77 bool wxTabCtrl::DeleteAllItems()
78 {
79 // TODO
80 return FALSE;
81 }
82
83 // Delete an item
84 bool wxTabCtrl::DeleteItem(int item)
85 {
86 // TODO
87 return FALSE;
88 }
89
90 // Get the selection
91 int wxTabCtrl::GetSelection() const
92 {
93 // TODO
94 return 0;
95 }
96
97 // Get the tab with the current keyboard focus
98 int wxTabCtrl::GetCurFocus() const
99 {
100 // TODO
101 return 0;
102 }
103
104 // Get the associated image list
105 wxImageList* wxTabCtrl::GetImageList() const
106 {
107 return m_imageList;
108 }
109
110 // Get the number of items
111 int wxTabCtrl::GetItemCount() const
112 {
113 // TODO
114 return 0;
115 }
116
117 // Get the rect corresponding to the tab
118 bool wxTabCtrl::GetItemRect(int item, wxRect& wxrect) const
119 {
120 // TODO
121 return FALSE;
122 }
123
124 // Get the number of rows
125 int wxTabCtrl::GetRowCount() const
126 {
127 // TODO
128 return 0;
129 }
130
131 // Get the item text
132 wxString wxTabCtrl::GetItemText(int item) const
133 {
134 // TODO
135 return wxEmptyString;
136 }
137
138 // Get the item image
139 int wxTabCtrl::GetItemImage(int item) const
140 {
141 // TODO
142 return 0;
143 }
144
145 // Get the item data
146 void* wxTabCtrl::GetItemData(int item) const
147 {
148 // TODO
149 return NULL;
150 }
151
152 // Hit test
153 int wxTabCtrl::HitTest(const wxPoint& pt, long& flags)
154 {
155 // TODO
156 return 0;
157 }
158
159 // Insert an item
160 bool wxTabCtrl::InsertItem(int item, const wxString& text, int imageId, void* data)
161 {
162 // TODO
163 return FALSE;
164 }
165
166 // Set the selection
167 int wxTabCtrl::SetSelection(int item)
168 {
169 // TODO
170 return 0;
171 }
172
173 // Set the image list
174 void wxTabCtrl::SetImageList(wxImageList* imageList)
175 {
176 // TODO
177 }
178
179 // Set the text for an item
180 bool wxTabCtrl::SetItemText(int item, const wxString& text)
181 {
182 // TODO
183 return FALSE;
184 }
185
186 // Set the image for an item
187 bool wxTabCtrl::SetItemImage(int item, int image)
188 {
189 // TODO
190 return FALSE;
191 }
192
193 // Set the data for an item
194 bool wxTabCtrl::SetItemData(int item, void* data)
195 {
196 // TODO
197 return FALSE;
198 }
199
200 // Set the size for a fixed-width tab control
201 void wxTabCtrl::SetItemSize(const wxSize& size)
202 {
203 // TODO
204 }
205
206 // Set the padding between tabs
207 void wxTabCtrl::SetPadding(const wxSize& padding)
208 {
209 // TODO
210 }
211
212 // Tab event
213 IMPLEMENT_DYNAMIC_CLASS(wxTabEvent, wxCommandEvent)
214
215 wxTabEvent::wxTabEvent(wxEventType commandType, int id):
216 wxCommandEvent(commandType, id)
217 {
218 }
219