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 short wxBrush::GetMacTheme() 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
{ return (M_BRUSHDATA ? M_BRUSHDATA->m_colour : wxNullColour); }; {
return (M_BRUSHDATA ? M_BRUSHDATA->m_colour : wxNullColour);
}
int wxBrush::GetStyle() const int wxBrush::GetStyle() const
{ {
return (M_BRUSHDATA ? M_BRUSHDATA->m_style : 0); return (M_BRUSHDATA ? M_BRUSHDATA->m_style : 0);
}; }
wxBitmap *wxBrush::GetStipple() const 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);
}; }

View File

@@ -206,22 +206,24 @@ unsigned long wxBrush::GetMacThemeBackground( WXRECTPTR extent) const
short wxBrush::GetMacTheme() const short wxBrush::GetMacTheme() 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
{ return (M_BRUSHDATA ? M_BRUSHDATA->m_colour : wxNullColour); }; {
return (M_BRUSHDATA ? M_BRUSHDATA->m_colour : wxNullColour);
}
int wxBrush::GetStyle() const int wxBrush::GetStyle() const
{ {
return (M_BRUSHDATA ? M_BRUSHDATA->m_style : 0); return (M_BRUSHDATA ? M_BRUSHDATA->m_style : 0);
}; }
wxBitmap *wxBrush::GetStipple() const 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);
}; }

View File

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

View File

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

View File

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

View File

@@ -23,7 +23,7 @@
IMPLEMENT_DYNAMIC_CLASS(wxMemoryDC,wxPaintDC) IMPLEMENT_DYNAMIC_CLASS(wxMemoryDC,wxPaintDC)
wxMemoryDC::wxMemoryDC(void) wxMemoryDC::wxMemoryDC(void)
: m_selected() : m_selected()
{ {
m_ok = TRUE; m_ok = TRUE;
SetBackground(*wxWHITE_BRUSH); SetBackground(*wxWHITE_BRUSH);
@@ -33,7 +33,7 @@ wxMemoryDC::wxMemoryDC(void)
}; };
wxMemoryDC::wxMemoryDC( wxDC *WXUNUSED(dc) ) wxMemoryDC::wxMemoryDC( wxDC *WXUNUSED(dc) )
: m_selected() : m_selected()
{ {
m_ok = TRUE; m_ok = TRUE;
SetBackground(*wxWHITE_BRUSH); SetBackground(*wxWHITE_BRUSH);

View File

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

View File

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

View File

@@ -34,14 +34,14 @@
#include "wx/mac/uma.h" #include "wx/mac/uma.h"
/* /*
* GLContext implementation * GLContext implementation
*/ */
wxGLContext::wxGLContext( wxGLContext::wxGLContext(
AGLPixelFormat fmt, wxGLCanvas *win, AGLPixelFormat fmt, wxGLCanvas *win,
const wxPalette& palette, const wxPalette& palette,
const wxGLContext *other /* for sharing display lists */ const wxGLContext *other /* for sharing display lists */
) )
{ {
m_window = win; m_window = win;
@@ -108,8 +108,8 @@ void wxGLContext::SetColour(const char *colour)
/* /*
* wxGLCanvas implementation * wxGLCanvas implementation
*/ */
IMPLEMENT_CLASS(wxGLCanvas, wxWindow) IMPLEMENT_CLASS(wxGLCanvas, wxWindow)

View File

@@ -104,12 +104,12 @@ bool wxICONResourceHandler::LoadFile(wxBitmap *bitmap, const wxString& name, lo
Str255 theName ; Str255 theName ;
OSType theType ; OSType theType ;
#if TARGET_CARBON #if TARGET_CARBON
c2pstrcpy( (StringPtr) theName , name ) ; c2pstrcpy( (StringPtr) theName , name ) ;
#else #else
strcpy( (char *) theName , name ) ; strcpy( (char *) theName , name ) ;
c2pstr( (char *) theName ) ; c2pstr( (char *) theName ) ;
#endif #endif
Handle resHandle = GetNamedResource( 'cicn' , theName ) ; Handle resHandle = GetNamedResource( 'cicn' , theName ) ;
if ( resHandle != 0L ) if ( resHandle != 0L )

View File

@@ -24,7 +24,7 @@
#include "wx/utils.h" #include "wx/utils.h"
#if !USE_SHARED_LIBRARY #if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxListBox, wxControl) IMPLEMENT_DYNAMIC_CLASS(wxListBox, wxControl)
BEGIN_EVENT_TABLE(wxListBox, wxControl) BEGIN_EVENT_TABLE(wxListBox, wxControl)
EVT_SIZE( wxListBox::OnSize ) EVT_SIZE( wxListBox::OnSize )
@@ -419,7 +419,7 @@ void wxListBox::DoSetItems(const wxArrayString& choices, void** clientData)
wxT("Can't use client data with owner-drawn listboxes")); wxT("Can't use client data with owner-drawn listboxes"));
#else // !wxUSE_OWNER_DRAWN #else // !wxUSE_OWNER_DRAWN
Append( choices[i] , clientData[i] ) ; Append( choices[i] , clientData[i] ) ;
#endif #endif
} }
else else
Append( choices[i] ) ; Append( choices[i] ) ;
@@ -704,7 +704,7 @@ void wxListBox::SetupColours()
void wxListBox::Refresh(bool eraseBack, const wxRect *rect) void wxListBox::Refresh(bool eraseBack, const wxRect *rect)
{ {
wxControl::Refresh( eraseBack , rect ) ; wxControl::Refresh( eraseBack , rect ) ;
// MacRedrawControl() ; // MacRedrawControl() ;
} }
#if wxUSE_OWNER_DRAWN #if wxUSE_OWNER_DRAWN
@@ -735,9 +735,9 @@ wxOwnerDrawn *wxListBox::CreateItem(size_t n)
/* /*
void MacDrawStringCell(Rect *cellRect, Cell lCell, ListHandle theList, long refCon) void MacDrawStringCell(Rect *cellRect, Cell lCell, ListHandle theList, long refCon)
{ {
wxListBox* list; wxListBox* list;
// typecast our refCon // typecast our refCon
list = (wxListBox*)refCon; list = (wxListBox*)refCon;
MoveTo(cellRect->left + 4 , cellRect->top + 10 ); MoveTo(cellRect->left + 4 , cellRect->top + 10 );
const wxString text = list->m_stringArray[lCell.v] ; const wxString text = list->m_stringArray[lCell.v] ;
@@ -746,7 +746,7 @@ void MacDrawStringCell(Rect *cellRect, Cell lCell, ListHandle theList, long refC
::TextFace( 0 ) ; ::TextFace( 0 ) ;
DrawText(text, 0 , text.Length()); DrawText(text, 0 , text.Length());
} }
*/ */
void wxListBox::MacDelete( int N ) void wxListBox::MacDelete( int N )
{ {
@@ -759,7 +759,7 @@ void wxListBox::MacInsert( int n , const char * text)
Cell cell = { 0 , 0 } ; Cell cell = { 0 , 0 } ;
cell.v = n ; cell.v = n ;
LAddRow( 1 , cell.v , (ListHandle)m_macList ) ; LAddRow( 1 , cell.v , (ListHandle)m_macList ) ;
// LSetCell(text, strlen(text), cell, m_macList); // LSetCell(text, strlen(text), cell, m_macList);
Refresh(); Refresh();
} }
@@ -804,7 +804,7 @@ bool wxListBox::MacIsSelected( int n ) const
void wxListBox::MacDestroy() void wxListBox::MacDestroy()
{ {
// DisposeExtLDEFInfo( m_macList ) ; // DisposeExtLDEFInfo( m_macList ) ;
} }
int wxListBox::MacGetSelection() const int wxListBox::MacGetSelection() const
@@ -840,7 +840,7 @@ void wxListBox::MacSet( int n , const char * text )
// so we just have to redraw // so we just have to redraw
Cell cell = { 0 , 0 } ; Cell cell = { 0 , 0 } ;
cell.v = n ; cell.v = n ;
// LSetCell(text, strlen(text), cell, m_macList); // LSetCell(text, strlen(text), cell, m_macList);
Refresh(); Refresh();
} }

View File

