X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/213b5041fe4577ddd8df9f4e2f699e080296b5f5..95ad763a77ad999bc302a7fead376d091baae2c2:/interface/wx/msw/ole/activex.h diff --git a/interface/wx/msw/ole/activex.h b/interface/wx/msw/ole/activex.h index 74b7d22a1b..d69892ba83 100644 --- a/interface/wx/msw/ole/activex.h +++ b/interface/wx/msw/ole/activex.h @@ -22,6 +22,15 @@ 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{wxcore} @@ -55,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; }; @@ -158,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); @@ -171,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)) @@ -186,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() @@ -229,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; @@ -251,18 +270,18 @@ 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, @ref page_samples_flash Flash sample + @see wxActiveXEvent, @ref page_samples_flash */ class wxActiveXContainer : public wxControl {