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