]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/mac/classic/tabctrl.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxTabCtrl class
4 // Author: Stefan Csomor
8 // Copyright: (c) Stefan Csomor
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_TABCTRL_H_
13 #define _WX_TABCTRL_H_
18 * Flags returned by HitTest
21 #define wxTAB_HITTEST_NOWHERE 1
22 #define wxTAB_HITTEST_ONICON 2
23 #define wxTAB_HITTEST_ONLABEL 4
24 #define wxTAB_HITTEST_ONITEM 6
26 class WXDLLEXPORT wxTabCtrl
: public wxControl
28 DECLARE_DYNAMIC_CLASS(wxTabCtrl
)
36 inline wxTabCtrl(wxWindow
*parent
, wxWindowID id
, const wxPoint
& pos
= wxDefaultPosition
, const wxSize
& size
= wxDefaultSize
,
37 long style
= 0, const wxString
& name
= wxT("tabCtrl"))
39 Create(parent
, id
, pos
, size
, style
, name
);
46 int GetSelection() const;
48 // Get the tab with the current keyboard focus
49 int GetCurFocus() const;
51 // Get the associated image list
52 wxImageList
* GetImageList() const;
54 // Get the number of items
55 int GetItemCount() const;
57 // Get the rect corresponding to the tab
58 bool GetItemRect(int item
, wxRect
& rect
) const;
60 // Get the number of rows
61 int GetRowCount() const;
64 wxString
GetItemText(int item
) const ;
67 int GetItemImage(int item
) const;
70 void* GetItemData(int item
) const;
73 int SetSelection(int item
);
76 void SetImageList(wxImageList
* imageList
);
78 // Set the text for an item
79 bool SetItemText(int item
, const wxString
& text
);
81 // Set the image for an item
82 bool SetItemImage(int item
, int image
);
84 // Set the data for an item
85 bool SetItemData(int item
, void* data
);
87 // Set the size for a fixed-width tab control
88 void SetItemSize(const wxSize
& size
);
90 // Set the padding between tabs
91 void SetPadding(const wxSize
& padding
);
95 bool Create(wxWindow
*parent
, wxWindowID id
, const wxPoint
& pos
= wxDefaultPosition
, const wxSize
& size
= wxDefaultSize
,
96 long style
= 0, const wxString
& name
= wxT("tabCtrl"));
99 bool DeleteAllItems();
102 bool DeleteItem(int item
);
105 int HitTest(const wxPoint
& pt
, long& flags
);
108 bool InsertItem(int item
, const wxString
& text
, int imageId
= -1, void* data
= NULL
);
110 void Command(wxCommandEvent
& event
);
113 wxImageList
* m_imageList
;
115 DECLARE_EVENT_TABLE()
118 class WXDLLEXPORT wxTabEvent
: public wxCommandEvent
120 DECLARE_DYNAMIC_CLASS(wxTabEvent
)
123 wxTabEvent(wxEventType commandType
= wxEVT_NULL
, int id
= 0);
126 typedef void (wxEvtHandler::*wxTabEventFunction
)(wxTabEvent
&);
128 #define EVT_TAB_SEL_CHANGED(id, fn) { wxEVT_COMMAND_TAB_SEL_CHANGED, \
129 id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTabEventFunction) & fn, NULL },
130 #define EVT_TAB_SEL_CHANGING(id, fn) { wxEVT_COMMAND_TAB_SEL_CHANGING, \
131 id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTabEventFunction) & fn, NULL },