X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/dd72e7678d1f4fd36c4753373b2b22b59491f5a7..e4431849b4f2097edf0e01c5d50bf0ed947befa9:/interface/wx/msw/ole/activex.h diff --git a/interface/wx/msw/ole/activex.h b/interface/wx/msw/ole/activex.h index 579522e088..d69892ba83 100644 --- a/interface/wx/msw/ole/activex.h +++ b/interface/wx/msw/ole/activex.h @@ -9,37 +9,44 @@ /** @class wxActiveXEvent - An event class for handling activex events passed from wxActiveXContainer. + An event class for handling ActiveX events passed from wxActiveXContainer. ActiveX events are basically a function call with the parameters passed through an array of wxVariants along with a return value that is a wxVariant itself. What type the parameters or return value are depends on the context (i.e. what the .idl specifies). - Note that unlike the third party wxActiveX function names are not supported. - @beginEventTable{wxActiveXEvent} @event{EVT_ACTIVEX(func)} - Sent when the activex control hosted by wxActiveXContainer recieves an - activex event. + Sent when the ActiveX control hosted by wxActiveXContainer recieves an + ActiveX event. @endEventTable + ActiveX event parameters can get extremely complex and may be beyond the + abilities of wxVariant. If 'operator[]' fails, prints an error messages or + crashes the application, event handlers should use GetNativeParameters() + instead to obtain the original event information. + Calls to operator[] and GetNativeParmeters() can be mixed. It is valid + to handle some parameters of an event with operator[] and others directly + through GetNativeParameters(). It is \b not valid however to manipulate + the same parameter using both approaches at the same time. + @onlyfor{wxmsw} - @library{wxbase} + @library{wxcore} @category{events} */ class wxActiveXEvent : public wxCommandEvent { public: /** - Returns the dispatch id of this activex event. + Returns the dispatch id of this ActiveX event. This is the numeric value from the .idl file specified by the id(). */ DISPID GetDispatchId(int idx) const; /** - Obtains the number of parameters passed through the activex event. + Obtains the number of parameters passed through the ActiveX event. */ size_t ParamCount() const; @@ -57,6 +64,16 @@ public: Obtains the actual parameter value specified by idx. */ wxVariant operator[](size_t idx); + + /** + Obtain the original MSW parameters for the event. + Event handlers can use this information to handle complex event parameters + that are beyond the scope of wxVariant. + The information returned here is the information passed to the original + 'Invoke' method call. + \return a pointer to a struct containing the original MSW event parameters + */ + wxActiveXEventNativeMSW *GetNativeParameters() const; }; @@ -64,19 +81,19 @@ public: /** @class wxActiveXContainer - wxActiveXContainer is a host for an activex control on Windows (and as such + wxActiveXContainer is a host for an ActiveX control on Windows (and as such is a platform-specific class). - Note that the HWND that the class contains is the actual HWND of the activeX + Note that the HWND that the class contains is the actual HWND of the ActiveX control so using dynamic events and connecting to wxEVT_SIZE, for example, - will recieve the actual size message sent to the control. + will receive the actual size message sent to the control. It is somewhat similar to the ATL class CAxWindow in operation. - The size of the activex control's content is generally gauranteed to be that + The size of the ActiveX control's content is generally guaranteed to be that of the client size of the parent of this wxActiveXContainer. - You can also process activeX events through wxActiveXEvent. + You can also process ActiveX events through wxActiveXEvent. @section activexcontainer_example Example @@ -160,9 +177,9 @@ public: virtual bool Load(const wxString& fileName) { - if(m_PDF.CallMethod(wxT("LoadFile"), fileName).GetBool()) + if(m_PDF.CallMethod("LoadFile", fileName).GetBool()) { - m_PDF.CallMethod(wxT("setCurrentPage"), wxVariant((long)0)); + m_PDF.CallMethod("setCurrentPage", wxVariant((long)0)); NotifyMovieLoaded(); // initial refresh wxSizeEvent event; m_pAX->OnSize(event); @@ -173,7 +190,7 @@ public: } virtual bool Load(const wxURI& location) { - return m_PDF.CallMethod(wxT("LoadFile"), location.BuildUnescapedURI()).GetBool(); + return m_PDF.CallMethod("LoadFile", location.BuildUnescapedURI()).GetBool(); } virtual bool Load(const wxURI& WXUNUSED(location), const wxURI& WXUNUSED(proxy)) @@ -188,7 +205,7 @@ public: virtual bool SetPosition(wxLongLong where) { - m_PDF.CallMethod(wxT("setCurrentPage"), wxVariant((long)where.GetValue())); + m_PDF.CallMethod("setCurrentPage", wxVariant((long)where.GetValue())); return true; } virtual wxLongLong GetPosition() @@ -231,13 +248,13 @@ public: { if(flags) { - m_PDF.CallMethod(wxT("setShowToolbar"), true); - m_PDF.CallMethod(wxT("setShowScrollbars"), true); + m_PDF.CallMethod("setShowToolbar", true); + m_PDF.CallMethod("setShowScrollbars", true); } else { - m_PDF.CallMethod(wxT("setShowToolbar"), false); - m_PDF.CallMethod(wxT("setShowScrollbars"), false); + m_PDF.CallMethod("setShowToolbar", false); + m_PDF.CallMethod("setShowScrollbars", false); } return true; @@ -253,31 +270,31 @@ public: Put this in one of your existant source files and then create a wxMediaCtrl with //[this] is the parent window, "myfile.pdf" is the PDF file to open - wxMediaCtrl* mymediactrl = new wxMediaCtrl(this, wxT("myfile.pdf"), wxID_ANY, + wxMediaCtrl* mymediactrl = new wxMediaCtrl(this, "myfile.pdf", wxID_ANY, wxDefaultPosition, wxSize(300,300), - 0, wxT("wxPDFMediaBackend")); + 0, "wxPDFMediaBackend"); @endcode @onlyfor{wxmsw} @library{wxbase} - @category{misc,ipc} + @category{ctrl,ipc} - @see wxActiveXEvent + @see wxActiveXEvent, @ref page_samples_flash */ class wxActiveXContainer : public wxControl { public: /** - Creates this activex container. + Creates this ActiveX container. @param parent parent of this control. Must not be @NULL. @param iid - COM IID of pUnk to query. Must be a valid interface to an activex control. + COM IID of pUnk to query. Must be a valid interface to an ActiveX control. @param pUnk - Interface of activex control. + Interface of ActiveX control. */ wxActiveXContainer(wxWindow* parent, REFIID iid, IUnknown* pUnk); };