]>
git.saurik.com Git - wxWidgets.git/blob - src/mac/carbon/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 #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 m_macIsUserPane
= FALSE
;
39 if ( !wxControl::Create(parent
, id
, pos
, size
,
40 style
, wxDefaultValidator
, name
) )
45 Rect bounds
= wxMacGetBoundsForControl( this , pos
, size
) ;
46 m_macControl
= (WXWidget
) ::NewControl( MAC_WXHWND(parent
->MacGetTopLevelWindowRef()) , &bounds
, "\p" , true , 0 , 0 , 1,
47 kControlTabSmallProc
, (long) this ) ;
49 MacPostControlCreate(pos
,size
) ;
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
)