1 /////////////////////////////////////////////////////////////////////////////
2 // Program: wxWidgets Widgets Sample
3 // Name: itemcontainer.h
4 // Purpose: Part of the widgets sample showing wxComboBox
7 // License: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
10 #ifndef _WX_SAMPLE_WIDGETS_ITEMCONTAINER_H_
11 #define _WX_SAMPLE_WIDGETS_ITEMCONTAINER_H_
15 class ItemContainerWidgetsPage
: public WidgetsPage
18 ItemContainerWidgetsPage(WidgetsBookCtrl
*book
,
19 wxImageList
*image_list
,
20 const char *const icon
[]);
21 virtual ~ItemContainerWidgetsPage();
23 void OnButtonTestItemContainer(wxCommandEvent
& event
);
25 virtual wxItemContainer
* GetContainer() const = 0;
28 void StartTest(const wxString
& label
);
29 void EndTest(const wxArrayString
& result
);
31 // Track client data in wxItemContainer instances
32 wxClientData
* CreateClientData(int value
);
33 void StartTrackingData();
34 void StopTrackingData();
35 friend class TrackedClientData
;
37 bool VerifyAllClientDataDestroyed();
38 bool VerifyClientData(wxUIntPtr i
, const wxString
& str
);
40 wxString
DumpContainerData(const wxArrayString
& expected
) const;
42 static wxArrayString
MakeArray(const wxSortedArrayString
& sorted
);
44 wxArrayString m_items
;
45 wxSortedArrayString m_itemsSorted
;
46 int m_trackedDataObjects
;
48 // holds pointer to the widget being tested
49 wxItemContainer
*m_container
;
52 #endif // _WX_SAMPLE_WIDGETS_ITEMCONTAINER_H_