1 /////////////////////////////////////////////////////////////////////////////
2 // Program: wxWidgets Widgets Sample
3 // Name: itemcontainer.h
4 // Purpose: Part of the widgets sample showing wxComboBox
7 // License: wxWindows license
8 /////////////////////////////////////////////////////////////////////////////
10 #ifndef _WX_SAMPLE_WIDGETS_ITEMCONTAINER_H_
11 #define _WX_SAMPLE_WIDGETS_ITEMCONTAINER_H_
15 // define a common base class for sorted and normal string arrays
17 typedef wxBaseArrayStringBase wxMaybeSortedArrayString
;
19 // in non-STL build wxSortedArrayString derives from wxArrayString
20 typedef wxArrayString wxMaybeSortedArrayString
;
23 class ItemContainerWidgetsPage
: public WidgetsPage
26 ItemContainerWidgetsPage(WidgetsBookCtrl
*book
,
27 wxImageList
*image_list
,
29 virtual ~ItemContainerWidgetsPage();
31 void OnButtonTestItemContainer(wxCommandEvent
& event
);
33 virtual wxItemContainer
* GetContainer() const = 0;
36 void StartTest(const wxString
& label
);
37 void EndTest(const wxMaybeSortedArrayString
& result
);
39 // Track client data in wxItemContainer instances
40 wxClientData
* CreateClientData(int value
);
41 void StartTrackingData();
42 void StopTrackingData();
43 friend class TrackedClientData
;
45 bool VerifyAllClientDataDestroyed();
46 bool VerifyClientData(wxUIntPtr i
, const wxString
& str
);
48 wxString
DumpContainerData(const wxMaybeSortedArrayString
& expected
) const;
50 wxArrayString m_items
;
51 wxSortedArrayString m_itemsSorted
;
52 int m_trackedDataObjects
;
54 // holds pointer to the widget being tested
55 wxItemContainer
*m_container
;
58 #endif // _WX_SAMPLE_WIDGETS_ITEMCONTAINER_H_