Files
wxWidgets/wxPython/contrib/activex/wxie/latex/classwxActiveX.tex
Robin Dunn b7c75283f2 Lindsay Mathieson's newest wxActiveX class has been wrapped into a new
extension module called wx.activex.  Lots of demo and lib updates to
go along with it.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26301 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2004-03-23 05:29:50 +00:00

286 lines
14 KiB
TeX

\section{wx\-Active\-X Class Reference}
\label{classwxActiveX}\index{wxActiveX@{wxActiveX}}
{\tt \#include $<$wxactivex.h$>$}
\subsection{Detailed Description}
Main class for embedding a Active\-X control.
Use by itself or derive from it \begin{Desc}
\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}
\begin{Desc}
\item[Usage: ]construct using a Prog\-Id or class id
\footnotesize\begin{verbatim} new wxActiveX(parent, CLSID_WebBrowser, id, pos, size, style, name)
\end{verbatim}\normalsize
\footnotesize\begin{verbatim} new wxActiveX(parent, "ShockwaveFlash.ShockwaveFlash", id, pos, size, style, name)
\end{verbatim}\normalsize
\end{Desc}
\begin{Desc}
\item[Properties]Properties can be set using {\tt {\bf Set\-Prop()}} and set/retrieved using {\tt {\bf Prop()}}
\footnotesize\begin{verbatim} SetProp(name, wxVariant(x))
\end{verbatim}\normalsize
or
\footnotesize\begin{verbatim} wxString Prop("<name>") = x
\end{verbatim}\normalsize
\footnotesize\begin{verbatim} wxString result = Prop("<name>")
\end{verbatim}\normalsize
\footnotesize\begin{verbatim} flash_ctl.Prop("movie") = "file:///movies/test.swf";
\end{verbatim}\normalsize
\footnotesize\begin{verbatim} flash_ctl.Prop("Playing") = false;
\end{verbatim}\normalsize
\footnotesize\begin{verbatim} wxString current_movie = flash_ctl.Prop("movie");
\end{verbatim}\normalsize
\end{Desc}
\begin{Desc}
\item[Methods]Methods are invoked with {\tt {\bf Call\-Method()}}
\footnotesize\begin{verbatim} wxVariant result = CallMethod("<name>", args, nargs = -1)
\end{verbatim}\normalsize
\footnotesize\begin{verbatim} wxVariant args[] = {0L, "file:///e:/dev/wxie/bug-zap.swf"};
wxVariant result = X->CallMethod("LoadMovie", args);
\end{verbatim}\normalsize
\end{Desc}
\begin{Desc}
\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
\footnotesize\begin{verbatim}
BEGIN_EVENT_TABLE(wxIEFrame, wxFrame)
EVT_ACTIVEX_DISPID(ID_MSHTML, DISPID_STATUSTEXTCHANGE, OnMSHTMLStatusTextChangeX)
EVT_ACTIVEX(ID_MSHTML, "BeforeNavigate2", OnMSHTMLBeforeNavigate2X)
EVT_ACTIVEX(ID_MSHTML, "TitleChange", OnMSHTMLTitleChangeX)
EVT_ACTIVEX(ID_MSHTML, "NewWindow2", OnMSHTMLNewWindow2X)
EVT_ACTIVEX(ID_MSHTML, "ProgressChange", OnMSHTMLProgressChangeX)
END_EVENT_TABLE()
\end{verbatim}\normalsize
\end{Desc}
Definition at line 329 of file wxactivex.h.\subsection*{Public Member Functions}
\begin{CompactItemize}
\item
\index{wxActiveX@{wxActiveX}!wxActiveX@{wxActiveX}}\index{wxActiveX@{wxActiveX}!wxActiveX@{wxActiveX}}
{\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}
\begin{CompactList}\small\item\em Create using clsid.\item\end{CompactList}\item
\index{wxActiveX@{wxActiveX}!wxActiveX@{wxActiveX}}\index{wxActiveX@{wxActiveX}!wxActiveX@{wxActiveX}}
{\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}
\begin{CompactList}\small\item\em create using progid.\item\end{CompactList}\item
\index{GetEventCount@{GetEventCount}!wxActiveX@{wxActiveX}}\index{wxActiveX@{wxActiveX}!GetEventCount@{GetEventCount}}
int {\bf Get\-Event\-Count} () const\label{classwxActiveX_a3}
\begin{CompactList}\small\item\em Number of events defined for this control.\item\end{CompactList}\item
const {\bf Func\-X} \& {\bf Get\-Event\-Desc} (int idx) const
\begin{CompactList}\small\item\em returns event description by index.\item\end{CompactList}\item
\index{GetPropCount@{GetPropCount}!wxActiveX@{wxActiveX}}\index{wxActiveX@{wxActiveX}!GetPropCount@{GetPropCount}}
int {\bf Get\-Prop\-Count} () const\label{classwxActiveX_a5}
\begin{CompactList}\small\item\em Number of properties defined for this control.\item\end{CompactList}\item
const {\bf Prop\-X} \& {\bf Get\-Prop\-Desc} (int idx) const
\begin{CompactList}\small\item\em returns property description by index.\item\end{CompactList}\item
const {\bf Prop\-X} \& {\bf Get\-Prop\-Desc} (wx\-String name) const
\begin{CompactList}\small\item\em returns property description by name.\item\end{CompactList}\item
\index{GetMethodCount@{GetMethodCount}!wxActiveX@{wxActiveX}}\index{wxActiveX@{wxActiveX}!GetMethodCount@{GetMethodCount}}
int {\bf Get\-Method\-Count} () const\label{classwxActiveX_a8}
\begin{CompactList}\small\item\em Number of methods defined for this control.\item\end{CompactList}\item
const {\bf Func\-X} \& {\bf Get\-Method\-Desc} (int idx) const
\begin{CompactList}\small\item\em returns method description by name.\item\end{CompactList}\item
const {\bf Func\-X} \& {\bf Get\-Method\-Desc} (wx\-String name) const
\begin{CompactList}\small\item\em returns method description by name.\item\end{CompactList}\item
\index{SetProp@{SetProp}!wxActiveX@{wxActiveX}}\index{wxActiveX@{wxActiveX}!SetProp@{SetProp}}
void {\bf Set\-Prop} (MEMBERID name, VARIANTARG \&value)\label{classwxActiveX_a11}
\begin{CompactList}\small\item\em Set property VARIANTARG value by MEMBERID.\item\end{CompactList}\item
\index{SetProp@{SetProp}!wxActiveX@{wxActiveX}}\index{wxActiveX@{wxActiveX}!SetProp@{SetProp}}
void {\bf Set\-Prop} (const wx\-String \&name, const wx\-Variant \&value)\label{classwxActiveX_a12}
\begin{CompactList}\small\item\em Set property using wx\-Variant by name.\item\end{CompactList}\item
wx\-Property\-Setter {\bf Prop} (wx\-String name)
\begin{CompactList}\small\item\em Generic Get/Set Property by name. Automatically handles most types.\item\end{CompactList}\item
wx\-Variant {\bf Call\-Method} (wx\-String name, wx\-Variant args[$\,$], int nargs=-1)
\begin{CompactList}\small\item\em Call a method of the Active\-X control. Automatically handles most types.\item\end{CompactList}\end{CompactItemize}
\subsection*{Related Functions}
(Note that these are not member functions.)\begin{CompactItemize}
\item
bool {\bf MSWVariant\-To\-Variant} (VARIANTARG \&va, wx\-Variant \&vx)
\begin{CompactList}\small\item\em Convert MSW VARIANTARG to wx\-Variant. Handles basic types, need to add:\begin{itemize}
\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}
\item\end{CompactList}\item
bool {\bf Variant\-To\-MSWVariant} (const wx\-Variant \&vx, VARIANTARG \&va)
\begin{CompactList}\small\item\em Convert wx\-Variant to MSW VARIANTARG. Handles basic types, need to add:\begin{itemize}
\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}
\item\end{CompactList}\end{CompactItemize}
\subsection{Member Function Documentation}
\index{wxActiveX@{wx\-Active\-X}!GetEventDesc@{GetEventDesc}}
\index{GetEventDesc@{GetEventDesc}!wxActiveX@{wx\-Active\-X}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const {\bf Func\-X}\& wx\-Active\-X::Get\-Event\-Desc (int {\em idx}) const}\label{classwxActiveX_a4}
returns event description by index.
throws exception for invalid index \index{wxActiveX@{wx\-Active\-X}!GetPropDesc@{GetPropDesc}}
\index{GetPropDesc@{GetPropDesc}!wxActiveX@{wx\-Active\-X}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const {\bf Prop\-X}\& wx\-Active\-X::Get\-Prop\-Desc (int {\em idx}) const}\label{classwxActiveX_a6}
returns property description by index.
throws exception for invalid index \index{wxActiveX@{wx\-Active\-X}!GetPropDesc@{GetPropDesc}}
\index{GetPropDesc@{GetPropDesc}!wxActiveX@{wx\-Active\-X}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const {\bf Prop\-X}\& wx\-Active\-X::Get\-Prop\-Desc (wx\-String {\em name}) const}\label{classwxActiveX_a7}
returns property description by name.
throws exception for invalid name \index{wxActiveX@{wx\-Active\-X}!GetMethodDesc@{GetMethodDesc}}
\index{GetMethodDesc@{GetMethodDesc}!wxActiveX@{wx\-Active\-X}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const {\bf Func\-X}\& wx\-Active\-X::Get\-Method\-Desc (int {\em idx}) const}\label{classwxActiveX_a9}
returns method description by name.
throws exception for invalid index \index{wxActiveX@{wx\-Active\-X}!GetMethodDesc@{GetMethodDesc}}
\index{GetMethodDesc@{GetMethodDesc}!wxActiveX@{wx\-Active\-X}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const {\bf Func\-X}\& wx\-Active\-X::Get\-Method\-Desc (wx\-String {\em name}) const}\label{classwxActiveX_a10}
returns method description by name.
throws exception for invalid name \index{wxActiveX@{wx\-Active\-X}!Prop@{Prop}}
\index{Prop@{Prop}!wxActiveX@{wx\-Active\-X}}
\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}
Generic Get/Set Property by name. Automatically handles most types.
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em name}]Property name to read/set \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]wx\-Property\-Setter, which has overloads for setting/getting the property \end{Desc}
\begin{Desc}
\item[Usage:]\begin{itemize}
\item Prop(\char`\"{}$<$name$>$\char`\"{}) = $<$value$>$\item var = Prop(\char`\"{}$<$name$>$\char`\"{})\item e.g:\begin{itemize}
\item
\footnotesize\begin{verbatim} flash_ctl.Prop("movie") = "file:///movies/test.swf";
\end{verbatim}\normalsize
\item
\footnotesize\begin{verbatim} flash_ctl.Prop("Playing") = false;
\end{verbatim}\normalsize
\item
\footnotesize\begin{verbatim} wxString current_movie = flash_ctl.Prop("movie");
\end{verbatim}\normalsize
\end{itemize}
\end{itemize}
\end{Desc}
\begin{Desc}
\item[Exceptions:]
\begin{description}
\item[{\em raises}]exception if $<$name$>$ is invalid \end{description}
\end{Desc}
\begin{Desc}
\item[Note:]Have to add a few more type conversions yet ... \end{Desc}
Definition at line 458 of file wxactivex.h.\index{wxActiveX@{wx\-Active\-X}!CallMethod@{CallMethod}}
\index{CallMethod@{CallMethod}!wxActiveX@{wx\-Active\-X}}
\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}
Call a method of the Active\-X control. Automatically handles most types.
\begin{Desc}
\item[Parameters:]
\begin{description}
\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}
\end{Desc}
\begin{Desc}
\item[Returns:]wx\-Variant \end{Desc}
\begin{Desc}
\item[Usage:]\begin{itemize}
\item result = Call\-Method(\char`\"{}$<$name$>$\char`\"{}, args, nargs)\item e.g.\item
\footnotesize\begin{verbatim}
wxVariant args[] = {0L, "file:///e:/dev/wxie/bug-zap.swf"};
wxVariant result = X->CallMethod("LoadMovie", args);
\end{verbatim}\normalsize
\end{itemize}
\end{Desc}
\begin{Desc}
\item[Exceptions:]
\begin{description}
\item[{\em raises}]exception if $<$name$>$ is invalid \end{description}
\end{Desc}
\begin{Desc}
\item[Note:]Since wx\-Variant has built in type conversion, most the std types can be passed easily \end{Desc}
\subsection{Friends And Related Function Documentation}
\index{wxActiveX@{wx\-Active\-X}!MSWVariantToVariant@{MSWVariantToVariant}}
\index{MSWVariantToVariant@{MSWVariantToVariant}!wxActiveX@{wx\-Active\-X}}
\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}
Convert MSW VARIANTARG to wx\-Variant. Handles basic types, need to add:\begin{itemize}
\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}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em va}]VARAIANTARG to convert from \item[{\em vx}]Destination wx\-Variant \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]success/failure (true/false) \end{Desc}
\index{wxActiveX@{wx\-Active\-X}!VariantToMSWVariant@{VariantToMSWVariant}}
\index{VariantToMSWVariant@{VariantToMSWVariant}!wxActiveX@{wx\-Active\-X}}
\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}
Convert wx\-Variant to MSW VARIANTARG. Handles basic types, need to add:\begin{itemize}
\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}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em vx}]wx\-Variant to convert from \item[{\em va}]Destination VARIANTARG \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]success/failure (true/false) \end{Desc}
The documentation for this class was generated from the following file:\begin{CompactItemize}
\item
{\bf wxactivex.h}\end{CompactItemize}