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_
13 // for compilers that support precompilation, includes "wx/wx.h".
14 #include "wx/wxprec.h"
18 // define a common base class for sorted and normal string arrays
20 typedef wxBaseArrayStringBase wxMaybeSortedArrayString
;
22 // in non-STL build wxSortedArrayString derives from wxArrayString
23 typedef wxArrayString wxMaybeSortedArrayString
;
26 class ItemContainerWidgetsPage
: public WidgetsPage
29 ItemContainerWidgetsPage(WidgetsBookCtrl
*book
,
30 wxImageList
*image_list
,
32 virtual ~ItemContainerWidgetsPage();
34 void OnButtonTestItemContainer(wxCommandEvent
& event
);
36 virtual wxItemContainer
* GetContainer() const = 0;
39 void StartTest(const wxString
& label
);
40 void EndTest(const wxMaybeSortedArrayString
& result
);
42 // Track client data in wxItemContainer instances
43 wxClientData
* CreateClientData(int value
);
44 void StartTrackingData();
45 void StopTrackingData();
46 friend class TrackedClientData
;
48 bool VerifyAllClientDataDestroyed();
49 bool VerifyClientData(wxUIntPtr i
, const wxString
& str
);
51 wxString
DumpContainerData(const wxMaybeSortedArrayString
& expected
) const;
53 wxArrayString m_items
;
54 wxSortedArrayString m_itemsSorted
;
55 int m_trackedDataObjects
;
57 // holds pointer to the widget being tested
58 wxItemContainer
*m_container
;
61 #endif // _WX_SAMPLE_WIDGETS_ITEMCONTAINER_H_