@@ -122,8 +122,8 @@ void wxMacRemoveAllNotifiersForData( wxMacNotifierTableRef table , void* data )
void wxMacProcessNotifierEvents() void wxMacProcessNotifierEvents()
{ {
// if ( gInProcessing ) // if ( gInProcessing )
// return ; // return ;
gInProcessing = true ; gInProcessing = true ;
if ( gMacNotificationEvents.top != gMacNotificationEvents.bottom ) if ( gMacNotificationEvents.top != gMacNotificationEvents.bottom )

View File

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

View File

@@ -86,7 +86,7 @@ wxMetaFile::~wxMetaFile()
bool wxMetaFile::SetClipboard(int width, int height) bool wxMetaFile::SetClipboard(int width, int height)
{ {
#if wxUSE_DRAG_AND_DROP #if wxUSE_DRAG_AND_DROP
//TODO finishi this port , we need the data obj first //TODO finishi this port , we need the data obj first
if (!m_refData) if (!m_refData)
return FALSE; return FALSE;

View File

@@ -10,7 +10,7 @@
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__ #ifdef __GNUG__
#pragma implementation "notebook.h" #pragma implementation "notebook.h"
#endif #endif
// ============================================================================ // ============================================================================
@@ -35,10 +35,10 @@
static bool constantsSet = false ; static bool constantsSet = false ;
short kwxMacTabLeftMargin = 0 ; short kwxMacTabLeftMargin = 0 ;
short kwxMacTabTopMargin = 0 ; short kwxMacTabTopMargin = 0 ;
short kwxMacTabRightMargin = 0 ; short kwxMacTabRightMargin = 0 ;
short kwxMacTabBottomMargin = 0 ; short kwxMacTabBottomMargin = 0 ;
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// event table // event table
@@ -49,12 +49,12 @@ DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED)
DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING) DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING)
BEGIN_EVENT_TABLE(wxNotebook, wxControl) BEGIN_EVENT_TABLE(wxNotebook, wxControl)
EVT_NOTEBOOK_PAGE_CHANGED(-1, wxNotebook::OnSelChange) EVT_NOTEBOOK_PAGE_CHANGED(-1, wxNotebook::OnSelChange)
EVT_MOUSE_EVENTS(wxNotebook::OnMouse) EVT_MOUSE_EVENTS(wxNotebook::OnMouse)
EVT_SIZE(wxNotebook::OnSize) EVT_SIZE(wxNotebook::OnSize)
EVT_SET_FOCUS(wxNotebook::OnSetFocus) EVT_SET_FOCUS(wxNotebook::OnSetFocus)
EVT_NAVIGATION_KEY(wxNotebook::OnNavigationKey) EVT_NAVIGATION_KEY(wxNotebook::OnNavigationKey)
END_EVENT_TABLE() END_EVENT_TABLE()
IMPLEMENT_DYNAMIC_CLASS(wxNotebook, wxControl) IMPLEMENT_DYNAMIC_CLASS(wxNotebook, wxControl)
@@ -344,10 +344,10 @@ bool wxNotebook::InsertPage(int nPage,
} }
/* Added by Mark Newsam /* Added by Mark Newsam
* When a page is added or deleted to the notebook this function updates * When a page is added or deleted to the notebook this function updates
* information held in the m_macControl so that it matches the order * information held in the m_macControl so that it matches the order
* the user would expect. * the user would expect.
*/ */
void wxNotebook::MacSetupTabs() void wxNotebook::MacSetupTabs()
{ {
SetControl32BitMaximum( (ControlHandle) m_macControl , GetPageCount() ) ; SetControl32BitMaximum( (ControlHandle) m_macControl , GetPageCount() ) ;

View File

@@ -114,5 +114,5 @@ bool wxPalette::GetRGB(int index, unsigned char *red, unsigned char *green, unsi
} }
#endif #endif
// wxUSE_PALETTE // wxUSE_PALETTE

View File

@@ -32,7 +32,7 @@ wxPenRefData::wxPenRefData()
} }
wxPenRefData::wxPenRefData(const wxPenRefData& data) wxPenRefData::wxPenRefData(const wxPenRefData& data)
: wxGDIRefData() : wxGDIRefData()
{ {
m_style = data.m_style; m_style = data.m_style;
m_width = data.m_width; m_width = data.m_width;

View File

@@ -163,7 +163,7 @@ bool wxPNGReader::GetRGB(int x, int y, byte* r, byte* g, byte* b)
if (m_palette) { if (m_palette) {
return m_palette->GetRGB(GetIndex(x, y), r, g, b); return m_palette->GetRGB(GetIndex(x, y), r, g, b);
/* PALETTEENTRY entry; /* PALETTEENTRY entry;
::GetPaletteEntries((HPALETTE) m_palette->GetHPALETTE(), GetIndex(x, y), 1, &entry); ::GetPaletteEntries((HPALETTE) m_palette->GetHPALETTE(), GetIndex(x, y), 1, &entry);
*r = entry.peRed; *r = entry.peRed;
*g = entry.peGreen; *g = entry.peGreen;
@@ -215,7 +215,7 @@ bool wxPNGReader::SetPalette(wxPalette* colourmap)
ColorType |= (COLORTYPE_PALETTE | COLORTYPE_COLOR); ColorType |= (COLORTYPE_PALETTE | COLORTYPE_COLOR);
m_palette = new wxPalette( *colourmap ); m_palette = new wxPalette( *colourmap );
return true ; return true ;
// return (DibSetUsage(lpbi, (HPALETTE) m_palette->GetHPALETTE(), WXIMA_COLORS ) != 0); // return (DibSetUsage(lpbi, (HPALETTE) m_palette->GetHPALETTE(), WXIMA_COLORS ) != 0);
} }
bool bool
@@ -231,7 +231,7 @@ wxPNGReader::SetPalette(int n, byte *r, byte *g, byte *b)
m_palette->Create(n, r, g, b); m_palette->Create(n, r, g, b);
ColorType |= (COLORTYPE_PALETTE | COLORTYPE_COLOR); ColorType |= (COLORTYPE_PALETTE | COLORTYPE_COLOR);
return true ; return true ;
// return (DibSetUsage(lpbi, (HPALETTE) m_palette->GetHPALETTE(), WXIMA_COLORS ) != 0); // return (DibSetUsage(lpbi, (HPALETTE) m_palette->GetHPALETTE(), WXIMA_COLORS ) != 0);
} }
bool bool
@@ -259,7 +259,7 @@ wxPNGReader::SetPalette(int n, rgb_color_struct *rgb_struct)
m_palette->Create(n, r, g, b); m_palette->Create(n, r, g, b);
ColorType |= (COLORTYPE_PALETTE | COLORTYPE_COLOR); ColorType |= (COLORTYPE_PALETTE | COLORTYPE_COLOR);
return true ; return true ;
// return (DibSetUsage(lpbi, (HPALETTE) m_palette->GetHPALETTE(), WXIMA_COLORS ) != 0); // return (DibSetUsage(lpbi, (HPALETTE) m_palette->GetHPALETTE(), WXIMA_COLORS ) != 0);
} }
void wxPNGReader::NullData() void wxPNGReader::NullData()
@@ -314,7 +314,7 @@ bool wxPNGReader::InstantiateBitmap(wxBitmap *bitmap)
{ {
return FALSE; return FALSE;
} }
/* /*
HDC dc = ::CreateCompatibleDC(NULL); HDC dc = ::CreateCompatibleDC(NULL);
if (dc) if (dc)
@@ -381,7 +381,7 @@ wxPalette *wxCopyPalette(const wxPalette *cmap)
wxMask *wxPNGReader::CreateMask(void) wxMask *wxPNGReader::CreateMask(void)
{ {
/* /*
HBITMAP hBitmap = ::CreateBitmap(GetWidth(), GetHeight(), 1, 1, NULL); HBITMAP hBitmap = ::CreateBitmap(GetWidth(), GetHeight(), 1, 1, NULL);
HDC dc = ::CreateCompatibleDC(NULL); HDC dc = ::CreateCompatibleDC(NULL);
HBITMAP oldBitmap = (HBITMAP) ::SelectObject(dc, hBitmap); HBITMAP oldBitmap = (HBITMAP) ::SelectObject(dc, hBitmap);
@@ -501,7 +501,7 @@ bool wxPNGReader::ReadFile(char * ImageFileName)
int row_stride = info_ptr->width * ((pixel_depth+7)>>3); int row_stride = info_ptr->width * ((pixel_depth+7)>>3);
// printf("P = %d D = %d RS= %d ", info_ptr->num_palette, info_ptr->pixel_depth,row_stride); // printf("P = %d D = %d RS= %d ", info_ptr->num_palette, info_ptr->pixel_depth,row_stride);
// printf("CT = %d TRS = %d BD= %d ", info_ptr->color_type, info_ptr->valid & PNG_INFO_tRNS,info_ptr->bit_depth); // printf("CT = %d TRS = %d BD= %d ", info_ptr->color_type, info_ptr->valid & PNG_INFO_tRNS,info_ptr->bit_depth);
byte *row_pointers = new byte[row_stride]; byte *row_pointers = new byte[row_stride];
@@ -510,7 +510,7 @@ bool wxPNGReader::ReadFile(char * ImageFileName)
number_passes = png_set_interlace_handling(png_ptr); number_passes = png_set_interlace_handling(png_ptr);
else else
number_passes = 1; number_passes = 1;
// printf("NP = %d ", number_passes); // printf("NP = %d ", number_passes);
for (int pass=0; pass< number_passes; pass++) for (int pass=0; pass< number_passes; pass++)
{ {
@@ -619,7 +619,7 @@ bool wxPNGReader::ReadFile(char * ImageFileName)
while(iter.PrevRow()); while(iter.PrevRow());
SetGWorld( origPort , origDevice ) ; SetGWorld( origPort , origDevice ) ;
// printf("Y=%d ",y); // printf("Y=%d ",y);
} }
delete[] row_pointers; delete[] row_pointers;
@@ -688,7 +688,7 @@ bool wxPNGReader::SaveFile(char * ImageFileName)
} }
//png_set_error(ima_png_error, NULL); //png_set_error(ima_png_error, NULL);
// printf("writig pg %s ", filename); // printf("writig pg %s ", filename);
/* initialize the structures */ /* initialize the structures */
png_info_init(info_ptr); png_info_init(info_ptr);
png_write_init(png_ptr); png_write_init(png_ptr);
@@ -709,27 +709,27 @@ bool wxPNGReader::SaveFile(char * ImageFileName)
info_ptr->rowbytes = row_stride; info_ptr->rowbytes = row_stride;
// printf("P = %d D = %d RS= %d GD= %d CH= %d ", info_ptr->pixel_depth, info_ptr->bit_depth, row_stride, GetDepth(), info_ptr->channels); // printf("P = %d D = %d RS= %d GD= %d CH= %d ", info_ptr->pixel_depth, info_ptr->bit_depth, row_stride, GetDepth(), info_ptr->channels);
/* set the palette if there is one */ /* set the palette if there is one */
if ((GetColorType() & COLORTYPE_PALETTE) && GetPalette()) if ((GetColorType() & COLORTYPE_PALETTE) && GetPalette())
{ {
// printf("writing paleta[%d %d %x]",GetColorType() ,COLORTYPE_PALETTE, GetPalette()); // printf("writing paleta[%d %d %x]",GetColorType() ,COLORTYPE_PALETTE, GetPalette());
info_ptr->valid |= PNG_INFO_PLTE; info_ptr->valid |= PNG_INFO_PLTE;
info_ptr->palette = new png_color[256]; info_ptr->palette = new png_color[256];
info_ptr->num_palette = 256; info_ptr->num_palette = 256;
for (int i=0; i<256; i++) for (int i=0; i<256; i++)
GetPalette()->GetRGB(i, &info_ptr->palette[i].red, &info_ptr->palette[i].green, &info_ptr->palette[i].blue); GetPalette()->GetRGB(i, &info_ptr->palette[i].red, &info_ptr->palette[i].green, &info_ptr->palette[i].blue);
} }
// printf("Paleta [%d %d %x]",GetColorType() ,COLORTYPE_PALETTE, GetPalette()); // printf("Paleta [%d %d %x]",GetColorType() ,COLORTYPE_PALETTE, GetPalette());
/* optional significant bit chunk */ /* optional significant bit chunk */
// info_ptr->valid |= PNG_INFO_sBIT; // info_ptr->valid |= PNG_INFO_sBIT;
// info_ptr->sig_bit = true_bit_depth; // info_ptr->sig_bit = true_bit_depth;
/* optional gamma chunk */ /* optional gamma chunk */
// info_ptr->valid |= PNG_INFO_gAMA; // info_ptr->valid |= PNG_INFO_gAMA;
// info_ptr->gamma = gamma; // info_ptr->gamma = gamma;
/* other optional chunks */ /* other optional chunks */
@@ -741,33 +741,33 @@ bool wxPNGReader::SaveFile(char * ImageFileName)
/* shift the pixels up to a legal bit depth and fill in /* shift the pixels up to a legal bit depth and fill in
as appropriate to correctly scale the image */ as appropriate to correctly scale the image */
// png_set_shift(png_ptr, &(info_ptr->sig_bit)); // png_set_shift(png_ptr, &(info_ptr->sig_bit));
/* pack pixels into bytes */ /* pack pixels into bytes */
// png_set_packing(png_ptr); // png_set_packing(png_ptr);
/* flip bgr pixels to rgb */ /* flip bgr pixels to rgb */
// png_set_bgr(png_ptr); // png_set_bgr(png_ptr);
/* swap bytes of 16 bit files to most significant bit first */ /* swap bytes of 16 bit files to most significant bit first */
// png_set_swap(png_ptr); // png_set_swap(png_ptr);
/* get rid of filler bytes, pack rgb into 3 bytes */ /* get rid of filler bytes, pack rgb into 3 bytes */
// png_set_rgbx(png_ptr); // png_set_rgbx(png_ptr);
/* If you are only writing one row at a time, this works */ /* If you are only writing one row at a time, this works */
byte *row_pointers = new byte[row_stride]; byte *row_pointers = new byte[row_stride];
iter.upset(); iter.upset();
do { do {
// (unsigned char *)iter.GetRow(); // (unsigned char *)iter.GetRow();
iter.GetRow(row_pointers, row_stride); iter.GetRow(row_pointers, row_stride);
png_write_row(png_ptr, row_pointers); png_write_row(png_ptr, row_pointers);
} while(iter.PrevRow()); } while(iter.PrevRow());
delete[] row_pointers; delete[] row_pointers;
/* write the rest of the file */ /* write the rest of the file */
png_write_end(png_ptr, info_ptr); png_write_end(png_ptr, info_ptr);
/* clean up after the write, and free any memory allocated */ /* clean up after the write, and free any memory allocated */
@@ -800,7 +800,7 @@ static int Power(int x, int y)
} }
static char hexArray[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', static char hexArray[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B',
'C', 'D', 'E', 'F' }; 'C', 'D', 'E', 'F' };
static void DecToHex(int dec, char *buf) static void DecToHex(int dec, char *buf)
{ {

View File

@@ -19,7 +19,7 @@
#include "wx/msgdlg.h" #include "wx/msgdlg.h"
#include "wx/mac/uma.h" #include "wx/mac/uma.h"
#ifndef __DARWIN__ #ifndef __DARWIN__
#include "Printing.h" #include "Printing.h"
#endif #endif
#if defined(TARGET_CARBON) && !defined(__DARWIN__) #if defined(TARGET_CARBON) && !defined(__DARWIN__)
@@ -103,7 +103,7 @@ int wxPrintDialog::ShowModal()
} }
::UMAPrClose(NULL) ; ::UMAPrClose(NULL) ;
#else #else
#if PM_USE_SESSION_APIS #if PM_USE_SESSION_APIS
Boolean accepted; Boolean accepted;
{ {
@@ -183,9 +183,9 @@ int wxPrintDialog::ShowModal()
wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ; wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
dialog.ShowModal(); dialog.ShowModal();
} }
#else #else
#pragma warning "TODO: Printing for carbon without session apis" #pragma warning "TODO: Printing for carbon without session apis"
#endif #endif
#endif #endif
return result ; return result ;
} }
@@ -196,17 +196,17 @@ wxDC *wxPrintDialog::GetPrintDC()
} }
/* /*
* wxPageSetupDialog * wxPageSetupDialog
*/ */
wxPageSetupDialog::wxPageSetupDialog(): wxPageSetupDialog::wxPageSetupDialog():
wxDialog() wxDialog()
{ {
m_dialogParent = NULL; m_dialogParent = NULL;
} }
wxPageSetupDialog::wxPageSetupDialog(wxWindow *p, wxPageSetupData *data): wxPageSetupDialog::wxPageSetupDialog(wxWindow *p, wxPageSetupData *data):
wxDialog() wxDialog()
{ {
Create(p, data); Create(p, data);
} }
@@ -251,7 +251,7 @@ int wxPageSetupDialog::ShowModal()
} }
::UMAPrClose(NULL) ; ::UMAPrClose(NULL) ;
#else #else
#if PM_USE_SESSION_APIS #if PM_USE_SESSION_APIS
Boolean accepted; Boolean accepted;
{ {
@@ -305,9 +305,9 @@ int wxPageSetupDialog::ShowModal()
wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ; wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
dialog.ShowModal(); dialog.ShowModal();
} }
#else #else
#pragma warning "TODO: Printing for carbon without session apis" #pragma warning "TODO: Printing for carbon without session apis"
#endif #endif
#endif #endif
return result ; return result ;
} }

