]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/tabctrl.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxTabCtrl class
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart and Markus Holzem
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
16 #pragma interface "tabctrl.h"
21 // WXDLLEXPORT_DATA(extern const char*) wxToolBarNameStr;
24 * Flags returned by HitTest
27 #define wxTAB_HITTEST_NOWHERE 1
28 #define wxTAB_HITTEST_ONICON 2
29 #define wxTAB_HITTEST_ONLABEL 4
30 #define wxTAB_HITTEST_ONITEM 6
32 class WXDLLEXPORT wxTabCtrl
: public wxControl
34 DECLARE_DYNAMIC_CLASS(wxTabCtrl
)
42 inline wxTabCtrl(wxWindow
*parent
, const wxWindowID id
, const wxPoint
& pos
= wxDefaultPosition
, const wxSize
& size
= wxDefaultSize
,
43 const long style
= 0, const wxString
& name
= "tabCtrl")
45 Create(parent
, id
, pos
, size
, style
, name
);
52 int GetSelection(void) const;
54 // Get the associated image list
55 wxImageList
* GetImageList(void) const;
57 // Get the number of items
58 int GetItemCount(void) const;
60 // Get the rect corresponding to the tab
61 bool GetItemRect(const int item
, wxRect
& rect
) const;
63 // Get the number of rows
64 int GetRowCount(void) const;
67 wxString
GetItemText(const int item
) const ;
70 int GetItemImage(const int item
) const;
73 void* GetItemData(const int item
) const;
76 int SetSelection(const int item
);
79 void SetImageList(wxImageList
* imageList
);
81 // Set the text for an item
82 bool SetItemText(const int item
, const wxString
& text
);
84 // Set the image for an item
85 bool SetItemImage(const int item
, const int image
);
87 // Set the data for an item
88 bool SetItemData(const int item
, void* data
);
90 // Set the size for a fixed-width tab control
91 void SetItemSize(const wxSize
& size
);
93 // Set the padding between tabs
94 void SetPadding(const wxSize
& padding
);
98 bool Create(wxWindow
*parent
, const wxWindowID id
, const wxPoint
& pos
= wxDefaultPosition
, const wxSize
& size
= wxDefaultSize
,
99 const long style
= 0, const wxString
& name
= "tabCtrl");
102 bool DeleteAllItems(void);
105 bool DeleteItem(const int item
);
108 int HitTest(const wxPoint
& pt
, long& flags
);
111 int InsertItem(const int item
, const wxString
& text
, const int imageId
= -1, void* data
= NULL
);
115 // Call default behaviour
116 void OnPaint(wxPaintEvent
& event
) { Default() ; }
117 void OnSize(wxSizeEvent
& event
) { Default() ; }
118 void OnMouseEvent(wxMouseEvent
& event
) { Default() ; }
119 void OnKillFocus(wxFocusEvent
& event
) { Default() ; }
121 void Command(wxCommandEvent
& event
);
122 bool MSWCommand(const WXUINT param
, const WXWORD id
);
123 bool MSWNotify(const WXWPARAM wParam
, const WXLPARAM lParam
);
125 // Responds to colour changes
126 void OnSysColourChanged(wxSysColourChangedEvent
& event
);
129 wxImageList
* m_imageList
;
131 DECLARE_EVENT_TABLE()
134 class WXDLLEXPORT wxTabEvent
: public wxCommandEvent
136 DECLARE_DYNAMIC_CLASS(wxTabEvent
)
139 wxTabEvent(WXTYPE commandType
= 0, int id
= 0);
142 typedef void (wxEvtHandler::*wxTabEventFunction
)(wxTabEvent
&);
144 #define EVT_TAB_SEL_CHANGED(id, fn) { wxEVT_COMMAND_TAB_SEL_CHANGED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTabEventFunction) & fn },
145 #define EVT_TAB_SEL_CHANGING(id, fn) { wxEVT_COMMAND_TAB_SEL_CHANGING, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTabEventFunction) & fn },