]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/motif/tabctrl.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxTabCtrl class
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_TABCTRL_H_
13 #define _WX_TABCTRL_H_
16 #pragma interface "tabctrl.h"
22 * Flags returned by HitTest
25 #define wxTAB_HITTEST_NOWHERE 1
26 #define wxTAB_HITTEST_ONICON 2
27 #define wxTAB_HITTEST_ONLABEL 4
28 #define wxTAB_HITTEST_ONITEM 6
30 class WXDLLEXPORT wxTabCtrl
: public wxControl
32 DECLARE_DYNAMIC_CLASS(wxTabCtrl
)
40 inline wxTabCtrl(wxWindow
*parent
, wxWindowID id
, const wxPoint
& pos
= wxDefaultPosition
, const wxSize
& size
= wxDefaultSize
,
41 long style
= 0, const wxString
& name
= "tabCtrl")
43 Create(parent
, id
, pos
, size
, style
, name
);
50 int GetSelection() const;
52 // Get the tab with the current keyboard focus
53 int GetCurFocus() const;
55 // Get the associated image list
56 wxImageList
* GetImageList() const;
58 // Get the number of items
59 int GetItemCount() const;
61 // Get the rect corresponding to the tab
62 bool GetItemRect(int item
, wxRect
& rect
) const;
64 // Get the number of rows
65 int GetRowCount() const;
68 wxString
GetItemText(int item
) const ;
71 int GetItemImage(int item
) const;
74 void* GetItemData(int item
) const;
77 int SetSelection(int item
);
80 void SetImageList(wxImageList
* imageList
);
82 // Set the text for an item
83 bool SetItemText(int item
, const wxString
& text
);
85 // Set the image for an item
86 bool SetItemImage(int item
, int image
);
88 // Set the data for an item
89 bool SetItemData(int item
, void* data
);
91 // Set the size for a fixed-width tab control
92 void SetItemSize(const wxSize
& size
);
94 // Set the padding between tabs
95 void SetPadding(const wxSize
& padding
);
99 bool Create(wxWindow
*parent
, wxWindowID id
, const wxPoint
& pos
= wxDefaultPosition
, const wxSize
& size
= wxDefaultSize
,
100 long style
= 0, const wxString
& name
= "tabCtrl");
103 bool DeleteAllItems();
106 bool DeleteItem(int item
);
109 int HitTest(const wxPoint
& pt
, long& flags
);
112 bool InsertItem(int item
, const wxString
& text
, int imageId
= -1, void* data
= NULL
);
114 void Command(wxCommandEvent
& event
);
117 wxImageList
* m_imageList
;
119 DECLARE_EVENT_TABLE()
122 class WXDLLEXPORT wxTabEvent
: public wxCommandEvent
124 DECLARE_DYNAMIC_CLASS(wxTabEvent
)
127 wxTabEvent(wxEventType commandType
= wxEVT_NULL
, int id
= 0);
130 typedef void (wxEvtHandler::*wxTabEventFunction
)(wxTabEvent
&);
132 #define EVT_TAB_SEL_CHANGED(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_COMMAND_TAB_SEL_CHANGED, \
133 id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTabEventFunction) & fn, NULL ),
134 #define EVT_TAB_SEL_CHANGING(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_COMMAND_TAB_SEL_CHANGING, \
135 id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTabEventFunction) & fn, NULL ),