]> git.saurik.com Git - wxWidgets.git/commitdiff
added SetStatusText method (avoiding dc.Clear)
authorStefan Csomor <csomor@advancedconcepts.ch>
Wed, 19 Dec 2001 21:59:04 +0000 (21:59 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Wed, 19 Dec 2001 21:59:04 +0000 (21:59 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13115 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/mac/carbon/statbrma.cpp
src/mac/statbrma.cpp

index 5179971e24c69297a01640fec35fad36c4aaf68e..a88dc6f72cc19fc3caf4eddb9b62b2e4ec4c8341 100644 (file)
@@ -77,6 +77,27 @@ void wxStatusBarMac::DrawField(wxDC& dc, int i)
     DrawFieldText(dc, i);
 }
 
+void wxStatusBarMac::SetStatusText(const wxString& text, int number)
+{
+    wxCHECK_RET( (number >= 0) && (number < m_nFields),
+                 _T("invalid status bar field index") );
+
+    m_statusStrings[number] = text;
+    wxRect rect;
+    GetFieldRect(number, rect);
+    Refresh( TRUE , &rect ) ;
+    /*
+    // TODO make clear work again also when using themes
+    wxClientDC dc(this);
+    dc.SetBackground( wxBrush(GetBackgroundColour(), wxSOLID) );
+    dc.SetClippingRegion( rect.x+1, rect.y+1, rect.width-1, rect.height-1 );
+    dc.Clear();
+    dc.DestroyClippingRegion();
+    DrawFieldText( dc, number );
+    */
+
+}
+
 void wxStatusBarMac::OnPaint(wxPaintEvent& WXUNUSED(event) )
 {
        wxPaintDC dc(this);
index 5179971e24c69297a01640fec35fad36c4aaf68e..a88dc6f72cc19fc3caf4eddb9b62b2e4ec4c8341 100644 (file)
@@ -77,6 +77,27 @@ void wxStatusBarMac::DrawField(wxDC& dc, int i)
     DrawFieldText(dc, i);
 }
 
+void wxStatusBarMac::SetStatusText(const wxString& text, int number)
+{
+    wxCHECK_RET( (number >= 0) && (number < m_nFields),
+                 _T("invalid status bar field index") );
+
+    m_statusStrings[number] = text;
+    wxRect rect;
+    GetFieldRect(number, rect);
+    Refresh( TRUE , &rect ) ;
+    /*
+    // TODO make clear work again also when using themes
+    wxClientDC dc(this);
+    dc.SetBackground( wxBrush(GetBackgroundColour(), wxSOLID) );
+    dc.SetClippingRegion( rect.x+1, rect.y+1, rect.width-1, rect.height-1 );
+    dc.Clear();
+    dc.DestroyClippingRegion();
+    DrawFieldText( dc, number );
+    */
+
+}
+
 void wxStatusBarMac::OnPaint(wxPaintEvent& WXUNUSED(event) )
 {
        wxPaintDC dc(this);