]>
git.saurik.com Git - wxWidgets.git/blob - src/mac/classic/tabctrl.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/mac/classic/tabctrl.cpp
4 // Author: Stefan Csomor
8 // Copyright: (c) Stefan Csomor
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #include "wx/wxprec.h"
20 #include "wx/tabctrl.h"
23 #include "wx/control.h"
26 #include "wx/mac/uma.h"
28 IMPLEMENT_DYNAMIC_CLASS(wxTabCtrl
, wxControl
)
30 BEGIN_EVENT_TABLE(wxTabCtrl
, wxControl
)
33 wxTabCtrl::wxTabCtrl()
38 bool wxTabCtrl::Create(wxWindow
*parent
, wxWindowID id
, const wxPoint
& pos
, const wxSize
& size
,
39 long style
, const wxString
& name
)
41 if ( !wxControl::Create(parent
, id
, pos
, size
,
42 style
, wxDefaultValidator
, name
) )
50 MacPreControlCreate( parent
, id
, wxEmptyString
, pos
, size
,style
, wxDefaultValidator
, name
, &bounds
, title
) ;
52 m_macControl
= (WXWidget
) ::NewControl( MAC_WXHWND(parent
->MacGetRootWindow()) , &bounds
, title
, false , 0 , 0 , 1,
53 kControlTabSmallProc
, (long) this ) ;
55 MacPostControlCreate() ;
59 wxTabCtrl::~wxTabCtrl()
63 void wxTabCtrl::Command(wxCommandEvent
& event
)
68 bool wxTabCtrl::DeleteAllItems()
75 bool wxTabCtrl::DeleteItem(int item
)
82 int wxTabCtrl::GetSelection() const
88 // Get the tab with the current keyboard focus
89 int wxTabCtrl::GetCurFocus() const
95 // Get the associated image list
96 wxImageList
* wxTabCtrl::GetImageList() const
101 // Get the number of items
102 int wxTabCtrl::GetItemCount() const
108 // Get the rect corresponding to the tab
109 bool wxTabCtrl::GetItemRect(int item
, wxRect
& wxrect
) const
115 // Get the number of rows
116 int wxTabCtrl::GetRowCount() const
123 wxString
wxTabCtrl::GetItemText(int item
) const
126 return wxEmptyString
;
129 // Get the item image
130 int wxTabCtrl::GetItemImage(int item
) const
137 void* wxTabCtrl::GetItemData(int item
) const
144 int wxTabCtrl::HitTest(const wxPoint
& pt
, long& flags
)
151 bool wxTabCtrl::InsertItem(int item
, const wxString
& text
, int imageId
, void* data
)
158 int wxTabCtrl::SetSelection(int item
)
164 // Set the image list
165 void wxTabCtrl::SetImageList(wxImageList
* imageList
)
170 // Set the text for an item
171 bool wxTabCtrl::SetItemText(int item
, const wxString
& text
)
177 // Set the image for an item
178 bool wxTabCtrl::SetItemImage(int item
, int image
)
184 // Set the data for an item
185 bool wxTabCtrl::SetItemData(int item
, void* data
)
191 // Set the size for a fixed-width tab control
192 void wxTabCtrl::SetItemSize(const wxSize
& size
)
197 // Set the padding between tabs
198 void wxTabCtrl::SetPadding(const wxSize
& padding
)
204 IMPLEMENT_DYNAMIC_CLASS(wxTabEvent
, wxCommandEvent
)
206 wxTabEvent::wxTabEvent(wxEventType commandType
, int id
):
207 wxCommandEvent(commandType
, id
)
211 #endif // wxUSE_TAB_DIALOG