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