1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Stefan Csomor
8 // Copyright: (c) Stefan Csomor
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
13 #pragma implementation "tabctrl.h"
18 #include "wx/control.h"
19 #include "wx/tabctrl.h"
20 #include "wx/mac/uma.h"
22 #if !USE_SHARED_LIBRARY
23 IMPLEMENT_DYNAMIC_CLASS(wxTabCtrl
, wxControl
)
25 BEGIN_EVENT_TABLE(wxTabCtrl
, wxControl
)
29 wxTabCtrl
::wxTabCtrl()
34 bool wxTabCtrl
::Create(wxWindow
*parent
, wxWindowID id
, const wxPoint
& pos
, const wxSize
& size
,
35 long style
, const wxString
& name
)
37 if ( !wxControl
::Create(parent
, id
, pos
, size
,
38 style
, wxDefaultValidator
, name
) )
46 MacPreControlCreate( parent
, id
, wxEmptyString
, pos
, size
,style
, wxDefaultValidator
, name
, &bounds
, title
) ;
48 m_macControl
= (WXWidget
) ::NewControl( MAC_WXHWND(parent
->MacGetRootWindow()) , &bounds
, title
, false , 0 , 0 , 1,
49 kControlTabSmallProc
, (long) this ) ;
51 MacPostControlCreate() ;
55 wxTabCtrl
::~wxTabCtrl()
59 void wxTabCtrl
::Command(wxCommandEvent
& event
)
64 bool wxTabCtrl
::DeleteAllItems()
71 bool wxTabCtrl
::DeleteItem(int item
)
78 int wxTabCtrl
::GetSelection() const
84 // Get the tab with the current keyboard focus
85 int wxTabCtrl
::GetCurFocus() const
91 // Get the associated image list
92 wxImageList
* wxTabCtrl
::GetImageList() const
97 // Get the number of items
98 int wxTabCtrl
::GetItemCount() const
104 // Get the rect corresponding to the tab
105 bool wxTabCtrl
::GetItemRect(int item
, wxRect
& wxrect
) const
111 // Get the number of rows
112 int wxTabCtrl
::GetRowCount() const
119 wxString wxTabCtrl
::GetItemText(int item
) const
122 return wxEmptyString
;
125 // Get the item image
126 int wxTabCtrl
::GetItemImage(int item
) const
133 void* wxTabCtrl
::GetItemData(int item
) const
140 int wxTabCtrl
::HitTest(const wxPoint
& pt
, long& flags
)
147 bool wxTabCtrl
::InsertItem(int item
, const wxString
& text
, int imageId
, void* data
)
154 int wxTabCtrl
::SetSelection(int item
)
160 // Set the image list
161 void wxTabCtrl
::SetImageList(wxImageList
* imageList
)
166 // Set the text for an item
167 bool wxTabCtrl
::SetItemText(int item
, const wxString
& text
)
173 // Set the image for an item
174 bool wxTabCtrl
::SetItemImage(int item
, int image
)
180 // Set the data for an item
181 bool wxTabCtrl
::SetItemData(int item
, void* data
)
187 // Set the size for a fixed-width tab control
188 void wxTabCtrl
::SetItemSize(const wxSize
& size
)
193 // Set the padding between tabs
194 void wxTabCtrl
::SetPadding(const wxSize
& padding
)
200 IMPLEMENT_DYNAMIC_CLASS(wxTabEvent
, wxCommandEvent
)
202 wxTabEvent
::wxTabEvent(wxEventType commandType
, int id
):
203 wxCommandEvent(commandType
, id
)