]> git.saurik.com Git - wxWidgets.git/blame_incremental - include/wx/os2/tabctrl.h
delete children in ~wxWindow dtor and not in the base class ~wxWindowNative as it...
[wxWidgets.git] / include / wx / os2 / tabctrl.h
... / ...
CommitLineData
1/////////////////////////////////////////////////////////////////////////////
2// Name: tabctrl.h
3// Purpose: wxTabCtrl class
4// Author: David Webster
5// Modified by:
6// Created: ??/??/98
7// RCS-ID: $Id$
8// Copyright: (c) David Webster
9// Licence: wxWindows licence
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_TABCTRL_H_
13#define _WX_TABCTRL_H_
14
15class wxImageList;
16
17/*
18 * Flags returned by HitTest
19 */
20
21#define wxTAB_HITTEST_NOWHERE 1
22#define wxTAB_HITTEST_ONICON 2
23#define wxTAB_HITTEST_ONLABEL 4
24#define wxTAB_HITTEST_ONITEM 6
25
26class WXDLLEXPORT wxTabCtrl: public wxControl
27{
28 DECLARE_DYNAMIC_CLASS(wxTabCtrl)
29 public:
30 /*
31 * Public interface
32 */
33
34 wxTabCtrl();
35
36 inline wxTabCtrl(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
37 long style = 0, const wxString& name = "tabCtrl")
38 {
39 Create(parent, id, pos, size, style, name);
40 }
41 ~wxTabCtrl();
42
43// Accessors
44
45 // Get the selection
46 int GetSelection() const;
47
48 // Get the tab with the current keyboard focus
49 int GetCurFocus() const;
50
51 // Get the associated image list
52 wxImageList* GetImageList() const;
53
54 // Get the number of items
55 int GetItemCount() const;
56
57 // Get the rect corresponding to the tab
58 bool GetItemRect(int item, wxRect& rect) const;
59
60 // Get the number of rows
61 int GetRowCount() const;
62
63 // Get the item text
64 wxString GetItemText(int item) const ;
65
66 // Get the item image
67 int GetItemImage(int item) const;
68
69 // Get the item data
70 void* GetItemData(int item) const;
71
72 // Set the selection
73 int SetSelection(int item);
74
75 // Set the image list
76 void SetImageList(wxImageList* imageList);
77
78 // Set the text for an item
79 bool SetItemText(int item, const wxString& text);
80
81 // Set the image for an item
82 bool SetItemImage(int item, int image);
83
84 // Set the data for an item
85 bool SetItemData(int item, void* data);
86
87 // Set the size for a fixed-width tab control
88 void SetItemSize(const wxSize& size);
89
90 // Set the padding between tabs
91 void SetPadding(const wxSize& padding);
92
93// Operations
94
95 bool Create(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
96 long style = 0, const wxString& name = "tabCtrl");
97
98 // Delete all items
99 bool DeleteAllItems();
100
101 // Delete an item
102 bool DeleteItem(int item);
103
104 // Hit test
105 int HitTest(const wxPoint& pt, long& flags);
106
107 // Insert an item
108 bool InsertItem(int item, const wxString& text, int imageId = -1, void* data = NULL);
109
110 virtual bool OS2OnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result);
111
112 // Responds to colour changes
113 void OnSysColourChanged(wxSysColourChangedEvent& event);
114
115protected:
116 wxImageList* m_imageList;
117
118DECLARE_EVENT_TABLE()
119};
120
121class WXDLLEXPORT wxTabEvent: public wxCommandEvent
122{
123 DECLARE_DYNAMIC_CLASS(wxTabEvent)
124
125 public:
126 wxTabEvent(wxEventType commandType = wxEVT_NULL, int id = 0);
127};
128
129typedef void (wxEvtHandler::*wxTabEventFunction)(wxTabEvent&);
130
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 },
135
136#endif
137 // _WX_TABCTRL_H_