View File

@@ -43,11 +43,11 @@ IMPLEMENT_CLASS(wxMacPrintPreview, wxPrintPreviewBase)
#endif #endif
/* /*
* Printer * Printer
*/ */
wxMacPrinter::wxMacPrinter(wxPrintDialogData *data): wxMacPrinter::wxMacPrinter(wxPrintDialogData *data):
wxPrinterBase(data) wxPrinterBase(data)
{ {
} }
@@ -240,8 +240,8 @@ bool wxMacPrinter::Setup(wxWindow *parent)
} }
/* /*
* Print preview * Print preview
*/ */
wxMacPrintPreview::wxMacPrintPreview(wxPrintout *printout, wxMacPrintPreview::wxMacPrintPreview(wxPrintout *printout,
wxPrintout *printoutForPrinting, wxPrintout *printoutForPrinting,
@@ -252,7 +252,7 @@ wxMacPrintPreview::wxMacPrintPreview(wxPrintout *printout,
} }
wxMacPrintPreview::wxMacPrintPreview(wxPrintout *printout, wxPrintout *printoutForPrinting, wxPrintData *data): wxMacPrintPreview::wxMacPrintPreview(wxPrintout *printout, wxPrintout *printoutForPrinting, wxPrintData *data):
wxPrintPreviewBase(printout, printoutForPrinting, data) wxPrintPreviewBase(printout, printoutForPrinting, data)
{ {
DetermineScaling(); DetermineScaling();
} }

View File

@@ -10,8 +10,8 @@
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__ #ifdef __GNUG__
#pragma implementation "radioboxbase.h" #pragma implementation "radioboxbase.h"
#pragma implementation "radiobox.h" #pragma implementation "radiobox.h"
#endif #endif
//------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------
@@ -126,7 +126,7 @@ bool wxRadioBox::Create(wxWindow *parent, wxWindowID id, const wxString& label,
wxDefaultSize , i == 0 ? wxRB_GROUP : 0 ) ; wxDefaultSize , i == 0 ? wxRB_GROUP : 0 ) ;
if ( i == 0 ) if ( i == 0 )
m_radioButtonCycle = radBtn ; m_radioButtonCycle = radBtn ;
// m_radioButtonCycle=radBtn->AddInCycle(m_radioButtonCycle); // m_radioButtonCycle=radBtn->AddInCycle(m_radioButtonCycle);
} }
SetSelection(0); SetSelection(0);
@@ -386,7 +386,7 @@ void wxRadioBox::DoSetSize(int x, int y, int width, int height, int sizeFlags)
int i; int i;
wxRadioButton *current; wxRadioButton *current;
// define the position // define the position
int x_current, y_current; int x_current, y_current;
int x_offset,y_offset; int x_offset,y_offset;
@@ -401,7 +401,7 @@ void wxRadioBox::DoSetSize(int x, int y, int width, int height, int sizeFlags)
if ((y == -1)&& !(sizeFlags & wxSIZE_ALLOW_MINUS_ONE)) if ((y == -1)&& !(sizeFlags & wxSIZE_ALLOW_MINUS_ONE))
y_offset = y_current; y_offset = y_current;
// define size // define size
int charWidth,charHeight; int charWidth,charHeight;
int maxWidth,maxHeight; int maxWidth,maxHeight;
@@ -445,7 +445,7 @@ void wxRadioBox::DoSetSize(int x, int y, int width, int height, int sizeFlags)
wxControl::DoSetSize(x_offset,y_offset,width,height,wxSIZE_AUTO); wxControl::DoSetSize(x_offset,y_offset,width,height,wxSIZE_AUTO);
// arrange radiobuttons // arrange radiobuttons
int x_start,y_start; int x_start,y_start;

