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