Tidied space and tabs in wxMac files

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@19397 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2003-02-28 23:48:13 +00:00
parent 7de24929eb
commit e40298d54e
202 changed files with 17354 additions and 17176 deletions

View File

@@ -206,22 +206,24 @@ unsigned long wxBrush::GetMacThemeBackground( WXRECTPTR extent) const
short wxBrush::GetMacTheme() const
{
return (M_BRUSHDATA ? ( M_BRUSHDATA->m_macBrushKind == kwxMacBrushTheme ? M_BRUSHDATA->m_macThemeBrush : kThemeBrushBlack) : kThemeBrushBlack);
};
}
wxColour& wxBrush::GetColour() const
{ return (M_BRUSHDATA ? M_BRUSHDATA->m_colour : wxNullColour); };
{
return (M_BRUSHDATA ? M_BRUSHDATA->m_colour : wxNullColour);
}
int wxBrush::GetStyle() const
{
return (M_BRUSHDATA ? M_BRUSHDATA->m_style : 0);
};
}
wxBitmap *wxBrush::GetStipple() const
{
return (M_BRUSHDATA ? & M_BRUSHDATA->m_stipple : 0);
};
}
wxMacBrushKind wxBrush::MacGetBrushKind() const
{
return (M_BRUSHDATA ? M_BRUSHDATA->m_macBrushKind : kwxMacBrushColour);
};
}

View File

@@ -206,22 +206,24 @@ unsigned long wxBrush::GetMacThemeBackground( WXRECTPTR extent) const
short wxBrush::GetMacTheme() const
{
return (M_BRUSHDATA ? ( M_BRUSHDATA->m_macBrushKind == kwxMacBrushTheme ? M_BRUSHDATA->m_macThemeBrush : kThemeBrushBlack) : kThemeBrushBlack);
};
}
wxColour& wxBrush::GetColour() const
{ return (M_BRUSHDATA ? M_BRUSHDATA->m_colour : wxNullColour); };
{
return (M_BRUSHDATA ? M_BRUSHDATA->m_colour : wxNullColour);
}
int wxBrush::GetStyle() const
{
return (M_BRUSHDATA ? M_BRUSHDATA->m_style : 0);
};
}
wxBitmap *wxBrush::GetStipple() const
{
return (M_BRUSHDATA ? & M_BRUSHDATA->m_stipple : 0);
};
}
wxMacBrushKind wxBrush::MacGetBrushKind() const
{
return (M_BRUSHDATA ? M_BRUSHDATA->m_macBrushKind : kwxMacBrushColour);
};
}

View File

