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