1 /////////////////////////////////////////////////////////////////////////////
4 // Author: William Osborne
8 // Copyright: (c) William Osborne
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
13 #pragma implementation "tabctrl.h"
16 // For compilers that support precompilation, includes "wx.h".
17 #include "wx/wxprec.h"
27 #if defined(__WIN95__)
29 #include "wx/tabctrl.h"
31 #include "wx/palmos/imaglist.h"
33 IMPLEMENT_DYNAMIC_CLASS(wxTabCtrl
, wxControl
)
34 IMPLEMENT_DYNAMIC_CLASS(wxTabEvent
, wxNotifyEvent
)
36 DEFINE_EVENT_TYPE(wxEVT_COMMAND_TAB_SEL_CHANGED
)
37 DEFINE_EVENT_TYPE(wxEVT_COMMAND_TAB_SEL_CHANGING
)
39 BEGIN_EVENT_TABLE(wxTabCtrl
, wxControl
)
40 EVT_SYS_COLOUR_CHANGED(wxTabCtrl::OnSysColourChanged
)
43 wxTabCtrl::wxTabCtrl()
47 bool wxTabCtrl::Create(wxWindow
*parent
, wxWindowID id
, const wxPoint
& pos
, const wxSize
& size
,
48 long style
, const wxString
& name
)
53 wxTabCtrl::~wxTabCtrl()
57 bool wxTabCtrl::MSWOnNotify(int idCtrl
, WXLPARAM lParam
, WXLPARAM
*result
)
62 // Responds to colour changes, and passes event on to children.
63 void wxTabCtrl::OnSysColourChanged(wxSysColourChangedEvent
& event
)
68 bool wxTabCtrl::DeleteAllItems()
74 bool wxTabCtrl::DeleteItem(int item
)
80 int wxTabCtrl::GetSelection() const
85 // Get the tab with the current keyboard focus
86 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
103 // Get the rect corresponding to the tab
104 bool wxTabCtrl::GetItemRect(int item
, wxRect
& wxrect
) const
109 // Get the number of rows
110 int wxTabCtrl::GetRowCount() const
116 wxString
wxTabCtrl::GetItemText(int item
) const
118 wxString
str(wxEmptyString
);
123 // Get the item image
124 int wxTabCtrl::GetItemImage(int item
) const
130 void* wxTabCtrl::GetItemData(int item
) const
136 int wxTabCtrl::HitTest(const wxPoint
& pt
, long& flags
)
142 bool wxTabCtrl::InsertItem(int item
, const wxString
& text
, int imageId
, void* data
)
148 int wxTabCtrl::SetSelection(int item
)
153 // Set the image list
154 void wxTabCtrl::SetImageList(wxImageList
* imageList
)
158 // Set the text for an item
159 bool wxTabCtrl::SetItemText(int item
, const wxString
& text
)
164 // Set the image for an item
165 bool wxTabCtrl::SetItemImage(int item
, int image
)
170 // Set the data for an item
171 bool wxTabCtrl::SetItemData(int item
, void* data
)
176 // Set the size for a fixed-width tab control
177 void wxTabCtrl::SetItemSize(const wxSize
& size
)
181 // Set the padding between tabs
182 void wxTabCtrl::SetPadding(const wxSize
& padding
)