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