@@ -8,17 +8,22 @@
// Copyright: (c) Stefan Csomor
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
#pragma implementation "choice.h"
#endif
#include "wx/defs.h"
#include "wx/choice.h"
#include "wx/menu.h"
#include "wx/mac/uma.h"
#if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxChoice, wxControl)
#endif
extern MenuHandle NewUniqueMenu() ;
wxChoice::~wxChoice()
{
if ( HasClientObjectData() )
@@ -32,6 +37,7 @@ wxChoice::~wxChoice()
// DeleteMenu( m_macPopUpMenuId ) ;
// DisposeMenu( m_macPopUpMenuHandle ) ;
}
bool wxChoice::Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos,
const wxSize& size,
@@ -60,6 +66,7 @@ bool wxChoice::Create(wxWindow *parent, wxWindowID id,
}
return TRUE;
}
// ----------------------------------------------------------------------------
// adding/deleting items to/from the list
// ----------------------------------------------------------------------------
@@ -73,6 +80,7 @@ int wxChoice::DoAppend(const wxString& item)
SetControl32BitMaximum( (ControlHandle) m_macControl , GetCount()) ;
return index ;
}
void wxChoice::Delete(int n)
{
wxCHECK_RET( n < GetCount(), wxT("invalid item index in wxChoice::Delete") );
@@ -85,6 +93,7 @@ void wxChoice::Delete(int n)
m_datas.RemoveAt( n ) ;
SetControl32BitMaximum( (ControlHandle) m_macControl , GetCount()) ;
}
void wxChoice::Clear()
{
FreeData();
@@ -96,6 +105,7 @@ void wxChoice::Clear()
m_datas.Empty() ;
SetControl32BitMaximum( (ControlHandle) m_macControl , 0 ) ;
}
void wxChoice::FreeData()
{
if ( HasClientObjectData() )
@@ -107,6 +117,7 @@ void wxChoice::FreeData()
}
}
}
// ----------------------------------------------------------------------------
// selection
// ----------------------------------------------------------------------------
@@ -114,17 +125,21 @@ int wxChoice::GetSelection() const
{
return GetControl32BitValue( (ControlHandle) m_macControl ) -1 ;
}
void wxChoice::SetSelection(int n)
{
SetControl32BitValue( (ControlHandle) m_macControl , n + 1 ) ;
}
// ----------------------------------------------------------------------------
// string list functions
// ----------------------------------------------------------------------------
int wxChoice::GetCount() const
{
return m_strings.GetCount() ;
}
int wxChoice::FindString(const wxString& s) const
{
for( int i = 0 ; i < GetCount() ; i++ )
@@ -134,6 +149,7 @@ int wxChoice::FindString(const wxString& s) const
}
return wxNOT_FOUND ;
}
void wxChoice::SetString(int n, const wxString& s)
{
wxFAIL_MSG(wxT("wxChoice::SetString() not yet implemented"));
@@ -157,20 +173,24 @@ void wxChoice::DoSetItemClientData( int n, void* clientData )
m_datas[n] = (char*) clientData ;
}
void *wxChoice::DoGetItemClientData(int n) const
{
wxCHECK_MSG( n >= 0 && (size_t)n < m_datas.GetCount(), NULL,
"invalid index in wxChoice::GetClientData" );
return (void *)m_datas[n];
}
void wxChoice::DoSetItemClientObject( int n, wxClientData* clientData )
{
DoSetItemClientData(n, clientData);
}
wxClientData* wxChoice::DoGetItemClientObject( int n ) const
{
return (wxClientData *)DoGetItemClientData(n);
}
void wxChoice::MacHandleControlClick( WXWidget control , wxInt16 controlpart )
{
wxCommandEvent event(wxEVT_COMMAND_CHOICE_SELECTED, m_windowId );
@@ -188,6 +208,7 @@ void wxChoice::MacHandleControlClick( WXWidget control , wxInt16 controlpart )
ProcessCommand(event);
}
}
wxSize wxChoice::DoGetBestSize() const
{
int lbWidth = 100; // some defaults

View File

@@ -895,12 +895,11 @@ void wxControl::OnMouseEvent( wxMouseEvent &event )
bool wxControl::MacCanFocus() const
{
{ if ( (ControlHandle) m_macControl == NULL )
if ( (ControlHandle) m_macControl == NULL )
return true ;
else
return false ;
}
}
void wxControl::MacHandleControlClick( WXWidget control , wxInt16 controlpart )
{

View File

@@ -8,9 +8,11 @@
// Copyright: (c) Stefan Csomor
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
#pragma implementation "dc.h"
#endif
#include "wx/dc.h"
#include "wx/app.h"
#include "wx/mac/uma.h"
@@ -30,9 +32,11 @@ using namespace std ;
#if !USE_SHARED_LIBRARY
IMPLEMENT_ABSTRACT_CLASS(wxDC, wxObject)
#endif
//-----------------------------------------------------------------------------
// constants
//-----------------------------------------------------------------------------
#define mm2inches 0.0393700787402
#define inches2mm 25.4
#define mm2twips 56.6929133859
@@ -45,6 +49,7 @@ const double M_PI = 3.14159265358979 ;
const double RAD2DEG = 180.0 / M_PI;
const short kEmulatedMode = -1 ;
const short kUnsupportedMode = -2 ;
wxMacPortSetter::wxMacPortSetter( const wxDC* dc ) :
m_ph( (GrafPtr) dc->m_macPort )
{
@@ -52,10 +57,12 @@ wxMacPortSetter::wxMacPortSetter( const wxDC* dc ) :
m_dc = dc ;
dc->MacSetupPort(&m_ph) ;
}
wxMacPortSetter::~wxMacPortSetter()
{
m_dc->MacCleanupPort(&m_ph) ;
}
wxMacWindowClipper::wxMacWindowClipper( const wxWindow* win )
{
m_formerClip = NewRgn() ;
@@ -89,24 +96,28 @@ wxMacWindowClipper::wxMacWindowClipper( const wxWindow* win )
SetClip( m_newClip ) ;
}
}
wxMacWindowClipper::~wxMacWindowClipper()
{
SetClip( m_formerClip ) ;
DisposeRgn( m_newClip ) ;
DisposeRgn( m_formerClip ) ;
}
//-----------------------------------------------------------------------------
// Local functions
//-----------------------------------------------------------------------------
static inline double dmin(double a, double b) { return a < b ? a : b; }
static inline double dmax(double a, double b) { return a > b ? a : b; }
static inline double DegToRad(double deg) { return (deg * M_PI) / 180.0; }
//-----------------------------------------------------------------------------
// wxDC
//-----------------------------------------------------------------------------
// this function emulates all wx colour manipulations, used to verify the implementation
// by setting the mode in the blitting functions to kEmulatedMode
void wxMacCalculateColour( int logical_func , const RGBColor &srcColor , RGBColor &dstColor ) ;
void wxMacCalculateColour( int logical_func , const RGBColor &srcColor , RGBColor &dstColor )
{
switch ( logical_func )
@@ -190,6 +201,7 @@ void wxMacCalculateColour( int logical_func , const RGBColor &srcColor , RGBColo
break ;
}
}
wxDC::wxDC()
{
m_ok = FALSE;
@@ -228,11 +240,13 @@ wxDC::wxDC()
m_macForegroundPixMap = NULL ;
m_macBackgroundPixMap = NULL ;
}
wxDC::~wxDC(void)
{
DisposeRgn( (RgnHandle) m_macBoundaryClipRgn ) ;
DisposeRgn( (RgnHandle) m_macCurrentClipRgn ) ;
}
void wxDC::MacSetupPort(wxMacPortStateHelper* help) const
{
wxASSERT( m_macCurrentPortStateHelper == NULL ) ;
@@ -242,6 +256,7 @@ void wxDC::MacSetupPort(wxMacPortStateHelper* help) const
m_macBrushInstalled = false ;
m_macPenInstalled = false ;
}
void wxDC::MacCleanupPort(wxMacPortStateHelper* help) const
{
wxASSERT( m_macCurrentPortStateHelper == help ) ;
@@ -271,6 +286,7 @@ void wxDC::MacCleanupPort(wxMacPortStateHelper* help) const
m_macBackgroundPixMap = NULL ;
}
}
void wxDC::DoDrawBitmap( const wxBitmap &bmp, wxCoord x, wxCoord y, bool useMask )
{
wxCHECK_RET( Ok(), wxT("invalid window dc") );
@@ -356,12 +372,14 @@ void wxDC::DoDrawBitmap( const wxBitmap &bmp, wxCoord x, wxCoord y, bool useMask
m_macBrushInstalled = false ;
m_macFontInstalled = false ;
}
void wxDC::DoDrawIcon( const wxIcon &icon, wxCoord x, wxCoord y )
{
wxCHECK_RET(Ok(), wxT("Invalid dc wxDC::DoDrawIcon"));
wxCHECK_RET(icon.Ok(), wxT("Invalid icon wxDC::DoDrawIcon"));
DoDrawBitmap( icon , x , y , icon.GetMask() != NULL ) ;
}
void wxDC::DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
{
wxCHECK_RET(Ok(), wxT("wxDC::DoSetClippingRegion Invalid DC"));
@@ -388,6 +406,7 @@ void wxDC::DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoord hei
m_clipY2 = yy + hh;
}
}
void wxDC::DoSetClippingRegionAsRegion( const wxRegion &region )
{
wxCHECK_RET( Ok(), wxT("invalid window dc") ) ;
@@ -435,17 +454,20 @@ void wxDC::DoSetClippingRegionAsRegion( const wxRegion &region )
}
}
}
void wxDC::DestroyClippingRegion()
{
wxMacPortSetter helper(this) ;
CopyRgn( (RgnHandle) m_macBoundaryClipRgn , (RgnHandle) m_macCurrentClipRgn ) ;
m_clipping = FALSE;
}
void wxDC::DoGetSize( int* width, int* height ) const
{
*width = m_maxX-m_minX;
*height = m_maxY-m_minY;
}
void wxDC::DoGetSizeMM( int* width, int* height ) const
{
int w = 0;
@@ -454,18 +476,21 @@ void wxDC::DoGetSizeMM( int* width, int* height ) const
*width = long( double(w) / (m_scaleX*m_mm_to_pix_x) );
*height = long( double(h) / (m_scaleY*m_mm_to_pix_y) );
}
void wxDC::SetTextForeground( const wxColour &col )
{
wxCHECK_RET(Ok(), wxT("Invalid DC"));
m_textForegroundColour = col;
m_macFontInstalled = false ;
}
void wxDC::SetTextBackground( const wxColour &col )
{
wxCHECK_RET(Ok(), wxT("Invalid DC"));
m_textBackgroundColour = col;
m_macFontInstalled = false ;
}
void wxDC::SetMapMode( int mode )
{
switch (mode)
@@ -493,6 +518,7 @@ void wxDC::SetMapMode( int mode )
m_needComputeScaleY = TRUE;
}
}
void wxDC::SetUserScale( double x, double y )
{
// allow negative ? -> no
@@ -500,6 +526,7 @@ void wxDC::SetUserScale( double x, double y )
m_userScaleY = y;
ComputeScaleAndOrigin();
}
void wxDC::SetLogicalScale( double x, double y )
{
// allow negative ?
@@ -507,18 +534,21 @@ void wxDC::SetLogicalScale( double x, double y )
m_logicalScaleY = y;
ComputeScaleAndOrigin();
}
void wxDC::SetLogicalOrigin( wxCoord x, wxCoord y )
{
m_logicalOriginX = x * m_signX; // is this still correct ?
m_logicalOriginY = y * m_signY;
ComputeScaleAndOrigin();
}
void wxDC::SetDeviceOrigin( wxCoord x, wxCoord y )
{
m_externalDeviceOriginX = x;
m_externalDeviceOriginY = y;
ComputeScaleAndOrigin();
}
#if 0
void wxDC::SetInternalDeviceOrigin( long x, long y )
{
@@ -532,16 +562,19 @@ void wxDC::GetInternalDeviceOrigin( long *x, long *y )
if (y) *y = m_internalDeviceOriginY;
}
#endif
void wxDC::SetAxisOrientation( bool xLeftRight, bool yBottomUp )
{
m_signX = (xLeftRight ? 1 : -1);
m_signY = (yBottomUp ? -1 : 1);
ComputeScaleAndOrigin();
}
wxSize wxDC::GetPPI() const
{
return wxSize(72, 72);
}
int wxDC::GetDepth() const
{
if ( IsPortColor( (CGrafPtr) m_macPort ) )
@@ -550,6 +583,7 @@ int wxDC::GetDepth() const
}
return 1 ;
}
void wxDC::ComputeScaleAndOrigin()
{
// CMB: copy scale to see if it changes
@@ -570,18 +604,22 @@ void wxDC::ComputeScaleAndOrigin()
SetPen(* pen);
}
}
void wxDC::SetPalette( const wxPalette& palette )
{
}
void wxDC::SetBackgroundMode( int mode )
{
m_backgroundMode = mode ;
}
void wxDC::SetFont( const wxFont &font )
{
m_font = font;
m_macFontInstalled = false ;
}
void wxDC::SetPen( const wxPen &pen )
{
if ( m_pen == pen )
@@ -589,6 +627,7 @@ void wxDC::SetPen( const wxPen &pen )
m_pen = pen;
m_macPenInstalled = false ;
}
void wxDC::SetBrush( const wxBrush &brush )
{
if (m_brush == brush)
@@ -596,6 +635,7 @@ void wxDC::SetBrush( const wxBrush &brush )
m_brush = brush;
m_macBrushInstalled = false ;
}
void wxDC::SetBackground( const wxBrush &brush )
{
if (m_backgroundBrush == brush)
@@ -605,6 +645,7 @@ void wxDC::SetBackground( const wxBrush &brush )
return;
m_macBrushInstalled = false ;
}
void wxDC::SetLogicalFunction( int function )
{
if (m_logicalFunction == function)
@@ -614,13 +655,16 @@ void wxDC::SetLogicalFunction( int function )
m_macBrushInstalled = false ;
m_macPenInstalled = false ;
}
extern bool wxDoFloodFill(wxDC *dc, wxCoord x, wxCoord y,
const wxColour & col, int style);
bool wxDC::DoFloodFill(wxCoord x, wxCoord y,
const wxColour& col, int style)
{
return wxDoFloodFill(this, x, y, col, style);
}
bool wxDC::DoGetPixel( wxCoord x, wxCoord y, wxColour *col ) const
{
wxCHECK_MSG( Ok(), false, wxT("wxDC::DoGetPixel Invalid DC") );
@@ -633,6 +677,7 @@ bool wxDC::DoGetPixel( wxCoord x, wxCoord y, wxColour *col ) const
colour.blue >> 8);
return true ;
}
void wxDC::DoDrawLine( wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2 )
{
wxCHECK_RET(Ok(), wxT("Invalid DC"));
@@ -670,6 +715,7 @@ void wxDC::DoDrawLine( wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2 )
::LineTo(xx2, yy2);
}
}
void wxDC::DoCrossHair( wxCoord x, wxCoord y )
{
wxCHECK_RET( Ok(), wxT("wxDC::DoCrossHair Invalid window dc") );
@@ -690,6 +736,7 @@ void wxDC::DoCrossHair( wxCoord x, wxCoord y )
CalcBoundingBox(x+w, y+h);
}
}
/*
* To draw arcs properly the angles need to be converted from the WX style:
* Angles start on the +ve X axis and go anti-clockwise (As you would draw on
@@ -698,6 +745,7 @@ void wxDC::DoCrossHair( wxCoord x, wxCoord y )
* the Mac style:
* Angles start on the +ve y axis and go clockwise.
*/
static double wxConvertWXangleToMACangle(double angle)
{
double newAngle = 90 - angle ;
@@ -705,6 +753,7 @@ static double wxConvertWXangleToMACangle(double angle)
newAngle += 360 ;
return newAngle ;
}
void wxDC::DoDrawArc( wxCoord x1, wxCoord y1,
wxCoord x2, wxCoord y2,
wxCoord xc, wxCoord yc )
@@ -755,6 +804,7 @@ void wxDC::DoDrawArc( wxCoord x1, wxCoord y1,
FrameArc(&r, alpha1, alpha2);
}
}
void wxDC::DoDrawEllipticArc( wxCoord x, wxCoord y, wxCoord w, wxCoord h,
double sa, double ea )
{
@@ -786,6 +836,7 @@ void wxDC::DoDrawEllipticArc( wxCoord x, wxCoord y, wxCoord w, wxCoord h,
FrameArc(&r, (short)sa, (short)angle);
}
}
void wxDC::DoDrawPoint( wxCoord x, wxCoord y )
{
wxCHECK_RET(Ok(), wxT("Invalid DC"));
@@ -799,6 +850,7 @@ void wxDC::DoDrawPoint( wxCoord x, wxCoord y )
CalcBoundingBox(x, y);
}
}
void wxDC::DoDrawLines(int n, wxPoint points[],
wxCoord xoffset, wxCoord yoffset)
{
@@ -820,6 +872,7 @@ void wxDC::DoDrawLines(int n, wxPoint points[],
::LineTo( x2 - offset, y2 - offset );
}
}
void wxDC::DoDrawPolygon(int n, wxPoint points[],
wxCoord xoffset, wxCoord yoffset,
int fillStyle )
@@ -857,6 +910,7 @@ void wxDC::DoDrawPolygon(int n, wxPoint points[],
}
KillPoly( polygon );
}
void wxDC::DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
{
wxCHECK_RET(Ok(), wxT("Invalid DC"));
@@ -891,6 +945,7 @@ void wxDC::DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
::FrameRect( &rect ) ;
}
}
void wxDC::DoDrawRoundedRectangle(wxCoord x, wxCoord y,
wxCoord width, wxCoord height,
double radius)
@@ -929,6 +984,7 @@ void wxDC::DoDrawRoundedRectangle(wxCoord x, wxCoord y,
::FrameRoundRect( &rect , int(radius * 2) , int(radius * 2) ) ;
}
}
void wxDC::DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
{
wxCHECK_RET(Ok(), wxT("Invalid DC"));
@@ -964,7 +1020,6 @@ void wxDC::DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
}
}
bool wxDC::CanDrawBitmap(void) const
{
return true ;
@@ -1217,10 +1272,12 @@ bool wxDC::DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height,
m_macFontInstalled = false ;
return TRUE;
}
inline Fixed IntToFixed( int inInt )
{
return (((SInt32) inInt) << 16);
}
inline int FixedToInt( Fixed inFixed )
{
return (((SInt32) inFixed) >> 16);
@@ -1319,6 +1376,7 @@ void wxDC::DoDrawRotatedText(const wxString& str, wxCoord x, wxCoord y,
::ATSUDisposeTextLayout(atsuLayout);
delete[] buf ;
}
void wxDC::DoDrawText(const wxString& strtext, wxCoord x, wxCoord y)
{
wxCHECK_RET(Ok(), wxT("wxDC::DoDrawText Invalid DC"));
@@ -1452,11 +1510,13 @@ void wxDC::DoDrawText(const wxString& strtext, wxCoord x, wxCoord y)
}
::TextMode( srcOr ) ;
}
bool wxDC::CanGetTextExtent() const
{
wxCHECK_MSG(Ok(), false, wxT("Invalid DC"));
return true ;
}
void wxDC::DoGetTextExtent( const wxString &string, wxCoord *width, wxCoord *height,
wxCoord *descent, wxCoord *externalLeading ,
wxFont *theFont ) const
@@ -1566,6 +1626,7 @@ void wxDC::DoGetTextExtent( const wxString &string, wxCoord *width, wxCoord *he
m_macFontInstalled = false ;
}
}
wxCoord wxDC::GetCharWidth(void) const
{
wxCHECK_MSG(Ok(), 1, wxT("Invalid DC"));
@@ -1600,6 +1661,7 @@ wxCoord wxDC::GetCharWidth(void) const
}
return YDEV2LOGREL(width) ;
}
wxCoord wxDC::GetCharHeight(void) const
{
wxCHECK_MSG(Ok(), 1, wxT("Invalid DC"));
@@ -1609,6 +1671,7 @@ wxCoord wxDC::GetCharHeight(void) const
::GetFontInfo( &fi ) ;
return YDEV2LOGREL( fi.descent + fi.ascent );
}
void wxDC::Clear(void)
{
wxCHECK_RET(Ok(), wxT("Invalid DC"));
@@ -1622,6 +1685,7 @@ void wxDC::Clear(void)
::EraseRect( &rect ) ;
}
}
void wxDC::MacInstallFont() const
{
wxCHECK_RET(Ok(), wxT("Invalid DC"));
@@ -1753,6 +1817,7 @@ void wxDC::MacInstallFont() const
atsuTags, atsuSizes, atsuValues);
wxASSERT_MSG( status == noErr , "couldn't set create ATSU style" ) ;
}
Pattern gHatchPatterns[] =
{
{ { 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF } },
@@ -1763,6 +1828,7 @@ Pattern gHatchPatterns[] =
{ { 0x10 , 0x10 , 0x10 , 0x10 , 0x10 , 0x10 , 0x10 , 0x10 } },
{ { 0x81 , 0x42 , 0x24 , 0x18 , 0x18 , 0x24 , 0x42 , 0x81 } }
} ;
static void wxMacGetHatchPattern(int hatchStyle, Pattern *pattern)
{
int theIndex = 1 ;
@@ -1792,6 +1858,7 @@ static void wxMacGetHatchPattern(int hatchStyle, Pattern *pattern)
}
*pattern = gHatchPatterns[theIndex-1] ;
}
void wxDC::MacInstallPen() const
{
wxCHECK_RET(Ok(), wxT("Invalid DC"));
@@ -1905,6 +1972,7 @@ void wxDC::MacInstallPen() const
m_macBrushInstalled = false ;
m_macFontInstalled = false ;
}
void wxDC::MacSetupBackgroundForCurrentPort(const wxBrush& background )
{
Pattern whiteColor ;
@@ -1942,6 +2010,7 @@ void wxDC::MacSetupBackgroundForCurrentPort(const wxBrush& background )
}
}
}
void wxDC::MacInstallBrush() const
{
wxCHECK_RET(Ok(), wxT("Invalid DC"));
@@ -2083,6 +2152,7 @@ void wxDC::MacInstallBrush() const
m_macPenInstalled = false ;
m_macFontInstalled = false ;
}
// ---------------------------------------------------------------------------
// coordinates transformations
// ---------------------------------------------------------------------------
@@ -2091,30 +2161,37 @@ wxCoord wxDCBase::DeviceToLogicalX(wxCoord x) const
{
return ((wxDC *)this)->XDEV2LOG(x);
}
wxCoord wxDCBase::DeviceToLogicalY(wxCoord y) const
{
return ((wxDC *)this)->YDEV2LOG(y);
}
wxCoord wxDCBase::DeviceToLogicalXRel(wxCoord x) const
{
return ((wxDC *)this)->XDEV2LOGREL(x);
}
wxCoord wxDCBase::DeviceToLogicalYRel(wxCoord y) const
{
return ((wxDC *)this)->YDEV2LOGREL(y);
}
wxCoord wxDCBase::LogicalToDeviceX(wxCoord x) const
{
return ((wxDC *)this)->XLOG2DEV(x);
}
wxCoord wxDCBase::LogicalToDeviceY(wxCoord y) const
{
return ((wxDC *)this)->YLOG2DEV(y);
}
wxCoord wxDCBase::LogicalToDeviceXRel(wxCoord x) const
{
return ((wxDC *)this)->XLOG2DEVREL(x);
}
wxCoord wxDCBase::LogicalToDeviceYRel(wxCoord y) const
{
return ((wxDC *)this)->YLOG2DEVREL(y);

View File

@@ -57,7 +57,6 @@ bool wxDialog::Create(wxWindow *parent, wxWindowID id,
long style,
const wxString& name)
{
SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE));
@@ -68,6 +67,7 @@ bool wxDialog::Create(wxWindow *parent, wxWindowID id,
m_macWindowBackgroundTheme = kThemeBrushDialogBackgroundActive ;
SetThemeWindowBackground( (WindowRef) m_macWindow , m_macWindowBackgroundTheme , false ) ;
return TRUE;
}
@@ -96,8 +96,7 @@ wxDialog::~wxDialog()
// By default, pressing escape cancels the dialog , on mac command-stop does the same thing
void wxDialog::OnCharHook(wxKeyEvent& event)
{
if (
( event.m_keyCode == WXK_ESCAPE ||
if (( event.m_keyCode == WXK_ESCAPE ||
( event.m_keyCode == '.' && event.MetaDown() ) )
&& FindWindow(wxID_CANCEL) )
{

View File

@@ -121,7 +121,6 @@ wxFrame::~wxFrame()
m_isBeingDeleted = TRUE;
DeleteAllBars();
}

View File

@@ -9,7 +9,6 @@
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
#pragma implementation "menu.h"
#pragma implementation "menuitem.h"

View File

@@ -38,7 +38,6 @@ END_EVENT_TABLE()
* eg. if(GetWindowStyle() & wxSL_VERTICAL) {} else { horizontal case }>
*/
// Slider
wxSlider::wxSlider()
{

View File

@@ -902,5 +902,3 @@ bool WXDLLEXPORT wxIsWaitingForThread()
#include "wx/thrimpl.cpp"
#endif // wxUSE_THREADS
// vi:sts=4:sw=4:et

View File

@@ -116,7 +116,6 @@ void wxToolBar::Init()
bool wxToolBar::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size,
long style, const wxString& name)
{
int x = pos.x;
int y = pos.y;
int width = size.x;

View File

@@ -632,7 +632,6 @@ WXWidget wxTopLevelWindowMac::MacGetContainerForEmbedding()
void wxTopLevelWindowMac::MacUpdate( long timestamp)
{
wxMacPortStateHelper help( (GrafPtr) GetWindowPort( (WindowRef) m_macWindow) ) ;
BeginUpdate( (WindowRef)m_macWindow ) ;
@@ -770,6 +769,7 @@ void wxTopLevelWindowMac::MacFireMouseEvent(
MacDispatchMouseEvent( event ) ;
}
}
#if !TARGET_CARBON
void wxTopLevelWindowMac::MacMouseDown( WXEVENTREF ev , short part)

View File

@@ -692,8 +692,6 @@ OSErr UMASetKeyboardFocus (WindowPtr inWindow,
}
// events
void UMAUpdateControls( WindowPtr inWindow , RgnHandle inRgn )
{
@@ -707,7 +705,6 @@ void UMAUpdateControls( WindowPtr inWindow , RgnHandle inRgn )
UpdateControls( inWindow , inRgn ) ;
InvalWindowRgn( inWindow, updateRgn) ;
DisposeRgn( updateRgn ) ;
}
bool UMAIsWindowFloating( WindowRef inWindow )
@@ -750,6 +747,7 @@ void UMAHighlightAndActivateWindow( WindowRef inWindowRef , bool inActivate )
SetPort( port ) ;
}
}
OSStatus UMADrawThemePlacard( const Rect *inRect , ThemeDrawState inState )
{
return ::DrawThemePlacard( inRect , inState ) ;

View File

@@ -980,7 +980,7 @@ wxWindowMac *wxGetActiveWindow()
// Coordinates relative to the window
void wxWindowMac::WarpPointer (int x_pos, int y_pos)
{
// We really dont move the mouse programmatically under mac
// We really don't move the mouse programmatically under Mac.
}
const wxBrush& wxWindowMac::MacGetBackgroundBrush()
@@ -1045,7 +1045,6 @@ const wxBrush& wxWindowMac::MacGetBackgroundBrush()
}
return m_macBackgroundBrush ;
}
void wxWindowMac::OnEraseBackground(wxEraseEvent& event)

View File

@@ -8,17 +8,22 @@
// Copyright: (c) Stefan Csomor
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
#pragma implementation "choice.h"
#endif
#include "wx/defs.h"
#include "wx/choice.h"
#include "wx/menu.h"
#include "wx/mac/uma.h"
#if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxChoice, wxControl)
#endif
extern MenuHandle NewUniqueMenu() ;
wxChoice::~wxChoice()
{
if ( HasClientObjectData() )
@@ -32,6 +37,7 @@ wxChoice::~wxChoice()
// DeleteMenu( m_macPopUpMenuId ) ;
// DisposeMenu( m_macPopUpMenuHandle ) ;
}
bool wxChoice::Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos,
const wxSize& size,
@@ -60,6 +66,7 @@ bool wxChoice::Create(wxWindow *parent, wxWindowID id,
}
return TRUE;
}
// ----------------------------------------------------------------------------
// adding/deleting items to/from the list
// ----------------------------------------------------------------------------
@@ -73,6 +80,7 @@ int wxChoice::DoAppend(const wxString& item)
SetControl32BitMaximum( (ControlHandle) m_macControl , GetCount()) ;
return index ;
}
void wxChoice::Delete(int n)
{
wxCHECK_RET( n < GetCount(), wxT("invalid item index in wxChoice::Delete") );
@@ -85,6 +93,7 @@ void wxChoice::Delete(int n)
m_datas.RemoveAt( n ) ;
SetControl32BitMaximum( (ControlHandle) m_macControl , GetCount()) ;
}
void wxChoice::Clear()
{
FreeData();
@@ -96,6 +105,7 @@ void wxChoice::Clear()
m_datas.Empty() ;
SetControl32BitMaximum( (ControlHandle) m_macControl , 0 ) ;
}
void wxChoice::FreeData()
{
if ( HasClientObjectData() )
@@ -107,6 +117,7 @@ void wxChoice::FreeData()
}
}
}
// ----------------------------------------------------------------------------
// selection
// ----------------------------------------------------------------------------
@@ -114,17 +125,21 @@ int wxChoice::GetSelection() const
{
return GetControl32BitValue( (ControlHandle) m_macControl ) -1 ;
}
void wxChoice::SetSelection(int n)
{
SetControl32BitValue( (ControlHandle) m_macControl , n + 1 ) ;
}
// ----------------------------------------------------------------------------
// string list functions
// ----------------------------------------------------------------------------
int wxChoice::GetCount() const
{
return m_strings.GetCount() ;
}
int wxChoice::FindString(const wxString& s) const
{
for( int i = 0 ; i < GetCount() ; i++ )
@@ -134,6 +149,7 @@ int wxChoice::FindString(const wxString& s) const
}
return wxNOT_FOUND ;
}
void wxChoice::SetString(int n, const wxString& s)
{
wxFAIL_MSG(wxT("wxChoice::SetString() not yet implemented"));
@@ -157,20 +173,24 @@ void wxChoice::DoSetItemClientData( int n, void* clientData )
m_datas[n] = (char*) clientData ;
}
void *wxChoice::DoGetItemClientData(int n) const
{
wxCHECK_MSG( n >= 0 && (size_t)n < m_datas.GetCount(), NULL,
"invalid index in wxChoice::GetClientData" );
return (void *)m_datas[n];
}
void wxChoice::DoSetItemClientObject( int n, wxClientData* clientData )
{
DoSetItemClientData(n, clientData);
}
wxClientData* wxChoice::DoGetItemClientObject( int n ) const
{
return (wxClientData *)DoGetItemClientData(n);
}
void wxChoice::MacHandleControlClick( WXWidget control , wxInt16 controlpart )
{
wxCommandEvent event(wxEVT_COMMAND_CHOICE_SELECTED, m_windowId );
@@ -188,6 +208,7 @@ void wxChoice::MacHandleControlClick( WXWidget control , wxInt16 controlpart )
ProcessCommand(event);
}
}
wxSize wxChoice::DoGetBestSize() const
{
int lbWidth = 100; // some defaults

View File

@@ -895,12 +895,11 @@ void wxControl::OnMouseEvent( wxMouseEvent &event )
bool wxControl::MacCanFocus() const
{
{ if ( (ControlHandle) m_macControl == NULL )
if ( (ControlHandle) m_macControl == NULL )
return true ;
else
return false ;
}
}
void wxControl::MacHandleControlClick( WXWidget control , wxInt16 controlpart )
{

View File

@@ -8,9 +8,11 @@
// Copyright: (c) Stefan Csomor
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
#pragma implementation "dc.h"
#endif
#include "wx/dc.h"
#include "wx/app.h"
#include "wx/mac/uma.h"
@@ -30,9 +32,11 @@ using namespace std ;
#if !USE_SHARED_LIBRARY
IMPLEMENT_ABSTRACT_CLASS(wxDC, wxObject)
#endif
//-----------------------------------------------------------------------------
// constants
//-----------------------------------------------------------------------------
#define mm2inches 0.0393700787402
#define inches2mm 25.4
#define mm2twips 56.6929133859
@@ -45,6 +49,7 @@ const double M_PI = 3.14159265358979 ;
const double RAD2DEG = 180.0 / M_PI;
const short kEmulatedMode = -1 ;
const short kUnsupportedMode = -2 ;
wxMacPortSetter::wxMacPortSetter( const wxDC* dc ) :
m_ph( (GrafPtr) dc->m_macPort )
{
@@ -52,10 +57,12 @@ wxMacPortSetter::wxMacPortSetter( const wxDC* dc ) :
m_dc = dc ;
dc->MacSetupPort(&m_ph) ;
}
wxMacPortSetter::~wxMacPortSetter()
{
m_dc->MacCleanupPort(&m_ph) ;
}
wxMacWindowClipper::wxMacWindowClipper( const wxWindow* win )
{
m_formerClip = NewRgn() ;
@@ -89,24 +96,28 @@ wxMacWindowClipper::wxMacWindowClipper( const wxWindow* win )
SetClip( m_newClip ) ;
}
}
wxMacWindowClipper::~wxMacWindowClipper()
{
SetClip( m_formerClip ) ;
DisposeRgn( m_newClip ) ;
DisposeRgn( m_formerClip ) ;
}
//-----------------------------------------------------------------------------
// Local functions
//-----------------------------------------------------------------------------
static inline double dmin(double a, double b) { return a < b ? a : b; }
static inline double dmax(double a, double b) { return a > b ? a : b; }
static inline double DegToRad(double deg) { return (deg * M_PI) / 180.0; }
//-----------------------------------------------------------------------------
// wxDC
//-----------------------------------------------------------------------------
// this function emulates all wx colour manipulations, used to verify the implementation
// by setting the mode in the blitting functions to kEmulatedMode
void wxMacCalculateColour( int logical_func , const RGBColor &srcColor , RGBColor &dstColor ) ;
void wxMacCalculateColour( int logical_func , const RGBColor &srcColor , RGBColor &dstColor )
{
switch ( logical_func )
@@ -190,6 +201,7 @@ void wxMacCalculateColour( int logical_func , const RGBColor &srcColor , RGBColo
break ;
}
}
wxDC::wxDC()
{
m_ok = FALSE;
@@ -228,11 +240,13 @@ wxDC::wxDC()
m_macForegroundPixMap = NULL ;
m_macBackgroundPixMap = NULL ;
}
wxDC::~wxDC(void)
{
DisposeRgn( (RgnHandle) m_macBoundaryClipRgn ) ;
DisposeRgn( (RgnHandle) m_macCurrentClipRgn ) ;
}
void wxDC::MacSetupPort(wxMacPortStateHelper* help) const
{
wxASSERT( m_macCurrentPortStateHelper == NULL ) ;
@@ -242,6 +256,7 @@ void wxDC::MacSetupPort(wxMacPortStateHelper* help) const
m_macBrushInstalled = false ;
m_macPenInstalled = false ;
}
void wxDC::MacCleanupPort(wxMacPortStateHelper* help) const
{
wxASSERT( m_macCurrentPortStateHelper == help ) ;
@@ -271,6 +286,7 @@ void wxDC::MacCleanupPort(wxMacPortStateHelper* help) const
m_macBackgroundPixMap = NULL ;
}
}
void wxDC::DoDrawBitmap( const wxBitmap &bmp, wxCoord x, wxCoord y, bool useMask )
{
wxCHECK_RET( Ok(), wxT("invalid window dc") );
@@ -356,12 +372,14 @@ void wxDC::DoDrawBitmap( const wxBitmap &bmp, wxCoord x, wxCoord y, bool useMask
m_macBrushInstalled = false ;
m_macFontInstalled = false ;
}
void wxDC::DoDrawIcon( const wxIcon &icon, wxCoord x, wxCoord y )
{
wxCHECK_RET(Ok(), wxT("Invalid dc wxDC::DoDrawIcon"));
wxCHECK_RET(icon.Ok(), wxT("Invalid icon wxDC::DoDrawIcon"));
DoDrawBitmap( icon , x , y , icon.GetMask() != NULL ) ;
}
void wxDC::DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
{
wxCHECK_RET(Ok(), wxT("wxDC::DoSetClippingRegion Invalid DC"));
@@ -388,6 +406,7 @@ void wxDC::DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoord hei
m_clipY2 = yy + hh;
}
}
void wxDC::DoSetClippingRegionAsRegion( const wxRegion &region )
{
wxCHECK_RET( Ok(), wxT("invalid window dc") ) ;
@@ -435,17 +454,20 @@ void wxDC::DoSetClippingRegionAsRegion( const wxRegion &region )
}
}
}
void wxDC::DestroyClippingRegion()
{
wxMacPortSetter helper(this) ;
CopyRgn( (RgnHandle) m_macBoundaryClipRgn , (RgnHandle) m_macCurrentClipRgn ) ;
m_clipping = FALSE;
}
void wxDC::DoGetSize( int* width, int* height ) const
{
*width = m_maxX-m_minX;
*height = m_maxY-m_minY;
}
void wxDC::DoGetSizeMM( int* width, int* height ) const
{
int w = 0;
@@ -454,18 +476,21 @@ void wxDC::DoGetSizeMM( int* width, int* height ) const
*width = long( double(w) / (m_scaleX*m_mm_to_pix_x) );
*height = long( double(h) / (m_scaleY*m_mm_to_pix_y) );
}
void wxDC::SetTextForeground( const wxColour &col )
{
wxCHECK_RET(Ok(), wxT("Invalid DC"));
m_textForegroundColour = col;
m_macFontInstalled = false ;
}
void wxDC::SetTextBackground( const wxColour &col )
{
wxCHECK_RET(Ok(), wxT("Invalid DC"));
m_textBackgroundColour = col;
m_macFontInstalled = false ;
}
void wxDC::SetMapMode( int mode )
{
switch (mode)
@@ -493,6 +518,7 @@ void wxDC::SetMapMode( int mode )
m_needComputeScaleY = TRUE;
}
}
void wxDC::SetUserScale( double x, double y )
{
// allow negative ? -> no
@@ -500,6 +526,7 @@ void wxDC::SetUserScale( double x, double y )
m_userScaleY = y;
ComputeScaleAndOrigin();
}
void wxDC::SetLogicalScale( double x, double y )
{
// allow negative ?
@@ -507,18 +534,21 @@ void wxDC::SetLogicalScale( double x, double y )
m_logicalScaleY = y;
ComputeScaleAndOrigin();
}
void wxDC::SetLogicalOrigin( wxCoord x, wxCoord y )
{
m_logicalOriginX = x * m_signX; // is this still correct ?
m_logicalOriginY = y * m_signY;
ComputeScaleAndOrigin();
}
void wxDC::SetDeviceOrigin( wxCoord x, wxCoord y )
{
m_externalDeviceOriginX = x;
m_externalDeviceOriginY = y;
ComputeScaleAndOrigin();
}
#if 0
void wxDC::SetInternalDeviceOrigin( long x, long y )
{
@@ -532,16 +562,19 @@ void wxDC::GetInternalDeviceOrigin( long *x, long *y )
if (y) *y = m_internalDeviceOriginY;
}
#endif
void wxDC::SetAxisOrientation( bool xLeftRight, bool yBottomUp )
{
m_signX = (xLeftRight ? 1 : -1);
m_signY = (yBottomUp ? -1 : 1);
ComputeScaleAndOrigin();
}
wxSize wxDC::GetPPI() const
{
return wxSize(72, 72);
}
int wxDC::GetDepth() const
{
if ( IsPortColor( (CGrafPtr) m_macPort ) )
@@ -550,6 +583,7 @@ int wxDC::GetDepth() const
}
return 1 ;
}
void wxDC::ComputeScaleAndOrigin()
{
// CMB: copy scale to see if it changes
@@ -570,18 +604,22 @@ void wxDC::ComputeScaleAndOrigin()
SetPen(* pen);
}
}
void wxDC::SetPalette( const wxPalette& palette )
{
}
void wxDC::SetBackgroundMode( int mode )
{
m_backgroundMode = mode ;
}
void wxDC::SetFont( const wxFont &font )
{
m_font = font;
m_macFontInstalled = false ;
}
void wxDC::SetPen( const wxPen &pen )
{
if ( m_pen == pen )
@@ -589,6 +627,7 @@ void wxDC::SetPen( const wxPen &pen )
m_pen = pen;
m_macPenInstalled = false ;
}
void wxDC::SetBrush( const wxBrush &brush )
{
if (m_brush == brush)
@@ -596,6 +635,7 @@ void wxDC::SetBrush( const wxBrush &brush )
m_brush = brush;
m_macBrushInstalled = false ;
}
void wxDC::SetBackground( const wxBrush &brush )
{
if (m_backgroundBrush == brush)
@@ -605,6 +645,7 @@ void wxDC::SetBackground( const wxBrush &brush )
return;
m_macBrushInstalled = false ;
}
void wxDC::SetLogicalFunction( int function )
{
if (m_logicalFunction == function)
@@ -614,13 +655,16 @@ void wxDC::SetLogicalFunction( int function )
m_macBrushInstalled = false ;
m_macPenInstalled = false ;
}
extern bool wxDoFloodFill(wxDC *dc, wxCoord x, wxCoord y,
const wxColour & col, int style);
bool wxDC::DoFloodFill(wxCoord x, wxCoord y,
const wxColour& col, int style)
{
return wxDoFloodFill(this, x, y, col, style);
}
bool wxDC::DoGetPixel( wxCoord x, wxCoord y, wxColour *col ) const
{
wxCHECK_MSG( Ok(), false, wxT("wxDC::DoGetPixel Invalid DC") );
@@ -633,6 +677,7 @@ bool wxDC::DoGetPixel( wxCoord x, wxCoord y, wxColour *col ) const
colour.blue >> 8);
return true ;
}
void wxDC::DoDrawLine( wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2 )
{
wxCHECK_RET(Ok(), wxT("Invalid DC"));
@@ -670,6 +715,7 @@ void wxDC::DoDrawLine( wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2 )
::LineTo(xx2, yy2);
}
}
void wxDC::DoCrossHair( wxCoord x, wxCoord y )
{
wxCHECK_RET( Ok(), wxT("wxDC::DoCrossHair Invalid window dc") );
@@ -690,6 +736,7 @@ void wxDC::DoCrossHair( wxCoord x, wxCoord y )
CalcBoundingBox(x+w, y+h);
}
}
/*
* To draw arcs properly the angles need to be converted from the WX style:
* Angles start on the +ve X axis and go anti-clockwise (As you would draw on
@@ -698,6 +745,7 @@ void wxDC::DoCrossHair( wxCoord x, wxCoord y )
* the Mac style:
* Angles start on the +ve y axis and go clockwise.
*/
static double wxConvertWXangleToMACangle(double angle)
{
double newAngle = 90 - angle ;
@@ -705,6 +753,7 @@ static double wxConvertWXangleToMACangle(double angle)
newAngle += 360 ;
return newAngle ;
}
void wxDC::DoDrawArc( wxCoord x1, wxCoord y1,
wxCoord x2, wxCoord y2,
wxCoord xc, wxCoord yc )
@@ -755,6 +804,7 @@ void wxDC::DoDrawArc( wxCoord x1, wxCoord y1,
FrameArc(&r, alpha1, alpha2);
}
}
void wxDC::DoDrawEllipticArc( wxCoord x, wxCoord y, wxCoord w, wxCoord h,
double sa, double ea )
{
@@ -786,6 +836,7 @@ void wxDC::DoDrawEllipticArc( wxCoord x, wxCoord y, wxCoord w, wxCoord h,
FrameArc(&r, (short)sa, (short)angle);
}
}
void wxDC::DoDrawPoint( wxCoord x, wxCoord y )
{
wxCHECK_RET(Ok(), wxT("Invalid DC"));
@@ -799,6 +850,7 @@ void wxDC::DoDrawPoint( wxCoord x, wxCoord y )
CalcBoundingBox(x, y);
}
}
void wxDC::DoDrawLines(int n, wxPoint points[],
wxCoord xoffset, wxCoord yoffset)
{
@@ -820,6 +872,7 @@ void wxDC::DoDrawLines(int n, wxPoint points[],
::LineTo( x2 - offset, y2 - offset );
}
}
void wxDC::DoDrawPolygon(int n, wxPoint points[],
wxCoord xoffset, wxCoord yoffset,
int fillStyle )
@@ -857,6 +910,7 @@ void wxDC::DoDrawPolygon(int n, wxPoint points[],
}
KillPoly( polygon );
}
void wxDC::DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
{
wxCHECK_RET(Ok(), wxT("Invalid DC"));
@@ -891,6 +945,7 @@ void wxDC::DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
::FrameRect( &rect ) ;
}
}
void wxDC::DoDrawRoundedRectangle(wxCoord x, wxCoord y,
wxCoord width, wxCoord height,
double radius)
@@ -929,6 +984,7 @@ void wxDC::DoDrawRoundedRectangle(wxCoord x, wxCoord y,
::FrameRoundRect( &rect , int(radius * 2) , int(radius * 2) ) ;
}
}
void wxDC::DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
{
wxCHECK_RET(Ok(), wxT("Invalid DC"));
@@ -964,7 +1020,6 @@ void wxDC::DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
}
}
bool wxDC::CanDrawBitmap(void) const
{
return true ;
@@ -1217,10 +1272,12 @@ bool wxDC::DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height,
m_macFontInstalled = false ;
return TRUE;
}
inline Fixed IntToFixed( int inInt )
{
return (((SInt32) inInt) << 16);
}
inline int FixedToInt( Fixed inFixed )
{
return (((SInt32) inFixed) >> 16);
@@ -1319,6 +1376,7 @@ void wxDC::DoDrawRotatedText(const wxString& str, wxCoord x, wxCoord y,
::ATSUDisposeTextLayout(atsuLayout);
delete[] buf ;
}
void wxDC::DoDrawText(const wxString& strtext, wxCoord x, wxCoord y)
{
wxCHECK_RET(Ok(), wxT("wxDC::DoDrawText Invalid DC"));
@@ -1452,11 +1510,13 @@ void wxDC::DoDrawText(const wxString& strtext, wxCoord x, wxCoord y)
}
::TextMode( srcOr ) ;
}
bool wxDC::CanGetTextExtent() const
{
wxCHECK_MSG(Ok(), false, wxT("Invalid DC"));
return true ;
}
void wxDC::DoGetTextExtent( const wxString &string, wxCoord *width, wxCoord *height,
wxCoord *descent, wxCoord *externalLeading ,
wxFont *theFont ) const
@@ -1566,6 +1626,7 @@ void wxDC::DoGetTextExtent( const wxString &string, wxCoord *width, wxCoord *he
m_macFontInstalled = false ;
}
}
wxCoord wxDC::GetCharWidth(void) const
{
wxCHECK_MSG(Ok(), 1, wxT("Invalid DC"));
@@ -1600,6 +1661,7 @@ wxCoord wxDC::GetCharWidth(void) const
}
return YDEV2LOGREL(width) ;
}
wxCoord wxDC::GetCharHeight(void) const
{
wxCHECK_MSG(Ok(), 1, wxT("Invalid DC"));
@@ -1609,6 +1671,7 @@ wxCoord wxDC::GetCharHeight(void) const
::GetFontInfo( &fi ) ;
return YDEV2LOGREL( fi.descent + fi.ascent );
}
void wxDC::Clear(void)
{
wxCHECK_RET(Ok(), wxT("Invalid DC"));
@@ -1622,6 +1685,7 @@ void wxDC::Clear(void)
::EraseRect( &rect ) ;
}
}
void wxDC::MacInstallFont() const
{
wxCHECK_RET(Ok(), wxT("Invalid DC"));
@@ -1753,6 +1817,7 @@ void wxDC::MacInstallFont() const
atsuTags, atsuSizes, atsuValues);
wxASSERT_MSG( status == noErr , "couldn't set create ATSU style" ) ;
}
Pattern gHatchPatterns[] =
{
{ { 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF } },
@@ -1763,6 +1828,7 @@ Pattern gHatchPatterns[] =
{ { 0x10 , 0x10 , 0x10 , 0x10 , 0x10 , 0x10 , 0x10 , 0x10 } },
{ { 0x81 , 0x42 , 0x24 , 0x18 , 0x18 , 0x24 , 0x42 , 0x81 } }
} ;
static void wxMacGetHatchPattern(int hatchStyle, Pattern *pattern)
{
int theIndex = 1 ;
@@ -1792,6 +1858,7 @@ static void wxMacGetHatchPattern(int hatchStyle, Pattern *pattern)
}
*pattern = gHatchPatterns[theIndex-1] ;
}
void wxDC::MacInstallPen() const
{
wxCHECK_RET(Ok(), wxT("Invalid DC"));
@@ -1905,6 +1972,7 @@ void wxDC::MacInstallPen() const
m_macBrushInstalled = false ;
m_macFontInstalled = false ;
}
void wxDC::MacSetupBackgroundForCurrentPort(const wxBrush& background )
{
Pattern whiteColor ;
@@ -1942,6 +2010,7 @@ void wxDC::MacSetupBackgroundForCurrentPort(const wxBrush& background )
}
}
}
void wxDC::MacInstallBrush() const
{
wxCHECK_RET(Ok(), wxT("Invalid DC"));
@@ -2083,6 +2152,7 @@ void wxDC::MacInstallBrush() const
m_macPenInstalled = false ;
m_macFontInstalled = false ;
}
// ---------------------------------------------------------------------------
// coordinates transformations
// ---------------------------------------------------------------------------
@@ -2091,30 +2161,37 @@ wxCoord wxDCBase::DeviceToLogicalX(wxCoord x) const
{
return ((wxDC *)this)->XDEV2LOG(x);
}
wxCoord wxDCBase::DeviceToLogicalY(wxCoord y) const
{
return ((wxDC *)this)->YDEV2LOG(y);
}
wxCoord wxDCBase::DeviceToLogicalXRel(wxCoord x) const
{
return ((wxDC *)this)->XDEV2LOGREL(x);
}
wxCoord wxDCBase::DeviceToLogicalYRel(wxCoord y) const
{
return ((wxDC *)this)->YDEV2LOGREL(y);
}
wxCoord wxDCBase::LogicalToDeviceX(wxCoord x) const
{
return ((wxDC *)this)->XLOG2DEV(x);
}
wxCoord wxDCBase::LogicalToDeviceY(wxCoord y) const
{
return ((wxDC *)this)->YLOG2DEV(y);
}
wxCoord wxDCBase::LogicalToDeviceXRel(wxCoord x) const
{
return ((wxDC *)this)->XLOG2DEVREL(x);
}
wxCoord wxDCBase::LogicalToDeviceYRel(wxCoord y) const
{
return ((wxDC *)this)->YLOG2DEVREL(y);

View File

@@ -57,7 +57,6 @@ bool wxDialog::Create(wxWindow *parent, wxWindowID id,
long style,
const wxString& name)
{
SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE));
@@ -68,6 +67,7 @@ bool wxDialog::Create(wxWindow *parent, wxWindowID id,
m_macWindowBackgroundTheme = kThemeBrushDialogBackgroundActive ;
SetThemeWindowBackground( (WindowRef) m_macWindow , m_macWindowBackgroundTheme , false ) ;
return TRUE;
}
@@ -96,8 +96,7 @@ wxDialog::~wxDialog()
// By default, pressing escape cancels the dialog , on mac command-stop does the same thing
void wxDialog::OnCharHook(wxKeyEvent& event)
{
if (
( event.m_keyCode == WXK_ESCAPE ||
if (( event.m_keyCode == WXK_ESCAPE ||
( event.m_keyCode == '.' && event.MetaDown() ) )
&& FindWindow(wxID_CANCEL) )
{

View File

@@ -121,7 +121,6 @@ wxFrame::~wxFrame()
m_isBeingDeleted = TRUE;
DeleteAllBars();
}

View File

@@ -9,7 +9,6 @@
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
#pragma implementation "menu.h"
#pragma implementation "menuitem.h"

View File

@@ -38,7 +38,6 @@ END_EVENT_TABLE()
* eg. if(GetWindowStyle() & wxSL_VERTICAL) {} else { horizontal case }>
*/
// Slider
wxSlider::wxSlider()
{

View File

@@ -902,5 +902,3 @@ bool WXDLLEXPORT wxIsWaitingForThread()
#include "wx/thrimpl.cpp"
#endif // wxUSE_THREADS
// vi:sts=4:sw=4:et

View File

@@ -116,7 +116,6 @@ void wxToolBar::Init()
bool wxToolBar::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size,
long style, const wxString& name)
{
int x = pos.x;
int y = pos.y;
int width = size.x;

View File

@@ -632,7 +632,6 @@ WXWidget wxTopLevelWindowMac::MacGetContainerForEmbedding()
void wxTopLevelWindowMac::MacUpdate( long timestamp)
{
wxMacPortStateHelper help( (GrafPtr) GetWindowPort( (WindowRef) m_macWindow) ) ;
BeginUpdate( (WindowRef)m_macWindow ) ;
@@ -770,6 +769,7 @@ void wxTopLevelWindowMac::MacFireMouseEvent(
MacDispatchMouseEvent( event ) ;
}
}
#if !TARGET_CARBON
void wxTopLevelWindowMac::MacMouseDown( WXEVENTREF ev , short part)

View File

@@ -692,8 +692,6 @@ OSErr UMASetKeyboardFocus (WindowPtr inWindow,
}
// events
void UMAUpdateControls( WindowPtr inWindow , RgnHandle inRgn )
{
@@ -707,7 +705,6 @@ void UMAUpdateControls( WindowPtr inWindow , RgnHandle inRgn )
UpdateControls( inWindow , inRgn ) ;
InvalWindowRgn( inWindow, updateRgn) ;
DisposeRgn( updateRgn ) ;
}
bool UMAIsWindowFloating( WindowRef inWindow )
@@ -750,6 +747,7 @@ void UMAHighlightAndActivateWindow( WindowRef inWindowRef , bool inActivate )
SetPort( port ) ;
}
}
OSStatus UMADrawThemePlacard( const Rect *inRect , ThemeDrawState inState )
{
return ::DrawThemePlacard( inRect , inState ) ;

View File

@@ -980,7 +980,7 @@ wxWindowMac *wxGetActiveWindow()
// Coordinates relative to the window
void wxWindowMac::WarpPointer (int x_pos, int y_pos)
{
// We really dont move the mouse programmatically under mac
// We really don't move the mouse programmatically under Mac.
}
const wxBrush& wxWindowMac::MacGetBackgroundBrush()
@@ -1045,7 +1045,6 @@ const wxBrush& wxWindowMac::MacGetBackgroundBrush()
}
return m_macBackgroundBrush ;
}
void wxWindowMac::OnEraseBackground(wxEraseEvent& event)