]>
git.saurik.com Git - wxWidgets.git/blob - src/mac/classic/tabctrl.cpp
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 IMPLEMENT_DYNAMIC_CLASS(wxTabCtrl
, wxControl
)
24 BEGIN_EVENT_TABLE(wxTabCtrl
, wxControl
)
27 wxTabCtrl::wxTabCtrl()
32 bool wxTabCtrl::Create(wxWindow
*parent
, wxWindowID id
, const wxPoint
& pos
, const wxSize
& size
,
33 long style
, const wxString
& name
)
35 if ( !wxControl::Create(parent
, id
, pos
, size
,
36 style
, wxDefaultValidator
, name
) )
44 MacPreControlCreate( parent
, id
, wxEmptyString
, pos
, size
,style
, wxDefaultValidator
, name
, &bounds
, title
) ;
46 m_macControl
= (WXWidget
) ::NewControl( MAC_WXHWND(parent
->MacGetRootWindow()) , &bounds
, title
, false , 0 , 0 , 1,
47 kControlTabSmallProc
, (long) this ) ;
49 MacPostControlCreate() ;
53 wxTabCtrl::~wxTabCtrl()
57 void wxTabCtrl::Command(wxCommandEvent
& event
)
62 bool wxTabCtrl::DeleteAllItems()
69 bool wxTabCtrl::DeleteItem(int item
)
76 int wxTabCtrl::GetSelection() const
82 // Get the tab with the current keyboard focus
83 int wxTabCtrl::GetCurFocus() const
89 // Get the associated image list
90 wxImageList
* wxTabCtrl::GetImageList() const
95 // Get the number of items
96 int wxTabCtrl::GetItemCount() const
102 // Get the rect corresponding to the tab
103 bool wxTabCtrl::GetItemRect(int item
, wxRect
& wxrect
) const
109 // Get the number of rows
110 int wxTabCtrl::GetRowCount() const
117 wxString
wxTabCtrl::GetItemText(int item
) const
120 return wxEmptyString
;
123 // Get the item image
124 int wxTabCtrl::GetItemImage(int item
) const
131 void* wxTabCtrl::GetItemData(int item
) const
138 int wxTabCtrl::HitTest(const wxPoint
& pt
, long& flags
)
145 bool wxTabCtrl::InsertItem(int item
, const wxString
& text
, int imageId
, void* data
)
152 int wxTabCtrl::SetSelection(int item
)
158 // Set the image list
159 void wxTabCtrl::SetImageList(wxImageList
* imageList
)
164 // Set the text for an item
165 bool wxTabCtrl::SetItemText(int item
, const wxString
& text
)
171 // Set the image for an item
172 bool wxTabCtrl::SetItemImage(int item
, int image
)
178 // Set the data for an item
179 bool wxTabCtrl::SetItemData(int item
, void* data
)
185 // Set the size for a fixed-width tab control
186 void wxTabCtrl::SetItemSize(const wxSize
& size
)
191 // Set the padding between tabs
192 void wxTabCtrl::SetPadding(const wxSize
& padding
)
198 IMPLEMENT_DYNAMIC_CLASS(wxTabEvent
, wxCommandEvent
)
200 wxTabEvent::wxTabEvent(wxEventType commandType
, int id
):
201 wxCommandEvent(commandType
, id
)