View File

@@ -24,23 +24,22 @@ END_EVENT_TABLE()
#endif #endif
// The dimensions of the different styles of sliders (From Aqua document) // The dimensions of the different styles of sliders (From Aqua document)
#define wxSLIDER_DIMENSIONACROSS 15 #define wxSLIDER_DIMENSIONACROSS 15
#define wxSLIDER_DIMENSIONACROSS_WITHTICKMARKS 24 #define wxSLIDER_DIMENSIONACROSS_WITHTICKMARKS 24
#define wxSLIDER_DIMENSIONACROSS_ARROW 18 #define wxSLIDER_DIMENSIONACROSS_ARROW 18
// Distance between slider and text // Distance between slider and text
#define wxSLIDER_BORDERTEXT 5 #define wxSLIDER_BORDERTEXT 5
/* NB! The default orientation for a slider is horizontal however if the user specifies /* NB! The default orientation for a slider is horizontal however if the user specifies
* some slider styles but dosen't specify the orientation we have to assume he wants a * some slider styles but dosen't specify the orientation we have to assume he wants a
* horizontal one. Therefore in this file when testing for the sliders orientation * horizontal one. Therefore in this file when testing for the sliders orientation
* vertical is tested for if this is not set then we use the horizontal one * vertical is tested for if this is not set then we use the horizontal one
* eg. if(GetWindowStyle() & wxSL_VERTICAL) {} else { horizontal case }> * eg. if(GetWindowStyle() & wxSL_VERTICAL) {} else { horizontal case }>
*/ */
// Slider
// Slider wxSlider::wxSlider()
wxSlider::wxSlider()
{ {
m_pageSize = 1; m_pageSize = 1;
m_lineSize = 1; m_lineSize = 1;
@@ -257,12 +256,12 @@ void wxSlider::MacHandleControlClick( WXWidget control , wxInt16 controlpart )
GetEventHandler()->ProcessEvent( cevent ); GetEventHandler()->ProcessEvent( cevent );
} }
/* This is overloaded in wxSlider so that the proper width/height will always be used /* This is overloaded in wxSlider so that the proper width/height will always be used
* for the slider different values would cause redrawing and mouse detection problems */ * for the slider different values would cause redrawing and mouse detection problems */
void wxSlider::SetSizeHints( int minW, int minH, void wxSlider::SetSizeHints( int minW, int minH,
int maxW , int maxH , int maxW , int maxH ,
int incW , int incH ) int incW , int incH )
{ {
wxSize size = GetBestSize(); wxSize size = GetBestSize();
if(GetWindowStyle() & wxSL_VERTICAL) { if(GetWindowStyle() & wxSL_VERTICAL) {
@@ -271,10 +270,10 @@ void wxSlider::MacHandleControlClick( WXWidget control , wxInt16 controlpart )
else { else {
wxWindow::SetSizeHints(minW, size.y, maxW, size.y, incW, incH); wxWindow::SetSizeHints(minW, size.y, maxW, size.y, incW, incH);
} }
} }
wxSize wxSlider::DoGetBestSize() const wxSize wxSlider::DoGetBestSize() const
{ {
wxSize size; wxSize size;
int textwidth, textheight; int textwidth, textheight;
@@ -323,14 +322,14 @@ void wxSlider::MacHandleControlClick( WXWidget control , wxInt16 controlpart )
size.x = 150; size.x = 150;
} }
return size; return size;
} }
void wxSlider::DoSetSize(int x, int y, int width, int height, int sizeFlags) void wxSlider::DoSetSize(int x, int y, int width, int height, int sizeFlags)
{ {
wxControl::DoSetSize( x, y , width , height ,sizeFlags ) ; wxControl::DoSetSize( x, y , width , height ,sizeFlags ) ;
} }
void wxSlider::MacUpdateDimensions() void wxSlider::MacUpdateDimensions()
{ {
// actually in the current systems this should never be possible, but later reparenting // actually in the current systems this should never be possible, but later reparenting
// may become a reality // may become a reality

View File

@@ -137,13 +137,13 @@ void wxStaticText::OnDraw( wxDC &dc )
{ {
if (m_width <= 0 || m_height <= 0) if (m_width <= 0 || m_height <= 0)
return; return;
/* /*
dc.Clear() ; dc.Clear() ;
wxRect rect(0,0,m_width,m_height) ; wxRect rect(0,0,m_width,m_height) ;
dc.SetFont(*wxSMALL_FONT) ; dc.SetFont(*wxSMALL_FONT) ;
dc.DrawRectangle(rect) ; dc.DrawRectangle(rect) ;
*/ */
if ( !IsWindowHilited( (WindowRef) MacGetRootWindow() ) && if ( !IsWindowHilited( (WindowRef) MacGetRootWindow() ) &&
( GetBackgroundColour() == wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE ) ( GetBackgroundColour() == wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE )
|| GetBackgroundColour() == wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE) ) ) || GetBackgroundColour() == wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE) ) )

View File

@@ -902,5 +902,3 @@ bool WXDLLEXPORT wxIsWaitingForThread()
#include "wx/thrimpl.cpp" #include "wx/thrimpl.cpp"
#endif // wxUSE_THREADS #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, bool wxToolBar::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size,
long style, const wxString& name) long style, const wxString& name)
{ {
int x = pos.x; int x = pos.x;
int y = pos.y; int y = pos.y;
int width = size.x; int width = size.x;
@@ -376,7 +375,7 @@ void wxToolBar::MacSuperChangedPosition()
localOrigin.v = ly ; localOrigin.v = ly ;
localOrigin.h = lx ; localOrigin.h = lx ;
// GetParent()->MacGetPortParams( &localOrigin , &clipRect , &window , &win ) ; // GetParent()->MacGetPortParams( &localOrigin , &clipRect , &window , &win ) ;
Rect toolbarrect = { localOrigin.v ,localOrigin.h , Rect toolbarrect = { localOrigin.v ,localOrigin.h ,
m_height + localOrigin.v , m_width + localOrigin.h} ; m_height + localOrigin.v , m_width + localOrigin.h} ;

View File

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

View File

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

View File

@@ -980,7 +980,7 @@ wxWindowMac *wxGetActiveWindow()
// Coordinates relative to the window // Coordinates relative to the window
void wxWindowMac::WarpPointer (int x_pos, int y_pos) 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() const wxBrush& wxWindowMac::MacGetBackgroundBrush()
@@ -1045,7 +1045,6 @@ const wxBrush& wxWindowMac::MacGetBackgroundBrush()
} }
return m_macBackgroundBrush ; return m_macBackgroundBrush ;
} }
void wxWindowMac::OnEraseBackground(wxEraseEvent& event) void wxWindowMac::OnEraseBackground(wxEraseEvent& event)

