1 \section{\class{wxClientData
}}\label{wxclientdata
}
3 All classes deriving from
\helpref{wxEvtHandler
}{wxevthandler
}
4 (such as all controls and
\helpref{wxApp
}{wxapp
})
5 can hold arbitrary data which is here referred to as "client data".
6 This is useful e.g. for scripting languages which need to handle
7 shadow objects for most of wxWidgets' classes and which store
8 a handle to such a shadow class as client data in that class.
9 This data can either be of type void - in which case the data
10 {\it container
} does not take care of freeing the data again
11 or it is of type wxClientData or its derivatives. In that case the
12 container (e.g. a control) will free the memory itself later.
13 Note that you
{\it must not
} assign both void data and data
14 derived from the wxClientData class to a container.
16 Some controls can hold various items and these controls can
17 additionally hold client data for each item. This is the case for
18 \helpref{wxChoice
}{wxchoice
},
\helpref{wxComboBox
}{wxcombobox
}
19 and
\helpref{wxListBox
}{wxlistbox
}.
\helpref{wxTreeCtrl
}{wxtreectrl
}
20 has a specialized class
\helpref{wxTreeItemData
}{wxtreeitemdata
}
21 for each item in the tree.
23 If you want to add client data to your own classes, you may
24 use the mix-in class
\helpref{wxClientDataContainer
}{wxclientdatacontainer
}.
26 \wxheading{Include files
}
32 \helpref{wxBase
}{librarieslist
}
36 \helpref{wxEvtHandler
}{wxevthandler
},
\helpref{wxTreeItemData
}{wxtreeitemdata
},
37 \helpref{wxStringClientData
}{wxstringclientdata
},
\helpref{wxClientDataContainer
}{wxclientdatacontainer
}
39 \latexignore{\rtfignore{\wxheading{Members
}}}
42 \membersection{wxClientData::wxClientData
}\label{wxclientdatawxclientdata
}
44 \func{}{wxClientData
}{\void}
48 \membersection{wxClientData::
\destruct{wxClientData
}}\label{wxclientdatadtor
}
50 \func{}{\destruct{wxClientData
}}{\void}
54 \section{\class{wxClientDataContainer
}}\label{wxclientdatacontainer
}
56 This class is a mixin that provides storage and management of "client
57 data." This data can either be of type void - in which case the data
58 {\it container
} does not take care of freeing the data again
59 or it is of type wxClientData or its derivatives. In that case the
60 container will free the memory itself later.
61 Note that you
{\it must not
} assign both void data and data
62 derived from the wxClientData class to a container.
64 NOTE: This functionality is currently duplicated in wxEvtHandler in
65 order to avoid having more than one vtable in that class hierarchy.
69 \helpref{wxEvtHandler
}{wxevthandler
},
\helpref{wxClientData
}{wxclientdata
}
71 \wxheading{Derived from
}
75 \wxheading{Include files
}
81 \helpref{wxBase
}{librarieslist
}
83 \wxheading{Data structures
}
85 \latexignore{\rtfignore{\wxheading{Members
}}}
88 \membersection{wxClientDataContainer::wxClientDataContainer
}\label{wxclientdatacontainerwxclientdatacontainer
}
90 \func{}{wxClientDataContainer
}{\void}
93 \membersection{wxClientDataContainer::
\destruct{wxClientDataContainer
}}\label{wxclientdatacontainerdtor
}
95 \func{}{\destruct{wxClientDataContainer
}}{\void}
98 \membersection{wxClientDataContainer::GetClientData
}\label{wxclientdatacontainergetclientdata
}
100 \constfunc{void*
}{GetClientData
}{\void}
102 Get the untyped client data.
104 \membersection{wxClientDataContainer::GetClientObject
}\label{wxclientdatacontainergetclientobject
}
106 \constfunc{wxClientData*
}{GetClientObject
}{\void}
108 Get a pointer to the client data object.
110 \membersection{wxClientDataContainer::SetClientData
}\label{wxclientdatacontainersetclientdata
}
112 \func{void
}{SetClientData
}{\param{void*
}{data
}}
114 Set the untyped client data.
116 \membersection{wxClientDataContainer::SetClientObject
}\label{wxclientdatacontainersetclientobject
}
118 \func{void
}{SetClientObject
}{\param{wxClientData*
}{data
}}
120 Set the client data object. Any previous object will be deleted.