Commit 9f4d6a14 authored by Charlie Fenton's avatar Charlie Fenton

MGR: Implement Mac accessibility for Statistics and Disk tabs

svn path=/trunk/boinc/; revision=19706
parent e47b17ae
......@@ -9497,3 +9497,25 @@ Rom 24 Nov 2009
client/
boinc_log.cpp
Charlie 25 Nov 2009
- MGR: Implement Mac accessibility for Statistics and Disk tabs,
eliminate screen reader saying "unknown" for intermediate panels,
general cleanup of accessibility code and operation.
- Mac Sandbox: attempt to fix bug where Manager reports that admin user
is not authorized to run BOINC. I haven't been able to reproduce
this bug, so this fix is a shot in the dark.
client/
check_security.cpp
clientgui/
AdvancedFrame.cpp
BOINCBaseView.h
BOINCListCtrl.cpp, .h
BOINCTaskCtrl.cpp
ProjectListCtrl.cpp. .h
ViewStatistics.cpp, .h
common/
wxPieCtrl.cpp, .h
Mac/
MacAccessibility.cpp
......@@ -679,6 +679,11 @@ bool CAdvancedFrame::CreateNotebook( bool /* bRPCsSafe */ ) {
pPanel->SetSizer(pPanelSizer);
pPanel->Layout();
#ifdef __WXMAC__
//Accessibility
HIObjectSetAccessibilityIgnored((HIObjectRef)pPanel->GetHandle(), true);
#endif
wxLogTrace(wxT("Function Start/End"), wxT("CAdvancedFrame::CreateNotebook - Function End"));
return true;
}
......
......@@ -56,8 +56,17 @@ class CTaskItemGroup : wxObject {
public:
CTaskItemGroup();
CTaskItemGroup( wxString strName ) :
m_strName(strName), m_pStaticBox(NULL), m_pStaticBoxSizer(NULL) { m_Tasks.clear(); };
~CTaskItemGroup() {};
m_strName(strName), m_pStaticBox(NULL), m_pStaticBoxSizer(NULL) {
m_Tasks.clear();
#ifdef __WXMAC__
m_pTaskGroupAccessibilityEventHandlerRef = NULL;
#endif
};
~CTaskItemGroup() {
#ifdef __WXMAC__
RemoveMacAccessibilitySupport();
#endif
};
wxButton* button(int i) {return m_Tasks[i]->m_pButton;}
wxString m_strName;
......@@ -65,7 +74,15 @@ public:
wxStaticBox* m_pStaticBox;
wxStaticBoxSizer* m_pStaticBoxSizer;
std::vector<CTaskItem*> m_Tasks;
std::vector<CTaskItem*> m_Tasks;
#ifdef __WXMAC__
void SetupMacAccessibilitySupport();
void RemoveMacAccessibilitySupport();
private:
EventHandlerRef m_pTaskGroupAccessibilityEventHandlerRef;
#endif
};
typedef bool (*ListSortCompareFunc)(int, int);
......
......@@ -57,7 +57,7 @@ CBOINCListCtrl::CBOINCListCtrl(
m_bProgressBarEventPending = false;
#else
#ifdef __WXMAC__
SetupMacListControlAccessibilitySupport();
SetupMacAccessibilitySupport();
#endif
#endif
......@@ -73,7 +73,7 @@ CBOINCListCtrl::~CBOINCListCtrl()
{
m_iRowsNeedingProgressBars.Clear();
#ifdef __WXMAC__
RemoveMacListControlAccessibilitySupport();
RemoveMacAccessibilitySupport();
#endif
}
......
......@@ -92,8 +92,8 @@ private:
wxScrolledWindow* GetMainWin(void) { return (wxScrolledWindow*) m_mainWin; }
wxCoord GetHeaderHeight(void) { return m_headerHeight; }
#ifdef __WXMAC__
void SetupMacListControlAccessibilitySupport();
void RemoveMacListControlAccessibilitySupport();
void SetupMacAccessibilitySupport();
void RemoveMacAccessibilitySupport();
CBOINCBaseView* GetParentView() { return m_pParentView; }
HIViewRef m_headerView;
......
......@@ -39,6 +39,14 @@ CBOINCTaskCtrl::CBOINCTaskCtrl(CBOINCBaseView* pView, wxWindowID iTaskWindowID,
SetVirtualSize( 200, 1000 );
EnableScrolling(false, true);
SetScrollRate( 0, 10 );
#ifdef __WXMAC__
//Accessibility
HIObjectSetAccessibilityIgnored((HIObjectRef)GetHandle(), true);
HIViewRef parentView = (HIViewRef)m_pParent->GetHandle();
HIObjectSetAccessibilityIgnored((HIObjectRef)parentView, true);
#endif
}
......@@ -162,6 +170,9 @@ wxInt32 CBOINCTaskCtrl::UpdateControls() {
pGroup->m_pStaticBox = new wxStaticBox(this, wxID_ANY, pGroup->m_strName);
pGroup->m_pStaticBoxSizer = new wxStaticBoxSizer(pGroup->m_pStaticBox, wxVERTICAL);
m_pSizer->Add(pGroup->m_pStaticBoxSizer, 0, wxEXPAND|wxALL, 5);
#ifdef __WXMAC__
pGroup->SetupMacAccessibilitySupport();
#endif
}
}
......@@ -189,7 +200,7 @@ wxInt32 CBOINCTaskCtrl::UpdateControls() {
// Force update layout and scrollbars, since nothing we do here
// necessarily generates a size event which would do it for us.
FitInside();
return 0;
}
......
......@@ -36,12 +36,12 @@
CProjectListCtrlAccessible::CProjectListCtrlAccessible(wxWindow* win) {
mp_win = win;
SetupMacListControlAccessibilitySupport();
SetupMacAccessibilitySupport();
}
CProjectListCtrlAccessible::~CProjectListCtrlAccessible() {
RemoveMacListControlAccessibilitySupport();
RemoveMacAccessibilitySupport();
}
#endif
......
......@@ -121,8 +121,8 @@ public:
EventHandlerRef m_plistAccessibilityEventHandlerRef;
wxWindow *GetWindow() { return mp_win; }
void SetupMacListControlAccessibilitySupport();
void RemoveMacListControlAccessibilitySupport();
void SetupMacAccessibilitySupport();
void RemoveMacAccessibilitySupport();
#endif
};
......
......@@ -1806,10 +1806,17 @@ CViewStatistics::CViewStatistics(wxNotebook* pNotebook) :
m_pTaskPane->UpdateControls();
UpdateSelection();
#ifdef __WXMAC__
SetupMacAccessibilitySupport();
#endif
}
CViewStatistics::~CViewStatistics() {
EmptyTasks();
#ifdef __WXMAC__
RemoveMacAccessibilitySupport();
#endif
}
wxString& CViewStatistics::GetViewName() {
......
......@@ -226,7 +226,14 @@ public:
protected:
CPaintStatistics* m_PaintStatistics;
CPaintStatistics* m_PaintStatistics;
#ifdef __WXMAC__
void SetupMacAccessibilitySupport();
void RemoveMacAccessibilitySupport();
EventHandlerRef m_pStatisticsAccessibilityEventHandlerRef;
#endif
virtual bool OnSaveState( wxConfigBase* pConfig );
virtual bool OnRestoreState( wxConfigBase* pConfig );
......
......@@ -69,6 +69,16 @@ wxPieCtrl::wxPieCtrl(wxWindow * parent, wxWindowID id, wxPoint pos,
SetSize(sz);
m_CanvasBitmap.Create(1,1);
RecreateCanvas();
#ifdef __WXMAC__
SetupMacAccessibilitySupport();
#endif
}
wxPieCtrl::~wxPieCtrl() {
#ifdef __WXMAC__
RemoveMacAccessibilitySupport();
#endif
}
/* getter and setter */
......
......@@ -105,6 +105,8 @@ public:
wxPieCtrl(wxWindow * parent, wxWindowID id = wxID_ANY, wxPoint pos = wxDefaultPosition,
wxSize sz = wxDefaultSize, long style = 0, wxString name = wxT("wxPieCtrl"));
~wxPieCtrl();
wxColour GetBackColour();
void SetBackColour(wxColour colour);
......@@ -148,6 +150,15 @@ public:
void OnSize(wxSizeEvent & event);
void OnMouseMove(wxMouseEvent& ev);
void OnEraseBackground(wxEraseEvent & /*event*/);
#ifdef __WXMAC__
private:
void SetupMacAccessibilitySupport();
void RemoveMacAccessibilitySupport();
EventHandlerRef m_pPieCtrlAccessibilityEventHandlerRef;
#endif
};
#endif
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment