]> git.saurik.com Git - wxWidgets.git/commitdiff
Added start at accessibility functionality
authorJulian Smart <julian@anthemion.co.uk>
Sun, 16 Feb 2003 11:59:49 +0000 (11:59 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Sun, 16 Feb 2003 11:59:49 +0000 (11:59 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@19229 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/accesscmn.cpp [new file with mode: 0644]
src/common/wincmn.cpp
src/msw/ole/access.cpp [new file with mode: 0644]
src/msw/ole/automtn.cpp
src/msw/window.cpp
src/wxWindows.dsp

diff --git a/src/common/accesscmn.cpp b/src/common/accesscmn.cpp
new file mode 100644 (file)
index 0000000..a5cb561
--- /dev/null
@@ -0,0 +1,30 @@
+///////////////////////////////////////////////////////////////////////////////
+// Name:        common/accesscmn.cpp
+// Author:      Julian Smart
+// Modified by:
+// Created:     2003-02-12
+// RCS-ID:      $Id$
+// Copyright:   (c) Julian Smart
+// Licence:     wxWindows licence
+///////////////////////////////////////////////////////////////////////////////
+
+// ----------------------------------------------------------------------------
+// headers
+// ----------------------------------------------------------------------------
+
+#ifdef __GNUG__
+    #pragma implementation "accessbase.h"
+#endif
+
+#include "wx/wxprec.h"
+
+#ifdef __BORLANDC__
+    #pragma hdrstop
+#endif
+
+#if wxUSE_ACCESSIBILITY
+
+#include "wx/access.h"
+
+#endif
+
index d54ce77bdfb25226d542d23cf3bdee019c93ee37..b701f7aa6df3fac1a58cb1eb450502c8209daa22 100644 (file)
     #include "wx/dnd.h"
 #endif // wxUSE_DRAG_AND_DROP
 
+#if wxUSE_ACCESSIBILITY
+    #include "wx/access.h"    
+#endif
+
 #if wxUSE_HELP
     #include "wx/cshelp.h"
 #endif // wxUSE_HELP
@@ -180,6 +184,10 @@ void wxWindowBase::InitBase()
     m_hasCustomPalette = FALSE;
 #endif // wxUSE_PALETTE
 
+#if wxUSE_ACCESSIBILITY
+    m_accessible = NULL;
+#endif
+
     m_virtualSize = wxDefaultSize;
 
     m_minVirtualWidth =
@@ -302,6 +310,11 @@ wxWindowBase::~wxWindowBase()
         delete m_tooltip;
 #endif // wxUSE_TOOLTIPS
 
+#if wxUSE_ACCESSIBILITY
+    if ( m_accessible )
+        delete m_accessible;
+#endif
+
     // reset the dangling pointer our parent window may keep to us
     if ( m_parent && m_parent->GetDefaultItem() == this )
     {
@@ -1933,6 +1946,36 @@ void wxWindowBase::OnMiddleClick( wxMouseEvent& event )
     }
 }
 
+// ----------------------------------------------------------------------------
+// accessibility
+// ----------------------------------------------------------------------------
+
+#if wxUSE_ACCESSIBILITY
+void wxWindowBase::SetAccessible(wxAccessible* accessible)
+{
+    if (m_accessible)
+        delete m_accessible;
+    m_accessible = accessible;
+    if (m_accessible)
+        m_accessible->SetWindow((wxWindow*) this);
+}
+
+// Returns the accessible object, creating if necessary.
+wxAccessible* wxWindowBase::GetOrCreateAccessible()
+{
+    if (!m_accessible)
+        m_accessible = CreateAccessible();
+    return m_accessible;
+}
+
+// Override to create a specific accessible object.
+wxAccessible* wxWindowBase::CreateAccessible()
+{
+    return new wxWindowAccessible((wxWindow*) this);
+}
+
+#endif
+
 // ----------------------------------------------------------------------------
 // list classes implementation
 // ----------------------------------------------------------------------------
@@ -2047,4 +2090,255 @@ wxWindow* wxGetTopLevelParent(wxWindow *win)
     return win;
 }
 
