]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/msw/ole/activex.h
Temporarily disable colour picker to keep build working and bofore finding nice repla...
[wxWidgets.git] / include / wx / msw / ole / activex.h
index 0c9477e8fed9b04c3ae04ca1bb7bd063e1eb613d..31a9eb2a4c2e5a16ed023511ccaf01213f419c82 100644 (file)
@@ -1,5 +1,5 @@
 ///////////////////////////////////////////////////////////////////////////////
-// Name:        wx/activex.h
+// Name:        wx/msw/ole/activex.h
 // Purpose:     wxActiveXContainer class
 // Author:      Ryan Norton <wxprojects@comcast.net>
 // Modified by:
 //  WX includes
 //---------------------------------------------------------------------------
 #include "wx/window.h"
+#include "wx/variant.h"
 
 //---------------------------------------------------------------------------
 // MSW COM includes
 //---------------------------------------------------------------------------
 #include <oleidl.h>
 #include <olectl.h>
+
+#if !defined(__WXWINCE__) || defined(__WINCE_STANDARDSDK__)
 #include <exdisp.h>
+#endif
+
 #include <docobj.h>
 
 //
@@ -146,10 +151,6 @@ WX_DECLARE_AUTOOLE(wxAutoIOleInPlaceObject, IOleInPlaceObject)
 WX_DECLARE_AUTOOLE(wxAutoIOleInPlaceActiveObject, IOleInPlaceActiveObject)
 WX_DECLARE_AUTOOLE(wxAutoIOleDocumentView, IOleDocumentView)
 WX_DECLARE_AUTOOLE(wxAutoIViewObject, IViewObject)
-WX_DECLARE_AUTOOLE(wxAutoIOleInPlaceSite, IOleInPlaceSite)
-WX_DECLARE_AUTOOLE(wxAutoIOleDocument, IOleDocument)
-WX_DECLARE_AUTOOLE(wxAutoIPersistStreamInit, IPersistStreamInit)
-WX_DECLARE_AUTOOLE(wxAutoIAdviseSink, IAdviseSink)
 
 class wxActiveXContainer : public wxWindow
 {
@@ -164,6 +165,7 @@ public:
 
 protected:
     friend class FrameSite;
+    friend class wxActiveXEvents;
 
     wxAutoIDispatch            m_Dispatch;
     wxAutoIOleClientSite      m_clientSite;
@@ -181,5 +183,49 @@ protected:
     void CreateActiveX(REFIID, IUnknown*);
 };
 
-#endif // _WX_MSW_OLE_ACTIVEXCONTAINER_H_
 
+// Events
+class wxActiveXEvent : public wxCommandEvent
+{
+private:
+    friend class wxActiveXEvents;
+    wxVariant m_params;
+    DISPID m_dispid;
+
+public:
+    virtual wxEvent *Clone() const
+    { return new wxActiveXEvent(*this); }
+
+    size_t ParamCount() const
+    {   return m_params.GetCount();  }
+
+    wxString ParamType(size_t idx) const
+    {
+        wxASSERT(idx < m_params.GetCount());
+        return m_params[idx].GetType();
+    }
+
+    wxString ParamName(size_t idx) const
+    {
+        wxASSERT(idx < m_params.GetCount());
+        return m_params[idx].GetName();
+    }
+
+    wxVariant& operator[] (size_t idx)
+    {
+        wxASSERT(idx < ParamCount());
+        return m_params[idx];
+    }
+
+    DISPID GetDispatchId() const
+    {   return m_dispid;    }
+};
+
+#define wxACTIVEX_ID    14001
+DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_MEDIA, wxEVT_ACTIVEX, wxACTIVEX_ID)
+typedef void (wxEvtHandler::*wxActiveXEventFunction)(wxActiveXEvent&);
+#define EVT_ACTIVEX(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_ACTIVEX, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxActiveXEventFunction) & fn, (wxObject *) NULL ),
+#define wxActiveXEventHandler(func) \
+    (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxActiveXEventFunction, &func)
+
+#endif // _WX_MSW_OLE_ACTIVEXCONTAINER_H_