diff --git a/checkin_notes b/checkin_notes index e401e82f1b..564663b2c2 100755 --- a/checkin_notes +++ b/checkin_notes @@ -11077,3 +11077,12 @@ David 12 Oct 2006 gui_rpc_client.h gui_rpc_client_ops.C gui_rpc_client_print.C + +Charlie 12 Oct 2006 + - More fixes to wxPieCtrl for Mac. + + client/ + clientgui/ + ViewResources.cpp + common/ + wxPieCtrl.cpp,h diff --git a/clientgui/ViewResources.cpp b/clientgui/ViewResources.cpp index 6cb99bf280..4e3243e028 100644 --- a/clientgui/ViewResources.cpp +++ b/clientgui/ViewResources.cpp @@ -66,7 +66,9 @@ CViewResources::CViewResources(wxNotebook* pNotebook) : // setup the legend m_pieCtrlTotal->GetLegend()->SetTransparent(true); m_pieCtrlTotal->GetLegend()->SetHorBorder(10); +#ifndef __WXMAC__ m_pieCtrlTotal->GetLegend()->SetWindowStyle(wxSTATIC_BORDER); +#endif m_pieCtrlTotal->GetLegend()->SetLabelFont(*wxSWISS_FONT); m_pieCtrlTotal->GetLegend()->SetLabelColour(wxColour(0,0,127)); m_pieCtrlTotal->GetLegend()->SetLabelColour(wxColour(0,0,127)); @@ -85,7 +87,10 @@ CViewResources::CViewResources(wxNotebook* pNotebook) : //setup the legend m_pieCtrlBOINC->GetLegend()->SetTransparent(true); m_pieCtrlBOINC->GetLegend()->SetHorBorder(10); +#ifndef __WXMAC__ m_pieCtrlBOINC->GetLegend()->SetWindowStyle(wxSTATIC_BORDER); +#endif + m_pieCtrlTotal->GetLegend()->SetLabelFont(*wxSWISS_FONT); m_pieCtrlBOINC->GetLegend()->SetLabelFont(*wxSWISS_FONT); m_pieCtrlBOINC->GetLegend()->SetLabelColour(wxColour(0,0,127)); m_pieCtrlBOINC->GetLegend()->SetLabelColour(wxColour(0,0,127)); @@ -213,7 +218,9 @@ void CViewResources::OnListRender( wxTimerEvent& WXUNUSED(event) ) { m_pieCtrlBOINC->m_Series.Add(part); } //force a repaint of the legend (doesn't work if not explicitly resized) +#ifndef __WXMAC__ m_pieCtrlBOINC->GetLegend()->SetSize(wxSize(10,10)); +#endif m_pieCtrlBOINC->Refresh(); } else { @@ -225,7 +232,9 @@ void CViewResources::OnListRender( wxTimerEvent& WXUNUSED(event) ) { part.SetColour(wxColour(0,0,0)); m_pieCtrlBOINC->m_Series.Add(part); //force a repaint of the legend (doesn't work if not explicitly resized) +#ifndef __WXMAC__ m_pieCtrlBOINC->GetLegend()->SetSize(wxSize(10,10)); +#endif m_pieCtrlBOINC->Refresh(); } //data for pie chart 2 (total disk usage) @@ -256,7 +265,9 @@ void CViewResources::OnListRender( wxTimerEvent& WXUNUSED(event) ) { part.SetColour(wxColour(0,0,255)); m_pieCtrlTotal->m_Series.Add(part); //force a repaint of the legend (doesn't work if not explicitly resized) +#ifndef __WXMAC__ m_pieCtrlTotal->GetLegend()->SetSize(wxSize(10,10)); +#endif m_pieCtrlTotal->Refresh(); } diff --git a/clientgui/common/wxPieCtrl.cpp b/clientgui/common/wxPieCtrl.cpp index 6f2a028704..f445492b04 100644 --- a/clientgui/common/wxPieCtrl.cpp +++ b/clientgui/common/wxPieCtrl.cpp @@ -31,6 +31,9 @@ wxPieCtrlLegend::wxPieCtrlLegend(wxPieCtrl * parent, wxString title, m_TitleColour = wxColour(0,0,127); m_LabelColour = *wxBLACK; m_BackColour = wxColour(255,255,0); +#ifdef __WXMAC__ + m_TitleFont = *wxNORMAL_FONT; // Prevent wxDebug assert +#endif } void wxPieCtrlLegend::SetTransparent(bool value) @@ -128,15 +131,29 @@ void wxPieCtrlLegend::OnPaint(wxPaintEvent & event) #endif dy += m_VerBorder; if(w != maxwidth || h != dy) SetSize(maxwidth, dy); + +#ifdef __WXMAC__ + // SetWindowStyle borders distort the pie circle on Mac so we draw our own + int x, y; + wxPen savedPen = mdc.GetPen(); + + GetSize(&x,&y); + x--; + y--; + mdc.SetPen(*wxGREY_PEN); + mdc.DrawLine(0,0,x,0); // top + mdc.DrawLine(0,y,0,0); // left + mdc.SetPen(*wxWHITE_PEN); + mdc.DrawLine(0,y,x,y); // bottom + mdc.DrawLine(x,0,x,y); // right + mdc.SetPen(savedPen); +#endif pdc.Blit(0,0,w,h,&mdc,0,0); } void wxPieCtrlLegend::SetLabelFont(wxFont font) { m_LabelFont = font; -#ifdef __WXMAC__ - m_TitleFont = font; -#endif Refresh(); }