-// vi:sts=4:sw=4:et
+#if wxUSE_ACCESSIBILITY
+// ----------------------------------------------------------------------------
+// accessible object for windows
+// ----------------------------------------------------------------------------
+
+// Can return either a child object, or an integer
+// representing the child element, starting from 1.
+wxAccStatus wxWindowAccessible::HitTest(const wxPoint& pt, int* childId, wxAccessible** childObject)
+{
+    wxASSERT( GetWindow() != NULL );
+    if (!GetWindow())
+        return wxACC_FAIL;
+
+    return wxACC_NOT_IMPLEMENTED;
+}
+
+// Returns the rectangle for this object (id = 0) or a child element (id > 0).
+wxAccStatus wxWindowAccessible::GetLocation(wxRect& rect, int elementId)
+{
+    wxASSERT( GetWindow() != NULL );
+    if (!GetWindow())
+        return wxACC_FAIL;
+
+    return wxACC_NOT_IMPLEMENTED;
+}
+
+// Navigates from fromId to toId/toObject.
+wxAccStatus wxWindowAccessible::Navigate(wxNavDir navDir, int fromId,
+                             int* toId, wxAccessible** toObject)
+{
+    wxASSERT( GetWindow() != NULL );
+    if (!GetWindow())
+        return wxACC_FAIL;
+
+    return wxACC_NOT_IMPLEMENTED;
+}
+
+// Gets the name of the specified object.
+wxAccStatus wxWindowAccessible::GetName(int childId, wxString* name)
+{
+    wxASSERT( GetWindow() != NULL );
+    if (!GetWindow())
+        return wxACC_FAIL;
+
+    wxString title(GetWindow()->GetTitle());
+    if (!title.IsEmpty())
+    {
+        *name = title;
+        return wxACC_OK;
+    }
+    else
+        return wxACC_NOT_IMPLEMENTED;
+}
+
+// Gets the number of children.
+wxAccStatus wxWindowAccessible::GetChildCount(int* childId)
+{
+    wxASSERT( GetWindow() != NULL );
+    if (!GetWindow())
+        return wxACC_FAIL;
+
+    *childId = (int) GetWindow()->GetChildren().GetCount();
+    return wxACC_OK;
+}
+
+// Gets the specified child (starting from 1).
+// If *child is NULL and return value is wxACC_OK,
+// this means that the child is a simple element and
+// not an accessible object.
+wxAccStatus wxWindowAccessible::GetChild(int childId, wxAccessible** child)
+{
+    wxASSERT( GetWindow() != NULL );
+    if (!GetWindow())
+        return wxACC_FAIL;
+
+    if (childId == 0)
+    {
+        *child = this;
+        return wxACC_OK;
+    }
+
+    if (childId > (int) GetWindow()->GetChildren().GetCount())
+        return wxACC_FAIL;
+
+    wxWindow* childWindow = (wxWindow*) GetWindow()->GetChildren().Nth(childId-1)->GetData();
+    *child = childWindow->GetOrCreateAccessible();
+    if (*child)
+        return wxACC_OK;
+    else
+        return wxACC_FAIL;
+}
+
+// Gets the parent, or NULL.
+wxAccStatus wxWindowAccessible::GetParent(wxAccessible** parent)
+{
+    wxASSERT( GetWindow() != NULL );
+    if (!GetWindow())
+        return wxACC_FAIL;
+
+    wxWindow* parentWindow = GetWindow()->GetParent();
+    if (!parent)
+    {
+        *parent = NULL;
+        return wxACC_OK;
+    }
+    else
+    {
+        *parent = parentWindow->GetOrCreateAccessible();
+        if (*parent)
+            return wxACC_OK;
+        else
+            return wxACC_FAIL;
+    }
+}
+
+// Performs the default action. childId is 0 (the action for this object)
+// or > 0 (the action for a child).
+// Return wxACC_NOT_SUPPORTED if there is no default action for this
+// window (e.g. an edit control).
+wxAccStatus wxWindowAccessible::DoDefaultAction(int childId)
+{
+    wxASSERT( GetWindow() != NULL );
+    if (!GetWindow())
+        return wxACC_FAIL;
+
+    return wxACC_NOT_IMPLEMENTED;
+}
+
+// Gets the default action for this object (0) or > 0 (the action for a child).
+// Return wxACC_OK even if there is no action. actionName is the action, or the empty
+// string if there is no action.
+// The retrieved string describes the action that is performed on an object,
+// not what the object does as a result. For example, a toolbar button that prints
+// a document has a default action of "Press" rather than "Prints the current document."
+wxAccStatus wxWindowAccessible::GetDefaultAction(int childId, wxString* actionName)
+{
+    wxASSERT( GetWindow() != NULL );
+    if (!GetWindow())
+        return wxACC_FAIL;
+
+    return wxACC_NOT_IMPLEMENTED;
+}
+
+// Returns the description for this object or a child.
+wxAccStatus wxWindowAccessible::GetDescription(int childId, wxString* description)
+{
+    wxASSERT( GetWindow() != NULL );
+    if (!GetWindow())
+        return wxACC_FAIL;
+
+    return wxACC_NOT_IMPLEMENTED;
+}
+
+// Returns help text for this object or a child, similar to tooltip text.
+wxAccStatus wxWindowAccessible::GetHelpText(int childId, wxString* helpText)
+{
+    wxASSERT( GetWindow() != NULL );
+    if (!GetWindow())
+        return wxACC_FAIL;
+
+    wxString ht(GetWindow()->GetHelpText());
+    if (!ht.IsEmpty())
+    {
+        *helpText = ht;
+        return wxACC_OK;
+    }
+    return wxACC_NOT_IMPLEMENTED;
+}
+
+// Returns the keyboard shortcut for this object or child.
+// Return e.g. ALT+K
+wxAccStatus wxWindowAccessible::GetKeyboardShortcut(int childId, wxString* shortcut)
+{
+    wxASSERT( GetWindow() != NULL );
+    if (!GetWindow())
+        return wxACC_FAIL;
+
+    return wxACC_NOT_IMPLEMENTED;
+}
+
+// Returns a role constant.
+wxAccStatus wxWindowAccessible::GetRole(int childId, wxAccRole* role)
+{
+    wxASSERT( GetWindow() != NULL );
+    if (!GetWindow())
+        return wxACC_FAIL;
+
+    return wxACC_NOT_IMPLEMENTED;
+}
+
+// Returns a state constant.
+wxAccStatus wxWindowAccessible::GetState(int childId, long* state)
+{
+    wxASSERT( GetWindow() != NULL );
+    if (!GetWindow())
+        return wxACC_FAIL;
+
+    return wxACC_NOT_IMPLEMENTED;
+}
+
+// Returns a localized string representing the value for the object
+// or child.
+wxAccStatus wxWindowAccessible::GetValue(int childId, wxString* strValue)
+{
+    wxASSERT( GetWindow() != NULL );
+    if (!GetWindow())
+        return wxACC_FAIL;
+
+    return wxACC_NOT_IMPLEMENTED;
+}
+
+// Selects the object or child.
+wxAccStatus wxWindowAccessible::Select(int childId, wxAccSelectionFlags selectFlags)
+{
+    wxASSERT( GetWindow() != NULL );
+    if (!GetWindow())
+        return wxACC_FAIL;
+
+    return wxACC_NOT_IMPLEMENTED;
+}
+
+// Gets the window with the keyboard focus.
+// If childId is 0 and child is NULL, no object in
+// this subhierarchy has the focus.
+// If this object has the focus, child should be 'this'.
+wxAccStatus wxWindowAccessible::GetFocus(int* childId, wxAccessible** child)
+{
+    wxASSERT( GetWindow() != NULL );
+    if (!GetWindow())
+        return wxACC_FAIL;
+
+    return wxACC_NOT_IMPLEMENTED;
+}
+
+// Gets a variant representing the selected children
+// of this object.
+// Acceptable values:
+// - a null variant (IsNull() returns TRUE)
+// - a list variant (GetType() == wxT("list")
+// - an integer representing the selected child element,
+//   or 0 if this object is selected (GetType() == wxT("long")
+// - a "void*" pointer to a wxAccessible child object
+wxAccStatus wxWindowAccessible::GetSelections(wxVariant* selections)
+{
+    wxASSERT( GetWindow() != NULL );
+    if (!GetWindow())
+        return wxACC_FAIL;
+
+    return wxACC_NOT_IMPLEMENTED;
+}
+
+#endif // wxUSE_ACCESSIBILITY
diff --git a/src/msw/ole/access.cpp b/src/msw/ole/access.cpp
new file mode 100644 (file)
index 0000000..3bc308c
--- /dev/null
@@ -0,0 +1,1599 @@
+///////////////////////////////////////////////////////////////////////////////
+// Name:        msw/ole/access.cpp
+// Purpose:     implementation of wxIAccessible and wxAccessible
+// Author:      Julian Smart
+// Modified by:
+// Created:     2003-02-12
+// RCS-ID:      $Id$
+// Copyright:   (c) 2003 Julian Smart
+// Licence:     wxWindows licence
+///////////////////////////////////////////////////////////////////////////////
+
+// ============================================================================
+// declarations
+// ============================================================================
+
+// ----------------------------------------------------------------------------
+// headers
+// ----------------------------------------------------------------------------
+
+#ifdef __GNUG__
+  #pragma implementation "access.h"
+#endif
+
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
+#if defined(__BORLANDC__)
+  #pragma hdrstop
+#endif
+#ifndef WX_PRECOMP
+#include "wx/window.h"
+#endif
+
+#include "wx/setup.h"
+
+#if wxUSE_OLE && wxUSE_ACCESSIBILITY
+
+#include "wx/log.h"
+#include "wx/access.h"
+
+#include <windows.h>
+
+// for some compilers, the entire ole2.h must be included, not only oleauto.h
+#if wxUSE_NORLANDER_HEADERS || defined(__WATCOMC__)
+    #include <ole2.h>
+#endif
+
+#include <oleauto.h>
+#include <oleacc.h>
+
+#include "wx/msw/ole/oleutils.h"
+
+#ifndef CHILDID_SELF
+#define CHILDID_SELF 0
+#endif
+
+#ifndef OBJID_CLIENT
+#define OBJID_CLIENT 0xFFFFFFFC
+#endif
+
+// Convert to Windows role
+int wxConvertToWindowsRole(wxAccRole wxrole);
+
+// Convert to Windows state
+long wxConvertToWindowsState(long wxstate);
+
+// Convert to Windows selection flag
+int wxConvertToWindowsSelFlag(wxAccSelectionFlags sel);
+
+// Convert from Windows selection flag
+wxAccSelectionFlags wxConvertFromWindowsSelFlag(int sel);
+
+// ----------------------------------------------------------------------------
+// wxIEnumVARIANT interface implementation
+// ----------------------------------------------------------------------------
+
+class wxIEnumVARIANT : public IEnumVARIANT
+{
+public:
+    wxIEnumVARIANT(const wxVariant& variant);
+    ~wxIEnumVARIANT() { }
+
+    DECLARE_IUNKNOWN_METHODS;
+
+    // IEnumVARIANT
+    STDMETHODIMP Next(ULONG celt, VARIANT *rgelt, ULONG *pceltFetched);
+    STDMETHODIMP Skip(ULONG celt);
+    STDMETHODIMP Reset();
+    STDMETHODIMP Clone(IEnumVARIANT **ppenum);
+
+private:
+    wxVariant m_variant;  // List of further variants
+    int       m_nCurrent; // Current enum position
+
+    DECLARE_NO_COPY_CLASS(wxIEnumVARIANT)
+};
+
+// ----------------------------------------------------------------------------
+// wxIEnumVARIANT
+// ----------------------------------------------------------------------------
+
+BEGIN_IID_TABLE(wxIEnumVARIANT)
+    ADD_IID(Unknown)
+    ADD_IID(EnumVARIANT)
+END_IID_TABLE;
+
+IMPLEMENT_IUNKNOWN_METHODS(wxIEnumVARIANT)
+
+// wxVariant contains a list of further variants.
+wxIEnumVARIANT::wxIEnumVARIANT(const wxVariant& variant)
+{
+    m_variant = variant;
+}
+
+STDMETHODIMP wxIEnumVARIANT::Next(ULONG      celt,
+                                    VARIANT *rgelt,
+                                    ULONG     *pceltFetched)
+{
+    wxLogTrace(wxTRACE_OleCalls, wxT("wxIEnumVARIANT::Next"));
+
+    if ( celt > 1 ) {
+        // we only return 1 element at a time - mainly because I'm too lazy to
+        // implement something which you're never asked for anyhow
+        return S_FALSE;
+    }
+
+    if (m_variant.GetType() != wxT("list"))
+        return S_FALSE;
+
+    if ( m_nCurrent < (int) m_variant.GetList().GetCount() ) {
+        if (!wxConvertVariantToOle(m_variant[m_nCurrent++], rgelt[0]))
+        {
+            return S_FALSE;
+        }
+
+        // TODO: should we AddRef if this is an object?
+
+        * pceltFetched = 1;
+        return S_OK;
+    }
+    else {
+        // bad index
+        return S_FALSE;
+    }
+}
+
+STDMETHODIMP wxIEnumVARIANT::Skip(ULONG celt)
+{
+    wxLogTrace(wxTRACE_OleCalls, wxT("wxIEnumVARIANT::Skip"));
+
+    if (m_variant.GetType() != wxT("list"))
+        return S_FALSE;
+
+    m_nCurrent += celt;
+    if ( m_nCurrent < (int) m_variant.GetList().GetCount() )
+        return S_OK;
+
+    // no, can't skip this many elements
+    m_nCurrent -= celt;
+
+    return S_FALSE;
+}
+
+STDMETHODIMP wxIEnumVARIANT::Reset()
+{
+    wxLogTrace(wxTRACE_OleCalls, wxT("wxIEnumVARIANT::Reset"));
+
+    m_nCurrent = 0;
+
+    return S_OK;
+}
+
+STDMETHODIMP wxIEnumVARIANT::Clone(IEnumVARIANT **ppenum)
+{
+    wxLogTrace(wxTRACE_OleCalls, wxT("wxIEnumVARIANT::Clone"));
+
+    wxIEnumVARIANT *pNew = new wxIEnumVARIANT(m_variant);
+    pNew->AddRef();
+    *ppenum = pNew;
+
+    return S_OK;
+}
+
+
+// ----------------------------------------------------------------------------
+// wxIAccessible implementation of IAccessible interface
+// ----------------------------------------------------------------------------
+
+class wxIAccessible : public IAccessible
+{
+public:
+    wxIAccessible(wxAccessible *pAccessible);
+
+    DECLARE_IUNKNOWN_METHODS;
+
+// IAccessible
+
+// Navigation and Hierarchy
+
+        // Retrieves the child element or child object at a given point on the screen.
+        // All visual objects support this method; sound objects do not support it.    
+
+    STDMETHODIMP accHitTest(long xLeft, long yLeft, VARIANT* pVarID);
+
+        // Retrieves the specified object's current screen location. All visual objects must
+        // support this method; sound objects do not support it.    
+
+    STDMETHODIMP accLocation ( long* pxLeft, long* pyTop, long* pcxWidth, long* pcyHeight, VARIANT varID);
+
+        // Traverses to another user interface element within a container and retrieves the object.
+        // All visual objects must support this method.
+
+    STDMETHODIMP accNavigate ( long navDir, VARIANT varStart, VARIANT* pVarEnd);
+
+        // Retrieves the address of an IDispatch interface for the specified child.
+        // All objects must support this property.
+    
+    STDMETHODIMP get_accChild ( VARIANT varChildID, IDispatch** ppDispChild);
+
+        // Retrieves the number of children that belong to this object.
+        // All objects must support this property.
+    
+    STDMETHODIMP get_accChildCount ( long* pCountChildren);
+
+        // Retrieves the IDispatch interface of the object's parent.
+        // All objects support this property.
+    
+    STDMETHODIMP get_accParent ( IDispatch** ppDispParent);
+
+// Descriptive Properties and Methods
+
+        // Performs the object's default action. Not all objects have a default
+        // action.
+    
+    STDMETHODIMP accDoDefaultAction(VARIANT varID);
+
+        // Retrieves a string that describes the object's default action.
+        // Not all objects have a default action.
+    
+    STDMETHODIMP get_accDefaultAction ( VARIANT varID, BSTR* pszDefaultAction);
+
+        // Retrieves a string that describes the visual appearance of the specified object.
+        // Not all objects have a description.
+
+    STDMETHODIMP get_accDescription ( VARIANT varID, BSTR* pszDescription);
+
+        // Retrieves an object's Help property string.
+        // Not all objects support this property.
+
+    STDMETHODIMP get_accHelp ( VARIANT varID, BSTR* pszHelp);
+
+        // Retrieves the full path of the WinHelp file associated with the specified
+        // object and the identifier of the appropriate topic within that file.
+        // Not all objects support this property.
+        
+    STDMETHODIMP get_accHelpTopic ( BSTR* pszHelpFile, VARIANT varChild, long* pidTopic);
+
+        // Retrieves the specified object's shortcut key or access key, also known as
+        // the mnemonic. All objects that have a shortcut key or access key support
+        // this property.
+        
+    STDMETHODIMP get_accKeyboardShortcut ( VARIANT varID, BSTR* pszKeyboardShortcut);
+
+        // Retrieves the name of the specified object.
+        // All objects support this property.
+    
+    STDMETHODIMP get_accName ( VARIANT varID, BSTR* pszName);
+
+        // Retrieves information that describes the role of the specified object.
+        // All objects support this property.
+
+    STDMETHODIMP get_accRole ( VARIANT varID, VARIANT* pVarRole);
+
+        // Retrieves the current state of the specified object.
+        // All objects support this property.
+    
+    STDMETHODIMP get_accState ( VARIANT varID, VARIANT* pVarState);
+    
+        // Retrieves the value of the specified object.
+        // Not all objects have a value.
+
+    STDMETHODIMP get_accValue ( VARIANT varID, BSTR* pszValue);
+
+// Selection and Focus
+
+        // Modifies the selection or moves the keyboard focus of the
+        // specified object. All objects that select or receive the
+        // keyboard focus must support this method.
+
+    STDMETHODIMP accSelect ( long flagsSelect, VARIANT varID );
+
+        // Retrieves the object that has the keyboard focus. All objects
+        // that receive the keyboard focus must support this property.
+        
+    STDMETHODIMP get_accFocus ( VARIANT* pVarID);
+
+        // Retrieves the selected children of this object. All objects
+        // selected must support this property.
+        
+    STDMETHODIMP get_accSelection ( VARIANT * pVarChildren);
+
+// Obsolete
+
+    STDMETHODIMP put_accName(VARIANT varChild, BSTR szName) { return E_FAIL; }
+    STDMETHODIMP put_accValue(VARIANT varChild, BSTR szName) { return E_FAIL; }
+
+// IDispatch
+
+        // Get type info
+
+    STDMETHODIMP GetTypeInfo(unsigned int typeInfo, LCID lcid, ITypeInfo** ppTypeInfo);
+
+        // Get type info count
+
+    STDMETHODIMP GetTypeInfoCount(unsigned int* typeInfoCount);
+
+        // Get ids of names
+
+    STDMETHODIMP GetIDsOfNames(REFIID riid, OLECHAR** names, unsigned int cNames,
+        LCID lcid, DISPID* dispId);
+
+        // Invoke
+
+    STDMETHODIMP Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, 
+                        WORD wFlags, DISPPARAMS *pDispParams, 
+                        VARIANT *pVarResult, EXCEPINFO *pExcepInfo, 
+                        unsigned int *puArgErr );
+
+private:
+    wxAccessible *m_pAccessible;      // pointer to C++ class we belong to
+
+    DECLARE_NO_COPY_CLASS(wxIAccessible)
+};
+
+// ============================================================================
+// Implementation
+// ============================================================================
+
+// ----------------------------------------------------------------------------
+// wxIAccessible implementation
+// ----------------------------------------------------------------------------
+BEGIN_IID_TABLE(wxIAccessible)
+  ADD_IID(Unknown)
+  ADD_IID(Accessible)
+  ADD_IID(Dispatch)
+END_IID_TABLE;
+
+IMPLEMENT_IUNKNOWN_METHODS(wxIAccessible)
+
+wxIAccessible::wxIAccessible(wxAccessible *pAccessible)
+{
+    wxASSERT( pAccessible != NULL );
+
+    m_pAccessible = pAccessible;
+}
+
+// Retrieves the child element or child object at a given point on the screen.
+// All visual objects support this method; sound objects do not support it.    
+
+STDMETHODIMP wxIAccessible::accHitTest(long xLeft, long yLeft, VARIANT* pVarID)
+{
+    wxASSERT (m_pAccessible != NULL);
+    if (!m_pAccessible)
+        return E_FAIL;
+    
+    wxAccessible* childObject = NULL;
+    int childId = 0;
+    VariantInit(pVarID);
+    
+    wxAccStatus status = m_pAccessible->HitTest(wxPoint(xLeft, yLeft), & childId, & childObject);
+    
+    if (status == wxACC_FAIL)
+        return E_FAIL;
+    
+    if (status == wxACC_NOT_IMPLEMENTED)
+    {
+        // Use standard interface instead.
+        IAccessible* stdInterface = (IAccessible*)m_pAccessible->GetIAccessibleStd();
+        if (!stdInterface)
+            return E_FAIL;
+        else
+            return stdInterface->accHitTest(xLeft, yLeft, pVarID);
+    }
+    
+    if (childObject)
+    {
+        if (childObject == m_pAccessible)
+        {
+            pVarID->vt = VT_I4;
+            pVarID->lVal = CHILDID_SELF;
+            return S_OK;
+        }
+        else
+        {
+            wxIAccessible* childIA = childObject->GetIAccessible();
+            if (!childIA)
+                return E_FAIL;
+
+               if (childIA->QueryInterface(IID_IDispatch, (LPVOID*) pVarID->pdispVal) != S_OK)
+                   return E_FAIL;
+            
+            pVarID->vt = VT_DISPATCH;
+            pVarID->pdispVal->AddRef();
+            return S_OK;
+        }
+    }
+    else if (childId > 0)
+    {
+        pVarID->vt = VT_I4;
+        pVarID->lVal = childId;
+        return S_OK;
+    }
+    else
+    {
+        pVarID->vt = VT_EMPTY;
+        return S_FALSE;
+    }
+    
+    return E_FAIL;
+}
+
+// Retrieves the specified object's current screen location. All visual objects must
+// support this method; sound objects do not support it.    
+
+STDMETHODIMP wxIAccessible::accLocation ( long* pxLeft, long* pyTop, long* pcxWidth, long* pcyHeight, VARIANT varID)
+{
+    wxASSERT (m_pAccessible != NULL);
+    if (!m_pAccessible)
+        return E_FAIL;
+    
+    wxRect rect;
+
+    wxAccStatus status = m_pAccessible->GetLocation(rect, varID.lVal);
+    if (status == wxACC_FAIL)
+        return E_FAIL;
+    
+    if (status == wxACC_NOT_IMPLEMENTED)
+    {
+        // Use standard interface instead.
+        IAccessible* stdInterface = (IAccessible*)m_pAccessible->GetIAccessibleStd();
+        if (!stdInterface)
+            return E_FAIL;
+        else
+            return stdInterface->accLocation(pxLeft, pyTop, pcxWidth, pcyHeight, varID);
+    }
+    else
+    {
+        *pxLeft = rect.x;
+        *pyTop = rect.y;
+        *pcxWidth = rect.width;
+        *pcyHeight = rect.height;
+        return S_OK;
+    }
+
+    return E_FAIL;
+}
+
+// Traverses to another user interface element within a container and retrieves the object.
+// All visual objects must support this method.
+
+STDMETHODIMP wxIAccessible::accNavigate ( long navDir, VARIANT varStart, VARIANT* pVarEnd)
+{
+    wxASSERT (m_pAccessible != NULL);
+    if (!m_pAccessible)
+        return E_FAIL;
+
+    if (varStart.vt != VT_I4)
+        return E_INVALIDARG;
+    
+    wxAccessible* elementObject = NULL;
+    int elementId = 0;
+    VariantInit(pVarEnd);
+    wxNavDir navDirWX = wxNAVDIR_FIRSTCHILD;
+
+    switch (navDir)
+    {
+    case NAVDIR_DOWN:
+        navDirWX = wxNAVDIR_DOWN;
+        break;
+
+    case NAVDIR_FIRSTCHILD:
+        navDirWX = wxNAVDIR_FIRSTCHILD;
+        break;
+
+    case NAVDIR_LASTCHILD:
+        navDirWX = wxNAVDIR_LASTCHILD;
+        break;
+
+    case NAVDIR_LEFT:
+        navDirWX = wxNAVDIR_LEFT;
+        break;
+
+    case NAVDIR_NEXT:
+        navDirWX = wxNAVDIR_NEXT;
+        break;
+
+    case NAVDIR_PREVIOUS:
+        navDirWX = wxNAVDIR_PREVIOUS;
+        break;
+
+    case NAVDIR_RIGHT:
+        navDirWX = wxNAVDIR_RIGHT;
+        break;
+
+    case NAVDIR_UP:
+        navDirWX = wxNAVDIR_UP;
+        break;
+    }
+    
+    wxAccStatus status = m_pAccessible->Navigate(navDirWX, varStart.lVal, & elementId,
+        & elementObject);
+
+    if (status == wxACC_FAIL)
+        return E_FAIL;
+    
+    if (status == wxACC_NOT_IMPLEMENTED)
+    {
+        // Use standard interface instead.
+        IAccessible* stdInterface = (IAccessible*)m_pAccessible->GetIAccessibleStd();
+        if (!stdInterface)
+            return E_FAIL;
+        else
+            return stdInterface->accNavigate ( navDir, varStart, pVarEnd);
+    }
+    else
+    {
+        if (elementObject)
+        {
+            wxIAccessible* objectIA = elementObject->GetIAccessible();
+            if (!objectIA)
+                return E_FAIL;
+
+               if (objectIA->QueryInterface(IID_IDispatch, (LPVOID*) pVarEnd->pdispVal) != S_OK)
+                   return E_FAIL;
+            
+            pVarEnd->vt = VT_DISPATCH;
+            pVarEnd->pdispVal->AddRef();
+            return S_OK;
+        }
+        else if (elementId > 0)
+        {
+            pVarEnd->vt = VT_I4;
+            pVarEnd->lVal = elementId;
+            return S_OK;
+        }
+        else
+        {
+            pVarEnd->vt = VT_EMPTY;
+            return S_FALSE;
+        }
+    }
+
+    return E_FAIL;
+}
+
+// Retrieves the address of an IDispatch interface for the specified child.
+// All objects must support this property.
+    
+STDMETHODIMP wxIAccessible::get_accChild ( VARIANT varChildID, IDispatch** ppDispChild)
+{
+    wxASSERT (m_pAccessible != NULL);
+    if (!m_pAccessible)
+        return E_FAIL;
+    
+    if (varChildID.vt != VT_I4)
+        return E_INVALIDARG;
+
+    if (varChildID.lVal == CHILDID_SELF)
+    {
+        *ppDispChild = this;
+        AddRef();
+        return S_OK;
+    }
+    
+    wxAccessible* child = NULL;
+
+    wxAccStatus status = m_pAccessible->GetChild(varChildID.lVal, & child);
+    if (status == wxACC_FAIL)
+        return E_FAIL;
+    
+    if (status == wxACC_NOT_IMPLEMENTED)
+    {
+        // Use standard interface instead.
+        IAccessible* stdInterface = (IAccessible*)m_pAccessible->GetIAccessibleStd();
+        if (!stdInterface)
+            return E_FAIL;
+        else
+            return stdInterface->get_accChild (varChildID, ppDispChild);
+    }
+    else
+    {
+        if (child)
+        {
+            wxIAccessible* objectIA = child->GetIAccessible();
+            if (!objectIA)
+                return E_FAIL;
+            *ppDispChild = objectIA;
+            objectIA->AddRef();
+            return S_OK;
+        }
+        else
+            return S_FALSE; // Indicates it's not an accessible object
+    }
+
+    return E_FAIL;
+}
+
+// Retrieves the number of children that belong to this object.
+// All objects must support this property.
+    
+STDMETHODIMP wxIAccessible::get_accChildCount ( long* pCountChildren)
+{
+    wxASSERT (m_pAccessible != NULL);
+    if (!m_pAccessible)
+        return E_FAIL;
+    
+    int childCount = 0;
+    wxAccStatus status = m_pAccessible->GetChildCount(& childCount);
+    if (status == wxACC_FAIL)
+        return E_FAIL;
+    
+    if (status == wxACC_NOT_IMPLEMENTED)
+    {
+        // Use standard interface instead.
+        IAccessible* stdInterface = (IAccessible*)m_pAccessible->GetIAccessibleStd();
+        if (!stdInterface)
+            return E_FAIL;
+        else
+            return stdInterface->get_accChildCount (pCountChildren);
+    }
+    else
+    {
+        * pCountChildren = (long) childCount;
+        return S_OK;
+    }
+
+    return E_FAIL;
+}
+
+// Retrieves the IDispatch interface of the object's parent.
+// All objects support this property.
+    
+STDMETHODIMP wxIAccessible::get_accParent ( IDispatch** ppDispParent)
+{
+    wxASSERT (m_pAccessible != NULL);
+    if (!m_pAccessible)
+        return E_FAIL;
+    
+    wxAccessible* parent = NULL;
+    wxAccStatus status = m_pAccessible->GetParent(& parent);
+    if (status == wxACC_FAIL)
+        return E_FAIL;
+    
+    if (status == wxACC_NOT_IMPLEMENTED)
+    {
+        // Use standard interface instead.
+        IAccessible* stdInterface = (IAccessible*)m_pAccessible->GetIAccessibleStd();
+        if (!stdInterface)
+            return E_FAIL;
+        else
+            return stdInterface->get_accParent (ppDispParent);
+    }
+    else
+    {
+        if (parent)
+        {
+            wxIAccessible* objectIA = parent->GetIAccessible();
+            if (!objectIA)
+                return E_FAIL;
+
+               if (objectIA->QueryInterface(IID_IDispatch, (LPVOID*) ppDispParent) != S_OK)
+                   return E_FAIL;
+            
+            (*ppDispParent)->AddRef();
+            return S_OK;
+/*
+            wxIAccessible* objectIA = parent->GetIAccessible();
+            if (!objectIA)
+                return E_FAIL;
+            objectIA->AddRef();
+            *ppDispParent = objectIA;
+            return S_OK;
+*/
+        }
+        else
+        {
+            *ppDispParent = NULL;
+            return S_OK;
+        }
+    }
+
+    return E_FAIL;
+}
+
+// Performs the object's default action. Not all objects have a default
+// action.
+    
+STDMETHODIMP wxIAccessible::accDoDefaultAction(VARIANT varID)
+{
+    wxASSERT (m_pAccessible != NULL);
+    if (!m_pAccessible)
+        return E_FAIL;
+    
+    if (varID.vt != VT_I4)
+        return E_INVALIDARG;
+    
+    wxAccStatus status = m_pAccessible->DoDefaultAction(varID.lVal);
+    if (status == wxACC_FAIL)
+        return E_FAIL;
+
+    if (status == wxACC_NOT_SUPPORTED)
+        return DISP_E_MEMBERNOTFOUND;
+    
+    if (status == wxACC_NOT_IMPLEMENTED)
+    {
+        // Use standard interface instead.
+        IAccessible* stdInterface = (IAccessible*)m_pAccessible->GetIAccessibleStd();
+        if (!stdInterface)
+            return E_FAIL;
+        else
+            return stdInterface->accDoDefaultAction(varID);
+    }
+    return E_FAIL;
+}
+
+// Retrieves a string that describes the object's default action.
+// Not all objects have a default action.
+    
+STDMETHODIMP wxIAccessible::get_accDefaultAction ( VARIANT varID, BSTR* pszDefaultAction)
+{
+    wxASSERT (m_pAccessible != NULL);
+    if (!m_pAccessible)
+        return E_FAIL;
+    
+    if (varID.vt != VT_I4)
+        return E_INVALIDARG;
+    
+    wxString defaultAction;
+    wxAccStatus status = m_pAccessible->GetDefaultAction(varID.lVal, & defaultAction);
+    if (status == wxACC_FAIL)
+        return E_FAIL;
+    
+    if (status == wxACC_NOT_SUPPORTED)
+        return DISP_E_MEMBERNOTFOUND;
+    
+    if (status == wxACC_NOT_IMPLEMENTED)
+    {
+        // Use standard interface instead.
+        IAccessible* stdInterface = (IAccessible*)m_pAccessible->GetIAccessibleStd();
+        if (!stdInterface)
+            return E_FAIL;
+        else
+            return stdInterface->get_accDefaultAction (varID, pszDefaultAction);
+    }
+    else
+    {
+        if (defaultAction.IsEmpty())
+        {
+            * pszDefaultAction = NULL;
+            return S_FALSE;
+        }
+        else
+        {
+            wxBasicString basicString(defaultAction);
+            * pszDefaultAction = basicString.Get();
+            return S_OK;
+        }
+    }
+    return E_FAIL;
+}
+
+// Retrieves a string that describes the visual appearance of the specified object.
+// Not all objects have a description.
+
+STDMETHODIMP wxIAccessible::get_accDescription ( VARIANT varID, BSTR* pszDescription)
+{
+    wxASSERT (m_pAccessible != NULL);
+    if (!m_pAccessible)
+        return E_FAIL;
+    
+    if (varID.vt != VT_I4)
+        return E_INVALIDARG;
+    
+    wxString description;
+    wxAccStatus status = m_pAccessible->GetDescription(varID.lVal, & description);
+    if (status == wxACC_FAIL)
+        return E_FAIL;
+    
+    if (status == wxACC_NOT_IMPLEMENTED)
+    {
+        // Use standard interface instead.
+        IAccessible* stdInterface = (IAccessible*)m_pAccessible->GetIAccessibleStd();
+        if (!stdInterface)
+            return E_FAIL;
+        else
+            return stdInterface->get_accDescription (varID, pszDescription);
+    }
+    else
+    {
+        if (description.IsEmpty())
+        {
+            * pszDescription = NULL;
+            return S_FALSE;
+        }
+        else
+        {
+            wxBasicString basicString(description);
+            * pszDescription = basicString.Get();
+            return S_OK;
+        }        
+    }
+    return E_FAIL;
+}
+
+// Retrieves an object's Help property string.
+// Not all objects support this property.
+
+STDMETHODIMP wxIAccessible::get_accHelp ( VARIANT varID, BSTR* pszHelp)
+{
+    wxASSERT (m_pAccessible != NULL);
+    if (!m_pAccessible)
+        return E_FAIL;
+    
+    if (varID.vt != VT_I4)
+        return E_INVALIDARG;
+    
+    wxString helpString;
+    wxAccStatus status = m_pAccessible->GetHelpText(varID.lVal, & helpString);
+    if (status == wxACC_FAIL)
+        return E_FAIL;
+    
+    if (status == wxACC_NOT_IMPLEMENTED)
+    {
+        // Use standard interface instead.
+        IAccessible* stdInterface = (IAccessible*)m_pAccessible->GetIAccessibleStd();
+        if (!stdInterface)
+            return E_FAIL;
+        else
+            return stdInterface->get_accHelp (varID, pszHelp);
+    }
+    else
+    {
+        if (helpString.IsEmpty())
+        {
+            * pszHelp = NULL;
+            return S_FALSE;
+        }
+        else
+        {
+            wxBasicString basicString(helpString);
+            * pszHelp = basicString.Get();
+            return S_OK;
+        }        
+    }
+    return E_FAIL;
+}
+
+// Retrieves the full path of the WinHelp file associated with the specified
+// object and the identifier of the appropriate topic within that file.
+// Not all objects support this property.
+// NOTE: not supported by wxWindows at this time. Use
+// GetHelpText instead.
+        
+STDMETHODIMP wxIAccessible::get_accHelpTopic ( BSTR* pszHelpFile, VARIANT varChild, long* pidTopic)
+{
+    wxASSERT (m_pAccessible != NULL);
+    if (!m_pAccessible)
+        return E_FAIL;
+    
+    if (varChild.vt != VT_I4)
+        return E_INVALIDARG;
+    
+    wxAccStatus status = wxACC_NOT_IMPLEMENTED;
+    if (status == wxACC_FAIL)
+        return E_FAIL;
+    
+    if (status == wxACC_NOT_IMPLEMENTED)
+    {
+        // Use standard interface instead.
+        IAccessible* stdInterface = (IAccessible*)m_pAccessible->GetIAccessibleStd();
+        if (!stdInterface)
+            return E_FAIL;
+        else
+            return stdInterface->get_accHelpTopic (pszHelpFile, varChild, pidTopic);
+    }
+    return E_FAIL;
+}
+
+// Retrieves the specified object's shortcut key or access key, also known as
+// the mnemonic. All objects that have a shortcut key or access key support
+// this property.
+        
+STDMETHODIMP wxIAccessible::get_accKeyboardShortcut ( VARIANT varID, BSTR* pszKeyboardShortcut)
+{
+    *pszKeyboardShortcut = NULL;
+
+    wxASSERT (m_pAccessible != NULL);
+    if (!m_pAccessible)
+        return E_FAIL;
+    
+    if (varID.vt != VT_I4)
+        return E_INVALIDARG;
+    
+    wxString keyboardShortcut;
+    wxAccStatus status = m_pAccessible->GetHelpText(varID.lVal, & keyboardShortcut);
+    if (status == wxACC_FAIL)
+        return E_FAIL;
+    
+    if (status == wxACC_NOT_IMPLEMENTED)
+    {
+        // Use standard interface instead.
+        IAccessible* stdInterface = (IAccessible*)m_pAccessible->GetIAccessibleStd();
+        if (!stdInterface)
+            return E_FAIL;
+        else
+            return stdInterface->get_accKeyboardShortcut(varID, pszKeyboardShortcut);
+    }
+    else
+    {
+        if (keyboardShortcut.IsEmpty())
+        {
+            * pszKeyboardShortcut = NULL;
+            return S_FALSE;
+        }
+        else
+        {
+            wxBasicString basicString(keyboardShortcut);
+            * pszKeyboardShortcut = basicString.Get();
+            return S_OK;
+        }        
+    }
+    return E_FAIL;
+}
+
+// Retrieves the name of the specified object.
+// All objects support this property.
+    
+STDMETHODIMP wxIAccessible::get_accName ( VARIANT varID, BSTR* pszName)
+{
+    *pszName = NULL;
+
+    wxASSERT (m_pAccessible != NULL);
+    if (!m_pAccessible)
+        return E_FAIL;
+
+    if (varID.vt != VT_I4)
+        return E_INVALIDARG;
+    
+    wxString name;
+    
+    wxAccStatus status = m_pAccessible->GetName(varID.lVal, & name);
+    
+    if (status == wxACC_FAIL)
+        return E_FAIL;
+    
+    if (status == wxACC_NOT_IMPLEMENTED)
+    {
+        // Use standard interface instead.
+        IAccessible* stdInterface = (IAccessible*)m_pAccessible->GetIAccessibleStd();
+        if (!stdInterface)
+            return E_FAIL;
+        else
+            return stdInterface->get_accName (varID, pszName);
+    }
+    else
+    {
+        wxBasicString basicString(name);
+        *pszName = basicString.Get();
+        return S_OK;
+    }
+    return E_FAIL;
+}
+
+// Retrieves information that describes the role of the specified object.
+// All objects support this property.
+
+STDMETHODIMP wxIAccessible::get_accRole ( VARIANT varID, VARIANT* pVarRole)
+{
+    wxASSERT (m_pAccessible != NULL);
+    if (!m_pAccessible)
+        return E_FAIL;
+    
+    if (varID.vt != VT_I4)
+        return E_INVALIDARG;
+    
+    VariantInit(pVarRole);
+
+    wxAccRole role = wxROLE_NONE;
+    
+    wxAccStatus status = m_pAccessible->GetRole(varID.lVal, & role);
+    
+    if (status == wxACC_FAIL)
+        return E_FAIL;
+    
+    if (status == wxACC_NOT_IMPLEMENTED)
+    {
+        // Use standard interface instead.
+        IAccessible* stdInterface = (IAccessible*)m_pAccessible->GetIAccessibleStd();
+        if (!stdInterface)
+            return E_FAIL;
+        else
+            return stdInterface->get_accRole (varID, pVarRole);
+    }
+    else
+    {
+        if (role == wxROLE_NONE)
+        {
+            pVarRole->vt = VT_EMPTY;
+            return S_OK;
+        }
+
+        pVarRole->lVal = wxConvertToWindowsRole(role);
+        pVarRole->vt = VT_I4;
+
+        return S_OK;
+    }
+    return E_FAIL;
+}
+
+// Retrieves the current state of the specified object.
+// All objects support this property.
+    
+STDMETHODIMP wxIAccessible::get_accState ( VARIANT varID, VARIANT* pVarState)
+{
+    wxASSERT (m_pAccessible != NULL);
+    if (!m_pAccessible)
+        return E_FAIL;
+    
+    if (varID.vt != VT_I4)
+        return E_INVALIDARG;
+
+    long wxstate = 0;
+    
+    wxAccStatus status = m_pAccessible->GetState(varID.lVal, & wxstate);
+    if (status == wxACC_FAIL)
+        return E_FAIL;
+    
+    if (status == wxACC_NOT_IMPLEMENTED)
+    {
+        // Use standard interface instead.
+        IAccessible* stdInterface = (IAccessible*)m_pAccessible->GetIAccessibleStd();
+        if (!stdInterface)
+            return E_FAIL;
+        else
+            return stdInterface->get_accState (varID, pVarState);
+    }
+    else
+    {
+        long state = wxConvertToWindowsState(wxstate);
+        pVarState->lVal = state;
+        pVarState->vt = VT_I4;
+        return S_OK;
+    }
+    return E_FAIL;
+}
+    
+// Retrieves the value of the specified object.
+// Not all objects have a value.
+
+STDMETHODIMP wxIAccessible::get_accValue ( VARIANT varID, BSTR* pszValue)
+{
+    wxASSERT (m_pAccessible != NULL);
+    if (!m_pAccessible)
+        return E_FAIL;
+    
+    if (varID.vt != VT_I4)
+        return E_INVALIDARG;
+    
+    wxString strValue;
+    
+    wxAccStatus status = m_pAccessible->GetValue(varID.lVal, & strValue);
+    
+    if (status == wxACC_FAIL)
+        return E_FAIL;
+    
+    if (status == wxACC_NOT_IMPLEMENTED)
+    {
+        // Use standard interface instead.
+        IAccessible* stdInterface = (IAccessible*)m_pAccessible->GetIAccessibleStd();
+        if (!stdInterface)
+            return E_FAIL;
+        else
+            return stdInterface->get_accValue (varID, pszValue);
+    }
+    else
+    {
+        wxBasicString basicString(strValue);
+        * pszValue = basicString.Get();
+        return S_OK;
+    }
+    return E_FAIL;
+}
+
+// Modifies the selection or moves the keyboard focus of the
+// specified object. All objects that select or receive the
+// keyboard focus must support this method.
+
+STDMETHODIMP wxIAccessible::accSelect ( long flagsSelect, VARIANT varID )
+{
+    wxASSERT (m_pAccessible != NULL);
+    if (!m_pAccessible)
+        return E_FAIL;
+    
+    if (varID.vt != VT_I4)
+        return E_INVALIDARG;
+    
+    wxAccSelectionFlags wxsel = wxConvertFromWindowsSelFlag(flagsSelect);
+
+    wxAccStatus status = m_pAccessible->Select(varID.lVal, wxsel);
+    if (status == wxACC_FAIL)
+        return E_FAIL;
+    
+    if (status == wxACC_NOT_IMPLEMENTED)
+    {
+        // Use standard interface instead.
+        IAccessible* stdInterface = (IAccessible*)m_pAccessible->GetIAccessibleStd();
+        if (!stdInterface)
+            return E_FAIL;
+        else
+            return stdInterface->accSelect ( flagsSelect, varID );
+    }
+    else
+        return S_OK;
+
+    return E_FAIL;
+}
+
+// Retrieves the object that has the keyboard focus. All objects
+// that receive the keyboard focus must support this property.
+        
+STDMETHODIMP wxIAccessible::get_accFocus ( VARIANT* pVarID)
+{
+    wxASSERT (m_pAccessible != NULL);
+    if (!m_pAccessible)
+        return E_FAIL;
+    
+    wxAccessible* childObject = NULL;
+    int childId = 0;
+    VariantInit(pVarID);
+    
+    wxAccStatus status = m_pAccessible->GetFocus(& childId, & childObject);
+    if (status == wxACC_FAIL)
+        return E_FAIL;
+    
+    if (status == wxACC_NOT_IMPLEMENTED)
+    {
+        // Use standard interface instead.
+        IAccessible* stdInterface = (IAccessible*)m_pAccessible->GetIAccessibleStd();
+        if (!stdInterface)
+            return E_FAIL;
+        else
+            return stdInterface->get_accFocus (pVarID);
+    }
+    if (childObject)
+    {
+        if (childObject == m_pAccessible)
+        {
+            pVarID->vt = VT_I4;
+            pVarID->lVal = CHILDID_SELF;
+            return S_OK;
+        }
+        else
+        {
+            wxIAccessible* childIA = childObject->GetIAccessible();
+            if (!childIA)
+                return E_FAIL;
+
+               if (childIA->QueryInterface(IID_IDispatch, (LPVOID*) pVarID->pdispVal) != S_OK)
+                   return E_FAIL;
+            
+            pVarID->vt = VT_DISPATCH;
+            pVarID->pdispVal->AddRef();
+            return S_OK;
+        }
+    }
+    else if (childId > 0)
+    {
+        pVarID->vt = VT_I4;
+        pVarID->lVal = childId;
+        return S_OK;
+    }
+    else
+    {
+        pVarID->vt = VT_EMPTY;
+        return S_FALSE;
+    }
+    
+    return E_FAIL;
+}
+
+// Retrieves the selected children of this object. All objects
+// selected must support this property.
+        
+STDMETHODIMP wxIAccessible::get_accSelection ( VARIANT * pVarChildren)
+{
+    wxASSERT (m_pAccessible != NULL);
+    if (!m_pAccessible)
+        return E_FAIL;
+
+    VariantInit(pVarChildren);
+    
+    wxVariant selections;
+    wxAccStatus status = m_pAccessible->GetSelections(& selections);
+    if (status == wxACC_FAIL)
+        return E_FAIL;
+    
+    if (status == wxACC_NOT_IMPLEMENTED)
+    {
+        // Use standard interface instead.
+        IAccessible* stdInterface = (IAccessible*)m_pAccessible->GetIAccessibleStd();
+        if (!stdInterface)
+            return E_FAIL;
+        else
+            return stdInterface->get_accSelection (pVarChildren);
+    }
+    else
+    {
+        if (selections.GetType() == wxT("long"))
+        {
+            pVarChildren->vt = VT_I4;
+            pVarChildren->lVal = selections.GetLong();
+
+            return S_OK;
+        }
+        else if (selections.GetType() == wxT("void*"))
+        {
+            wxAccessible* childObject = (wxAccessible*) selections.GetVoidPtr();
+            wxIAccessible* childIA = childObject->GetIAccessible();
+            if (!childIA)
+                return E_FAIL;
+
+               if (childIA->QueryInterface(IID_IDispatch, (LPVOID*) pVarChildren->pdispVal) != S_OK)
+                   return E_FAIL;
+            
+            pVarChildren->vt = VT_DISPATCH;
+            pVarChildren->pdispVal->AddRef();
+
+            return S_OK;
+        }
+        else if (selections.GetType() == wxT("list"))
+        {
+            // TODO: should we AddRef for every "void*" member??
+
+            wxIEnumVARIANT* enumVariant = new wxIEnumVARIANT(selections);
+            enumVariant->AddRef();
+
+            pVarChildren->vt = VT_UNKNOWN;
+            pVarChildren->punkVal = enumVariant;
+
+            return S_OK;
+        }
+    }
+
+    return E_FAIL;
+}
+
+// Get type info
+
+STDMETHODIMP wxIAccessible::GetTypeInfo(unsigned int typeInfo, LCID lcid, ITypeInfo** ppTypeInfo)
+{
+    *ppTypeInfo = NULL;
+    return E_NOTIMPL;
+}
+
+// Get type info count
+
+STDMETHODIMP wxIAccessible::GetTypeInfoCount(unsigned int* typeInfoCount)
+{
+    *typeInfoCount = 0;
+    return E_NOTIMPL;
+}
+
+// Get ids of names
+
+STDMETHODIMP wxIAccessible::GetIDsOfNames(REFIID riid, OLECHAR** names, unsigned int cNames,
+        LCID lcid, DISPID* dispId)
+{
+    return E_NOTIMPL;
+}
+
+// Invoke
+
+STDMETHODIMP wxIAccessible::Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, 
+                        WORD wFlags, DISPPARAMS *pDispParams, 
+                        VARIANT *pVarResult, EXCEPINFO *pExcepInfo, 
+                        unsigned int *puArgErr )
+{
+    return E_NOTIMPL;
+}
+
+// ----------------------------------------------------------------------------
+// wxAccessible implementation
+// ----------------------------------------------------------------------------
+
+// ctors
+
+// common part of all ctors
+void wxAccessible::Init()
+{
+    m_pIAccessibleStd = NULL;
+    m_pIAccessible = new wxIAccessible(this);
+    m_pIAccessible->AddRef();
+}
+
+wxAccessible::wxAccessible(wxWindow* win)
+            : wxAccessibleBase(win)
+{
+    Init();
+}
+
+wxAccessible::~wxAccessible()
+{
+    m_pIAccessible->Release();
+    if (m_pIAccessibleStd)
+        ((IAccessible*)m_pIAccessibleStd)->Release();
+}
+
+// Gets or creates a standard interface for this object.
+void* wxAccessible::GetIAccessibleStd()
+{
+    if (m_pIAccessibleStd)
+        return m_pIAccessibleStd;
+
+    if (GetWindow())
+    {
+#if 0
+        HRESULT retCode = ::CreateStdAccessibleProxy((HWND) GetWindow()->GetHWND(),
+                wxT("wxWindowClass"), OBJID_CLIENT, IID_IAccessible, (void**) & m_pIAccessibleStd);
+#else
+        HRESULT retCode = ::CreateStdAccessibleObject((HWND) GetWindow()->GetHWND(),
+                OBJID_CLIENT, IID_IAccessible, (void**) & m_pIAccessibleStd);
+#endif
+        if (retCode == S_OK)
+            return m_pIAccessibleStd;
+        else
+        {
+            m_pIAccessibleStd = NULL;
+            return NULL;
+        }
+    }
+    return NULL;
+}
+
+// Utilities
+
+// Convert to Windows role
+int wxConvertToWindowsRole(wxAccRole wxrole)
+{
+    switch (wxrole)
+    {
+    case wxROLE_SYSTEM_ALERT:
+        return ROLE_SYSTEM_ALERT;
+    case wxROLE_SYSTEM_ANIMATION:
+        return ROLE_SYSTEM_ANIMATION;
+    case wxROLE_SYSTEM_APPLICATION:
+        return ROLE_SYSTEM_APPLICATION;
+    case wxROLE_SYSTEM_BORDER:
+        return ROLE_SYSTEM_BORDER;
+    case wxROLE_SYSTEM_BUTTONDROPDOWN:
+        return ROLE_SYSTEM_BUTTONDROPDOWN;
+    case wxROLE_SYSTEM_BUTTONDROPDOWNGRID:
+        return ROLE_SYSTEM_BUTTONDROPDOWNGRID;
+    case wxROLE_SYSTEM_BUTTONMENU:
+        return ROLE_SYSTEM_BUTTONMENU;
+    case wxROLE_SYSTEM_CARET:
+        return ROLE_SYSTEM_CARET;
+    case wxROLE_SYSTEM_CELL:
+        return ROLE_SYSTEM_CELL;
+    case wxROLE_SYSTEM_CHARACTER:
+        return ROLE_SYSTEM_CHARACTER;
+    case wxROLE_SYSTEM_CHART:
+        return ROLE_SYSTEM_CHART;
+    case wxROLE_SYSTEM_CHECKBUTTON:
+        return ROLE_SYSTEM_CHECKBUTTON;
+    case wxROLE_SYSTEM_CLIENT:
+        return ROLE_SYSTEM_CLIENT;
+    case wxROLE_SYSTEM_CLOCK:
+        return ROLE_SYSTEM_CLOCK;
+    case wxROLE_SYSTEM_COLUMN:
+        return ROLE_SYSTEM_COLUMN;
+    case wxROLE_SYSTEM_COLUMNHEADER:
+        return ROLE_SYSTEM_COLUMNHEADER;
+    case wxROLE_SYSTEM_COMBOBOX:
+        return ROLE_SYSTEM_COMBOBOX;
+    case wxROLE_SYSTEM_CURSOR:
+        return ROLE_SYSTEM_CURSOR;
+    case wxROLE_SYSTEM_DIAGRAM:
+        return ROLE_SYSTEM_DIAGRAM;
+    case wxROLE_SYSTEM_DIAL:
+        return ROLE_SYSTEM_DIAL;
+    case wxROLE_SYSTEM_DIALOG:
+        return ROLE_SYSTEM_DIALOG;
+    case wxROLE_SYSTEM_DOCUMENT:
+        return ROLE_SYSTEM_DOCUMENT;
+    case wxROLE_SYSTEM_DROPLIST:
+        return ROLE_SYSTEM_DROPLIST;
+    case wxROLE_SYSTEM_EQUATION:
+        return ROLE_SYSTEM_EQUATION;
+    case wxROLE_SYSTEM_GRAPHIC:
+        return ROLE_SYSTEM_GRAPHIC;
+    case wxROLE_SYSTEM_GRIP:
+        return ROLE_SYSTEM_GRIP;
+    case wxROLE_SYSTEM_GROUPING:
+        return ROLE_SYSTEM_GROUPING;
+    case wxROLE_SYSTEM_HELPBALLOON:
+        return ROLE_SYSTEM_HELPBALLOON;
+    case wxROLE_SYSTEM_HOTKEYFIELD:
+        return ROLE_SYSTEM_HOTKEYFIELD;
+    case wxROLE_SYSTEM_INDICATOR:
+        return ROLE_SYSTEM_INDICATOR;
+    case wxROLE_SYSTEM_LINK:
+        return ROLE_SYSTEM_LINK;
+    case wxROLE_SYSTEM_LIST:
+        return ROLE_SYSTEM_LIST;
+    case wxROLE_SYSTEM_LISTITEM:
+        return ROLE_SYSTEM_LISTITEM;
+    case wxROLE_SYSTEM_MENUBAR:
+        return ROLE_SYSTEM_MENUBAR;
+    case wxROLE_SYSTEM_MENUITEM:
+        return ROLE_SYSTEM_MENUITEM;
+    case wxROLE_SYSTEM_MENUPOPUP:
+        return ROLE_SYSTEM_MENUPOPUP;
+    case wxROLE_SYSTEM_OUTLINE:
+        return ROLE_SYSTEM_OUTLINE;
+    case wxROLE_SYSTEM_OUTLINEITEM:
+        return ROLE_SYSTEM_OUTLINEITEM;
+    case wxROLE_SYSTEM_PAGETAB:
+        return ROLE_SYSTEM_PAGETAB;
+    case wxROLE_SYSTEM_PAGETABLIST:
+        return ROLE_SYSTEM_PAGETABLIST;
+    case wxROLE_SYSTEM_PANE:
+        return ROLE_SYSTEM_PANE;
+    case wxROLE_SYSTEM_PROGRESSBAR:
+        return ROLE_SYSTEM_PROGRESSBAR;
+    case wxROLE_SYSTEM_PROPERTYPAGE:
+        return ROLE_SYSTEM_PROPERTYPAGE;
+    case wxROLE_SYSTEM_PUSHBUTTON:
+        return ROLE_SYSTEM_PUSHBUTTON;
+    case wxROLE_SYSTEM_RADIOBUTTON:
+        return ROLE_SYSTEM_RADIOBUTTON;
+    case wxROLE_SYSTEM_ROW:
+        return ROLE_SYSTEM_ROW;
+    case wxROLE_SYSTEM_ROWHEADER:
+        return ROLE_SYSTEM_ROWHEADER;
+    case wxROLE_SYSTEM_SCROLLBAR:
+        return ROLE_SYSTEM_SCROLLBAR;
+    case wxROLE_SYSTEM_SEPARATOR:
+        return ROLE_SYSTEM_SEPARATOR;
+    case wxROLE_SYSTEM_SLIDER:
+        return ROLE_SYSTEM_SLIDER;
+    case wxROLE_SYSTEM_SOUND:
+        return ROLE_SYSTEM_SOUND;
+    case wxROLE_SYSTEM_SPINBUTTON:
+        return ROLE_SYSTEM_SPINBUTTON;
+    case wxROLE_SYSTEM_STATICTEXT:
+        return ROLE_SYSTEM_STATICTEXT;
+    case wxROLE_SYSTEM_STATUSBAR:
+        return ROLE_SYSTEM_STATUSBAR;
+    case wxROLE_SYSTEM_TABLE:
+        return ROLE_SYSTEM_TABLE;
+    case wxROLE_SYSTEM_TEXT:
+        return ROLE_SYSTEM_TEXT;
+    case wxROLE_SYSTEM_TITLEBAR:
+        return ROLE_SYSTEM_TITLEBAR;
+    case wxROLE_SYSTEM_TOOLBAR:
+        return ROLE_SYSTEM_TOOLBAR;
+    case wxROLE_SYSTEM_TOOLTIP:
+        return ROLE_SYSTEM_TOOLTIP;
+    case wxROLE_SYSTEM_WHITESPACE:
+        return ROLE_SYSTEM_WHITESPACE;
+    case wxROLE_SYSTEM_WINDOW:
+        return ROLE_SYSTEM_WINDOW;
+    }
+    return 0;
+}
+
+// Convert to Windows state
+long wxConvertToWindowsState(long wxstate)
+{
+    long state = 0;
+    if (wxstate & wxACC_STATE_SYSTEM_ALERT_HIGH)
+        state |= STATE_SYSTEM_ALERT_HIGH;
+
+    if (wxstate & wxACC_STATE_SYSTEM_ALERT_MEDIUM)
+        state |= STATE_SYSTEM_ALERT_MEDIUM;
+
+    if (wxstate & wxACC_STATE_SYSTEM_ALERT_LOW)
+        state |= STATE_SYSTEM_ALERT_LOW;
+
+    if (wxstate & wxACC_STATE_SYSTEM_ANIMATED)
+        state |= STATE_SYSTEM_ANIMATED;
+
+    if (wxstate & wxACC_STATE_SYSTEM_BUSY)
+        state |= STATE_SYSTEM_BUSY;
+
+    if (wxstate & wxACC_STATE_SYSTEM_CHECKED)
+        state |= STATE_SYSTEM_CHECKED;
+
+    if (wxstate & wxACC_STATE_SYSTEM_COLLAPSED)
+        state |= STATE_SYSTEM_COLLAPSED;
+
+    if (wxstate & wxACC_STATE_SYSTEM_DEFAULT)
+        state |= STATE_SYSTEM_DEFAULT;
+
+    if (wxstate & wxACC_STATE_SYSTEM_EXPANDED)
+        state |= STATE_SYSTEM_EXPANDED;
+
+    if (wxstate & wxACC_STATE_SYSTEM_EXTSELECTABLE)
+        state |= STATE_SYSTEM_EXTSELECTABLE;
+
+    if (wxstate & wxACC_STATE_SYSTEM_FLOATING)
+        state |= STATE_SYSTEM_FLOATING;
+
+    if (wxstate & wxACC_STATE_SYSTEM_FOCUSABLE)
+        state |= STATE_SYSTEM_FOCUSABLE;
+
+    if (wxstate & wxACC_STATE_SYSTEM_FOCUSED)
+        state |= STATE_SYSTEM_FOCUSED;
+
+    if (wxstate & wxACC_STATE_SYSTEM_HOTTRACKED)
+        state |= STATE_SYSTEM_HOTTRACKED;
+
+    if (wxstate & wxACC_STATE_SYSTEM_INVISIBLE)
+        state |= STATE_SYSTEM_INVISIBLE;
+
+    if (wxstate & wxACC_STATE_SYSTEM_INVISIBLE)
+        state |= STATE_SYSTEM_INVISIBLE;
+
+    if (wxstate & wxACC_STATE_SYSTEM_MIXED)
+        state |= STATE_SYSTEM_MIXED;
+
+    if (wxstate & wxACC_STATE_SYSTEM_MULTISELECTABLE)
+        state |= STATE_SYSTEM_MULTISELECTABLE;
+
+    if (wxstate & wxACC_STATE_SYSTEM_OFFSCREEN)
+        state |= STATE_SYSTEM_OFFSCREEN;
+
+    if (wxstate & wxACC_STATE_SYSTEM_PRESSED)
+        state |= STATE_SYSTEM_PRESSED;
+
+//    if (wxstate & wxACC_STATE_SYSTEM_PROTECTED)
+//        state |= STATE_SYSTEM_PROTECTED;
+
+    if (wxstate & wxACC_STATE_SYSTEM_READONLY)
+        state |= STATE_SYSTEM_READONLY;
+
+    if (wxstate & wxACC_STATE_SYSTEM_SELECTABLE)
+        state |= STATE_SYSTEM_SELECTABLE;
+
+    if (wxstate & wxACC_STATE_SYSTEM_SELECTED)
+        state |= STATE_SYSTEM_SELECTED;
+
+    if (wxstate & wxACC_STATE_SYSTEM_SELFVOICING)
+        state |= STATE_SYSTEM_SELFVOICING;
+
+    if (wxstate & wxACC_STATE_SYSTEM_UNAVAILABLE)
+        state |= STATE_SYSTEM_UNAVAILABLE;
+
+    return state;
+}
+
+// Convert to Windows selection flag
+int wxConvertToWindowsSelFlag(wxAccSelectionFlags wxsel)
+{
+    int sel = 0;
+
+    if (sel & wxACC_SEL_TAKEFOCUS)
+        sel |= SELFLAG_TAKEFOCUS;
+    if (sel & wxACC_SEL_TAKESELECTION)
+        sel |= SELFLAG_TAKESELECTION;
+    if (sel & wxACC_SEL_EXTENDSELECTION)
+        sel |= SELFLAG_EXTENDSELECTION;
+    if (sel & wxACC_SEL_ADDSELECTION)
+        sel |= SELFLAG_ADDSELECTION;
+    if (sel & wxACC_SEL_REMOVESELECTION)
+        sel |= SELFLAG_REMOVESELECTION;
+    return sel;
+}
+
+// Convert from Windows selection flag
+wxAccSelectionFlags wxConvertFromWindowsSelFlag(int sel)
+{
+    int wxsel = 0;
+
+    if (sel & SELFLAG_TAKEFOCUS)
+        wxsel |= wxACC_SEL_TAKEFOCUS;
+    if (sel & SELFLAG_TAKESELECTION)
+        wxsel |= wxACC_SEL_TAKESELECTION;
+    if (sel & SELFLAG_EXTENDSELECTION)
+        wxsel |= wxACC_SEL_EXTENDSELECTION;
+    if (sel & SELFLAG_ADDSELECTION)
+        wxsel |= wxACC_SEL_ADDSELECTION;
+    if (sel & SELFLAG_REMOVESELECTION)
+        wxsel |= wxACC_SEL_REMOVESELECTION;
+    return (wxAccSelectionFlags) wxsel;
+}
+
+
+#endif  //USE_ACCESSIBILITY
index 9596ceea35f532800860a70a90a35577cbc41574..063f4c4c7ea52e1944241e307e33c0b69731b18d 100644 (file)
@@ -28,6 +28,7 @@
 
 #define _FORCENAMELESSUNION
 #include "wx/log.h"
