]>
Commit | Line | Data |
---|---|---|
b7c75283 RD |
1 | \section{wx\-Active\-X Class Reference} |
2 | \label{classwxActiveX}\index{wxActiveX@{wxActiveX}} | |
3 | {\tt \#include $<$wxactivex.h$>$} | |
4 | ||
5 | ||
6 | ||
7 | \subsection{Detailed Description} | |
8 | Main class for embedding a Active\-X control. | |
9 | ||
10 | Use by itself or derive from it \begin{Desc} | |
11 | \item[Note:]The utility program (wxie) can generate a list of events, methods \& properties for a control. First display the control (File$|$Display), then get the type info (Active\-X$|$Get Type Info) - these are copied to the clipboard. Eventually this will be expanded to autogenerate wx\-Windows source files for a control with all methods etc encapsulated. \end{Desc} | |
12 | \begin{Desc} | |
13 | \item[Usage: ]construct using a Prog\-Id or class id | |
14 | ||
15 | \footnotesize\begin{verbatim} new wxActiveX(parent, CLSID_WebBrowser, id, pos, size, style, name) | |
16 | \end{verbatim}\normalsize | |
17 | ||
18 | ||
19 | \footnotesize\begin{verbatim} new wxActiveX(parent, "ShockwaveFlash.ShockwaveFlash", id, pos, size, style, name) | |
20 | \end{verbatim}\normalsize | |
21 | \end{Desc} | |
22 | \begin{Desc} | |
23 | \item[Properties]Properties can be set using {\tt {\bf Set\-Prop()}} and set/retrieved using {\tt {\bf Prop()}} | |
24 | ||
25 | \footnotesize\begin{verbatim} SetProp(name, wxVariant(x)) | |
26 | \end{verbatim}\normalsize | |
27 | or | |
28 | ||
29 | \footnotesize\begin{verbatim} wxString Prop("<name>") = x | |
30 | \end{verbatim}\normalsize | |
31 | ||
32 | ||
33 | \footnotesize\begin{verbatim} wxString result = Prop("<name>") | |
34 | \end{verbatim}\normalsize | |
35 | ||
36 | ||
37 | \footnotesize\begin{verbatim} flash_ctl.Prop("movie") = "file:///movies/test.swf"; | |
38 | \end{verbatim}\normalsize | |
39 | ||
40 | ||
41 | \footnotesize\begin{verbatim} flash_ctl.Prop("Playing") = false; | |
42 | \end{verbatim}\normalsize | |
43 | ||
44 | ||
45 | \footnotesize\begin{verbatim} wxString current_movie = flash_ctl.Prop("movie"); | |
46 | \end{verbatim}\normalsize | |
47 | \end{Desc} | |
48 | \begin{Desc} | |
49 | \item[Methods]Methods are invoked with {\tt {\bf Call\-Method()}} | |
50 | ||
51 | \footnotesize\begin{verbatim} wxVariant result = CallMethod("<name>", args, nargs = -1) | |
52 | \end{verbatim}\normalsize | |
53 | ||
54 | ||
55 | \footnotesize\begin{verbatim} wxVariant args[] = {0L, "file:///e:/dev/wxie/bug-zap.swf"}; | |
56 | wxVariant result = X->CallMethod("LoadMovie", args); | |
57 | \end{verbatim}\normalsize | |
58 | \end{Desc} | |
59 | \begin{Desc} | |
60 | \item[events]respond to events with the {\tt {\bf EVT\_\-ACTIVEX(control\-Id, event\-Name, handler)}} \& {\tt {\bf EVT\_\-ACTIVEX\_\-DISPID(control\-Id, event\-Disp\-Id, handler)}} macros | |
61 | ||
62 | \footnotesize\begin{verbatim} | |
63 | BEGIN_EVENT_TABLE(wxIEFrame, wxFrame) | |
64 | EVT_ACTIVEX_DISPID(ID_MSHTML, DISPID_STATUSTEXTCHANGE, OnMSHTMLStatusTextChangeX) | |
65 | EVT_ACTIVEX(ID_MSHTML, "BeforeNavigate2", OnMSHTMLBeforeNavigate2X) | |
66 | EVT_ACTIVEX(ID_MSHTML, "TitleChange", OnMSHTMLTitleChangeX) | |
67 | EVT_ACTIVEX(ID_MSHTML, "NewWindow2", OnMSHTMLNewWindow2X) | |
68 | EVT_ACTIVEX(ID_MSHTML, "ProgressChange", OnMSHTMLProgressChangeX) | |
69 | END_EVENT_TABLE() | |
70 | \end{verbatim}\normalsize | |
71 | \end{Desc} | |
72 | ||
73 | ||
74 | ||
75 | ||
76 | Definition at line 329 of file wxactivex.h.\subsection*{Public Member Functions} | |
77 | \begin{CompactItemize} | |
78 | \item | |
79 | \index{wxActiveX@{wxActiveX}!wxActiveX@{wxActiveX}}\index{wxActiveX@{wxActiveX}!wxActiveX@{wxActiveX}} | |
80 | {\bf wx\-Active\-X} (wx\-Window $\ast$parent, REFCLSID clsid, wx\-Window\-ID id=-1, const wx\-Point \&pos=wx\-Default\-Position, const wx\-Size \&size=wx\-Default\-Size, long style=0, const wx\-String \&name=wx\-Panel\-Name\-Str)\label{classwxActiveX_a0} | |
81 | ||
82 | \begin{CompactList}\small\item\em Create using clsid.\item\end{CompactList}\item | |
83 | \index{wxActiveX@{wxActiveX}!wxActiveX@{wxActiveX}}\index{wxActiveX@{wxActiveX}!wxActiveX@{wxActiveX}} | |
84 | {\bf wx\-Active\-X} (wx\-Window $\ast$parent, wx\-String prog\-Id, wx\-Window\-ID id=-1, const wx\-Point \&pos=wx\-Default\-Position, const wx\-Size \&size=wx\-Default\-Size, long style=0, const wx\-String \&name=wx\-Panel\-Name\-Str)\label{classwxActiveX_a1} | |
85 | ||
86 | \begin{CompactList}\small\item\em create using progid.\item\end{CompactList}\item | |
87 | \index{GetEventCount@{GetEventCount}!wxActiveX@{wxActiveX}}\index{wxActiveX@{wxActiveX}!GetEventCount@{GetEventCount}} | |
88 | int {\bf Get\-Event\-Count} () const\label{classwxActiveX_a3} | |
89 | ||
90 | \begin{CompactList}\small\item\em Number of events defined for this control.\item\end{CompactList}\item | |
91 | const {\bf Func\-X} \& {\bf Get\-Event\-Desc} (int idx) const | |
92 | \begin{CompactList}\small\item\em returns event description by index.\item\end{CompactList}\item | |
93 | \index{GetPropCount@{GetPropCount}!wxActiveX@{wxActiveX}}\index{wxActiveX@{wxActiveX}!GetPropCount@{GetPropCount}} | |
94 | int {\bf Get\-Prop\-Count} () const\label{classwxActiveX_a5} | |
95 | ||
96 | \begin{CompactList}\small\item\em Number of properties defined for this control.\item\end{CompactList}\item | |
97 | const {\bf Prop\-X} \& {\bf Get\-Prop\-Desc} (int idx) const | |
98 | \begin{CompactList}\small\item\em returns property description by index.\item\end{CompactList}\item | |
99 | const {\bf Prop\-X} \& {\bf Get\-Prop\-Desc} (wx\-String name) const | |
100 | \begin{CompactList}\small\item\em returns property description by name.\item\end{CompactList}\item | |
101 | \index{GetMethodCount@{GetMethodCount}!wxActiveX@{wxActiveX}}\index{wxActiveX@{wxActiveX}!GetMethodCount@{GetMethodCount}} | |
102 | int {\bf Get\-Method\-Count} () const\label{classwxActiveX_a8} | |
103 | ||
104 | \begin{CompactList}\small\item\em Number of methods defined for this control.\item\end{CompactList}\item | |
105 | const {\bf Func\-X} \& {\bf Get\-Method\-Desc} (int idx) const | |
106 | \begin{CompactList}\small\item\em returns method description by name.\item\end{CompactList}\item | |
107 | const {\bf Func\-X} \& {\bf Get\-Method\-Desc} (wx\-String name) const | |
108 | \begin{CompactList}\small\item\em returns method description by name.\item\end{CompactList}\item | |
109 | \index{SetProp@{SetProp}!wxActiveX@{wxActiveX}}\index{wxActiveX@{wxActiveX}!SetProp@{SetProp}} | |
110 | void {\bf Set\-Prop} (MEMBERID name, VARIANTARG \&value)\label{classwxActiveX_a11} | |
111 | ||
112 | \begin{CompactList}\small\item\em Set property VARIANTARG value by MEMBERID.\item\end{CompactList}\item | |
113 | \index{SetProp@{SetProp}!wxActiveX@{wxActiveX}}\index{wxActiveX@{wxActiveX}!SetProp@{SetProp}} | |
114 | void {\bf Set\-Prop} (const wx\-String \&name, const wx\-Variant \&value)\label{classwxActiveX_a12} | |
115 | ||
116 | \begin{CompactList}\small\item\em Set property using wx\-Variant by name.\item\end{CompactList}\item | |
117 | wx\-Property\-Setter {\bf Prop} (wx\-String name) | |
118 | \begin{CompactList}\small\item\em Generic Get/Set Property by name. Automatically handles most types.\item\end{CompactList}\item | |
119 | wx\-Variant {\bf Call\-Method} (wx\-String name, wx\-Variant args[$\,$], int nargs=-1) | |
120 | \begin{CompactList}\small\item\em Call a method of the Active\-X control. Automatically handles most types.\item\end{CompactList}\end{CompactItemize} | |
121 | \subsection*{Related Functions} | |
122 | (Note that these are not member functions.)\begin{CompactItemize} | |
123 | \item | |
124 | bool {\bf MSWVariant\-To\-Variant} (VARIANTARG \&va, wx\-Variant \&vx) | |
125 | \begin{CompactList}\small\item\em Convert MSW VARIANTARG to wx\-Variant. Handles basic types, need to add:\begin{itemize} | |
126 | \item VT\_\-ARRAY $|$ VT\_\-$\ast$\item better support for VT\_\-UNKNOWN (currently treated as void $\ast$)\item better support for VT\_\-DISPATCH (currently treated as void $\ast$).\end{itemize} | |
127 | \item\end{CompactList}\item | |
128 | bool {\bf Variant\-To\-MSWVariant} (const wx\-Variant \&vx, VARIANTARG \&va) | |
129 | \begin{CompactList}\small\item\em Convert wx\-Variant to MSW VARIANTARG. Handles basic types, need to add:\begin{itemize} | |
130 | \item VT\_\-ARRAY $|$ VT\_\-$\ast$\item better support for VT\_\-UNKNOWN (currently treated as void $\ast$)\item better support for VT\_\-DISPATCH (currently treated as void $\ast$).\end{itemize} | |
131 | \item\end{CompactList}\end{CompactItemize} | |
132 | ||
133 | ||
134 | \subsection{Member Function Documentation} | |
135 | \index{wxActiveX@{wx\-Active\-X}!GetEventDesc@{GetEventDesc}} | |
136 | \index{GetEventDesc@{GetEventDesc}!wxActiveX@{wx\-Active\-X}} | |
137 | \subsubsection{\setlength{\rightskip}{0pt plus 5cm}const {\bf Func\-X}\& wx\-Active\-X::Get\-Event\-Desc (int {\em idx}) const}\label{classwxActiveX_a4} | |
138 | ||
139 | ||
140 | returns event description by index. | |
141 | ||
142 | throws exception for invalid index \index{wxActiveX@{wx\-Active\-X}!GetPropDesc@{GetPropDesc}} | |
143 | \index{GetPropDesc@{GetPropDesc}!wxActiveX@{wx\-Active\-X}} | |
144 | \subsubsection{\setlength{\rightskip}{0pt plus 5cm}const {\bf Prop\-X}\& wx\-Active\-X::Get\-Prop\-Desc (int {\em idx}) const}\label{classwxActiveX_a6} | |
145 | ||
146 | ||
147 | returns property description by index. | |
148 | ||
149 | throws exception for invalid index \index{wxActiveX@{wx\-Active\-X}!GetPropDesc@{GetPropDesc}} | |
150 | \index{GetPropDesc@{GetPropDesc}!wxActiveX@{wx\-Active\-X}} | |
151 | \subsubsection{\setlength{\rightskip}{0pt plus 5cm}const {\bf Prop\-X}\& wx\-Active\-X::Get\-Prop\-Desc (wx\-String {\em name}) const}\label{classwxActiveX_a7} | |
152 | ||
153 | ||
154 | returns property description by name. | |
155 | ||
156 | throws exception for invalid name \index{wxActiveX@{wx\-Active\-X}!GetMethodDesc@{GetMethodDesc}} | |
157 | \index{GetMethodDesc@{GetMethodDesc}!wxActiveX@{wx\-Active\-X}} | |
158 | \subsubsection{\setlength{\rightskip}{0pt plus 5cm}const {\bf Func\-X}\& wx\-Active\-X::Get\-Method\-Desc (int {\em idx}) const}\label{classwxActiveX_a9} | |
159 | ||
160 | ||
161 | returns method description by name. | |
162 | ||
163 | throws exception for invalid index \index{wxActiveX@{wx\-Active\-X}!GetMethodDesc@{GetMethodDesc}} | |
164 | \index{GetMethodDesc@{GetMethodDesc}!wxActiveX@{wx\-Active\-X}} | |
165 | \subsubsection{\setlength{\rightskip}{0pt plus 5cm}const {\bf Func\-X}\& wx\-Active\-X::Get\-Method\-Desc (wx\-String {\em name}) const}\label{classwxActiveX_a10} | |
166 | ||
167 | ||
168 | returns method description by name. | |
169 | ||
170 | throws exception for invalid name \index{wxActiveX@{wx\-Active\-X}!Prop@{Prop}} | |
171 | \index{Prop@{Prop}!wxActiveX@{wx\-Active\-X}} | |
172 | \subsubsection{\setlength{\rightskip}{0pt plus 5cm}wx\-Property\-Setter wx\-Active\-X::Prop (wx\-String {\em name})\hspace{0.3cm}{\tt [inline]}}\label{classwxActiveX_a13} | |
173 | ||
174 | ||
175 | Generic Get/Set Property by name. Automatically handles most types. | |
176 | ||
177 | \begin{Desc} | |
178 | \item[Parameters:] | |
179 | \begin{description} | |
180 | \item[{\em name}]Property name to read/set \end{description} | |
181 | \end{Desc} | |
182 | \begin{Desc} | |
183 | \item[Returns:]wx\-Property\-Setter, which has overloads for setting/getting the property \end{Desc} | |
184 | ||
185 | ||
186 | \begin{Desc} | |
187 | \item[Usage:]\begin{itemize} | |
188 | \item Prop(\char`\"{}$<$name$>$\char`\"{}) = $<$value$>$\item var = Prop(\char`\"{}$<$name$>$\char`\"{})\item e.g:\begin{itemize} | |
189 | \item | |
190 | ||
191 | \footnotesize\begin{verbatim} flash_ctl.Prop("movie") = "file:///movies/test.swf"; | |
192 | \end{verbatim}\normalsize | |
193 | \item | |
194 | ||
195 | \footnotesize\begin{verbatim} flash_ctl.Prop("Playing") = false; | |
196 | \end{verbatim}\normalsize | |
197 | \item | |
198 | ||
199 | \footnotesize\begin{verbatim} wxString current_movie = flash_ctl.Prop("movie"); | |
200 | \end{verbatim}\normalsize | |
201 | \end{itemize} | |
202 | \end{itemize} | |
203 | \end{Desc} | |
204 | \begin{Desc} | |
205 | \item[Exceptions:] | |
206 | \begin{description} | |
207 | \item[{\em raises}]exception if $<$name$>$ is invalid \end{description} | |
208 | \end{Desc} | |
209 | \begin{Desc} | |
210 | \item[Note:]Have to add a few more type conversions yet ... \end{Desc} | |
211 | ||
212 | ||
213 | Definition at line 458 of file wxactivex.h.\index{wxActiveX@{wx\-Active\-X}!CallMethod@{CallMethod}} | |
214 | \index{CallMethod@{CallMethod}!wxActiveX@{wx\-Active\-X}} | |
215 | \subsubsection{\setlength{\rightskip}{0pt plus 5cm}wx\-Variant wx\-Active\-X::Call\-Method (wx\-String {\em name}, wx\-Variant {\em args}[$\,$], int {\em nargs} = -1)}\label{classwxActiveX_a26} | |
216 | ||
217 | ||
218 | Call a method of the Active\-X control. Automatically handles most types. | |
219 | ||
220 | \begin{Desc} | |
221 | \item[Parameters:] | |
222 | \begin{description} | |
223 | \item[{\em name}]name of method to call \item[{\em args}]array of wx\-Variant's, defaults to NULL (no args) \item[{\em nargs}]number of arguments passed via args. Defaults to actual number of args for the method \end{description} | |
224 | \end{Desc} | |
225 | \begin{Desc} | |
226 | \item[Returns:]wx\-Variant \end{Desc} | |
227 | ||
228 | ||
229 | \begin{Desc} | |
230 | \item[Usage:]\begin{itemize} | |
231 | \item result = Call\-Method(\char`\"{}$<$name$>$\char`\"{}, args, nargs)\item e.g.\item | |
232 | ||
233 | \footnotesize\begin{verbatim} | |
234 | wxVariant args[] = {0L, "file:///e:/dev/wxie/bug-zap.swf"}; | |
235 | wxVariant result = X->CallMethod("LoadMovie", args); | |
236 | \end{verbatim}\normalsize | |
237 | \end{itemize} | |
238 | \end{Desc} | |
239 | \begin{Desc} | |
240 | \item[Exceptions:] | |
241 | \begin{description} | |
242 | \item[{\em raises}]exception if $<$name$>$ is invalid \end{description} | |
243 | \end{Desc} | |
244 | \begin{Desc} | |
245 | \item[Note:]Since wx\-Variant has built in type conversion, most the std types can be passed easily \end{Desc} | |
246 | ||
247 | ||
248 | \subsection{Friends And Related Function Documentation} | |
249 | \index{wxActiveX@{wx\-Active\-X}!MSWVariantToVariant@{MSWVariantToVariant}} | |
250 | \index{MSWVariantToVariant@{MSWVariantToVariant}!wxActiveX@{wx\-Active\-X}} | |
251 | \subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool MSWVariant\-To\-Variant (VARIANTARG \& {\em va}, wx\-Variant \& {\em vx})\hspace{0.3cm}{\tt [related]}}\label{classwxActiveX_k0} | |
252 | ||
253 | ||
254 | Convert MSW VARIANTARG to wx\-Variant. Handles basic types, need to add:\begin{itemize} | |
255 | \item VT\_\-ARRAY $|$ VT\_\-$\ast$\item better support for VT\_\-UNKNOWN (currently treated as void $\ast$)\item better support for VT\_\-DISPATCH (currently treated as void $\ast$).\end{itemize} | |
256 | ||
257 | ||
258 | \begin{Desc} | |
259 | \item[Parameters:] | |
260 | \begin{description} | |
261 | \item[{\em va}]VARAIANTARG to convert from \item[{\em vx}]Destination wx\-Variant \end{description} | |
262 | \end{Desc} | |
263 | \begin{Desc} | |
264 | \item[Returns:]success/failure (true/false) \end{Desc} | |
265 | \index{wxActiveX@{wx\-Active\-X}!VariantToMSWVariant@{VariantToMSWVariant}} | |
266 | \index{VariantToMSWVariant@{VariantToMSWVariant}!wxActiveX@{wx\-Active\-X}} | |
267 | \subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool Variant\-To\-MSWVariant (const wx\-Variant \& {\em vx}, VARIANTARG \& {\em va})\hspace{0.3cm}{\tt [related]}}\label{classwxActiveX_k1} | |
268 | ||
269 | ||
270 | Convert wx\-Variant to MSW VARIANTARG. Handles basic types, need to add:\begin{itemize} | |
271 | \item VT\_\-ARRAY $|$ VT\_\-$\ast$\item better support for VT\_\-UNKNOWN (currently treated as void $\ast$)\item better support for VT\_\-DISPATCH (currently treated as void $\ast$).\end{itemize} | |
272 | ||
273 | ||
274 | \begin{Desc} | |
275 | \item[Parameters:] | |
276 | \begin{description} | |
277 | \item[{\em vx}]wx\-Variant to convert from \item[{\em va}]Destination VARIANTARG \end{description} | |
278 | \end{Desc} | |
279 | \begin{Desc} | |
280 | \item[Returns:]success/failure (true/false) \end{Desc} | |
281 | ||
282 | ||
283 | The documentation for this class was generated from the following file:\begin{CompactItemize} | |
284 | \item | |
285 | {\bf wxactivex.h}\end{CompactItemize} |