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