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
|
class WXDLLEXPORT wxBrushRefData: public wxGDIRefData
|
||||||
{
|
{
|
||||||
friend class WXDLLEXPORT wxBrush;
|
friend class WXDLLEXPORT wxBrush;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
wxBrushRefData();
|
wxBrushRefData();
|
||||||
wxBrushRefData(const wxBrushRefData& data);
|
wxBrushRefData(const wxBrushRefData& data);
|
||||||
@@ -40,6 +41,7 @@ protected:
|
|||||||
|
|
||||||
#define M_BRUSHDATA ((wxBrushRefData *)m_refData)
|
#define M_BRUSHDATA ((wxBrushRefData *)m_refData)
|
||||||
|
|
||||||
|
|
||||||
wxBrushRefData::wxBrushRefData()
|
wxBrushRefData::wxBrushRefData()
|
||||||
: m_style(wxSOLID)
|
: m_style(wxSOLID)
|
||||||
{
|
{
|
||||||
@@ -62,7 +64,6 @@ wxBrushRefData::~wxBrushRefData()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
// Brushes
|
|
||||||
wxBrush::wxBrush()
|
wxBrush::wxBrush()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -96,7 +97,7 @@ wxBrush::wxBrush(const wxBitmap& stipple)
|
|||||||
RealizeResource();
|
RealizeResource();
|
||||||
}
|
}
|
||||||
|
|
||||||
wxBrush::wxBrush(ThemeBrush macThemeBrush )
|
wxBrush::wxBrush( ThemeBrush macThemeBrush )
|
||||||
{
|
{
|
||||||
m_refData = new wxBrushRefData;
|
m_refData = new wxBrushRefData;
|
||||||
|
|
||||||
@@ -105,6 +106,7 @@ wxBrush::wxBrush(ThemeBrush macThemeBrush )
|
|||||||
|
|
||||||
RealizeResource();
|
RealizeResource();
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxBrush::Unshare()
|
void wxBrush::Unshare()
|
||||||
{
|
{
|
||||||
// Don't change shared data
|
// Don't change shared data
|
||||||
@@ -165,9 +167,10 @@ void wxBrush::MacSetTheme(ThemeBrush macThemeBrush)
|
|||||||
|
|
||||||
M_BRUSHDATA->m_macBrushKind = kwxMacBrushTheme;
|
M_BRUSHDATA->m_macBrushKind = kwxMacBrushTheme;
|
||||||
M_BRUSHDATA->m_macThemeBrush = macThemeBrush;
|
M_BRUSHDATA->m_macThemeBrush = macThemeBrush;
|
||||||
|
|
||||||
RGBColor color ;
|
RGBColor color ;
|
||||||
GetThemeBrushAsColor( macThemeBrush , 32, true, &color );
|
GetThemeBrushAsColor( macThemeBrush , 32, true, &color );
|
||||||
M_BRUSHDATA->m_colour.Set( color.red >> 8 , color.green >> 8 , color.blue >> 8 ) ;
|
M_BRUSHDATA->m_colour.Set( color.red >> 8 , color.green >> 8 , color.blue >> 8 );
|
||||||
|
|
||||||
RealizeResource();
|
RealizeResource();
|
||||||
}
|
}
|
||||||
@@ -178,7 +181,8 @@ void wxBrush::MacSetThemeBackground(unsigned long macThemeBackground, const WXRE
|
|||||||
|
|
||||||
M_BRUSHDATA->m_macBrushKind = kwxMacBrushThemeBackground;
|
M_BRUSHDATA->m_macBrushKind = kwxMacBrushThemeBackground;
|
||||||
M_BRUSHDATA->m_macThemeBackground = macThemeBackground;
|
M_BRUSHDATA->m_macThemeBackground = macThemeBackground;
|
||||||
M_BRUSHDATA->m_macThemeBackgroundExtent = *(Rect*)extent ;
|
M_BRUSHDATA->m_macThemeBackgroundExtent = *(Rect*)extent;
|
||||||
|
|
||||||
RealizeResource();
|
RealizeResource();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -186,24 +190,25 @@ bool wxBrush::RealizeResource()
|
|||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
unsigned long wxBrush::MacGetThemeBackground( WXRECTPTR extent) const
|
||||||
unsigned long wxBrush::MacGetThemeBackground( WXRECTPTR extent) const
|
unsigned long wxBrush::MacGetThemeBackground( WXRECTPTR extent) const
|
||||||
{
|
{
|
||||||
if ( M_BRUSHDATA && M_BRUSHDATA->m_macBrushKind == kwxMacBrushThemeBackground )
|
if ( M_BRUSHDATA && M_BRUSHDATA->m_macBrushKind == kwxMacBrushThemeBackground )
|
||||||
{
|
{
|
||||||
if ( extent )
|
if ( extent )
|
||||||
*(Rect*)extent = M_BRUSHDATA->m_macThemeBackgroundExtent ;
|
*(Rect*)extent = M_BRUSHDATA->m_macThemeBackgroundExtent;
|
||||||
return M_BRUSHDATA->m_macThemeBackground ;
|
|
||||||
|
return M_BRUSHDATA->m_macThemeBackground;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return 0 ;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
short wxBrush::MacGetTheme() 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
|
wxColour& wxBrush::GetColour() const
|
||||||
@@ -221,7 +226,8 @@ wxBitmap *wxBrush::GetStipple() const
|
|||||||
return (M_BRUSHDATA ? & M_BRUSHDATA->m_stipple : 0);
|
return (M_BRUSHDATA ? & M_BRUSHDATA->m_stipple : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
wxMacBrushKind wxBrush::MacGetBrushKind() const
|
wxMacBrushKind wxBrush::MacGetBrushKind() const
|
||||||
{
|
{
|
||||||
return (M_BRUSHDATA ? M_BRUSHDATA->m_macBrushKind : kwxMacBrushColour);
|
return (M_BRUSHDATA ? M_BRUSHDATA->m_macBrushKind : kwxMacBrushColour);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -14,16 +14,14 @@
|
|||||||
#include "wx/gdicmn.h"
|
#include "wx/gdicmn.h"
|
||||||
#include "wx/colour.h"
|
#include "wx/colour.h"
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxColour, wxObject)
|
|
||||||
|
|
||||||
// Colour
|
|
||||||
|
|
||||||
#include "wx/mac/private.h"
|
#include "wx/mac/private.h"
|
||||||
|
|
||||||
static void wxComposeRGBColor( WXCOLORREF* color , int red, int blue, int green ) ;
|
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 )
|
static void wxComposeRGBColor( WXCOLORREF* color , int red, int blue, int green )
|
||||||
{
|
{
|
||||||
RGBColor* col = (RGBColor*) color ;
|
RGBColor* col = (RGBColor*) color;
|
||||||
col->red = (red << 8) + red;
|
col->red = (red << 8) + red;
|
||||||
col->blue = (blue << 8) + blue;
|
col->blue = (blue << 8) + blue;
|
||||||
col->green = (green << 8) + green;
|
col->green = (green << 8) + green;
|
||||||
@@ -36,7 +34,7 @@ void wxColour::Init()
|
|||||||
m_blue =
|
m_blue =
|
||||||
m_green = 0;
|
m_green = 0;
|
||||||
|
|
||||||
wxComposeRGBColor( &m_pixel , m_red , m_blue , m_green ) ;
|
wxComposeRGBColor( &m_pixel, m_red, m_blue, m_green );
|
||||||
}
|
}
|
||||||
|
|
||||||
wxColour::wxColour (const wxColour& col)
|
wxColour::wxColour (const wxColour& col)
|
||||||
@@ -47,7 +45,7 @@ wxColour::wxColour (const wxColour& col)
|
|||||||
m_blue = col.m_blue;
|
m_blue = col.m_blue;
|
||||||
m_isInit = col.m_isInit;
|
m_isInit = col.m_isInit;
|
||||||
|
|
||||||
memcpy( &m_pixel , &col.m_pixel , 6 ) ;
|
memcpy( &m_pixel, &col.m_pixel, 6 );
|
||||||
}
|
}
|
||||||
|
|
||||||
wxColour& wxColour::operator =(const wxColour& col)
|
wxColour& wxColour::operator =(const wxColour& col)
|
||||||
@@ -57,7 +55,7 @@ wxColour& wxColour::operator =(const wxColour& col)
|
|||||||
m_blue = col.m_blue;
|
m_blue = col.m_blue;
|
||||||
m_isInit = col.m_isInit;
|
m_isInit = col.m_isInit;
|
||||||
|
|
||||||
memcpy( &m_pixel , &col.m_pixel , 6 ) ;
|
memcpy( &m_pixel, &col.m_pixel, 6 );
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
@@ -66,7 +64,7 @@ void wxColour::InitFromName(const wxString& name)
|
|||||||
{
|
{
|
||||||
if ( wxTheColourDatabase )
|
if ( wxTheColourDatabase )
|
||||||
{
|
{
|
||||||
wxColour col = wxTheColourDatabase->Find(name);
|
wxColour col = wxTheColourDatabase->Find( name );
|
||||||
if ( col.Ok() )
|
if ( col.Ok() )
|
||||||
{
|
{
|
||||||
*this = col;
|
*this = col;
|
||||||
@@ -89,14 +87,14 @@ void wxColour::Set (unsigned char r, unsigned char g, unsigned char b)
|
|||||||
m_blue = b;
|
m_blue = b;
|
||||||
m_isInit = true;
|
m_isInit = true;
|
||||||
|
|
||||||
wxComposeRGBColor( &m_pixel , m_red , m_blue , m_green ) ;
|
wxComposeRGBColor( &m_pixel , m_red , m_blue , m_green );
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxColour::Set( const WXCOLORREF* color )
|
void wxColour::Set( const WXCOLORREF* color )
|
||||||
{
|
{
|
||||||
RGBColor* col = (RGBColor*) color ;
|
RGBColor* col = (RGBColor*) color;
|
||||||
memcpy( &m_pixel , color , 6 ) ;
|
memcpy( &m_pixel, color, 6 );
|
||||||
m_red = col->red>>8 ;
|
m_red = col->red >> 8;
|
||||||
m_blue = col->blue>>8 ;
|
m_blue = col->blue >> 8;
|
||||||
m_green = col->green>>8 ;
|
m_green = col->green >> 8;
|
||||||
}
|
}
|
||||||
|
@@ -19,44 +19,47 @@ IMPLEMENT_DYNAMIC_CLASS(wxGauge, wxControl)
|
|||||||
|
|
||||||
#include "wx/mac/uma.h"
|
#include "wx/mac/uma.h"
|
||||||
|
|
||||||
bool wxGauge::Create(wxWindow *parent, wxWindowID id,
|
bool wxGauge::Create( wxWindow *parent,
|
||||||
int range,
|
wxWindowID id,
|
||||||
const wxPoint& pos,
|
int range,
|
||||||
const wxSize& s,
|
const wxPoint& pos,
|
||||||
long style,
|
const wxSize& s,
|
||||||
const wxValidator& validator,
|
long style,
|
||||||
const wxString& name)
|
const wxValidator& validator,
|
||||||
|
const wxString& name )
|
||||||
{
|
{
|
||||||
m_macIsUserPane = FALSE ;
|
m_macIsUserPane = false;
|
||||||
|
|
||||||
if ( !wxGaugeBase::Create(parent, id, range, pos, s, style & 0xE0FFFFFF, validator, name) )
|
if ( !wxGaugeBase::Create( parent, id, range, pos, s, style & 0xE0FFFFFF, validator, name ) )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
wxSize size = s ;
|
wxSize size = s;
|
||||||
/*
|
|
||||||
if ( size.x == wxDefaultCoord && size.y == wxDefaultCoord)
|
#if 0
|
||||||
{
|
if (size.x == wxDefaultCoord && size.y == wxDefaultCoord)
|
||||||
size = wxSize( 200 , 16 ) ;
|
size = wxSize( 200 , 16 );
|
||||||
}
|
#endif
|
||||||
*/
|
|
||||||
Rect bounds = wxMacGetBoundsForControl( this , pos , size ) ;
|
Rect bounds = wxMacGetBoundsForControl( this, pos, size );
|
||||||
m_peer = new wxMacControl(this) ;
|
m_peer = new wxMacControl( this );
|
||||||
verify_noerr ( CreateProgressBarControl( MAC_WXHWND(parent->MacGetTopLevelWindowRef()) , &bounds ,
|
OSStatus err = CreateProgressBarControl(
|
||||||
GetValue() , 0 , GetRange() , false /* not indeterminate */ , m_peer->GetControlRefAddr() ) );
|
MAC_WXHWND(parent->MacGetTopLevelWindowRef()), &bounds,
|
||||||
|
GetValue(), 0, GetRange(), false /* not indeterminate */, m_peer->GetControlRefAddr() );
|
||||||
|
verify_noerr( err );
|
||||||
|
|
||||||
if ( GetValue() == 0 )
|
if ( GetValue() == 0 )
|
||||||
m_peer->SetData<Boolean>( kControlEntireControl , kControlProgressBarAnimatingTag , (Boolean) false ) ;
|
m_peer->SetData<Boolean>( kControlEntireControl, kControlProgressBarAnimatingTag, (Boolean)false );
|
||||||
|
|
||||||
MacPostControlCreate(pos,size) ;
|
MacPostControlCreate( pos, size );
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxGauge::SetRange(int r)
|
void wxGauge::SetRange(int r)
|
||||||
{
|
{
|
||||||
// we are going via the base class in case there is
|
// we are going via the base class in case there is
|
||||||
// some change behind the values by it
|
// some change behind the values by it
|
||||||
wxGaugeBase::SetRange(r) ;
|
wxGaugeBase::SetRange( r ) ;
|
||||||
if ( m_peer && m_peer->Ok() )
|
if ( m_peer && m_peer->Ok() )
|
||||||
m_peer->SetMaximum( GetRange() ) ;
|
m_peer->SetMaximum( GetRange() ) ;
|
||||||
}
|
}
|
||||||
@@ -65,31 +68,32 @@ void wxGauge::SetValue(int pos)
|
|||||||
{
|
{
|
||||||
// we are going via the base class in case there is
|
// we are going via the base class in case there is
|
||||||
// some change behind the values by it
|
// some change behind the values by it
|
||||||
wxGaugeBase::SetValue(pos) ;
|
wxGaugeBase::SetValue( pos ) ;
|
||||||
|
|
||||||
if ( m_peer && m_peer->Ok() )
|
if ( m_peer && m_peer->Ok() )
|
||||||
{
|
{
|
||||||
m_peer->SetValue( GetValue() ) ;
|
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() ) ;
|
Boolean shouldAnimate = ( GetValue() > 0 && GetValue() < GetRange() ) ;
|
||||||
if ( m_peer->GetData<Boolean>( kControlEntireControl , kControlProgressBarAnimatingTag ) != shouldAnimate )
|
if ( m_peer->GetData<Boolean>( kControlEntireControl, kControlProgressBarAnimatingTag ) != shouldAnimate )
|
||||||
{
|
{
|
||||||
m_peer->SetData<Boolean>( kControlEntireControl , kControlProgressBarAnimatingTag , shouldAnimate ) ;
|
m_peer->SetData<Boolean>( kControlEntireControl, kControlProgressBarAnimatingTag, shouldAnimate ) ;
|
||||||
if ( !shouldAnimate )
|
if ( !shouldAnimate )
|
||||||
{
|
|
||||||
Refresh() ;
|
Refresh() ;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int wxGauge::GetValue() const
|
int wxGauge::GetValue() const
|
||||||
{
|
{
|
||||||
/*
|
#if 0
|
||||||
if ( m_peer && m_peer->Ok() )
|
if ( m_peer && m_peer->Ok() )
|
||||||
return m_peer->GetValue() ;
|
return m_peer->GetValue() ;
|
||||||
*/
|
#endif
|
||||||
|
|
||||||
return m_gaugePos ;
|
return m_gaugePos ;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // wxUSE_GAUGE
|
#endif // wxUSE_GAUGE
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@@ -1446,14 +1446,14 @@ bool wxTopLevelWindowMac::ShowFullScreen(bool show, long style)
|
|||||||
}
|
}
|
||||||
|
|
||||||
SetSize( x , y , w, h ) ;
|
SetSize( x , y , w, h ) ;
|
||||||
if( data->m_wasResizable )
|
if ( data->m_wasResizable )
|
||||||
MacChangeWindowAttributes( kWindowNoAttributes , kWindowResizableAttribute ) ;
|
MacChangeWindowAttributes( kWindowNoAttributes , kWindowResizableAttribute ) ;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ShowMenuBar() ;
|
ShowMenuBar() ;
|
||||||
FullScreenData *data = (FullScreenData *) m_macFullScreenData ;
|
FullScreenData *data = (FullScreenData *) m_macFullScreenData ;
|
||||||
if( data->m_wasResizable )
|
if ( data->m_wasResizable )
|
||||||
MacChangeWindowAttributes( kWindowResizableAttribute , kWindowNoAttributes ) ;
|
MacChangeWindowAttributes( kWindowResizableAttribute , kWindowNoAttributes ) ;
|
||||||
SetPosition( data->m_position ) ;
|
SetPosition( data->m_position ) ;
|
||||||
SetSize( data->m_size ) ;
|
SetSize( data->m_size ) ;
|
||||||
|
Reference in New Issue
Block a user