+#include "wx/msw/ole/oleutils.h"
 #include "wx/msw/ole/automtn.h"
 #include "wx/msw/private.h"
 
 #include <ole2ver.h>
 #include <oleauto.h>
 
-// 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);
-
-// Convert string from BSTR to wxString
-static wxString ConvertStringFromOle(BSTR bStr);
-
 // Verifies will fail if the needed buffer size is too large
 #define MAX_TIME_BUFFER_SIZE    128         // matches that in timecore.cpp
 #define MIN_DATE                (-657434L)  // about year 100
@@ -154,7 +122,7 @@ bool wxAutomationObject::Invoke(const wxString& member, int action,
 
        int namedArgStringCount = namedArgCount + 1;
        BSTR* argNames = new BSTR[namedArgStringCount];
-       argNames[0] = ConvertStringToOle(member);
+       argNames[0] = wxConvertStringToOle(member);
 
        // Note that arguments are specified in reverse order
        // (all totally logical; hey, we're dealing with OLE here.)
@@ -164,7 +132,7 @@ bool wxAutomationObject::Invoke(const wxString& member, int action,
        {       
                if (!INVOKEARG(i).GetName().IsNull())
                {
-                       argNames[(namedArgCount-j)] = ConvertStringToOle(INVOKEARG(i).GetName());
+                       argNames[(namedArgCount-j)] = wxConvertStringToOle(INVOKEARG(i).GetName());
                        j ++;
                }
        }
@@ -203,7 +171,7 @@ bool wxAutomationObject::Invoke(const wxString& member, int action,
        for (i = 0; i < noArgs; i++)
        {
                // Again, reverse args
-               if (!ConvertVariantToOle(INVOKEARG((noArgs-1) - i), oleArgs[i]))
+               if (!wxConvertVariantToOle(INVOKEARG((noArgs-1) - i), oleArgs[i]))
         {
                delete[] argNames;
                delete[] dispIds;
@@ -252,7 +220,7 @@ bool wxAutomationObject::Invoke(const wxString& member, int action,
                if (vReturnPtr)
                {
                        // Convert result to wxVariant form
-                       ConvertOleToVariant(vReturn, retValue);
+                       wxConvertOleToVariant(vReturn, retValue);
                        // Mustn't release the dispatch pointer
                        if (vReturn.vt == VT_DISPATCH)
                        {
@@ -534,7 +502,7 @@ bool wxAutomationObject::GetInstance(const wxString& classId) const
        CLSID clsId;
        IUnknown * pUnk = NULL;
 
-       BasicString unicodeName(classId.mb_str());
+       wxBasicString unicodeName(classId.mb_str());
        
        if (FAILED(CLSIDFromProgID((BSTR) unicodeName, &clsId))) 
        {
@@ -566,7 +534,7 @@ bool wxAutomationObject::CreateInstance(const wxString& classId) const
 
        CLSID clsId;
 
-       BasicString unicodeName(classId.mb_str());
+       wxBasicString unicodeName(classId.mb_str());
        
        if (FAILED(CLSIDFromProgID((BSTR) unicodeName, &clsId))) 
        {
@@ -585,7 +553,7 @@ bool wxAutomationObject::CreateInstance(const wxString& classId) const
 }
 
 
-bool ConvertVariantToOle(const wxVariant& variant, VARIANTARG& oleVariant)
+bool wxConvertVariantToOle(const wxVariant& variant, VARIANTARG& oleVariant)
 {
        ClearVariant(&oleVariant);
        if (variant.IsNull())
@@ -629,7 +597,7 @@ bool ConvertVariantToOle(const wxVariant& variant, VARIANTARG& oleVariant)
     {
         wxString str( variant.GetString() );
         oleVariant.vt = VT_BSTR;
-        oleVariant.bstrVal = ConvertStringToOle(str);
+        oleVariant.bstrVal = wxConvertStringToOle(str);
     }
 // For some reason, Watcom C++ can't link variant.cpp with time/date classes compiled
 #if wxUSE_TIMEDATE && !defined(__WATCOMC__)
@@ -683,7 +651,7 @@ bool ConvertVariantToOle(const wxVariant& variant, VARIANTARG& oleVariant)
            {
                    // copy each string in the list of strings
             wxVariant eachVariant(variant[i]);
-            if (!ConvertVariantToOle(eachVariant, * pvarg))
+            if (!wxConvertVariantToOle(eachVariant, * pvarg))
             {
                            // memory failure:  back out and free strings alloc'ed up to
                            // now, and then the array itself.
@@ -715,13 +683,13 @@ bool ConvertVariantToOle(const wxVariant& variant, VARIANTARG& oleVariant)
 #define VT_TYPEMASK 0xfff
 #endif
 
-bool ConvertOleToVariant(const VARIANTARG& oleVariant, wxVariant& variant)
+bool wxConvertOleToVariant(const VARIANTARG& oleVariant, wxVariant& variant)
 {
        switch (oleVariant.vt & VT_TYPEMASK)
        {
        case VT_BSTR:
                {
-                       wxString str(ConvertStringFromOle(oleVariant.bstrVal));
+                       wxString str(wxConvertStringFromOle(oleVariant.bstrVal));
                        variant = str;
                        break;
                }
@@ -794,7 +762,7 @@ bool ConvertOleToVariant(const VARIANTARG& oleVariant, wxVariant& variant)
                        {
                                VARIANTARG& oleElement = pvdata[i];
                                wxVariant vElement;
-                               if (!ConvertOleToVariant(oleElement, vElement))
+                               if (!wxConvertOleToVariant(oleElement, vElement))
                                        return FALSE;
                                
                                variant.Append(vElement);
@@ -825,7 +793,7 @@ bool ConvertOleToVariant(const VARIANTARG& oleVariant, wxVariant& variant)
     return TRUE;
 }
 
-static BSTR ConvertStringToOle(const wxString& str)
+BSTR wxConvertStringToOle(const wxString& str)
 {
 /*
        unsigned int len = strlen((const char*) str);
@@ -835,11 +803,11 @@ static BSTR ConvertStringToOle(const wxString& str)
        for (i=0; i < len; i++)
                s[i*2] = str[i];
 */
-       BasicString bstr(str.mb_str());
+       wxBasicString bstr(str.mb_str());
        return bstr.Get();
 }
 
-static wxString ConvertStringFromOle(BSTR bStr)
+wxString wxConvertStringFromOle(BSTR bStr)
 {
 #if wxUSE_UNICODE
     wxString str(bStr);
@@ -854,32 +822,50 @@ static wxString ConvertStringFromOle(BSTR bStr)
 }
 
 // ----------------------------------------------------------------------------
-// BasicString
+// wxBasicString
 // ----------------------------------------------------------------------------
 
 // ctor takes an ANSI string and transforms it to Unicode
-BasicString::BasicString(const char *sz)
+wxBasicString::wxBasicString(const char *sz)
+{
+    Init(sz);
+}
+
+// ctor takes an ANSI or Unicode string and transforms it to Unicode
+wxBasicString::wxBasicString(const wxString& str)
 {
-  // get the size of required buffer
-  UINT lenAnsi = strlen(sz);
-  #ifdef __MWERKS__
-  UINT lenWide = lenAnsi * 2 ;
-  #else
-  UINT lenWide = mbstowcs(NULL, sz, lenAnsi);
-  #endif
-
-  if ( lenWide > 0 ) {
-    m_wzBuf = new OLECHAR[lenWide + 1];
-    mbstowcs(m_wzBuf, sz, lenAnsi);
-    m_wzBuf[lenWide] = L'\0';
-  }
-  else {
-    m_wzBuf = NULL;
-  }
+#if wxUSE_UNICODE
+    m_wzBuf = new OLECHAR[str.Length() + 1];
+    memcpy(m_wzBuf, str.c_str(), str.Length()*2);
+    m_wzBuf[str.Length()] = L'\0';
+#else
+    Init(str.c_str());
+#endif
+}
+
+// Takes an ANSI string and transforms it to Unicode
+void wxBasicString::Init(const char *sz)
+{
+    // get the size of required buffer
+    UINT lenAnsi = strlen(sz);
+#ifdef __MWERKS__
+    UINT lenWide = lenAnsi * 2 ;
+#else
+    UINT lenWide = mbstowcs(NULL, sz, lenAnsi);
+#endif
+    
+    if ( lenWide > 0 ) {
+        m_wzBuf = new OLECHAR[lenWide + 1];
+        mbstowcs(m_wzBuf, sz, lenAnsi);
+        m_wzBuf[lenWide] = L'\0';
+    }
+    else {
+        m_wzBuf = NULL;
+    }
 }
 
 // dtor frees memory
-BasicString::~BasicString()
+wxBasicString::~wxBasicString()
 {
   delete [] m_wzBuf;
 }
index 0ff6db44ee0ddddd29c9a30521404f977d81869c..4ee76d5b6802cc2175806debb2aafced259d7a9d 100644 (file)
     #include "wx/dnd.h"
 #endif
 
+#if wxUSE_ACCESSIBILITY
+    #include "wx/access.h"
+    #include <oleacc.h>
+    #ifndef WM_GETOBJECT
+        #define WM_GETOBJECT 0x003D
+    #endif
+    #ifndef OBJID_CLIENT
+        #define OBJID_CLIENT 0xFFFFFFFC
+    #endif
+#endif
+
 #include "wx/menuitem.h"
 #include "wx/log.h"
 
@@ -2827,6 +2838,20 @@ long wxWindowMSW::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam
             }
             break;
 
+#if wxUSE_ACCESSIBILITY
+        case WM_GETOBJECT:
+            {
+                //WPARAM dwFlags = (WPARAM) (DWORD) wParam;
+                LPARAM dwObjId = (LPARAM) (DWORD) lParam;
+
+                if (dwObjId == OBJID_CLIENT && GetOrCreateAccessible())
+                {
+                    return LresultFromObject(IID_IAccessible, wParam, (IUnknown*) GetAccessible()->GetIAccessible());
+                }
+                break;
+            }
+#endif
+
 #if defined(__WIN32__) && defined(WM_HELP)
         case WM_HELP:
             {
index 68683ae901df2edcba9caea84c9e1a01d0995de4..c1013bc5b3dcb40509f240ae054fd4a4d3f3d3d1 100644 (file)
@@ -2,8 +2,8 @@
 # Microsoft Developer Studio Generated Build File, Format Version 6.00
 # ** DO NOT EDIT **
 
-# TARGTYPE "Win32 (x86) Static Library" 0x0104
 # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
+# TARGTYPE "Win32 (x86) Static Library" 0x0104
 
 CFG=wxWindows - Win32 Debug
 !MESSAGE This is not a valid makefile. To build this project using NMAKE,
@@ -32,8 +32,6 @@ CFG=wxWindows - Win32 Debug
 # PROP AllowPerConfigDependencies 0
 # PROP Scc_ProjName ""
 # PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
 
 !IF  "$(CFG)" == "wxWindows - Win32 Release Unicode DLL"
 
@@ -48,10 +46,13 @@ RSC=rc.exe
 # PROP Intermediate_Dir "../ReleaseUnicodeDll"
 # PROP Ignore_Export_Lib 0
 # PROP Target_Dir ""
+CPP=cl.exe
 # ADD BASE CPP /nologo /MD /W4 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "WXWINDLL_EXPORTS" /YX /FD /c
 # ADD CPP /nologo /MD /W4 /O2 /I "../lib/mswdllu" /I "../include" /I "./zlib" /I "./jpeg" /I "./png" /I "./regex" /I "./tiff" /D "_USRDLL" /D "WIN32" /D "NDEBUG" /D WINVER=0x0400 /D "STRICT" /D "WXMAKINGDLL" /D "_UNICODE" /D "UNICODE" /Yu"wx/wxprec.h" /FD /c
+MTL=midl.exe
 # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+RSC=rc.exe
 # ADD BASE RSC /l 0x409 /d "NDEBUG"
 # ADD RSC /l 0x409 /i "../include" /d "NDEBUG"
 BSC32=bscmake.exe
@@ -74,18 +75,21 @@ LINK32=link.exe
 # PROP Intermediate_Dir "../DebugUnicodeDll"
 # PROP Ignore_Export_Lib 0
 # PROP Target_Dir ""
+CPP=cl.exe
 # ADD BASE CPP /nologo /MDd /W4 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "WXWINDLL_EXPORTS" /YX /FD /GZ /c
 # ADD CPP /nologo /MDd /W4 /Zi /Od /I "../lib/mswdllud" /I "../include" /I "./zlib" /I "./jpeg" /I "./png" /I "./regex" /I "./tiff" /D "_USRDLL" /D "WIN32" /D "_DEBUG" /D WINVER=0x0400 /D "STRICT" /D "WXMAKINGDLL" /D "_UNICODE" /D "UNICODE" /Yu"wx/wxprec.h" /FD /c
+MTL=midl.exe
 # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+RSC=rc.exe
 # ADD BASE RSC /l 0x409 /d "_DEBUG"
 # ADD RSC /l 0x409 /i "../include" /d "_DEBUG"
 BSC32=bscmake.exe
 # ADD BASE BSC32 /nologo
 # ADD BSC32 /nologo
 LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib ..\lib\jpegd.lib ..\lib\tiffd.lib ..\lib\pngd.lib ..\lib\regexd.lib ..\lib\zlibd.lib /dll /debug /machine:I386 /pdbtype:sept /out:"../lib/wxmsw250ud.dll"
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib advapi32.lib comdlg32.lib shell32.lib ole32.lib oleaut32.lib odbc32.lib uuid.lib rpcrt4.lib comctl32.lib wsock32.lib winmm.lib ..\lib\jpegd.lib ..\lib\tiffd.lib ..\lib\pngd.lib ..\lib\regexd.lib ..\lib\zlibd.lib /nologo /version:2.3 /dll /debug /machine:I386 /pdbtype:sept /out:"../lib/wxmsw250ud.dll"
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib ..\lib\jpegd.lib ..\lib\tiffd.lib ..\lib\pngd.lib ..\lib\regexd.lib ..\lib\zlibd.lib /dll /debug /machine:I386 /out:"../lib/wxmsw250ud.dll" /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib advapi32.lib comdlg32.lib shell32.lib ole32.lib oleaut32.lib odbc32.lib uuid.lib rpcrt4.lib comctl32.lib wsock32.lib winmm.lib ..\lib\jpegd.lib ..\lib\tiffd.lib ..\lib\pngd.lib ..\lib\regexd.lib ..\lib\zlibd.lib /nologo /version:2.3 /dll /debug /machine:I386 /out:"../lib/wxmsw250ud.dll" /pdbtype:sept
 
 !ELSEIF  "$(CFG)" == "wxWindows - Win32 Release Unicode"
 
@@ -99,8 +103,10 @@ LINK32=link.exe
 # PROP Output_Dir "../lib"
 # PROP Intermediate_Dir "../ReleaseUnicode"
 # PROP Target_Dir ""
+CPP=cl.exe
 # ADD BASE CPP /nologo /MD /W4 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
 # ADD CPP /nologo /MD /W4 /O2 /I "../lib/mswu" /I "../include" /I "./zlib" /I "./jpeg" /I "./png" /I "./regex" /I "./tiff" /D "WIN32" /D "NDEBUG" /D WINVER=0x0400 /D "STRICT" /D "_UNICODE" /D "UNICODE" /Yu"wx/wxprec.h" /FD /c
+RSC=rc.exe
 # ADD BASE RSC /l 0x409
 # ADD RSC /l 0x409
 BSC32=bscmake.exe
@@ -122,8 +128,10 @@ LIB32=link.exe -lib
 # PROP Output_Dir "../lib"
 # PROP Intermediate_Dir "../DebugUnicode"
 # PROP Target_Dir ""
+CPP=cl.exe
 # ADD BASE CPP /nologo /MDd /W4 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
 # ADD CPP /nologo /MDd /W4 /Zi /Od /I "../lib/mswud" /I "../include" /I "./zlib" /I "./jpeg" /I "./png" /I "./regex" /I "./tiff" /D "WIN32" /D "_DEBUG" /D "__WXDEBUG__" /D WINVER=0x0400 /D "STRICT" /D "_UNICODE" /D "UNICODE" /Yu"wx/wxprec.h" /FD /c
+RSC=rc.exe
 # ADD BASE RSC /l 0x409
 # ADD RSC /l 0x409
 BSC32=bscmake.exe
@@ -146,10 +154,13 @@ LIB32=link.exe -lib
 # PROP Intermediate_Dir "../ReleaseDll"
 # PROP Ignore_Export_Lib 0
 # PROP Target_Dir ""
+CPP=cl.exe
 # ADD BASE CPP /nologo /MD /W4 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "WXWINDLL_EXPORTS" /YX /FD /c
 # ADD CPP /nologo /MD /W4 /O2 /I "../lib/mswdll" /I "../include" /I "./zlib" /I "./jpeg" /I "./png" /I "./regex" /I "./tiff" /D "_USRDLL" /D "WIN32" /D "NDEBUG" /D WINVER=0x0400 /D "STRICT" /D "WXMAKINGDLL" /Yu"wx/wxprec.h" /FD /c
+MTL=midl.exe
 # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+RSC=rc.exe
 # ADD BASE RSC /l 0x409 /d "NDEBUG"
 # ADD RSC /l 0x409 /i "../include" /d "NDEBUG"
 BSC32=bscmake.exe
@@ -172,18 +183,21 @@ LINK32=link.exe
 # PROP Intermediate_Dir "../DebugDll"
 # PROP Ignore_Export_Lib 0
 # PROP Target_Dir ""
+CPP=cl.exe
 # ADD BASE CPP /nologo /MDd /W4 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "WXWINDLL_EXPORTS" /YX /FD /GZ /c
 # ADD CPP /nologo /MDd /W4 /Zi /Od /I "../lib/mswdlld" /I "../include" /I "./zlib" /I "./jpeg" /I "./png" /I "./regex" /I "./tiff" /D "_USRDLL" /D "WIN32" /D "_DEBUG" /D WINVER=0x0400 /D "STRICT" /D "WXMAKINGDLL" /Yu"wx/wxprec.h" /FD /c
+MTL=midl.exe
 # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+RSC=rc.exe
 # ADD BASE RSC /l 0x409 /d "_DEBUG"
 # ADD RSC /l 0x409 /i "../include" /d "_DEBUG"
 BSC32=bscmake.exe
 # ADD BASE BSC32 /nologo
 # ADD BSC32 /nologo
 LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib ..\lib\jpegd.lib ..\lib\tiffd.lib ..\lib\pngd.lib ..\lib\regexd.lib ..\lib\zlibd.lib /dll /debug /machine:I386 /pdbtype:sept /out:"../lib/wxmsw250d.dll"
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib advapi32.lib comdlg32.lib shell32.lib ole32.lib oleaut32.lib odbc32.lib uuid.lib rpcrt4.lib comctl32.lib wsock32.lib winmm.lib ..\lib\jpegd.lib ..\lib\tiffd.lib ..\lib\pngd.lib ..\lib\regexd.lib ..\lib\zlibd.lib /nologo /version:2.3 /dll /debug /machine:I386 /pdbtype:sept /out:"../lib/wxmsw250d.dll"
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib ..\lib\jpegd.lib ..\lib\tiffd.lib ..\lib\pngd.lib ..\lib\regexd.lib ..\lib\zlibd.lib /dll /debug /machine:I386 /out:"../lib/wxmsw250d.dll" /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib advapi32.lib comdlg32.lib shell32.lib ole32.lib oleaut32.lib odbc32.lib uuid.lib rpcrt4.lib comctl32.lib wsock32.lib winmm.lib ..\lib\jpegd.lib ..\lib\tiffd.lib ..\lib\pngd.lib ..\lib\regexd.lib ..\lib\zlibd.lib /nologo /version:2.3 /dll /debug /machine:I386 /out:"../lib/wxmsw250d.dll" /pdbtype:sept
 
 !ELSEIF  "$(CFG)" == "wxWindows - Win32 Release"
 
@@ -197,8 +211,10 @@ LINK32=link.exe
 # PROP Output_Dir "../lib"
 # PROP Intermediate_Dir "../Release"
 # PROP Target_Dir ""
+CPP=cl.exe
 # ADD BASE CPP /nologo /MD /W4 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
 # ADD CPP /nologo /MD /W4 /O2 /I "../lib/msw" /I "../include" /I "./zlib" /I "./jpeg" /I "./png" /I "./regex" /I "./tiff" /D "WIN32" /D "NDEBUG" /D WINVER=0x0400 /D "STRICT" /Yu"wx/wxprec.h" /FD /c
+RSC=rc.exe
 # ADD BASE RSC /l 0x409
 # ADD RSC /l 0x409
 BSC32=bscmake.exe
@@ -220,8 +236,10 @@ LIB32=link.exe -lib
 # PROP Output_Dir "../lib"
 # PROP Intermediate_Dir "../Debug"
 # PROP Target_Dir ""
+CPP=cl.exe
 # ADD BASE CPP /nologo /MDd /W4 /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
 # ADD CPP /nologo /MDd /W4 /Zi /Od /I "../lib/mswd" /I "../include" /I "./zlib" /I "./jpeg" /I "./png" /I "./regex" /I "./tiff" /D "WIN32" /D "_DEBUG" /D "__WXDEBUG__" /D WINVER=0x0400 /D "STRICT" /Yu"wx/wxprec.h" /FD /c
+RSC=rc.exe
 # ADD BASE RSC /l 0x409
 # ADD RSC /l 0x409
 BSC32=bscmake.exe
@@ -248,6 +266,10 @@ LIB32=link.exe -lib
 # PROP Default_Filter ""
 # Begin Source File
 
+SOURCE=.\common\accesscmn.cpp
+# End Source File
+# Begin Source File
+
 SOURCE=.\common\appcmn.cpp
 # End Source File
 # Begin Source File
@@ -352,6 +374,12 @@ SOURCE=.\common\docview.cpp
 # End Source File
 # Begin Source File
 
+SOURCE=.\common\dosyacc.c
+# ADD CPP /W1 /D "USE_DEFINE" /D "IDE_INVOKED"
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
 SOURCE=.\common\dseldlg.cpp
 # End Source File
 # Begin Source File
@@ -380,6 +408,11 @@ SOURCE=.\common\event.cpp
 # End Source File
 # Begin Source File
 
+SOURCE=.\common\extended.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
 SOURCE=.\common\fddlgcmn.cpp
 # End Source File
 # Begin Source File
@@ -708,6 +741,11 @@ SOURCE=.\common\txtstrm.cpp
 # End Source File
 # Begin Source File
 
+SOURCE=.\common\unzip.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
 SOURCE=.\common\url.cpp
 # End Source File
 # Begin Source File
@@ -758,24 +796,6 @@ SOURCE=.\common\zipstrm.cpp
 
 SOURCE=.\common\zstream.cpp
 # End Source File
-
-# Begin Source File
-
-SOURCE=.\common\extended.c
-# SUBTRACT CPP /YX /Yc /Yu
-# End Source File
-# Begin Source File
-
-SOURCE=.\common\unzip.c
-# SUBTRACT CPP /YX /Yc /Yu
-# End Source File
-
-# Begin Source File
-
-SOURCE=.\common\dosyacc.c
-# ADD CPP /W1 /D "USE_DEFINE" /D "IDE_INVOKED"
-# SUBTRACT CPP /YX /Yc /Yu
-# End Source File
 # End Group
 # Begin Group "Generic Files"
 
@@ -904,7 +924,6 @@ SOURCE=.\generic\treelay.cpp
 
 SOURCE=.\generic\wizard.cpp
 # End Source File
-
 # End Group
 # Begin Group "wxHTML Files"
 
@@ -989,18 +1008,44 @@ SOURCE=.\html\m_tables.cpp
 
 SOURCE=.\html\winpars.cpp
 # End Source File
-
 # End Group
 # Begin Group "MSW Files"
 
+# PROP Default_Filter ""
+# Begin Group "OLE Files"
+
 # PROP Default_Filter ""
 # Begin Source File
 
-SOURCE=.\msw\dummy.cpp
-# ADD CPP /Yc"wx/wxprec.h"
+SOURCE=.\msw\ole\access.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\msw\ole\automtn.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\msw\ole\dataobj.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\msw\ole\dropsrc.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\msw\ole\droptgt.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\msw\ole\oleutils.cpp
 # End Source File
 # Begin Source File
 
+SOURCE=.\msw\ole\uuid.cpp
+# End Source File
+# End Group
+# Begin Source File
+
 SOURCE=.\msw\accel.cpp
 # End Source File
 # Begin Source File
@@ -1125,6 +1170,11 @@ SOURCE=.\msw\dragimag.cpp
 # End Source File
 # Begin Source File
 
+SOURCE=.\msw\dummy.cpp
+# ADD CPP /Yc"wx/wxprec.h"
+# End Source File
+# Begin Source File
+
 SOURCE=.\msw\enhmeta.cpp
 # End Source File
 # Begin Source File
@@ -1177,6 +1227,16 @@ SOURCE=.\msw\glcanvas.cpp
 # End Source File
 # Begin Source File
 
+SOURCE=.\msw\gsocket.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=.\msw\gsockmsw.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
 SOURCE=.\msw\helpbest.cpp
 # End Source File
 # Begin Source File
@@ -1407,47 +1467,6 @@ SOURCE=.\msw\wave.cpp
 
 SOURCE=.\msw\window.cpp
 # End Source File
-
-# Begin Source File
-
-SOURCE=.\msw\gsocket.c
-# SUBTRACT CPP /YX /Yc /Yu
-# End Source File
-# Begin Source File
-
-SOURCE=.\msw\gsockmsw.c
-# SUBTRACT CPP /YX /Yc /Yu
-# End Source File
-
-# Begin Group "OLE Files"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=.\msw\ole\automtn.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\msw\ole\dataobj.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\msw\ole\dropsrc.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\msw\ole\droptgt.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\msw\ole\oleutils.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\msw\ole\uuid.cpp
-# End Source File
-
-# End Group
 # End Group
 # Begin Group "Headers"
 
@@ -1458,7 +1477,9 @@ SOURCE=.\msw\ole\uuid.cpp
 # Begin Source File
 
 SOURCE=..\include\wx\msw\setup.h
+
 !IF  "$(CFG)" == "wxWindows - Win32 Release Unicode DLL"
+
 # Begin Custom Build - Creating ..\lib\mswdllu\wx\setup.h from $(InputPath)
 InputPath=..\include\wx\msw\setup.h
 
@@ -1466,7 +1487,9 @@ InputPath=..\include\wx\msw\setup.h
        copy "$(InputPath)" ..\lib\mswdllu\wx\setup.h
 
 # End Custom Build
+
 !ELSEIF  "$(CFG)" == "wxWindows - Win32 Debug Unicode DLL"
+
 # Begin Custom Build - Creating ..\lib\mswdllud\wx\setup.h from $(InputPath)
 InputPath=..\include\wx\msw\setup.h
 
@@ -1474,7 +1497,9 @@ InputPath=..\include\wx\msw\setup.h
        copy "$(InputPath)" ..\lib\mswdllud\wx\setup.h
 
 # End Custom Build
+
 !ELSEIF  "$(CFG)" == "wxWindows - Win32 Release Unicode"
+
 # Begin Custom Build - Creating ..\lib\mswu\wx\setup.h from $(InputPath)
 InputPath=..\include\wx\msw\setup.h
 
@@ -1482,7 +1507,9 @@ InputPath=..\include\wx\msw\setup.h
        copy "$(InputPath)" ..\lib\mswu\wx\setup.h
 
 # End Custom Build
+
 !ELSEIF  "$(CFG)" == "wxWindows - Win32 Debug Unicode"
+
 # Begin Custom Build - Creating ..\lib\mswud\wx\setup.h from $(InputPath)
 InputPath=..\include\wx\msw\setup.h
 
@@ -1490,7 +1517,9 @@ InputPath=..\include\wx\msw\setup.h
        copy "$(InputPath)" ..\lib\mswud\wx\setup.h
 
 # End Custom Build
+
 !ELSEIF  "$(CFG)" == "wxWindows - Win32 Release DLL"
+
 # Begin Custom Build - Creating ..\lib\mswdll\wx\setup.h from $(InputPath)
 InputPath=..\include\wx\msw\setup.h
 
@@ -1498,7 +1527,9 @@ InputPath=..\include\wx\msw\setup.h
        copy "$(InputPath)" ..\lib\mswdll\wx\setup.h
 
 # End Custom Build
+
 !ELSEIF  "$(CFG)" == "wxWindows - Win32 Debug DLL"
+
 # Begin Custom Build - Creating ..\lib\mswdlld\wx\setup.h from $(InputPath)
 InputPath=..\include\wx\msw\setup.h
 
@@ -1506,7 +1537,9 @@ InputPath=..\include\wx\msw\setup.h
        copy "$(InputPath)" ..\lib\mswdlld\wx\setup.h
 
 # End Custom Build
+
 !ELSEIF  "$(CFG)" == "wxWindows - Win32 Release"
+
 # Begin Custom Build - Creating ..\lib\msw\wx\setup.h from $(InputPath)
 InputPath=..\include\wx\msw\setup.h
 
@@ -1514,7 +1547,9 @@ InputPath=..\include\wx\msw\setup.h
        copy "$(InputPath)" ..\lib\msw\wx\setup.h
 
 # End Custom Build
+
 !ELSEIF  "$(CFG)" == "wxWindows - Win32 Debug"
+
 # Begin Custom Build - Creating ..\lib\mswd\wx\setup.h from $(InputPath)
 InputPath=..\include\wx\msw\setup.h
 
@@ -1522,7 +1557,9 @@ InputPath=..\include\wx\msw\setup.h
        copy "$(InputPath)" ..\lib\mswd\wx\setup.h
 
 # End Custom Build
+
 !ENDIF 
+
 # End Source File
 # End Group
 # Begin Group "Common"
@@ -2484,7 +2521,6 @@ SOURCE=..\include\wx\zipstrm.h
 
 SOURCE=..\include\wx\zstream.h
 # End Source File
-
 # End Group
 # Begin Group "MSW"
 
@@ -2865,7 +2901,6 @@ SOURCE=..\include\wx\msw\window.h
 
 SOURCE=..\include\wx\msw\winundef.h
 # End Source File
-
 # End Group
 # Begin Group "Generic"
 
@@ -3030,7 +3065,6 @@ SOURCE=..\include\wx\generic\treectlg.h
 
 SOURCE=..\include\wx\generic\wizard.h
 # End Source File
-
 # End Group
 # Begin Group "HTML"
 
@@ -3087,7 +3121,6 @@ SOURCE=..\include\wx\html\m_templ.h
 
 SOURCE=..\include\wx\html\winpars.h
 # End Source File
-
 # End Group
 # End Group
 # End Target