// without having to deal with nasty IDispatch pointers.
bool GetObject(wxAutomationObject& obj, const wxString& property, int noArgs = 0, wxVariant args[] = (wxVariant*) NULL) const;
- // Convert variants
- static bool ConvertVariantToOle(const wxVariant& variant, VARIANTARG& oleVariant) ;
- static bool ConvertOleToVariant(const VARIANTARG& oleVariant, wxVariant& variant) ;
-
public:
WXIDISPATCH* m_dispatchPtr;
};
-// wrapper around BSTR type (by Vadim Zeitlin)
-
-class WXDLLEXPORT BasicString
-{
-public:
- // ctors & dtor
- BasicString(const char *sz);
- ~BasicString();
-
- // accessors
- // just get the string
- operator BSTR() const { return m_wzBuf; }
- // retrieve a copy of our string - caller must SysFreeString() it later!
- BSTR Get() const { return SysAllocString(m_wzBuf); }
-
-private:
- // @@@ not implemented (but should be)
- BasicString(const BasicString&);
- BasicString& operator=(const BasicString&);
-
- OLECHAR *m_wzBuf; // actual string
-};
#endif
// _WX_AUTOMTN_H_
// Comment this out if you don't mind slower compilation of the wxWindows
// library
#if !defined(__WXMAC__) && !defined(__SALFORDC__)
-#include <windows.h>
+// #include <windows.h>
#endif
#ifdef GetClassInfo
#pragma hdrstop
#endif
-#ifndef WX_PRECOMP
#include "wx/wx.h"
-#endif
#ifdef new
#undef new
#include "mfctest.h"
-#include "wx/wx.h"
-
/////////////////////////////////////////////////////////////////////////////
// theApp:
MyCanvas *canvas;
MyChild(wxFrame *frame, const wxString& title, const wxPoint& pos, const wxSize& size, const long style);
~MyChild(void);
- Bool OnClose(void);
+ bool OnClose(void);
void OnQuit(wxCommandEvent& event);
void OnNew(wxCommandEvent& event);
wxFrame *MyApp::CreateFrame(void)
{
MyChild *subframe = new MyChild(NULL, "Canvas Frame", wxPoint(10, 10), wxSize(300, 300),
- wxDEFAULT_FRAME);
+ wxDEFAULT_FRAME_STYLE);
subframe->SetTitle("wxWindows canvas frame");
MyCanvas *canvas = new MyCanvas(subframe, wxPoint(0, 0), wxSize(width, height));
wxCursor *cursor = new wxCursor(wxCURSOR_PENCIL);
- canvas->SetCursor(cursor);
+ canvas->SetCursor(*cursor);
subframe->canvas = canvas;
// Give it scrollbars
{
wxPaintDC dc(this);
- dc.SetFont(small_font);
- dc.SetPen(wxGREEN_PEN);
+ dc.SetFont(* small_font);
+ dc.SetPen(* wxGREEN_PEN);
dc.DrawLine(0, 0, 200, 200);
dc.DrawLine(200, 0, 0, 200);
- dc.SetBrush(wxCYAN_BRUSH);
- dc.SetPen(wxRED_PEN);
+ dc.SetBrush(* wxCYAN_BRUSH);
+ dc.SetPen(* wxRED_PEN);
dc.DrawRectangle(100, 100, 100, 50);
dc.DrawRoundedRectangle(150, 150, 100, 50, 20);
void MyCanvas::OnMouseEvent(wxMouseEvent& event)
{
wxClientDC dc(this);
- dc.SetPen(wxBLACK_PEN);
+ dc.SetPen(* wxBLACK_PEN);
long x, y;
event.Position(&x, &y);
if (xpos > -1 && ypos > -1 && event.Dragging())
canvas->SetFocus();
}
-Bool MyChild::OnClose(void)
+bool MyChild::OnClose(void)
{
return TRUE;
}
#include <math.h>
#include <time.h>
+#ifdef GetObject
+#undef GetObject
+#endif
+
+// wrapper around BSTR type (by Vadim Zeitlin)
+
+class WXDLLEXPORT BasicString
+{
+public:
+ // ctors & dtor
+ BasicString(const char *sz);
+ ~BasicString();
+
+ // accessors
+ // just get the string
+ operator BSTR() const { return m_wzBuf; }
+ // retrieve a copy of our string - caller must SysFreeString() it later!
+ BSTR Get() const { return SysAllocString(m_wzBuf); }
+
+private:
+ // @@@ not implemented (but should be)
+ BasicString(const BasicString&);
+ BasicString& operator=(const BasicString&);
+
+ OLECHAR *m_wzBuf; // actual string
+};
+
+// Convert variants
+static bool ConvertVariantToOle(const wxVariant& variant, VARIANTARG& oleVariant) ;
+static bool ConvertOleToVariant(const VARIANTARG& oleVariant, wxVariant& variant) ;
+
// Convert string to Unicode
static BSTR ConvertStringToOle(const wxString& str);
}
-bool wxAutomationObject::ConvertVariantToOle(const wxVariant& variant, VARIANTARG& oleVariant)
+bool ConvertVariantToOle(const wxVariant& variant, VARIANTARG& oleVariant)
{
ClearVariant(&oleVariant);
if (variant.IsNull())
#define VT_TYPEMASK 0xfff
#endif
-bool wxAutomationObject::ConvertOleToVariant(const VARIANTARG& oleVariant, wxVariant& variant)
+bool ConvertOleToVariant(const VARIANTARG& oleVariant, wxVariant& variant)
{
switch (oleVariant.vt & VT_TYPEMASK)
{
#if defined(__WIN32__) && !defined(__GNUWIN32__)
-#include <wx/log.h>
-#include <wx/msw/ole/oleutils.h>
-#include <wx/msw/ole/dataobj.h>
+#include <wx/log.h>
+#include <wx/msw/ole/dataobj.h>
+
+#include <windows.h>
+#include <oleauto.h>
#ifndef __WIN32__
#include <ole2.h>
#include <olestd.h>
#endif
+#include <wx/msw/ole/oleutils.h>
+
// ----------------------------------------------------------------------------
// functions
// ----------------------------------------------------------------------------
#if wxUSE_DRAG_AND_DROP
#include <wx/log.h>
-#include <wx/msw/ole/oleutils.h>
#include <wx/msw/ole/dataobj.h>
#include <wx/msw/ole/dropsrc.h>
+#include <windows.h>
+
#ifndef __WIN32__
#include <ole2.h>
#include <olestd.h>
#endif
+#include <oleauto.h>
+
+#include <wx/msw/ole/oleutils.h>
+
// ----------------------------------------------------------------------------
// wxIDropSource implementation of IDropSource interface
// ----------------------------------------------------------------------------