]> git.saurik.com Git - wxWidgets.git/blame - interface/wx/clntdata.h
Add test for absence of events from wxSpinCtrlDouble ctor.
[wxWidgets.git] / interface / wx / clntdata.h
CommitLineData
23324ae1
FM
1/////////////////////////////////////////////////////////////////////////////
2// Name: clntdata.h
d18d9f60 3// Purpose: interface of wxClientData[Container] and wxStringClientData
23324ae1 4// Author: wxWidgets team
526954c5 5// Licence: wxWindows licence
23324ae1
FM
6/////////////////////////////////////////////////////////////////////////////
7
8/**
9 @class wxClientDataContainer
7c913512 10
163bd4f7
FM
11 This class is a mixin that provides storage and management of "client data".
12 This data can either be of type void - in which case the data
d18d9f60
BP
13 @e container does not take care of freeing the data again or it is of
14 type wxClientData or its derivatives. In that case the container will free
15 the memory itself later. Note that you @e must not assign both void data
16 and data derived from the wxClientData class to a container.
7c913512 17
d18d9f60
BP
18 @note This functionality is currently duplicated in wxEvtHandler in order
19 to avoid having more than one vtable in that class hierarchy.
7c913512 20
23324ae1 21 @library{wxbase}
d18d9f60 22 @category{containers}
7c913512 23
e54c96f1 24 @see wxEvtHandler, wxClientData
23324ae1 25*/
7c913512 26class wxClientDataContainer
23324ae1
FM
27{
28public:
29 /**
d18d9f60 30 Default constructor.
23324ae1
FM
31 */
32 wxClientDataContainer();
33
34 /**
d18d9f60 35 Destructor.
23324ae1 36 */
b7e94bd7 37 virtual ~wxClientDataContainer();
23324ae1
FM
38
39 /**
40 Get the untyped client data.
41 */
328f5751 42 void* GetClientData() const;
23324ae1
FM
43
44 /**
45 Get a pointer to the client data object.
46 */
328f5751 47 wxClientData* GetClientObject() const;
23324ae1
FM
48
49 /**
50 Set the untyped client data.
51 */
52 void SetClientData(void* data);
53
54 /**
55 Set the client data object. Any previous object will be deleted.
56 */
57 void SetClientObject(wxClientData* data);
58};
59
60
e54c96f1 61
23324ae1
FM
62/**
63 @class wxClientData
7c913512 64
d18d9f60
BP
65 All classes deriving from wxEvtHandler (such as all controls and wxApp) can
66 hold arbitrary data which is here referred to as "client data". This is
67 useful e.g. for scripting languages which need to handle shadow objects for
68 most of wxWidgets' classes and which store a handle to such a shadow class
69 as client data in that class. This data can either be of type void - in
70 which case the data @e container does not take care of freeing the data
71 again or it is of type wxClientData or its derivatives. In that case the
72 container (e.g. a control) will free the memory itself later. Note that you
73 @e must not assign both void data and data derived from the wxClientData
74 class to a container.
75
76 Some controls can hold various items and these controls can additionally
77 hold client data for each item. This is the case for wxChoice, wxComboBox
78 and wxListBox. wxTreeCtrl has a specialized class wxTreeItemData for each
79 item in the tree.
80
81 If you want to add client data to your own classes, you may use the mix-in
82 class wxClientDataContainer.
7c913512 83
23324ae1 84 @library{wxbase}
d18d9f60 85 @category{containers}
7c913512 86
d18d9f60
BP
87 @see wxEvtHandler, wxTreeItemData, wxStringClientData,
88 wxClientDataContainer
23324ae1 89*/
7c913512 90class wxClientData
23324ae1
FM
91{
92public:
93 /**
94 Constructor.
95 */
96 wxClientData();
97
98 /**
99 Virtual destructor.
100 */
b7e94bd7 101 virtual ~wxClientData();
23324ae1
FM
102};
103
104
e54c96f1 105
23324ae1
FM
106/**
107 @class wxStringClientData
7c913512 108
23324ae1 109 Predefined client data class for holding a string.
7c913512 110
23324ae1 111 @library{wxbase}
d18d9f60 112 @category{containers}
23324ae1
FM
113*/
114class wxStringClientData : public wxClientData
115{
116public:
23324ae1 117 /**
d18d9f60 118 Default constructor.
23324ae1
FM
119 */
120 wxStringClientData();
d18d9f60
BP
121
122 /**
123 Create client data with string.
124 */
7c913512 125 wxStringClientData(const wxString& data);
23324ae1
FM
126
127 /**
128 Get string client data.
129 */
4707b84c 130 const wxString& GetData() const;
23324ae1
FM
131
132 /**
133 Set string client data.
134 */
135 void SetData(const wxString& data);
136};
e54c96f1 137