X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d3b55102350d3b1d85bef3e4a4ab8998bc487183..35f9639d83631e1f6c8afee75203b707ab307388:/wxPython/contrib/iewin/wxactivex.h?ds=sidebyside diff --git a/wxPython/contrib/iewin/wxactivex.h b/wxPython/contrib/iewin/wxactivex.h index f62ac9830e..4c88a1d3f3 100644 --- a/wxPython/contrib/iewin/wxactivex.h +++ b/wxPython/contrib/iewin/wxactivex.h @@ -261,6 +261,36 @@ class wxOleInit class wxActiveX : public wxWindow { public: + //////////////////////////////////////// + // type stuff + class ParamX // refer to ELEMDESC, IDLDESC in MSDN + { + public: + USHORT flags; + bool isPtr, isSafeArray; + VARTYPE vt; + wxString name; + + inline bool IsIn() const {return (flags & IDLFLAG_FIN) != 0;} + inline bool IsOut() const {return (flags & IDLFLAG_FOUT) != 0;} + inline bool IsRetVal() const {return (flags & IDLFLAG_FRETVAL) != 0;} + }; + + typedef vector ParamXArray; + + class FuncX // refer to FUNCDESC in MSDN + { + public: + wxString name; + MEMBERID memid; + bool hasOut; + + ParamXArray params; + }; + + typedef vector FuncXArray; + typedef map MemberIdList; + wxActiveX(wxWindow * parent, REFCLSID clsid, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, @@ -276,12 +306,15 @@ public: void CreateActiveX(REFCLSID clsid); void CreateActiveX(LPOLESTR progId); - void GetTypeInfo(); - void GetTypeInfo(ITypeInfo *ti, bool defEventSink); + // expose type info + inline int GetEventCount() const {return m_events.size();} + const FuncX& GetEvent(int idx) const; HRESULT ConnectAdvise(REFIID riid, IUnknown *eventSink); void OnSize(wxSizeEvent&); + void OnPaint(wxPaintEvent& event); + void OnMouse(wxMouseEvent& event); void OnSetFocus(wxFocusEvent&); void OnKillFocus(wxFocusEvent&); @@ -303,6 +336,7 @@ protected: m_oleInPlaceActiveObject; wxAutoOleInterface m_docView; + wxAutoOleInterface m_viewObject; HWND m_oleObjectHWND; bool m_bAmbientUserMode; DWORD m_docAdviseCookie; @@ -310,41 +344,19 @@ protected: HRESULT AmbientPropertyChanged(DISPID dispid); - // type stuff - class ParamX // refer to ELEMDESC, IDLDESC in MSDN - { - public: - USHORT flags; - VARTYPE vt; - wxString name; - - inline bool IsIn() const {return (flags & IDLFLAG_FIN) != 0;} - inline bool IsOut() const {return (flags & IDLFLAG_FOUT) != 0;} - inline bool IsRetVal() const {return (flags & IDLFLAG_FRETVAL) != 0;} - }; - - typedef vector ParamXArray; - - class FuncX // refer to FUNCDESC in MSDN - { - public: - wxString name; - MEMBERID memid; - bool hasOut; - - ParamXArray params; - }; + void GetTypeInfo(); + void GetTypeInfo(ITypeInfo *ti, bool defEventSink); - typedef vector FuncXArray; - typedef map MemberIdList; // events FuncXArray m_events; MemberIdList m_eventsIdx; + + WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam); }; // events -class wxActiveXEvent : public wxNotifyEvent +class wxActiveXEvent : public wxCommandEvent { private: friend class wxActiveXEvents; @@ -355,18 +367,23 @@ public: virtual wxEvent *Clone() const { return new wxActiveXEvent(*this); } + wxString EventName(); int ParamCount() const; + wxString ParamType(int idx); + wxString ParamName(int idx); wxVariant operator[] (int idx) const; wxVariant& operator[] (int idx); wxVariant operator[] (wxString name) const; wxVariant& operator[] (wxString name); }; -const wxEventType& RegisterActiveXEvent(wxChar *eventName); +const wxEventType& RegisterActiveXEvent(const wxChar *eventName); +const wxEventType& RegisterActiveXEvent(DISPID event); typedef void (wxEvtHandler::*wxActiveXEventFunction)(wxActiveXEvent&); -#define EVT_ACTIVEX(id, eventName, fn) DECLARE_EVENT_TABLE_ENTRY(RegisterActiveXEvent(wxT(eventName)), id, -1, (wxObjectEventFunction) (wxEventFunction) (wxActiveXEventFunction) & fn, (wxObject *) NULL ), +#define EVT_ACTIVEX(id, eventName, fn) DECLARE_EVENT_TABLE_ENTRY(RegisterActiveXEvent(wxT(eventName)), id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxActiveXEventFunction, & fn ), (wxObject *) NULL ), +#define EVT_ACTIVEX_DISPID(id, eventDispId, fn) DECLARE_EVENT_TABLE_ENTRY(RegisterActiveXEvent(eventDispId), id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxActiveXEventFunction, & fn ), (wxObject *) NULL ), //util bool MSWVariantToVariant(VARIANTARG& va, wxVariant& vx);