cleanup - reformatting
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37312 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -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,32 +9,20 @@
|
|||||||
// 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()
|
||||||
{
|
{
|
||||||
@@ -50,7 +38,7 @@ bool wxStatusBarMac::Create(wxWindow *parent, wxWindowID id,
|
|||||||
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 );
|
||||||
@@ -58,7 +46,7 @@ bool wxStatusBarMac::Create(wxWindow *parent, wxWindowID id,
|
|||||||
// 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 ;
|
||||||
@@ -113,7 +99,7 @@ void wxStatusBarMac::SetStatusText(const wxString& text, int number)
|
|||||||
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -132,9 +118,9 @@ void wxStatusBarMac::OnPaint(wxPaintEvent& WXUNUSED(event) )
|
|||||||
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));
|
||||||
}
|
}
|
||||||
@@ -143,22 +129,20 @@ void wxStatusBarMac::OnPaint(wxPaintEvent& WXUNUSED(event) )
|
|||||||
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;
|
||||||
|
Reference in New Issue
Block a user