View File

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

View File

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

View File

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

View File

@@ -23,7 +23,7 @@
IMPLEMENT_DYNAMIC_CLASS(wxMemoryDC,wxPaintDC) IMPLEMENT_DYNAMIC_CLASS(wxMemoryDC,wxPaintDC)
wxMemoryDC::wxMemoryDC(void) wxMemoryDC::wxMemoryDC(void)
: m_selected() : m_selected()
{ {
m_ok = TRUE; m_ok = TRUE;
SetBackground(*wxWHITE_BRUSH); SetBackground(*wxWHITE_BRUSH);
@@ -33,7 +33,7 @@ wxMemoryDC::wxMemoryDC(void)
}; };
wxMemoryDC::wxMemoryDC( wxDC *WXUNUSED(dc) ) wxMemoryDC::wxMemoryDC( wxDC *WXUNUSED(dc) )
: m_selected() : m_selected()
{ {
m_ok = TRUE; m_ok = TRUE;
SetBackground(*wxWHITE_BRUSH); SetBackground(*wxWHITE_BRUSH);

View File

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

View File

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

View File

@@ -34,14 +34,14 @@
#include "wx/mac/uma.h" #include "wx/mac/uma.h"
/* /*
* GLContext implementation * GLContext implementation
*/ */
wxGLContext::wxGLContext( wxGLContext::wxGLContext(
AGLPixelFormat fmt, wxGLCanvas *win, AGLPixelFormat fmt, wxGLCanvas *win,
const wxPalette& palette, const wxPalette& palette,
const wxGLContext *other /* for sharing display lists */ const wxGLContext *other /* for sharing display lists */
) )
{ {
m_window = win; m_window = win;
@@ -108,8 +108,8 @@ void wxGLContext::SetColour(const char *colour)
/* /*
* wxGLCanvas implementation * wxGLCanvas implementation
*/ */
IMPLEMENT_CLASS(wxGLCanvas, wxWindow) IMPLEMENT_CLASS(wxGLCanvas, wxWindow)

View File

@@ -104,12 +104,12 @@ bool wxICONResourceHandler::LoadFile(wxBitmap *bitmap, const wxString& name, lo
Str255 theName ; Str255 theName ;
OSType theType ; OSType theType ;
#if TARGET_CARBON #if TARGET_CARBON
c2pstrcpy( (StringPtr) theName , name ) ; c2pstrcpy( (StringPtr) theName , name ) ;
#else #else
strcpy( (char *) theName , name ) ; strcpy( (char *) theName , name ) ;
c2pstr( (char *) theName ) ; c2pstr( (char *) theName ) ;
#endif #endif
Handle resHandle = GetNamedResource( 'cicn' , theName ) ; Handle resHandle = GetNamedResource( 'cicn' , theName ) ;
if ( resHandle != 0L ) if ( resHandle != 0L )

View File

@@ -24,7 +24,7 @@
#include "wx/utils.h" #include "wx/utils.h"
#if !USE_SHARED_LIBRARY #if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxListBox, wxControl) IMPLEMENT_DYNAMIC_CLASS(wxListBox, wxControl)
BEGIN_EVENT_TABLE(wxListBox, wxControl) BEGIN_EVENT_TABLE(wxListBox, wxControl)
EVT_SIZE( wxListBox::OnSize ) EVT_SIZE( wxListBox::OnSize )
@@ -419,7 +419,7 @@ void wxListBox::DoSetItems(const wxArrayString& choices, void** clientData)
wxT("Can't use client data with owner-drawn listboxes")); wxT("Can't use client data with owner-drawn listboxes"));
#else // !wxUSE_OWNER_DRAWN #else // !wxUSE_OWNER_DRAWN
Append( choices[i] , clientData[i] ) ; Append( choices[i] , clientData[i] ) ;
#endif #endif
} }
else else
Append( choices[i] ) ; Append( choices[i] ) ;
@@ -704,7 +704,7 @@ void wxListBox::SetupColours()
void wxListBox::Refresh(bool eraseBack, const wxRect *rect) void wxListBox::Refresh(bool eraseBack, const wxRect *rect)
{ {
wxControl::Refresh( eraseBack , rect ) ; wxControl::Refresh( eraseBack , rect ) ;
// MacRedrawControl() ; // MacRedrawControl() ;
} }
#if wxUSE_OWNER_DRAWN #if wxUSE_OWNER_DRAWN
@@ -735,9 +735,9 @@ wxOwnerDrawn *wxListBox::CreateItem(size_t n)
/* /*
void MacDrawStringCell(Rect *cellRect, Cell lCell, ListHandle theList, long refCon) void MacDrawStringCell(Rect *cellRect, Cell lCell, ListHandle theList, long refCon)
{ {
wxListBox* list; wxListBox* list;
// typecast our refCon // typecast our refCon
list = (wxListBox*)refCon; list = (wxListBox*)refCon;
MoveTo(cellRect->left + 4 , cellRect->top + 10 ); MoveTo(cellRect->left + 4 , cellRect->top + 10 );
const wxString text = list->m_stringArray[lCell.v] ; const wxString text = list->m_stringArray[lCell.v] ;
@@ -746,7 +746,7 @@ void MacDrawStringCell(Rect *cellRect, Cell lCell, ListHandle theList, long refC
::TextFace( 0 ) ; ::TextFace( 0 ) ;
DrawText(text, 0 , text.Length()); DrawText(text, 0 , text.Length());
} }
*/ */
void wxListBox::MacDelete( int N ) void wxListBox::MacDelete( int N )
{ {
@@ -759,7 +759,7 @@ void wxListBox::MacInsert( int n , const char * text)
Cell cell = { 0 , 0 } ; Cell cell = { 0 , 0 } ;
cell.v = n ; cell.v = n ;
LAddRow( 1 , cell.v , (ListHandle)m_macList ) ; LAddRow( 1 , cell.v , (ListHandle)m_macList ) ;
// LSetCell(text, strlen(text), cell, m_macList); // LSetCell(text, strlen(text), cell, m_macList);
Refresh(); Refresh();
} }
@@ -804,7 +804,7 @@ bool wxListBox::MacIsSelected( int n ) const
void wxListBox::MacDestroy() void wxListBox::MacDestroy()
{ {
// DisposeExtLDEFInfo( m_macList ) ; // DisposeExtLDEFInfo( m_macList ) ;
} }
int wxListBox::MacGetSelection() const int wxListBox::MacGetSelection() const
@@ -840,7 +840,7 @@ void wxListBox::MacSet( int n , const char * text )
// so we just have to redraw // so we just have to redraw
Cell cell = { 0 , 0 } ; Cell cell = { 0 , 0 } ;
cell.v = n ; cell.v = n ;
// LSetCell(text, strlen(text), cell, m_macList); // LSetCell(text, strlen(text), cell, m_macList);
Refresh(); Refresh();
} }

View File

