]>
git.saurik.com Git - wxWidgets.git/blob - interface/clntdata.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxClientData[Container] and wxStringClientData
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
10 @class wxClientDataContainer
13 This class is a mixin that provides storage and management of "client
14 data." This data can either be of type void - in which case the data
15 @e container does not take care of freeing the data again or it is of
16 type wxClientData or its derivatives. In that case the container will free
17 the memory itself later. Note that you @e must not assign both void data
18 and data derived from the wxClientData class to a container.
20 @note This functionality is currently duplicated in wxEvtHandler in order
21 to avoid having more than one vtable in that class hierarchy.
26 @see wxEvtHandler, wxClientData
28 class wxClientDataContainer
34 wxClientDataContainer();
39 ~wxClientDataContainer();
42 Get the untyped client data.
44 void* GetClientData() const;
47 Get a pointer to the client data object.
49 wxClientData
* GetClientObject() const;
52 Set the untyped client data.
54 void SetClientData(void* data
);
57 Set the client data object. Any previous object will be deleted.
59 void SetClientObject(wxClientData
* data
);
68 All classes deriving from wxEvtHandler (such as all controls and wxApp) can
69 hold arbitrary data which is here referred to as "client data". This is
70 useful e.g. for scripting languages which need to handle shadow objects for
71 most of wxWidgets' classes and which store a handle to such a shadow class
72 as client data in that class. This data can either be of type void - in
73 which case the data @e container does not take care of freeing the data
74 again or it is of type wxClientData or its derivatives. In that case the
75 container (e.g. a control) will free the memory itself later. Note that you
76 @e must not assign both void data and data derived from the wxClientData
79 Some controls can hold various items and these controls can additionally
80 hold client data for each item. This is the case for wxChoice, wxComboBox
81 and wxListBox. wxTreeCtrl has a specialized class wxTreeItemData for each
84 If you want to add client data to your own classes, you may use the mix-in
85 class wxClientDataContainer.
90 @see wxEvtHandler, wxTreeItemData, wxStringClientData,
110 @class wxStringClientData
111 @wxheader{clntdata.h}
113 Predefined client data class for holding a string.
116 @category{containers}
118 class wxStringClientData
: public wxClientData
124 wxStringClientData();
127 Create client data with string.
129 wxStringClientData(const wxString
& data
);
132 Get string client data.
134 const wxString
GetData() const;
137 Set string client data.
139 void SetData(const wxString
& data
);