]> git.saurik.com Git - wxWidgets.git/blob - src/mac/carbon/tabctrl.cpp
Inital fill in background, removed tabs, -1->wxID_ANY, TRUE->true, FALSE->false
[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 verify_noerr ( CreateTabsControl( MAC_WXHWND(parent->MacGetTopLevelWindowRef()) , &bounds ,
60 tabsize , tabstyle, 0, NULL, (ControlRef*) &m_macControl) );
61
62 MacPostControlCreate(pos,size) ;
63 return TRUE ;
64 }
65
66 wxTabCtrl::~wxTabCtrl()
67 {
68 }
69
70 void wxTabCtrl::Command(wxCommandEvent& event)
71 {
72 }
73
74 // Delete all items
75 bool wxTabCtrl::DeleteAllItems()
76 {
77 // TODO
78 return FALSE;
79 }
80
81 // Delete an item
82 bool wxTabCtrl::DeleteItem(int item)
83 {
84 // TODO
85 return FALSE;
86 }
87
88 // Get the selection
89 int wxTabCtrl::GetSelection() const
90 {
91 // TODO
92 return 0;
93 }
94
95 // Get the tab with the current keyboard focus
96 int wxTabCtrl::GetCurFocus() const
97 {
98 // TODO
99 return 0;
100 }
101
102 // Get the associated image list
103 wxImageList* wxTabCtrl::GetImageList() const
104 {
105 return m_imageList;
106 }
107
108 // Get the number of items
109 int wxTabCtrl::GetItemCount() const
110 {
111 // TODO
112 return 0;
113 }
114
115 // Get the rect corresponding to the tab
116 bool wxTabCtrl::GetItemRect(int item, wxRect& wxrect) const
117 {
118 // TODO
119 return FALSE;
120 }
121
122 // Get the number of rows
123 int wxTabCtrl::GetRowCount() const
124 {
125 // TODO
126 return 0;
127 }
128
129 // Get the item text
130 wxString wxTabCtrl::GetItemText(int item) const
131 {
132 // TODO
133 return wxEmptyString;
134 }
135
136 // Get the item image
137 int wxTabCtrl::GetItemImage(int item) const
138 {
139 // TODO
140 return 0;
141 }
142
143 // Get the item data
144 void* wxTabCtrl::GetItemData(int item) const
145 {
146 // TODO
147 return NULL;
148 }
149
150 // Hit test
151 int wxTabCtrl::HitTest(const wxPoint& pt, long& flags)
152 {
153 // TODO
154 return 0;
155 }
156
157 // Insert an item
158 bool wxTabCtrl::InsertItem(int item, const wxString& text, int imageId, void* data)
159 {
160 // TODO
161 return FALSE;
162 }
163
164 // Set the selection
165 int wxTabCtrl::SetSelection(int item)
166 {
167 // TODO
168 return 0;
169 }
170
171 // Set the image list
172 void wxTabCtrl::SetImageList(wxImageList* imageList)
173 {
174 // TODO
175 }
176
177 // Set the text for an item
178 bool wxTabCtrl::SetItemText(int item, const wxString& text)
179 {
180 // TODO
181 return FALSE;
182 }
183
184 // Set the image for an item
185 bool wxTabCtrl::SetItemImage(int item, int image)
186 {
187 // TODO
188 return FALSE;
189 }
190
191 // Set the data for an item
192 bool wxTabCtrl::SetItemData(int item, void* data)
193 {
194 // TODO
195 return FALSE;
196 }
197
198 // Set the size for a fixed-width tab control
199 void wxTabCtrl::SetItemSize(const wxSize& size)
200 {
201 // TODO
202 }
203
204 // Set the padding between tabs
205 void wxTabCtrl::SetPadding(const wxSize& padding)
206 {
207 // TODO
208 }
209
210 // Tab event
211 IMPLEMENT_DYNAMIC_CLASS(wxTabEvent, wxCommandEvent)
212
213 wxTabEvent::wxTabEvent(wxEventType commandType, int id):
214 wxCommandEvent(commandType, id)
215 {
216 }
217