1. the main function for item insertion is now DoInsertItems() which allows for much more efficient addition of many new items at once 2. the items client data management is done entirely in wxItemContainer itself, the derived classes don't have to distinguish between void and object client data 3. many fixes for sorted controls, in particular implemented wxCB_SORT support in wxGTK combobox git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@47730 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
54 lines
1.6 KiB
C++
54 lines
1.6 KiB
C++
/////////////////////////////////////////////////////////////////////////////
|
|
// 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_
|
|
|
|
// for compilers that support precompilation, includes "wx/wx.h".
|
|
#include "wx/wxprec.h"
|
|
|
|
#include "widgets.h"
|
|
|
|
class ItemContainerWidgetsPage : public WidgetsPage
|
|
{
|
|
public:
|
|
ItemContainerWidgetsPage(WidgetsBookCtrl *book,
|
|
wxImageList *image_list,
|
|
char* icon[]);
|
|
virtual ~ItemContainerWidgetsPage();
|
|
|
|
void OnButtonTestItemContainer(wxCommandEvent& event);
|
|
|
|
virtual wxItemContainer* GetContainer() const = 0;
|
|
|
|
private:
|
|
void StartTest(const wxString& label);
|
|
void EndTest(const wxArrayString& result);
|
|
|
|
// 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);
|
|
|
|
wxString DumpContainerData(const wxArrayString& expected) const;
|
|
|
|
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_
|