diff --git a/checkin_notes b/checkin_notes index 22f2a9b3b5..2e7f499ec9 100644 --- a/checkin_notes +++ b/checkin_notes @@ -2886,3 +2886,10 @@ Charlie 10 May 2011 clientgui/ sg_BoincSimpleFrame.cpp sg_ProjectPanel.cpp + +Charlie 11 May 2011 + - MGR: Fixes to new Simple GUI for Linux. + + clientgui/ + sg_PanelBase.cpp, .h + sg_TaskPanel.cpp diff --git a/clientgui/sg_PanelBase.cpp b/clientgui/sg_PanelBase.cpp index 542f18a48c..bc9b13bb68 100755 --- a/clientgui/sg_PanelBase.cpp +++ b/clientgui/sg_PanelBase.cpp @@ -21,7 +21,11 @@ IMPLEMENT_DYNAMIC_CLASS(CSimplePanelBase, wxPanel) BEGIN_EVENT_TABLE(CSimplePanelBase, wxPanel) +#if (defined(__WXMSW_) || defined(__WXMAC__)) EVT_ERASE_BACKGROUND(CSimplePanelBase::OnEraseBackground) +#else // Linux + EVT_PAINT(CSimplePanelBase::OnPaint) +#endif END_EVENT_TABLE() @@ -39,7 +43,7 @@ CSimplePanelBase::CSimplePanelBase( wxWindow* parent ) : #ifdef __WXMAC__ // Tell accessibility aids to ignore this panel (but not its contents) HIObjectSetAccessibilityIgnored((HIObjectRef)GetHandle(), true); -#endif +#endif } @@ -117,13 +121,15 @@ void CSimplePanelBase::MakeBGBitMap() { } +#if (defined(__WXMSW_) || defined(__WXMAC__)) + void CSimplePanelBase::OnEraseBackground(wxEraseEvent& event) { wxDC* dc = event.GetDC(); if (!m_GotBGBitMap) { MakeBGBitMap(); } -//return; + dc->DrawBitmap(m_TaskPanelBGBitMap, 0, 0); wxPen oldPen= dc->GetPen(); wxBrush oldBrush = dc->GetBrush(); @@ -144,6 +150,39 @@ void CSimplePanelBase::OnEraseBackground(wxEraseEvent& event) { dc->SetBrush(oldBrush); } +#else // Linux + +void CSimplePanelBase::OnPaint(wxPaintEvent& event) { + wxPaintDC dc(this); + + if (!m_GotBGBitMap) { + MakeBGBitMap(); + } + + dc.DrawBitmap(m_TaskPanelBGBitMap, 0, 0); + wxPen oldPen= dc.GetPen(); + wxBrush oldBrush = dc.GetBrush(); + int oldMode = dc.GetBackgroundMode(); + wxCoord w, h; + wxPen bgPen(*wxBLUE, 3); + wxBrush bgBrush(*wxBLUE, wxTRANSPARENT); + + dc.SetBackgroundMode(wxSOLID); + dc.SetPen(bgPen); + dc.SetBrush(bgBrush); + dc.GetSize(&w, &h); + dc.DrawRoundedRectangle(0, 0, w, h, 10.0); + + // Restore Mode, Pen and Brush + dc.SetBackgroundMode(oldMode); + dc.SetPen(oldPen); + dc.SetBrush(oldBrush); + + event.Skip(); +} + +#endif + void CSimplePanelBase::UpdateStaticText(CTransparentStaticText **whichText, wxString s) { EllipseStringIfNeeded(s, *whichText); @@ -179,4 +218,4 @@ void CSimplePanelBase::EllipseStringIfNeeded(wxString& s, wxWindow *win) { w += ellipsisWidth; } } -} \ No newline at end of file +} diff --git a/clientgui/sg_PanelBase.h b/clientgui/sg_PanelBase.h index 381a95e3ea..2e1639f5e4 100755 --- a/clientgui/sg_PanelBase.h +++ b/clientgui/sg_PanelBase.h @@ -82,7 +82,11 @@ class CSimplePanelBase : public wxPanel protected: void MakeBGBitMap(); +#if (defined(__WXMSW_) || defined(__WXMAC__)) void OnEraseBackground(wxEraseEvent& event); +#else // Linux + void OnPaint(wxPaintEvent& event); +#endif wxBitmap m_TaskPanelBGBitMap; bool m_GotBGBitMap; diff --git a/clientgui/sg_TaskPanel.cpp b/clientgui/sg_TaskPanel.cpp index 58f724f27d..0b81767534 100755 --- a/clientgui/sg_TaskPanel.cpp +++ b/clientgui/sg_TaskPanel.cpp @@ -424,6 +424,7 @@ void CSimpleTaskPanel::Update() { m_TimeRemainingValue->Show(); m_ProgressValueText->Show(); m_TaskCommandsButton->Show(); +this->Layout(); } UpdateTaskSelectionList();