2007-07-26 09:54:14 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Program: wxWidgets Widgets Sample
|
|
|
|
// Name: itemcontainer.h
|
|
|
|
// Purpose: Part of the widgets sample showing wxComboBox
|
|
|
|
// Created: 20.07.07
|
|
|
|
// Id: $Id$
|
|
|
|
// License: wxWindows license
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_SAMPLE_WIDGETS_ITEMCONTAINER_H_
|
|
|
|
#define _WX_SAMPLE_WIDGETS_ITEMCONTAINER_H_
|
|
|
|
|
|
|
|
#include "widgets.h"
|
|
|
|
|
2007-07-28 09:12:46 -04:00
|
|
|
// define a common base class for sorted and normal string arrays
|
|
|
|
#if wxUSE_STL
|
|
|
|
typedef wxBaseArrayStringBase wxMaybeSortedArrayString;
|
|
|
|
#else
|
|
|
|
// in non-STL build wxSortedArrayString derives from wxArrayString
|
|
|
|
typedef wxArrayString wxMaybeSortedArrayString;
|
|
|
|
#endif
|
|
|
|
|
2007-07-26 09:54:14 -04:00
|
|
|
class ItemContainerWidgetsPage : public WidgetsPage
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
ItemContainerWidgetsPage(WidgetsBookCtrl *book,
|
|
|
|
wxImageList *image_list,
|
2008-01-15 20:39:44 -05:00
|
|
|
const char *const icon[]);
|
2007-07-26 09:54:14 -04:00
|
|
|
virtual ~ItemContainerWidgetsPage();
|
|
|
|
|
|
|
|
void OnButtonTestItemContainer(wxCommandEvent& event);
|
|
|
|
|
|
|
|
virtual wxItemContainer* GetContainer() const = 0;
|
|
|
|
|
|
|
|
private:
|
|
|
|
void StartTest(const wxString& label);
|
2007-07-28 09:12:46 -04:00
|
|
|
void EndTest(const wxMaybeSortedArrayString& result);
|
2007-07-26 09:54:14 -04:00
|
|
|
|
|
|
|
// Track client data in wxItemContainer instances
|
|
|
|
wxClientData* CreateClientData(int value);
|
|
|
|
void StartTrackingData();
|
|
|
|
void StopTrackingData();
|
|
|
|
friend class TrackedClientData;
|
|
|
|
|
|
|
|
bool VerifyAllClientDataDestroyed();
|
|
|
|
bool VerifyClientData(wxUIntPtr i, const wxString& str);
|
|
|
|
|
2007-07-28 09:12:46 -04:00
|
|
|
wxString DumpContainerData(const wxMaybeSortedArrayString& expected) const;
|
2007-07-26 09:54:14 -04:00
|
|
|
|
|
|
|
wxArrayString m_items;
|
|
|
|
wxSortedArrayString m_itemsSorted;
|
|
|
|
int m_trackedDataObjects;
|
|
|
|
|
|
|
|
// holds pointer to the widget being tested
|
|
|
|
wxItemContainer *m_container;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // _WX_SAMPLE_WIDGETS_ITEMCONTAINER_H_
|