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