@@ -122,8 +122,8 @@ void wxMacRemoveAllNotifiersForData( wxMacNotifierTableRef table , void* data )
void wxMacProcessNotifierEvents() void wxMacProcessNotifierEvents()
{ {
// if ( gInProcessing ) // if ( gInProcessing )
// return ; // return ;
gInProcessing = true ; gInProcessing = true ;
if ( gMacNotificationEvents.top != gMacNotificationEvents.bottom ) if ( gMacNotificationEvents.top != gMacNotificationEvents.bottom )

View File

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

View File

@@ -86,7 +86,7 @@ wxMetaFile::~wxMetaFile()
bool wxMetaFile::SetClipboard(int width, int height) bool wxMetaFile::SetClipboard(int width, int height)
{ {
#if wxUSE_DRAG_AND_DROP #if wxUSE_DRAG_AND_DROP
//TODO finishi this port , we need the data obj first //TODO finishi this port , we need the data obj first
if (!m_refData) if (!m_refData)
return FALSE; return FALSE;

View File

@@ -10,7 +10,7 @@
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__ #ifdef __GNUG__
#pragma implementation "notebook.h" #pragma implementation "notebook.h"
#endif #endif
// ============================================================================ // ============================================================================
@@ -35,10 +35,10 @@
static bool constantsSet = false ; static bool constantsSet = false ;
short kwxMacTabLeftMargin = 0 ; short kwxMacTabLeftMargin = 0 ;
short kwxMacTabTopMargin = 0 ; short kwxMacTabTopMargin = 0 ;
short kwxMacTabRightMargin = 0 ; short kwxMacTabRightMargin = 0 ;
short kwxMacTabBottomMargin = 0 ; short kwxMacTabBottomMargin = 0 ;
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// event table // event table
@@ -49,12 +49,12 @@ DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED)
DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING) DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING)
BEGIN_EVENT_TABLE(wxNotebook, wxControl) BEGIN_EVENT_TABLE(wxNotebook, wxControl)
EVT_NOTEBOOK_PAGE_CHANGED(-1, wxNotebook::OnSelChange) EVT_NOTEBOOK_PAGE_CHANGED(-1, wxNotebook::OnSelChange)
EVT_MOUSE_EVENTS(wxNotebook::OnMouse) EVT_MOUSE_EVENTS(wxNotebook::OnMouse)
EVT_SIZE(wxNotebook::OnSize) EVT_SIZE(wxNotebook::OnSize)
EVT_SET_FOCUS(wxNotebook::OnSetFocus) EVT_SET_FOCUS(wxNotebook::OnSetFocus)
EVT_NAVIGATION_KEY(wxNotebook::OnNavigationKey) EVT_NAVIGATION_KEY(wxNotebook::OnNavigationKey)
END_EVENT_TABLE() END_EVENT_TABLE()
IMPLEMENT_DYNAMIC_CLASS(wxNotebook, wxControl) IMPLEMENT_DYNAMIC_CLASS(wxNotebook, wxControl)
@@ -344,10 +344,10 @@ bool wxNotebook::InsertPage(int nPage,
} }
/* Added by Mark Newsam /* Added by Mark Newsam
* When a page is added or deleted to the notebook this function updates * When a page is added or deleted to the notebook this function updates
* information held in the m_macControl so that it matches the order * information held in the m_macControl so that it matches the order
* the user would expect. * the user would expect.
*/ */
void wxNotebook::MacSetupTabs() void wxNotebook::MacSetupTabs()
{ {
SetControl32BitMaximum( (ControlHandle) m_macControl , GetPageCount() ) ; SetControl32BitMaximum( (ControlHandle) m_macControl , GetPageCount() ) ;

View File

@@ -114,5 +114,5 @@ bool wxPalette::GetRGB(int index, unsigned char *red, unsigned char *green, unsi
} }
#endif #endif
// wxUSE_PALETTE // wxUSE_PALETTE

View File

@@ -32,7 +32,7 @@ wxPenRefData::wxPenRefData()
} }
wxPenRefData::wxPenRefData(const wxPenRefData& data) wxPenRefData::wxPenRefData(const wxPenRefData& data)
: wxGDIRefData() : wxGDIRefData()
{ {
m_style = data.m_style; m_style = data.m_style;
m_width = data.m_width; m_width = data.m_width;

View File

@@ -163,7 +163,7 @@ bool wxPNGReader::GetRGB(int x, int y, byte* r, byte* g, byte* b)
if (m_palette) { if (m_palette) {
return m_palette->GetRGB(GetIndex(x, y), r, g, b); return m_palette->GetRGB(GetIndex(x, y), r, g, b);
/* PALETTEENTRY entry; /* PALETTEENTRY entry;
::GetPaletteEntries((HPALETTE) m_palette->GetHPALETTE(), GetIndex(x, y), 1, &entry); ::GetPaletteEntries((HPALETTE) m_palette->GetHPALETTE(), GetIndex(x, y), 1, &entry);
*r = entry.peRed; *r = entry.peRed;
*g = entry.peGreen; *g = entry.peGreen;
@@ -215,7 +215,7 @@ bool wxPNGReader::SetPalette(wxPalette* colourmap)
ColorType |= (COLORTYPE_PALETTE | COLORTYPE_COLOR); ColorType |= (COLORTYPE_PALETTE | COLORTYPE_COLOR);
m_palette = new wxPalette( *colourmap ); m_palette = new wxPalette( *colourmap );
return true ; return true ;
// return (DibSetUsage(lpbi, (HPALETTE) m_palette->GetHPALETTE(), WXIMA_COLORS ) != 0); // return (DibSetUsage(lpbi, (HPALETTE) m_palette->GetHPALETTE(), WXIMA_COLORS ) != 0);
} }
bool bool
@@ -231,7 +231,7 @@ wxPNGReader::SetPalette(int n, byte *r, byte *g, byte *b)
m_palette->Create(n, r, g, b); m_palette->Create(n, r, g, b);
ColorType |= (COLORTYPE_PALETTE | COLORTYPE_COLOR); ColorType |= (COLORTYPE_PALETTE | COLORTYPE_COLOR);
return true ; return true ;
// return (DibSetUsage(lpbi, (HPALETTE) m_palette->GetHPALETTE(), WXIMA_COLORS ) != 0); // return (DibSetUsage(lpbi, (HPALETTE) m_palette->GetHPALETTE(), WXIMA_COLORS ) != 0);
} }
bool bool
@@ -259,7 +259,7 @@ wxPNGReader::SetPalette(int n, rgb_color_struct *rgb_struct)
m_palette->Create(n, r, g, b); m_palette->Create(n, r, g, b);
ColorType |= (COLORTYPE_PALETTE | COLORTYPE_COLOR); ColorType |= (COLORTYPE_PALETTE | COLORTYPE_COLOR);
return true ; return true ;
// return (DibSetUsage(lpbi, (HPALETTE) m_palette->GetHPALETTE(), WXIMA_COLORS ) != 0); // return (DibSetUsage(lpbi, (HPALETTE) m_palette->GetHPALETTE(), WXIMA_COLORS ) != 0);
} }
void wxPNGReader::NullData() void wxPNGReader::NullData()
@@ -314,7 +314,7 @@ bool wxPNGReader::InstantiateBitmap(wxBitmap *bitmap)
{ {
return FALSE; return FALSE;
} }
/* /*
HDC dc = ::CreateCompatibleDC(NULL); HDC dc = ::CreateCompatibleDC(NULL);
if (dc) if (dc)
@@ -381,7 +381,7 @@ wxPalette *wxCopyPalette(const wxPalette *cmap)
wxMask *wxPNGReader::CreateMask(void) wxMask *wxPNGReader::CreateMask(void)
{ {
/* /*
HBITMAP hBitmap = ::CreateBitmap(GetWidth(), GetHeight(), 1, 1, NULL); HBITMAP hBitmap = ::CreateBitmap(GetWidth(), GetHeight(), 1, 1, NULL);
HDC dc = ::CreateCompatibleDC(NULL); HDC dc = ::CreateCompatibleDC(NULL);
HBITMAP oldBitmap = (HBITMAP) ::SelectObject(dc, hBitmap); HBITMAP oldBitmap = (HBITMAP) ::SelectObject(dc, hBitmap);
@@ -501,7 +501,7 @@ bool wxPNGReader::ReadFile(char * ImageFileName)
int row_stride = info_ptr->width * ((pixel_depth+7)>>3); int row_stride = info_ptr->width * ((pixel_depth+7)>>3);
// printf("P = %d D = %d RS= %d ", info_ptr->num_palette, info_ptr->pixel_depth,row_stride); // printf("P = %d D = %d RS= %d ", info_ptr->num_palette, info_ptr->pixel_depth,row_stride);
// printf("CT = %d TRS = %d BD= %d ", info_ptr->color_type, info_ptr->valid & PNG_INFO_tRNS,info_ptr->bit_depth); // printf("CT = %d TRS = %d BD= %d ", info_ptr->color_type, info_ptr->valid & PNG_INFO_tRNS,info_ptr->bit_depth);
byte *row_pointers = new byte[row_stride]; byte *row_pointers = new byte[row_stride];
@@ -510,7 +510,7 @@ bool wxPNGReader::ReadFile(char * ImageFileName)
number_passes = png_set_interlace_handling(png_ptr); number_passes = png_set_interlace_handling(png_ptr);
else else
number_passes = 1; number_passes = 1;
// printf("NP = %d ", number_passes); // printf("NP = %d ", number_passes);
for (int pass=0; pass< number_passes; pass++) for (int pass=0; pass< number_passes; pass++)
{ {
@@ -619,7 +619,7 @@ bool wxPNGReader::ReadFile(char * ImageFileName)
while(iter.PrevRow()); while(iter.PrevRow());
SetGWorld( origPort , origDevice ) ; SetGWorld( origPort , origDevice ) ;
// printf("Y=%d ",y); // printf("Y=%d ",y);
} }
delete[] row_pointers; delete[] row_pointers;
@@ -688,7 +688,7 @@ bool wxPNGReader::SaveFile(char * ImageFileName)
} }
//png_set_error(ima_png_error, NULL); //png_set_error(ima_png_error, NULL);
// printf("writig pg %s ", filename); // printf("writig pg %s ", filename);
/* initialize the structures */ /* initialize the structures */
png_info_init(info_ptr); png_info_init(info_ptr);
png_write_init(png_ptr); png_write_init(png_ptr);
@@ -709,27 +709,27 @@ bool wxPNGReader::SaveFile(char * ImageFileName)
info_ptr->rowbytes = row_stride; info_ptr->rowbytes = row_stride;
// printf("P = %d D = %d RS= %d GD= %d CH= %d ", info_ptr->pixel_depth, info_ptr->bit_depth, row_stride, GetDepth(), info_ptr->channels); // printf("P = %d D = %d RS= %d GD= %d CH= %d ", info_ptr->pixel_depth, info_ptr->bit_depth, row_stride, GetDepth(), info_ptr->channels);
/* set the palette if there is one */ /* set the palette if there is one */
if ((GetColorType() & COLORTYPE_PALETTE) && GetPalette()) if ((GetColorType() & COLORTYPE_PALETTE) && GetPalette())
{ {
// printf("writing paleta[%d %d %x]",GetColorType() ,COLORTYPE_PALETTE, GetPalette()); // printf("writing paleta[%d %d %x]",GetColorType() ,COLORTYPE_PALETTE, GetPalette());
info_ptr->valid |= PNG_INFO_PLTE; info_ptr->valid |= PNG_INFO_PLTE;
info_ptr->palette = new png_color[256]; info_ptr->palette = new png_color[256];
info_ptr->num_palette = 256; info_ptr->num_palette = 256;
for (int i=0; i<256; i++) for (int i=0; i<256; i++)
GetPalette()->GetRGB(i, &info_ptr->palette[i].red, &info_ptr->palette[i].green, &info_ptr->palette[i].blue); GetPalette()->GetRGB(i, &info_ptr->palette[i].red, &info_ptr->palette[i].green, &info_ptr->palette[i].blue);
} }
// printf("Paleta [%d %d %x]",GetColorType() ,COLORTYPE_PALETTE, GetPalette()); // printf("Paleta [%d %d %x]",GetColorType() ,COLORTYPE_PALETTE, GetPalette());
/* optional significant bit chunk */ /* optional significant bit chunk */
// info_ptr->valid |= PNG_INFO_sBIT; // info_ptr->valid |= PNG_INFO_sBIT;
// info_ptr->sig_bit = true_bit_depth; // info_ptr->sig_bit = true_bit_depth;
/* optional gamma chunk */ /* optional gamma chunk */
// info_ptr->valid |= PNG_INFO_gAMA; // info_ptr->valid |= PNG_INFO_gAMA;
// info_ptr->gamma = gamma; // info_ptr->gamma = gamma;
/* other optional chunks */ /* other optional chunks */
@@ -741,33 +741,33 @@ bool wxPNGReader::SaveFile(char * ImageFileName)
/* shift the pixels up to a legal bit depth and fill in /* shift the pixels up to a legal bit depth and fill in
as appropriate to correctly scale the image */ as appropriate to correctly scale the image */
// png_set_shift(png_ptr, &(info_ptr->sig_bit)); // png_set_shift(png_ptr, &(info_ptr->sig_bit));
/* pack pixels into bytes */ /* pack pixels into bytes */
// png_set_packing(png_ptr); // png_set_packing(png_ptr);
/* flip bgr pixels to rgb */ /* flip bgr pixels to rgb */
// png_set_bgr(png_ptr); // png_set_bgr(png_ptr);
/* swap bytes of 16 bit files to most significant bit first */ /* swap bytes of 16 bit files to most significant bit first */
// png_set_swap(png_ptr); // png_set_swap(png_ptr);
/* get rid of filler bytes, pack rgb into 3 bytes */ /* get rid of filler bytes, pack rgb into 3 bytes */
// png_set_rgbx(png_ptr); // png_set_rgbx(png_ptr);
/* If you are only writing one row at a time, this works */ /* If you are only writing one row at a time, this works */
byte *row_pointers = new byte[row_stride]; byte *row_pointers = new byte[row_stride];
iter.upset(); iter.upset();
do { do {
// (unsigned char *)iter.GetRow(); // (unsigned char *)iter.GetRow();
iter.GetRow(row_pointers, row_stride); iter.GetRow(row_pointers, row_stride);
png_write_row(png_ptr, row_pointers); png_write_row(png_ptr, row_pointers);
} while(iter.PrevRow()); } while(iter.PrevRow());
delete[] row_pointers; delete[] row_pointers;
/* write the rest of the file */ /* write the rest of the file */
png_write_end(png_ptr, info_ptr); png_write_end(png_ptr, info_ptr);
/* clean up after the write, and free any memory allocated */ /* clean up after the write, and free any memory allocated */
@@ -800,7 +800,7 @@ static int Power(int x, int y)
} }
static char hexArray[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', static char hexArray[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B',
'C', 'D', 'E', 'F' }; 'C', 'D', 'E', 'F' };
static void DecToHex(int dec, char *buf) static void DecToHex(int dec, char *buf)
{ {

View File

@@ -19,7 +19,7 @@
#include "wx/msgdlg.h" #include "wx/msgdlg.h"
#include "wx/mac/uma.h" #include "wx/mac/uma.h"
#ifndef __DARWIN__ #ifndef __DARWIN__
#include "Printing.h" #include "Printing.h"
#endif #endif
#if defined(TARGET_CARBON) && !defined(__DARWIN__) #if defined(TARGET_CARBON) && !defined(__DARWIN__)
@@ -103,7 +103,7 @@ int wxPrintDialog::ShowModal()
} }
::UMAPrClose(NULL) ; ::UMAPrClose(NULL) ;
#else #else
#if PM_USE_SESSION_APIS #if PM_USE_SESSION_APIS
Boolean accepted; Boolean accepted;
{ {
@@ -183,9 +183,9 @@ int wxPrintDialog::ShowModal()
wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ; wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
dialog.ShowModal(); dialog.ShowModal();
} }
#else #else
#pragma warning "TODO: Printing for carbon without session apis" #pragma warning "TODO: Printing for carbon without session apis"
#endif #endif
#endif #endif
return result ; return result ;
} }
@@ -196,17 +196,17 @@ wxDC *wxPrintDialog::GetPrintDC()
} }
/* /*
* wxPageSetupDialog * wxPageSetupDialog
*/ */
wxPageSetupDialog::wxPageSetupDialog(): wxPageSetupDialog::wxPageSetupDialog():
wxDialog() wxDialog()
{ {
m_dialogParent = NULL; m_dialogParent = NULL;
} }
wxPageSetupDialog::wxPageSetupDialog(wxWindow *p, wxPageSetupData *data): wxPageSetupDialog::wxPageSetupDialog(wxWindow *p, wxPageSetupData *data):
wxDialog() wxDialog()
{ {
Create(p, data); Create(p, data);
} }
@@ -251,7 +251,7 @@ int wxPageSetupDialog::ShowModal()
} }
::UMAPrClose(NULL) ; ::UMAPrClose(NULL) ;
#else #else
#if PM_USE_SESSION_APIS #if PM_USE_SESSION_APIS
Boolean accepted; Boolean accepted;
{ {
@@ -305,9 +305,9 @@ int wxPageSetupDialog::ShowModal()
wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ; wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
dialog.ShowModal(); dialog.ShowModal();
} }
#else #else
#pragma warning "TODO: Printing for carbon without session apis" #pragma warning "TODO: Printing for carbon without session apis"
#endif #endif
#endif #endif
return result ; return result ;
} }

