From 195d393d248cf0f1496faa599fd0955e5a4daa06 Mon Sep 17 00:00:00 2001 From: Charlie Fenton Date: Wed, 21 Dec 2011 08:40:10 +0000 Subject: [PATCH] MGR: Display project descriptions in Attach Wizard using wxTextCtrl instead of wxHtmlWindow to support screen readers svn path=/trunk/boinc/; revision=24847 --- checkin_notes | 8 ++++++++ clientgui/ProjectInfoPage.cpp | 12 ++++++------ clientgui/ProjectInfoPage.h | 2 +- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/checkin_notes b/checkin_notes index ad9810cb57..b38be26765 100644 --- a/checkin_notes +++ b/checkin_notes @@ -9205,3 +9205,11 @@ Rom 20 Dec 2011 vboxwrapper.cpp win_build/ vboxwrapper.vcproj + +Charlie 21 Dec 2011 + - MGR: Display project descriptions in Attach Wizard using wxTextCtrl + instead of wxHtmlWindow to support screen readers for accessibility, + after converting all occurrences of "n" to "^n". + + clientgui/ + ProjectInfoPage.cpp,.h diff --git a/clientgui/ProjectInfoPage.cpp b/clientgui/ProjectInfoPage.cpp index 9c9680a510..2f18423897 100644 --- a/clientgui/ProjectInfoPage.cpp +++ b/clientgui/ProjectInfoPage.cpp @@ -251,7 +251,7 @@ void CProjectInfoPage::CreateControls() wxStaticBoxSizer* itemStaticBoxSizer13 = new wxStaticBoxSizer(m_pProjectDetailsStaticCtrl, wxVERTICAL); itemFlexGridSizer6->Add(itemStaticBoxSizer13, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5); - m_pProjectDetailsDescriptionCtrl = new wxHtmlWindow( itemWizardPage23, ID_PROJECTDESCRIPTION, wxDefaultPosition, wxSize(DESCRIPTIONSWIDTH, 100), wxHW_SCROLLBAR_AUTO|wxHW_NO_SELECTION ); + m_pProjectDetailsDescriptionCtrl = new wxTextCtrl( itemWizardPage23, ID_PROJECTDESCRIPTION, wxT(""), wxDefaultPosition, wxSize(DESCRIPTIONSWIDTH, 100), wxTE_MULTILINE|wxTE_READONLY ); itemStaticBoxSizer13->Add(m_pProjectDetailsDescriptionCtrl, 0, wxGROW|wxLEFT|wxTOP|wxBOTTOM, 5); wxFlexGridSizer* itemFlexGridSizer16 = new wxFlexGridSizer(0, 2, 0, 0); @@ -482,12 +482,12 @@ void CProjectInfoPage::OnProjectSelected( wxCommandEvent& WXUNUSED(event) ) { EllipseStringIfNeeded(strURL, m_pProjectDetailsURLCtrl); // Populate the project details area -#ifdef _WIN32 - wxString desc = wxT("") + pProjectInfo->m_strDescription + wxT(""); -#else wxString desc = pProjectInfo->m_strDescription; -#endif - m_pProjectDetailsDescriptionCtrl->SetPage(desc); + // Change all occurrences of "n" to "^n" + desc.Replace(wxT(""), wxT("^"), true); + desc.Replace(wxT(""), wxT(""), true); + + m_pProjectDetailsDescriptionCtrl->SetValue(desc); m_pProjectDetailsURLCtrl->SetLabel(strURL); m_pProjectDetailsURLCtrl->SetURL(pProjectInfo->m_strURL); // Set tooltip to full text in case ellipsed diff --git a/clientgui/ProjectInfoPage.h b/clientgui/ProjectInfoPage.h index 5d1d6a48d7..320ef29971 100644 --- a/clientgui/ProjectInfoPage.h +++ b/clientgui/ProjectInfoPage.h @@ -115,7 +115,7 @@ public: wxStaticText* m_pProjectsStaticCtrl; wxListBox* m_pProjectsCtrl; wxStaticBox* m_pProjectDetailsStaticCtrl; - wxHtmlWindow* m_pProjectDetailsDescriptionCtrl; + wxTextCtrl* m_pProjectDetailsDescriptionCtrl; wxStaticText* m_pProjectDetailsResearchAreaStaticCtrl; wxStaticText* m_pProjectDetailsResearchAreaCtrl; wxStaticText* m_pProjectDetailsOrganizationStaticCtrl;