]> git.saurik.com Git - wxWidgets.git/blame - samples/widgets/itemcontainer.h
call GetCache() from a global object ctor to ensure that it is done before any thread...
[wxWidgets.git] / samples / widgets / itemcontainer.h
CommitLineData
a236aa20
VZ
1/////////////////////////////////////////////////////////////////////////////
2// Program: wxWidgets Widgets Sample
3// Name: itemcontainer.h
4// Purpose: Part of the widgets sample showing wxComboBox
5// Created: 20.07.07
6// Id: $Id$
7// License: wxWindows license
8/////////////////////////////////////////////////////////////////////////////
9
10#ifndef _WX_SAMPLE_WIDGETS_ITEMCONTAINER_H_
11#define _WX_SAMPLE_WIDGETS_ITEMCONTAINER_H_
12
a236aa20
VZ
13#include "widgets.h"
14
c1daf252
VZ
15// define a common base class for sorted and normal string arrays
16#if wxUSE_STL
17 typedef wxBaseArrayStringBase wxMaybeSortedArrayString;
18#else
19 // in non-STL build wxSortedArrayString derives from wxArrayString
20 typedef wxArrayString wxMaybeSortedArrayString;
21#endif
22
a236aa20
VZ
23class ItemContainerWidgetsPage : public WidgetsPage
24{
25public:
26 ItemContainerWidgetsPage(WidgetsBookCtrl *book,
27 wxImageList *image_list,
747d7d7c 28 const char *const icon[]);
a236aa20
VZ
29 virtual ~ItemContainerWidgetsPage();
30
31 void OnButtonTestItemContainer(wxCommandEvent& event);
32
33 virtual wxItemContainer* GetContainer() const = 0;
34
35private:
36 void StartTest(const wxString& label);
c1daf252 37 void EndTest(const wxMaybeSortedArrayString& result);
a236aa20
VZ
38
39 // Track client data in wxItemContainer instances
40 wxClientData* CreateClientData(int value);
41 void StartTrackingData();
42 void StopTrackingData();
43 friend class TrackedClientData;
44
45 bool VerifyAllClientDataDestroyed();
46 bool VerifyClientData(wxUIntPtr i, const wxString& str);
47
c1daf252 48 wxString DumpContainerData(const wxMaybeSortedArrayString& expected) const;
a236aa20
VZ
49
50 wxArrayString m_items;
51 wxSortedArrayString m_itemsSorted;
52 int m_trackedDataObjects;
53
54 // holds pointer to the widget being tested
55 wxItemContainer *m_container;
56};
57
58#endif // _WX_SAMPLE_WIDGETS_ITEMCONTAINER_H_