View File

@@ -43,11 +43,11 @@ IMPLEMENT_CLASS(wxMacPrintPreview, wxPrintPreviewBase)
#endif #endif
/* /*
* Printer * Printer
*/ */
wxMacPrinter::wxMacPrinter(wxPrintDialogData *data): wxMacPrinter::wxMacPrinter(wxPrintDialogData *data):
wxPrinterBase(data) wxPrinterBase(data)
{ {
} }
@@ -240,8 +240,8 @@ bool wxMacPrinter::Setup(wxWindow *parent)
} }
/* /*
* Print preview * Print preview
*/ */
wxMacPrintPreview::wxMacPrintPreview(wxPrintout *printout, wxMacPrintPreview::wxMacPrintPreview(wxPrintout *printout,
wxPrintout *printoutForPrinting, wxPrintout *printoutForPrinting,
@@ -252,7 +252,7 @@ wxMacPrintPreview::wxMacPrintPreview(wxPrintout *printout,
} }
wxMacPrintPreview::wxMacPrintPreview(wxPrintout *printout, wxPrintout *printoutForPrinting, wxPrintData *data): wxMacPrintPreview::wxMacPrintPreview(wxPrintout *printout, wxPrintout *printoutForPrinting, wxPrintData *data):
wxPrintPreviewBase(printout, printoutForPrinting, data) wxPrintPreviewBase(printout, printoutForPrinting, data)
{ {
DetermineScaling(); DetermineScaling();
} }

View File

@@ -10,8 +10,8 @@
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__ #ifdef __GNUG__
#pragma implementation "radioboxbase.h" #pragma implementation "radioboxbase.h"
#pragma implementation "radiobox.h" #pragma implementation "radiobox.h"
#endif #endif
//------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------
@@ -126,7 +126,7 @@ bool wxRadioBox::Create(wxWindow *parent, wxWindowID id, const wxString& label,
wxDefaultSize , i == 0 ? wxRB_GROUP : 0 ) ; wxDefaultSize , i == 0 ? wxRB_GROUP : 0 ) ;
if ( i == 0 ) if ( i == 0 )
m_radioButtonCycle = radBtn ; m_radioButtonCycle = radBtn ;
// m_radioButtonCycle=radBtn->AddInCycle(m_radioButtonCycle); // m_radioButtonCycle=radBtn->AddInCycle(m_radioButtonCycle);
} }
SetSelection(0); SetSelection(0);
@@ -386,7 +386,7 @@ void wxRadioBox::DoSetSize(int x, int y, int width, int height, int sizeFlags)
int i; int i;
wxRadioButton *current; wxRadioButton *current;
// define the position // define the position
int x_current, y_current; int x_current, y_current;
int x_offset,y_offset; int x_offset,y_offset;
@@ -401,7 +401,7 @@ void wxRadioBox::DoSetSize(int x, int y, int width, int height, int sizeFlags)
if ((y == -1)&& !(sizeFlags & wxSIZE_ALLOW_MINUS_ONE)) if ((y == -1)&& !(sizeFlags & wxSIZE_ALLOW_MINUS_ONE))
y_offset = y_current; y_offset = y_current;
// define size // define size
int charWidth,charHeight; int charWidth,charHeight;
int maxWidth,maxHeight; int maxWidth,maxHeight;
@@ -445,7 +445,7 @@ void wxRadioBox::DoSetSize(int x, int y, int width, int height, int sizeFlags)
wxControl::DoSetSize(x_offset,y_offset,width,height,wxSIZE_AUTO); wxControl::DoSetSize(x_offset,y_offset,width,height,wxSIZE_AUTO);
// arrange radiobuttons // arrange radiobuttons
int x_start,y_start; int x_start,y_start;

