Use special "wxDataView" Windows class name in wxMSW

This makes it possible for the screen readers to handle wxDataViewCtrl
specially and better than by default.
This commit is contained in:
Vadim Zeitlin
2016-12-18 22:37:49 +01:00
parent d4e595adb0
commit 9ff563b0f8

View File

@@ -22,6 +22,7 @@
#ifndef WX_PRECOMP
#ifdef __WXMSW__
#include "wx/app.h" // GetRegisteredClassName()
#include "wx/msw/private.h"
#include "wx/msw/wrapwin.h"
#include "wx/msw/wrapcctl.h" // include <commctrl.h> "properly"
@@ -1689,9 +1690,26 @@ wxBEGIN_EVENT_TABLE(wxDataViewMainWindow,wxWindow)
wxEND_EVENT_TABLE()
wxDataViewMainWindow::wxDataViewMainWindow( wxDataViewCtrl *parent, wxWindowID id,
const wxPoint &pos, const wxSize &size, const wxString &name ) :
wxWindow( parent, id, pos, size, wxWANTS_CHARS|wxBORDER_NONE, name )
const wxPoint &pos, const wxSize &size, const wxString &name )
{
// We want to use a specific class name for this window in wxMSW to make it
// possible to configure screen readers to handle it specifically.
#ifdef __WXMSW__
CreateUsingMSWClass
(
wxApp::GetRegisteredClassName
(
wxT("wxDataView"),
-1, // no specific background brush
0, // no special styles neither
wxApp::RegClass_OnlyNR
),
parent, id, pos, size, wxWANTS_CHARS|wxBORDER_NONE, name
);
#else
Create( parent, id, pos, size, wxWANTS_CHARS|wxBORDER_NONE, name )
#endif
SetOwner( parent );
m_editorRenderer = NULL;