Fix transparent static text for wxWidgets 2.9.4

This commit is contained in:
Charlie Fenton 2012-10-24 04:32:38 -07:00 committed by Oliver Bock
parent 15008dedce
commit 4ac21f182d
3 changed files with 7 additions and 15 deletions

View File

@ -6210,3 +6210,9 @@ Charlie 24 Oct 2012
boinc.xcodeproj/
project.pbxproj
buildWxMac.sh
Charlie 24 Oct 2012
- Fix transparent static text for wxWidgets 2.9.4.
clientgui\
sg_CustomControls.cpp,.h

View File

@ -59,9 +59,7 @@ void CTransparentStaticLine::OnPaint(wxPaintEvent& /*event*/) {
IMPLEMENT_DYNAMIC_CLASS (CTransparentStaticText, wxStaticText)
BEGIN_EVENT_TABLE(CTransparentStaticText, wxStaticText)
#ifdef __WXMAC__
EVT_ERASE_BACKGROUND(CTransparentStaticText::OnEraseBackground)
#endif
EVT_PAINT(CTransparentStaticText::OnPaint)
END_EVENT_TABLE()
@ -78,21 +76,13 @@ bool CTransparentStaticText::Create(wxWindow* parent, wxWindowID id, const wxStr
bool bRetVal = wxStaticText::Create(parent, id, label, pos, size, style|wxTRANSPARENT_WINDOW, name);
SetBackgroundColour(parent->GetBackgroundColour());
SetBackgroundStyle(wxBG_STYLE_COLOUR);
// SetBackgroundStyle(wxBG_STYLE_COLOUR);
SetForegroundColour(parent->GetForegroundColour());
return bRetVal;
}
#ifndef __WXMAC__
void CTransparentStaticText::SetLabel(const wxString& label) {
wxStaticText::SetLabel(label);
GetParent()->RefreshRect(GetRect());
}
#endif
void CTransparentStaticText::OnPaint(wxPaintEvent& /*event*/) {
wxPaintDC dc(this);
dc.SetFont(GetFont());

View File

@ -89,11 +89,7 @@ public:
virtual bool HasTransparentBackground() { return true; };
#ifdef __WXMAC__
virtual void OnEraseBackground(wxEraseEvent& /*event*/) {};
#else
virtual void SetLabel(const wxString& label);
#endif
virtual void OnPaint(wxPaintEvent& event);
DECLARE_EVENT_TABLE()