View File

@@ -24,23 +24,22 @@ END_EVENT_TABLE()
#endif #endif
// The dimensions of the different styles of sliders (From Aqua document) // The dimensions of the different styles of sliders (From Aqua document)
#define wxSLIDER_DIMENSIONACROSS 15 #define wxSLIDER_DIMENSIONACROSS 15
#define wxSLIDER_DIMENSIONACROSS_WITHTICKMARKS 24 #define wxSLIDER_DIMENSIONACROSS_WITHTICKMARKS 24
#define wxSLIDER_DIMENSIONACROSS_ARROW 18 #define wxSLIDER_DIMENSIONACROSS_ARROW 18
// Distance between slider and text // Distance between slider and text
#define wxSLIDER_BORDERTEXT 5 #define wxSLIDER_BORDERTEXT 5
/* NB! The default orientation for a slider is horizontal however if the user specifies /* NB! The default orientation for a slider is horizontal however if the user specifies
* some slider styles but dosen't specify the orientation we have to assume he wants a * some slider styles but dosen't specify the orientation we have to assume he wants a
* horizontal one. Therefore in this file when testing for the sliders orientation * horizontal one. Therefore in this file when testing for the sliders orientation
* vertical is tested for if this is not set then we use the horizontal one * vertical is tested for if this is not set then we use the horizontal one
* eg. if(GetWindowStyle() & wxSL_VERTICAL) {} else { horizontal case }> * eg. if(GetWindowStyle() & wxSL_VERTICAL) {} else { horizontal case }>
*/ */
// Slider
// Slider wxSlider::wxSlider()
wxSlider::wxSlider()
{ {
m_pageSize = 1; m_pageSize = 1;
m_lineSize = 1; m_lineSize = 1;
@@ -257,12 +256,12 @@ void wxSlider::MacHandleControlClick( WXWidget control , wxInt16 controlpart )
GetEventHandler()->ProcessEvent( cevent ); GetEventHandler()->ProcessEvent( cevent );
} }
/* This is overloaded in wxSlider so that the proper width/height will always be used /* This is overloaded in wxSlider so that the proper width/height will always be used
* for the slider different values would cause redrawing and mouse detection problems */ * for the slider different values would cause redrawing and mouse detection problems */
void wxSlider::SetSizeHints( int minW, int minH, void wxSlider::SetSizeHints( int minW, int minH,
int maxW , int maxH , int maxW , int maxH ,
int incW , int incH ) int incW , int incH )
{ {
wxSize size = GetBestSize(); wxSize size = GetBestSize();
if(GetWindowStyle() & wxSL_VERTICAL) { if(GetWindowStyle() & wxSL_VERTICAL) {
@@ -271,10 +270,10 @@ void wxSlider::MacHandleControlClick( WXWidget control , wxInt16 controlpart )
else { else {
wxWindow::SetSizeHints(minW, size.y, maxW, size.y, incW, incH); wxWindow::SetSizeHints(minW, size.y, maxW, size.y, incW, incH);
} }
} }
wxSize wxSlider::DoGetBestSize() const wxSize wxSlider::DoGetBestSize() const
{ {
wxSize size; wxSize size;
int textwidth, textheight; int textwidth, textheight;
@@ -323,14 +322,14 @@ void wxSlider::MacHandleControlClick( WXWidget control , wxInt16 controlpart )
size.x = 150; size.x = 150;
} }
return size; return size;
} }
void wxSlider::DoSetSize(int x, int y, int width, int height, int sizeFlags) void wxSlider::DoSetSize(int x, int y, int width, int height, int sizeFlags)
{ {
wxControl::DoSetSize( x, y , width , height ,sizeFlags ) ; wxControl::DoSetSize( x, y , width , height ,sizeFlags ) ;
} }
void wxSlider::MacUpdateDimensions() void wxSlider::MacUpdateDimensions()
{ {
// actually in the current systems this should never be possible, but later reparenting // actually in the current systems this should never be possible, but later reparenting
// may become a reality // may become a reality

View File

@@ -137,13 +137,13 @@ void wxStaticText::OnDraw( wxDC &dc )
{ {
if (m_width <= 0 || m_height <= 0) if (m_width <= 0 || m_height <= 0)
return; return;
/* /*
dc.Clear() ; dc.Clear() ;
wxRect rect(0,0,m_width,m_height) ; wxRect rect(0,0,m_width,m_height) ;
dc.SetFont(*wxSMALL_FONT) ; dc.SetFont(*wxSMALL_FONT) ;
dc.DrawRectangle(rect) ; dc.DrawRectangle(rect) ;
*/ */
if ( !IsWindowHilited( (WindowRef) MacGetRootWindow() ) && if ( !IsWindowHilited( (WindowRef) MacGetRootWindow() ) &&
( GetBackgroundColour() == wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE ) ( GetBackgroundColour() == wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE )
|| GetBackgroundColour() == wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE) ) ) || GetBackgroundColour() == wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE) ) )

View File

@@ -902,5 +902,3 @@ bool WXDLLEXPORT wxIsWaitingForThread()
#include "wx/thrimpl.cpp" #include "wx/thrimpl.cpp"
#endif // wxUSE_THREADS #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, bool wxToolBar::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size,
long style, const wxString& name) long style, const wxString& name)
{ {
int x = pos.x; int x = pos.x;
int y = pos.y; int y = pos.y;
int width = size.x; int width = size.x;
@@ -376,7 +375,7 @@ void wxToolBar::MacSuperChangedPosition()
localOrigin.v = ly ; localOrigin.v = ly ;
localOrigin.h = lx ; localOrigin.h = lx ;
// GetParent()->MacGetPortParams( &localOrigin , &clipRect , &window , &win ) ; // GetParent()->MacGetPortParams( &localOrigin , &clipRect , &window , &win ) ;
Rect toolbarrect = { localOrigin.v ,localOrigin.h , Rect toolbarrect = { localOrigin.v ,localOrigin.h ,
m_height + localOrigin.v , m_width + localOrigin.h} ; m_height + localOrigin.v , m_width + localOrigin.h} ;

View File

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

View File

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

View File

@@ -980,7 +980,7 @@ wxWindowMac *wxGetActiveWindow()
// Coordinates relative to the window // Coordinates relative to the window
void wxWindowMac::WarpPointer (int x_pos, int y_pos) 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() const wxBrush& wxWindowMac::MacGetBackgroundBrush()
@@ -1045,7 +1045,6 @@ const wxBrush& wxWindowMac::MacGetBackgroundBrush()
} }
return m_macBackgroundBrush ; return m_macBackgroundBrush ;
} }
void wxWindowMac::OnEraseBackground(wxEraseEvent& event) void wxWindowMac::OnEraseBackground(wxEraseEvent& event)