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 class ItemContainerWidgetsPage
: public WidgetsPage
21 ItemContainerWidgetsPage(WidgetsBookCtrl
*book
,
22 wxImageList
*image_list
,
24 virtual ~ItemContainerWidgetsPage();
26 void OnButtonTestItemContainer(wxCommandEvent
& event
);
28 virtual wxItemContainer
* GetContainer() const = 0;
31 void StartTest(const wxString
& label
);
32 void EndTest(const wxArrayString
& result
);
34 // Track client data in wxItemContainer instances
35 wxClientData
* CreateClientData(int value
);
36 void StartTrackingData();
37 void StopTrackingData();
38 friend class TrackedClientData
;
40 bool VerifyAllClientDataDestroyed();
41 bool VerifyClientData(wxUIntPtr i
, const wxString
& str
);
43 wxString
DumpContainerData(const wxArrayString
& expected
) const;
45 wxArrayString m_items
;
46 wxSortedArrayString m_itemsSorted
;
47 int m_trackedDataObjects
;
49 // holds pointer to the widget being tested
50 wxItemContainer
*m_container
;
53 #endif // _WX_SAMPLE_WIDGETS_ITEMCONTAINER_H_