]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/os2/tabctrl.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxTabCtrl class
4 // Author: David Webster
8 // Copyright: (c) David Webster
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 virtual bool OS2OnNotify(int idCtrl
, WXLPARAM lParam
, WXLPARAM
*result
);
112 // Responds to colour changes
113 void OnSysColourChanged(wxSysColourChangedEvent
& event
);
116 wxImageList
* m_imageList
;
118 DECLARE_EVENT_TABLE()
121 class WXDLLEXPORT wxTabEvent
: public wxCommandEvent
123 DECLARE_DYNAMIC_CLASS(wxTabEvent
)
126 wxTabEvent(wxEventType commandType
= wxEVT_NULL
, int id
= 0);
129 typedef void (wxEvtHandler::*wxTabEventFunction
)(wxTabEvent
&);
131 #define EVT_TAB_SEL_CHANGED(id, fn) { wxEVT_COMMAND_TAB_SEL_CHANGED, \
132 id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTabEventFunction) & fn, NULL },
133 #define EVT_TAB_SEL_CHANGING(id, fn) { wxEVT_COMMAND_TAB_SEL_CHANGING, \
134 id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTabEventFunction) & fn, NULL },