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