many wxItemContainer-related changes:
[wxWidgets.git] / samples / widgets / itemcontainer.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Program: wxWidgets Widgets Sample
3 // Name: itemcontainer.h
4 // Purpose: Part of the widgets sample showing wxComboBox
5 // Created: 20.07.07
6 // Id: $Id$
7 // License: wxWindows license
8 /////////////////////////////////////////////////////////////////////////////
9
10 #ifndef _WX_SAMPLE_WIDGETS_ITEMCONTAINER_H_
11 #define _WX_SAMPLE_WIDGETS_ITEMCONTAINER_H_
12
13 // for compilers that support precompilation, includes "wx/wx.h".
14 #include "wx/wxprec.h"
15
16 #include "widgets.h"
17
18 class ItemContainerWidgetsPage : public WidgetsPage
19 {
20 public:
21 ItemContainerWidgetsPage(WidgetsBookCtrl *book,
22 wxImageList *image_list,
23 char* icon[]);
24 virtual ~ItemContainerWidgetsPage();
25
26 void OnButtonTestItemContainer(wxCommandEvent& event);
27
28 virtual wxItemContainer* GetContainer() const = 0;
29
30 private:
31 void StartTest(const wxString& label);
32 void EndTest(const wxArrayString& result);
33
34 // Track client data in wxItemContainer instances
35 wxClientData* CreateClientData(int value);
36 void StartTrackingData();
37 void StopTrackingData();
38 friend class TrackedClientData;
39
40 bool VerifyAllClientDataDestroyed();
41 bool VerifyClientData(wxUIntPtr i, const wxString& str);
42
43 wxString DumpContainerData(const wxArrayString& expected) const;
44
45 wxArrayString m_items;
46 wxSortedArrayString m_itemsSorted;
47 int m_trackedDataObjects;
48
49 // holds pointer to the widget being tested
50 wxItemContainer *m_container;
51 };
52
53 #endif // _WX_SAMPLE_WIDGETS_ITEMCONTAINER_H_