]> git.saurik.com Git - wxWidgets.git/blob - samples/widgets/itemcontainer.h
Added samples/dll for showing how to use wxWidgets to implement
[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 #include "widgets.h"
14
15 class ItemContainerWidgetsPage : public WidgetsPage
16 {
17 public:
18 ItemContainerWidgetsPage(WidgetsBookCtrl *book,
19 wxImageList *image_list,
20 const char *const icon[]);
21 virtual ~ItemContainerWidgetsPage();
22
23 void OnButtonTestItemContainer(wxCommandEvent& event);
24
25 virtual wxItemContainer* GetContainer() const = 0;
26
27 private:
28 void StartTest(const wxString& label);
29 void EndTest(const wxArrayString& result);
30
31 // Track client data in wxItemContainer instances
32 wxClientData* CreateClientData(int value);
33 void StartTrackingData();
34 void StopTrackingData();
35 friend class TrackedClientData;
36
37 bool VerifyAllClientDataDestroyed();
38 bool VerifyClientData(wxUIntPtr i, const wxString& str);
39
40 wxString DumpContainerData(const wxArrayString& expected) const;
41
42 static wxArrayString MakeArray(const wxSortedArrayString& sorted);
43
44 wxArrayString m_items;
45 wxSortedArrayString m_itemsSorted;
46 int m_trackedDataObjects;
47
48 // holds pointer to the widget being tested
49 wxItemContainer *m_container;
50 };
51
52 #endif // _WX_SAMPLE_WIDGETS_ITEMCONTAINER_H_