cleanup - reformat
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36755 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -21,6 +21,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxBrush, wxGDIObject)
|
||||
class WXDLLEXPORT wxBrushRefData: public wxGDIRefData
|
||||
{
|
||||
friend class WXDLLEXPORT wxBrush;
|
||||
|
||||
public:
|
||||
wxBrushRefData();
|
||||
wxBrushRefData(const wxBrushRefData& data);
|
||||
@@ -40,6 +41,7 @@ protected:
|
||||
|
||||
#define M_BRUSHDATA ((wxBrushRefData *)m_refData)
|
||||
|
||||
|
||||
wxBrushRefData::wxBrushRefData()
|
||||
: m_style(wxSOLID)
|
||||
{
|
||||
@@ -62,7 +64,6 @@ wxBrushRefData::~wxBrushRefData()
|
||||
{
|
||||
}
|
||||
|
||||
// Brushes
|
||||
wxBrush::wxBrush()
|
||||
{
|
||||
}
|
||||
@@ -105,6 +106,7 @@ wxBrush::wxBrush(ThemeBrush macThemeBrush )
|
||||
|
||||
RealizeResource();
|
||||
}
|
||||
|
||||
void wxBrush::Unshare()
|
||||
{
|
||||
// Don't change shared data
|
||||
@@ -165,6 +167,7 @@ void wxBrush::MacSetTheme(ThemeBrush macThemeBrush)
|
||||
|
||||
M_BRUSHDATA->m_macBrushKind = kwxMacBrushTheme;
|
||||
M_BRUSHDATA->m_macThemeBrush = macThemeBrush;
|
||||
|
||||
RGBColor color ;
|
||||
GetThemeBrushAsColor( macThemeBrush , 32, true, &color );
|
||||
M_BRUSHDATA->m_colour.Set( color.red >> 8 , color.green >> 8 , color.blue >> 8 );
|
||||
@@ -179,6 +182,7 @@ void wxBrush::MacSetThemeBackground(unsigned long macThemeBackground, const WXRE
|
||||
M_BRUSHDATA->m_macBrushKind = kwxMacBrushThemeBackground;
|
||||
M_BRUSHDATA->m_macThemeBackground = macThemeBackground;
|
||||
M_BRUSHDATA->m_macThemeBackgroundExtent = *(Rect*)extent;
|
||||
|
||||
RealizeResource();
|
||||
}
|
||||
|
||||
@@ -186,13 +190,14 @@ bool wxBrush::RealizeResource()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
unsigned long wxBrush::MacGetThemeBackground( WXRECTPTR extent) const
|
||||
unsigned long wxBrush::MacGetThemeBackground( WXRECTPTR extent) const
|
||||
{
|
||||
if ( M_BRUSHDATA && M_BRUSHDATA->m_macBrushKind == kwxMacBrushThemeBackground )
|
||||
{
|
||||
if ( extent )
|
||||
*(Rect*)extent = M_BRUSHDATA->m_macThemeBackgroundExtent;
|
||||
|
||||
return M_BRUSHDATA->m_macThemeBackground;
|
||||
}
|
||||
else
|
||||
@@ -203,7 +208,7 @@ unsigned long wxBrush::MacGetThemeBackground( WXRECTPTR extent) const
|
||||
|
||||
short wxBrush::MacGetTheme() const
|
||||
{
|
||||
return (M_BRUSHDATA ? ( M_BRUSHDATA->m_macBrushKind == kwxMacBrushTheme ? M_BRUSHDATA->m_macThemeBrush : kThemeBrushBlack) : kThemeBrushBlack);
|
||||
return (M_BRUSHDATA ? ((M_BRUSHDATA->m_macBrushKind == kwxMacBrushTheme) ? M_BRUSHDATA->m_macThemeBrush : kThemeBrushBlack) : kThemeBrushBlack);
|
||||
}
|
||||
|
||||
wxColour& wxBrush::GetColour() const
|
||||
@@ -225,3 +230,4 @@ wxMacBrushKind wxBrush::MacGetBrushKind() const
|
||||
{
|
||||
return (M_BRUSHDATA ? M_BRUSHDATA->m_macBrushKind : kwxMacBrushColour);
|
||||
}
|
||||
|
||||
|
@@ -14,12 +14,10 @@
|
||||
#include "wx/gdicmn.h"
|
||||
#include "wx/colour.h"
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxColour, wxObject)
|
||||
|
||||
// Colour
|
||||
|
||||
#include "wx/mac/private.h"
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxColour, wxObject)
|
||||
|
||||
static void wxComposeRGBColor( WXCOLORREF* color , int red, int blue, int green );
|
||||
static void wxComposeRGBColor( WXCOLORREF* color , int red, int blue, int green )
|
||||
{
|
||||
|
@@ -19,7 +19,8 @@ IMPLEMENT_DYNAMIC_CLASS(wxGauge, wxControl)
|
||||
|
||||
#include "wx/mac/uma.h"
|
||||
|
||||
bool wxGauge::Create(wxWindow *parent, wxWindowID id,
|
||||
bool wxGauge::Create( wxWindow *parent,
|
||||
wxWindowID id,
|
||||
int range,
|
||||
const wxPoint& pos,
|
||||
const wxSize& s,
|
||||
@@ -27,29 +28,31 @@ bool wxGauge::Create(wxWindow *parent, wxWindowID id,
|
||||
const wxValidator& validator,
|
||||
const wxString& name )
|
||||
{
|
||||
m_macIsUserPane = FALSE ;
|
||||
m_macIsUserPane = false;
|
||||
|
||||
if ( !wxGaugeBase::Create( parent, id, range, pos, s, style & 0xE0FFFFFF, validator, name ) )
|
||||
return false;
|
||||
|
||||
wxSize size = s;
|
||||
/*
|
||||
|
||||
#if 0
|
||||
if (size.x == wxDefaultCoord && size.y == wxDefaultCoord)
|
||||
{
|
||||
size = wxSize( 200 , 16 );
|
||||
}
|
||||
*/
|
||||
#endif
|
||||
|
||||
Rect bounds = wxMacGetBoundsForControl( this, pos, size );
|
||||
m_peer = new wxMacControl( this );
|
||||
verify_noerr ( CreateProgressBarControl( MAC_WXHWND(parent->MacGetTopLevelWindowRef()) , &bounds ,
|
||||
GetValue() , 0 , GetRange() , false /* not indeterminate */ , m_peer->GetControlRefAddr() ) );
|
||||
OSStatus err = CreateProgressBarControl(
|
||||
MAC_WXHWND(parent->MacGetTopLevelWindowRef()), &bounds,
|
||||
GetValue(), 0, GetRange(), false /* not indeterminate */, m_peer->GetControlRefAddr() );
|
||||
verify_noerr( err );
|
||||
|
||||
if ( GetValue() == 0 )
|
||||
m_peer->SetData<Boolean>( kControlEntireControl, kControlProgressBarAnimatingTag, (Boolean)false );
|
||||
|
||||
MacPostControlCreate( pos, size );
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxGauge::SetRange(int r)
|
||||
@@ -66,28 +69,29 @@ void wxGauge::SetValue(int pos)
|
||||
// we are going via the base class in case there is
|
||||
// some change behind the values by it
|
||||
wxGaugeBase::SetValue( pos ) ;
|
||||
|
||||
if ( m_peer && m_peer->Ok() )
|
||||
{
|
||||
m_peer->SetValue( GetValue() ) ;
|
||||
// we turn off animation in the unnecessary situations as this is eating a lot of CPU otherwise
|
||||
|
||||
// turn off animation in the unnecessary situations as this is consuming a lot of CPU otherwise
|
||||
Boolean shouldAnimate = ( GetValue() > 0 && GetValue() < GetRange() ) ;
|
||||
if ( m_peer->GetData<Boolean>( kControlEntireControl, kControlProgressBarAnimatingTag ) != shouldAnimate )
|
||||
{
|
||||
m_peer->SetData<Boolean>( kControlEntireControl, kControlProgressBarAnimatingTag, shouldAnimate ) ;
|
||||
if ( !shouldAnimate )
|
||||
{
|
||||
Refresh() ;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int wxGauge::GetValue() const
|
||||
{
|
||||
/*
|
||||
#if 0
|
||||
if ( m_peer && m_peer->Ok() )
|
||||
return m_peer->GetValue() ;
|
||||
*/
|
||||
#endif
|
||||
|
||||
return m_gaugePos ;
|
||||
}
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user