cleanup - reformatting

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37312 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
David Surovell
2006-02-05 07:15:26 +00:00
parent 8e729eb44b
commit 61fa2e39da

View File

@@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// Name: statbar.cpp // Name: src/mac/carbon/statbarma.cpp
// Purpose: native implementation of wxStatusBar (optional) // Purpose: native implementation of wxStatusBar (optional)
// Author: Stefan Csomor // Author: Stefan Csomor
// Modified by: // Modified by:
@@ -9,36 +9,24 @@
// Licence: wxWindows licence // Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
#include "wx/wxprec.h" #include "wx/wxprec.h"
#include "wx/statusbr.h" #include "wx/statusbr.h"
#include "wx/dc.h" #include "wx/dc.h"
#include "wx/dcclient.h" #include "wx/dcclient.h"
#include "wx/mac/private.h"
#include "wx/toplevel.h"
BEGIN_EVENT_TABLE(wxStatusBarMac, wxStatusBarGeneric) BEGIN_EVENT_TABLE(wxStatusBarMac, wxStatusBarGeneric)
EVT_PAINT(wxStatusBarMac::OnPaint) EVT_PAINT(wxStatusBarMac::OnPaint)
END_EVENT_TABLE() END_EVENT_TABLE()
#ifdef __WXMAC__
#include "wx/mac/private.h"
#include "wx/toplevel.h"
#endif
// ============================================================================
// implementation
// ============================================================================
// ----------------------------------------------------------------------------
// wxStatusBarMac class
// ----------------------------------------------------------------------------
wxStatusBarMac::wxStatusBarMac() wxStatusBarMac::wxStatusBarMac()
{ {
SetParent(NULL); SetParent( NULL );
} }
wxStatusBarMac::~wxStatusBarMac() wxStatusBarMac::~wxStatusBarMac()
@@ -49,16 +37,16 @@ bool wxStatusBarMac::Create(wxWindow *parent, wxWindowID id,
long style , long style ,
const wxString& name) const wxString& name)
{ {
if( !wxStatusBarGeneric::Create( parent , id , style , name ) ) if ( !wxStatusBarGeneric::Create( parent , id , style , name ) )
return FALSE ; return false;
if ( parent->MacGetTopLevelWindow()->MacGetMetalAppearance() ) if ( parent->MacGetTopLevelWindow()->MacGetMetalAppearance() )
MacSetBackgroundBrush( wxNullBrush ) ; MacSetBackgroundBrush( wxNullBrush );
// normal system font is too tall for fitting into the standard height // normal system font is too tall for fitting into the standard height
SetWindowVariant( wxWINDOW_VARIANT_SMALL ) ; SetWindowVariant( wxWINDOW_VARIANT_SMALL );
return TRUE ; return true ;
} }
void wxStatusBarMac::DrawFieldText(wxDC& dc, int i) void wxStatusBarMac::DrawFieldText(wxDC& dc, int i)
@@ -70,9 +58,7 @@ void wxStatusBarMac::DrawFieldText(wxDC& dc, int i)
GetFieldRect(i, rect); GetFieldRect(i, rect);
if ( !MacIsReallyHilited() ) if ( !MacIsReallyHilited() )
{
dc.SetTextForeground( wxColour( 0x80 , 0x80 , 0x80 ) ) ; dc.SetTextForeground( wxColour( 0x80 , 0x80 , 0x80 ) ) ;
}
wxString text(GetStatusText(i)); wxString text(GetStatusText(i));
@@ -101,7 +87,7 @@ void wxStatusBarMac::DrawField(wxDC& dc, int i)
void wxStatusBarMac::SetStatusText(const wxString& text, int number) void wxStatusBarMac::SetStatusText(const wxString& text, int number)
{ {
wxCHECK_RET( (number >= 0) && (number < m_nFields), wxCHECK_RET( (number >= 0) && (number < m_nFields),
_T("invalid status bar field index") ); wxT("invalid status bar field index") );
if ( m_statusStrings[number] == text ) if ( m_statusStrings[number] == text )
return ; return ;
@@ -109,56 +95,54 @@ void wxStatusBarMac::SetStatusText(const wxString& text, int number)
m_statusStrings[number] = text; m_statusStrings[number] = text;
wxRect rect; wxRect rect;
GetFieldRect(number, rect); GetFieldRect(number, rect);
int w, h ; int w, h;
GetSize( &w , &h ) ; GetSize( &w, &h );
rect.y=0; rect.y = 0;
rect.height = h ; rect.height = h ;
Refresh( TRUE , &rect ) ; Refresh( true, &rect );
Update(); Update();
} }
void wxStatusBarMac::OnPaint(wxPaintEvent& WXUNUSED(event) ) void wxStatusBarMac::OnPaint(wxPaintEvent& WXUNUSED(event))
{ {
wxPaintDC dc(this); wxPaintDC dc(this);
dc.Clear() ; dc.Clear();
int major,minor; int major, minor;
wxGetOsVersion( &major, &minor ); wxGetOsVersion( &major, &minor );
int w, h ; int w, h;
GetSize( &w , &h ) ; GetSize( &w, &h );
if ( MacIsReallyHilited() ) if ( MacIsReallyHilited() )
{ {
wxPen white( *wxWHITE , 1 , wxSOLID ) ; wxPen white( *wxWHITE , 1 , wxSOLID );
if (major >= 10 ) if (major >= 10)
{ {
//Finder statusbar border color: (Project builder similar is 9B9B9B) // Finder statusbar border color: (Project Builder similar is 9B9B9B)
if ( MacGetTopLevelWindow()->MacGetMetalAppearance() ) if ( MacGetTopLevelWindow()->MacGetMetalAppearance() )
dc.SetPen(wxPen(wxColour(0x40,40,40) ,1,wxSOLID)) ; dc.SetPen(wxPen(wxColour(0x40, 0x40, 0x40), 1, wxSOLID));
else else
dc.SetPen(wxPen(wxColour(0xB1,0xB1,0xB1),1,wxSOLID)); dc.SetPen(wxPen(wxColour(0xB1, 0xB1, 0xB1), 1, wxSOLID));
} }
else else
{ {
wxPen black( *wxBLACK , 1 , wxSOLID ) ; wxPen black( *wxBLACK , 1 , wxSOLID );
dc.SetPen(black); dc.SetPen(black);
} }
dc.DrawLine(0, 0 ,
w , 0); dc.DrawLine(0, 0, w, 0);
dc.SetPen(white); dc.SetPen(white);
dc.DrawLine(0, 1 , dc.DrawLine(0, 1, w, 1);
w , 1);
} }
else else
{ {
if (major >= 10) if (major >= 10)
//Finder statusbar border color: (Project builder similar is 9B9B9B) // Finder statusbar border color: (Project Builder similar is 9B9B9B)
dc.SetPen(wxPen(wxColour(0xB1,0xB1,0xB1),1,wxSOLID)); dc.SetPen(wxPen(wxColour(0xB1, 0xB1, 0xB1), 1, wxSOLID));
else else
dc.SetPen(wxPen(wxColour(0x80,0x80,0x80),1,wxSOLID)); dc.SetPen(wxPen(wxColour(0x80, 0x80, 0x80), 1, wxSOLID));
dc.DrawLine(0, 0 , dc.DrawLine(0, 0, w, 0);
w , 0);
} }
int i; int i;
@@ -172,6 +156,6 @@ void wxStatusBarMac::OnPaint(wxPaintEvent& WXUNUSED(event) )
void wxStatusBarMac::MacHiliteChanged() void wxStatusBarMac::MacHiliteChanged()
{ {
Refresh() ; Refresh();
Update() ; Update();
} }