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