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:
@@ -206,22 +206,24 @@ unsigned long wxBrush::GetMacThemeBackground( WXRECTPTR extent) const
|
||||
short wxBrush::GetMacTheme() const
|
||||
{
|
||||
return (M_BRUSHDATA ? ( M_BRUSHDATA->m_macBrushKind == kwxMacBrushTheme ? M_BRUSHDATA->m_macThemeBrush : kThemeBrushBlack) : kThemeBrushBlack);
|
||||
};
|
||||
}
|
||||
|
||||
wxColour& wxBrush::GetColour() const
|
||||
{ return (M_BRUSHDATA ? M_BRUSHDATA->m_colour : wxNullColour); };
|
||||
{
|
||||
return (M_BRUSHDATA ? M_BRUSHDATA->m_colour : wxNullColour);
|
||||
}
|
||||
|
||||
int wxBrush::GetStyle() const
|
||||
{
|
||||
return (M_BRUSHDATA ? M_BRUSHDATA->m_style : 0);
|
||||
};
|
||||
}
|
||||
|
||||
wxBitmap *wxBrush::GetStipple() const
|
||||
{
|
||||
return (M_BRUSHDATA ? & M_BRUSHDATA->m_stipple : 0);
|
||||
};
|
||||
}
|
||||
|
||||
wxMacBrushKind wxBrush::MacGetBrushKind() const
|
||||
{
|
||||
return (M_BRUSHDATA ? M_BRUSHDATA->m_macBrushKind : kwxMacBrushColour);
|
||||
};
|
||||
}
|
@@ -206,22 +206,24 @@ unsigned long wxBrush::GetMacThemeBackground( WXRECTPTR extent) const
|
||||
short wxBrush::GetMacTheme() const
|
||||
{
|
||||
return (M_BRUSHDATA ? ( M_BRUSHDATA->m_macBrushKind == kwxMacBrushTheme ? M_BRUSHDATA->m_macThemeBrush : kThemeBrushBlack) : kThemeBrushBlack);
|
||||
};
|
||||
}
|
||||
|
||||
wxColour& wxBrush::GetColour() const
|
||||
{ return (M_BRUSHDATA ? M_BRUSHDATA->m_colour : wxNullColour); };
|
||||
{
|
||||
return (M_BRUSHDATA ? M_BRUSHDATA->m_colour : wxNullColour);
|
||||
}
|
||||
|
||||
int wxBrush::GetStyle() const
|
||||
{
|
||||
return (M_BRUSHDATA ? M_BRUSHDATA->m_style : 0);
|
||||
};
|
||||
}
|
||||
|
||||
wxBitmap *wxBrush::GetStipple() const
|
||||
{
|
||||
return (M_BRUSHDATA ? & M_BRUSHDATA->m_stipple : 0);
|
||||
};
|
||||
}
|
||||
|
||||
wxMacBrushKind wxBrush::MacGetBrushKind() const
|
||||
{
|
||||
return (M_BRUSHDATA ? M_BRUSHDATA->m_macBrushKind : kwxMacBrushColour);
|
||||
};
|
||||
}
|
@@ -8,17 +8,22 @@
|
||||
// Copyright: (c) Stefan Csomor
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation "choice.h"
|
||||
#endif
|
||||
|
||||
#include "wx/defs.h"
|
||||
#include "wx/choice.h"
|
||||
#include "wx/menu.h"
|
||||
#include "wx/mac/uma.h"
|
||||
|
||||
#if !USE_SHARED_LIBRARY
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxChoice, wxControl)
|
||||
#endif
|
||||
|
||||
extern MenuHandle NewUniqueMenu() ;
|
||||
|
||||
wxChoice::~wxChoice()
|
||||
{
|
||||
if ( HasClientObjectData() )
|
||||
@@ -32,6 +37,7 @@ wxChoice::~wxChoice()
|
||||
// DeleteMenu( m_macPopUpMenuId ) ;
|
||||
// DisposeMenu( m_macPopUpMenuHandle ) ;
|
||||
}
|
||||
|
||||
bool wxChoice::Create(wxWindow *parent, wxWindowID id,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
@@ -60,6 +66,7 @@ bool wxChoice::Create(wxWindow *parent, wxWindowID id,
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// adding/deleting items to/from the list
|
||||
// ----------------------------------------------------------------------------
|
||||
@@ -73,6 +80,7 @@ int wxChoice::DoAppend(const wxString& item)
|
||||
SetControl32BitMaximum( (ControlHandle) m_macControl , GetCount()) ;
|
||||
return index ;
|
||||
}
|
||||
|
||||
void wxChoice::Delete(int n)
|
||||
{
|
||||
wxCHECK_RET( n < GetCount(), wxT("invalid item index in wxChoice::Delete") );
|
||||
@@ -85,6 +93,7 @@ void wxChoice::Delete(int n)
|
||||
m_datas.RemoveAt( n ) ;
|
||||
SetControl32BitMaximum( (ControlHandle) m_macControl , GetCount()) ;
|
||||
}
|
||||
|
||||
void wxChoice::Clear()
|
||||
{
|
||||
FreeData();
|
||||
@@ -96,6 +105,7 @@ void wxChoice::Clear()
|
||||
m_datas.Empty() ;
|
||||
SetControl32BitMaximum( (ControlHandle) m_macControl , 0 ) ;
|
||||
}
|
||||
|
||||
void wxChoice::FreeData()
|
||||
{
|
||||
if ( HasClientObjectData() )
|
||||
@@ -107,6 +117,7 @@ void wxChoice::FreeData()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// selection
|
||||
// ----------------------------------------------------------------------------
|
||||
@@ -114,17 +125,21 @@ int wxChoice::GetSelection() const
|
||||
{
|
||||
return GetControl32BitValue( (ControlHandle) m_macControl ) -1 ;
|
||||
}
|
||||
|
||||
void wxChoice::SetSelection(int n)
|
||||
{
|
||||
SetControl32BitValue( (ControlHandle) m_macControl , n + 1 ) ;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// string list functions
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
int wxChoice::GetCount() const
|
||||
{
|
||||
return m_strings.GetCount() ;
|
||||
}
|
||||
|
||||
int wxChoice::FindString(const wxString& s) const
|
||||
{
|
||||
for( int i = 0 ; i < GetCount() ; i++ )
|
||||
@@ -134,6 +149,7 @@ int wxChoice::FindString(const wxString& s) const
|
||||
}
|
||||
return wxNOT_FOUND ;
|
||||
}
|
||||
|
||||
void wxChoice::SetString(int n, const wxString& s)
|
||||
{
|
||||
wxFAIL_MSG(wxT("wxChoice::SetString() not yet implemented"));
|
||||
@@ -157,20 +173,24 @@ void wxChoice::DoSetItemClientData( int n, void* clientData )
|
||||
|
||||
m_datas[n] = (char*) clientData ;
|
||||
}
|
||||
|
||||
void *wxChoice::DoGetItemClientData(int n) const
|
||||
{
|
||||
wxCHECK_MSG( n >= 0 && (size_t)n < m_datas.GetCount(), NULL,
|
||||
"invalid index in wxChoice::GetClientData" );
|
||||
return (void *)m_datas[n];
|
||||
}
|
||||
|
||||
void wxChoice::DoSetItemClientObject( int n, wxClientData* clientData )
|
||||
{
|
||||
DoSetItemClientData(n, clientData);
|
||||
}
|
||||
|
||||
wxClientData* wxChoice::DoGetItemClientObject( int n ) const
|
||||
{
|
||||
return (wxClientData *)DoGetItemClientData(n);
|
||||
}
|
||||
|
||||
void wxChoice::MacHandleControlClick( WXWidget control , wxInt16 controlpart )
|
||||
{
|
||||
wxCommandEvent event(wxEVT_COMMAND_CHOICE_SELECTED, m_windowId );
|
||||
@@ -188,6 +208,7 @@ void wxChoice::MacHandleControlClick( WXWidget control , wxInt16 controlpart )
|
||||
ProcessCommand(event);
|
||||
}
|
||||
}
|
||||
|
||||
wxSize wxChoice::DoGetBestSize() const
|
||||
{
|
||||
int lbWidth = 100; // some defaults
|
||||
|
@@ -895,11 +895,10 @@ void wxControl::OnMouseEvent( wxMouseEvent &event )
|
||||
|
||||
bool wxControl::MacCanFocus() const
|
||||
{
|
||||
{ if ( (ControlHandle) m_macControl == NULL )
|
||||
if ( (ControlHandle) m_macControl == NULL )
|
||||
return true ;
|
||||
else
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
|
||||
void wxControl::MacHandleControlClick( WXWidget control , wxInt16 controlpart )
|
||||
|
@@ -8,9 +8,11 @@
|
||||
// Copyright: (c) Stefan Csomor
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation "dc.h"
|
||||
#endif
|
||||
|
||||
#include "wx/dc.h"
|
||||
#include "wx/app.h"
|
||||
#include "wx/mac/uma.h"
|
||||
@@ -30,9 +32,11 @@ using namespace std ;
|
||||
#if !USE_SHARED_LIBRARY
|
||||
IMPLEMENT_ABSTRACT_CLASS(wxDC, wxObject)
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// constants
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#define mm2inches 0.0393700787402
|
||||
#define inches2mm 25.4
|
||||
#define mm2twips 56.6929133859
|
||||
@@ -45,6 +49,7 @@ const double M_PI = 3.14159265358979 ;
|
||||
const double RAD2DEG = 180.0 / M_PI;
|
||||
const short kEmulatedMode = -1 ;
|
||||
const short kUnsupportedMode = -2 ;
|
||||
|
||||
wxMacPortSetter::wxMacPortSetter( const wxDC* dc ) :
|
||||
m_ph( (GrafPtr) dc->m_macPort )
|
||||
{
|
||||
@@ -52,10 +57,12 @@ wxMacPortSetter::wxMacPortSetter( const wxDC* dc ) :
|
||||
m_dc = dc ;
|
||||
dc->MacSetupPort(&m_ph) ;
|
||||
}
|
||||
|
||||
wxMacPortSetter::~wxMacPortSetter()
|
||||
{
|
||||
m_dc->MacCleanupPort(&m_ph) ;
|
||||
}
|
||||
|
||||
wxMacWindowClipper::wxMacWindowClipper( const wxWindow* win )
|
||||
{
|
||||
m_formerClip = NewRgn() ;
|
||||
@@ -89,24 +96,28 @@ wxMacWindowClipper::wxMacWindowClipper( const wxWindow* win )
|
||||
SetClip( m_newClip ) ;
|
||||
}
|
||||
}
|
||||
|
||||
wxMacWindowClipper::~wxMacWindowClipper()
|
||||
{
|
||||
SetClip( m_formerClip ) ;
|
||||
DisposeRgn( m_newClip ) ;
|
||||
DisposeRgn( m_formerClip ) ;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Local functions
|
||||
//-----------------------------------------------------------------------------
|
||||
static inline double dmin(double a, double b) { return a < b ? a : b; }
|
||||
static inline double dmax(double a, double b) { return a > b ? a : b; }
|
||||
static inline double DegToRad(double deg) { return (deg * M_PI) / 180.0; }
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxDC
|
||||
//-----------------------------------------------------------------------------
|
||||
// this function emulates all wx colour manipulations, used to verify the implementation
|
||||
// by setting the mode in the blitting functions to kEmulatedMode
|
||||
void wxMacCalculateColour( int logical_func , const RGBColor &srcColor , RGBColor &dstColor ) ;
|
||||
|
||||
void wxMacCalculateColour( int logical_func , const RGBColor &srcColor , RGBColor &dstColor )
|
||||
{
|
||||
switch ( logical_func )
|
||||
@@ -190,6 +201,7 @@ void wxMacCalculateColour( int logical_func , const RGBColor &srcColor , RGBColo
|
||||
break ;
|
||||
}
|
||||
}
|
||||
|
||||
wxDC::wxDC()
|
||||
{
|
||||
m_ok = FALSE;
|
||||
@@ -228,11 +240,13 @@ wxDC::wxDC()
|
||||
m_macForegroundPixMap = NULL ;
|
||||
m_macBackgroundPixMap = NULL ;
|
||||
}
|
||||
|
||||
wxDC::~wxDC(void)
|
||||
{
|
||||
DisposeRgn( (RgnHandle) m_macBoundaryClipRgn ) ;
|
||||
DisposeRgn( (RgnHandle) m_macCurrentClipRgn ) ;
|
||||
}
|
||||
|
||||
void wxDC::MacSetupPort(wxMacPortStateHelper* help) const
|
||||
{
|
||||
wxASSERT( m_macCurrentPortStateHelper == NULL ) ;
|
||||
@@ -242,6 +256,7 @@ void wxDC::MacSetupPort(wxMacPortStateHelper* help) const
|
||||
m_macBrushInstalled = false ;
|
||||
m_macPenInstalled = false ;
|
||||
}
|
||||
|
||||
void wxDC::MacCleanupPort(wxMacPortStateHelper* help) const
|
||||
{
|
||||
wxASSERT( m_macCurrentPortStateHelper == help ) ;
|
||||
@@ -271,6 +286,7 @@ void wxDC::MacCleanupPort(wxMacPortStateHelper* help) const
|
||||
m_macBackgroundPixMap = NULL ;
|
||||
}
|
||||
}
|
||||
|
||||
void wxDC::DoDrawBitmap( const wxBitmap &bmp, wxCoord x, wxCoord y, bool useMask )
|
||||
{
|
||||
wxCHECK_RET( Ok(), wxT("invalid window dc") );
|
||||
@@ -356,12 +372,14 @@ void wxDC::DoDrawBitmap( const wxBitmap &bmp, wxCoord x, wxCoord y, bool useMask
|
||||
m_macBrushInstalled = false ;
|
||||
m_macFontInstalled = false ;
|
||||
}
|
||||
|
||||
void wxDC::DoDrawIcon( const wxIcon &icon, wxCoord x, wxCoord y )
|
||||
{
|
||||
wxCHECK_RET(Ok(), wxT("Invalid dc wxDC::DoDrawIcon"));
|
||||
wxCHECK_RET(icon.Ok(), wxT("Invalid icon wxDC::DoDrawIcon"));
|
||||
DoDrawBitmap( icon , x , y , icon.GetMask() != NULL ) ;
|
||||
}
|
||||
|
||||
void wxDC::DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
|
||||
{
|
||||
wxCHECK_RET(Ok(), wxT("wxDC::DoSetClippingRegion Invalid DC"));
|
||||
@@ -388,6 +406,7 @@ void wxDC::DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoord hei
|
||||
m_clipY2 = yy + hh;
|
||||
}
|
||||
}
|
||||
|
||||
void wxDC::DoSetClippingRegionAsRegion( const wxRegion ®ion )
|
||||
{
|
||||
wxCHECK_RET( Ok(), wxT("invalid window dc") ) ;
|
||||
@@ -435,17 +454,20 @@ void wxDC::DoSetClippingRegionAsRegion( const wxRegion ®ion )
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void wxDC::DestroyClippingRegion()
|
||||
{
|
||||
wxMacPortSetter helper(this) ;
|
||||
CopyRgn( (RgnHandle) m_macBoundaryClipRgn , (RgnHandle) m_macCurrentClipRgn ) ;
|
||||
m_clipping = FALSE;
|
||||
}
|
||||
|
||||
void wxDC::DoGetSize( int* width, int* height ) const
|
||||
{
|
||||
*width = m_maxX-m_minX;
|
||||
*height = m_maxY-m_minY;
|
||||
}
|
||||
|
||||
void wxDC::DoGetSizeMM( int* width, int* height ) const
|
||||
{
|
||||
int w = 0;
|
||||
@@ -454,18 +476,21 @@ void wxDC::DoGetSizeMM( int* width, int* height ) const
|
||||
*width = long( double(w) / (m_scaleX*m_mm_to_pix_x) );
|
||||
*height = long( double(h) / (m_scaleY*m_mm_to_pix_y) );
|
||||
}
|
||||
|
||||
void wxDC::SetTextForeground( const wxColour &col )
|
||||
{
|
||||
wxCHECK_RET(Ok(), wxT("Invalid DC"));
|
||||
m_textForegroundColour = col;
|
||||
m_macFontInstalled = false ;
|
||||
}
|
||||
|
||||
void wxDC::SetTextBackground( const wxColour &col )
|
||||
{
|
||||
wxCHECK_RET(Ok(), wxT("Invalid DC"));
|
||||
m_textBackgroundColour = col;
|
||||
m_macFontInstalled = false ;
|
||||
}
|
||||
|
||||
void wxDC::SetMapMode( int mode )
|
||||
{
|
||||
switch (mode)
|
||||
@@ -493,6 +518,7 @@ void wxDC::SetMapMode( int mode )
|
||||
m_needComputeScaleY = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
void wxDC::SetUserScale( double x, double y )
|
||||
{
|
||||
// allow negative ? -> no
|
||||
@@ -500,6 +526,7 @@ void wxDC::SetUserScale( double x, double y )
|
||||
m_userScaleY = y;
|
||||
ComputeScaleAndOrigin();
|
||||
}
|
||||
|
||||
void wxDC::SetLogicalScale( double x, double y )
|
||||
{
|
||||
// allow negative ?
|
||||
@@ -507,18 +534,21 @@ void wxDC::SetLogicalScale( double x, double y )
|
||||
m_logicalScaleY = y;
|
||||
ComputeScaleAndOrigin();
|
||||
}
|
||||
|
||||
void wxDC::SetLogicalOrigin( wxCoord x, wxCoord y )
|
||||
{
|
||||
m_logicalOriginX = x * m_signX; // is this still correct ?
|
||||
m_logicalOriginY = y * m_signY;
|
||||
ComputeScaleAndOrigin();
|
||||
}
|
||||
|
||||
void wxDC::SetDeviceOrigin( wxCoord x, wxCoord y )
|
||||
{
|
||||
m_externalDeviceOriginX = x;
|
||||
m_externalDeviceOriginY = y;
|
||||
ComputeScaleAndOrigin();
|
||||
}
|
||||
|
||||
#if 0
|
||||
void wxDC::SetInternalDeviceOrigin( long x, long y )
|
||||
{
|
||||
@@ -532,16 +562,19 @@ void wxDC::GetInternalDeviceOrigin( long *x, long *y )
|
||||
if (y) *y = m_internalDeviceOriginY;
|
||||
}
|
||||
#endif
|
||||
|
||||
void wxDC::SetAxisOrientation( bool xLeftRight, bool yBottomUp )
|
||||
{
|
||||
m_signX = (xLeftRight ? 1 : -1);
|
||||
m_signY = (yBottomUp ? -1 : 1);
|
||||
ComputeScaleAndOrigin();
|
||||
}
|
||||
|
||||
wxSize wxDC::GetPPI() const
|
||||
{
|
||||
return wxSize(72, 72);
|
||||
}
|
||||
|
||||
int wxDC::GetDepth() const
|
||||
{
|
||||
if ( IsPortColor( (CGrafPtr) m_macPort ) )
|
||||
@@ -550,6 +583,7 @@ int wxDC::GetDepth() const
|
||||
}
|
||||
return 1 ;
|
||||
}
|
||||
|
||||
void wxDC::ComputeScaleAndOrigin()
|
||||
{
|
||||
// CMB: copy scale to see if it changes
|
||||
@@ -570,18 +604,22 @@ void wxDC::ComputeScaleAndOrigin()
|
||||
SetPen(* pen);
|
||||
}
|
||||
}
|
||||
|
||||
void wxDC::SetPalette( const wxPalette& palette )
|
||||
{
|
||||
}
|
||||
|
||||
void wxDC::SetBackgroundMode( int mode )
|
||||
{
|
||||
m_backgroundMode = mode ;
|
||||
}
|
||||
|
||||
void wxDC::SetFont( const wxFont &font )
|
||||
{
|
||||
m_font = font;
|
||||
m_macFontInstalled = false ;
|
||||
}
|
||||
|
||||
void wxDC::SetPen( const wxPen &pen )
|
||||
{
|
||||
if ( m_pen == pen )
|
||||
@@ -589,6 +627,7 @@ void wxDC::SetPen( const wxPen &pen )
|
||||
m_pen = pen;
|
||||
m_macPenInstalled = false ;
|
||||
}
|
||||
|
||||
void wxDC::SetBrush( const wxBrush &brush )
|
||||
{
|
||||
if (m_brush == brush)
|
||||
@@ -596,6 +635,7 @@ void wxDC::SetBrush( const wxBrush &brush )
|
||||
m_brush = brush;
|
||||
m_macBrushInstalled = false ;
|
||||
}
|
||||
|
||||
void wxDC::SetBackground( const wxBrush &brush )
|
||||
{
|
||||
if (m_backgroundBrush == brush)
|
||||
@@ -605,6 +645,7 @@ void wxDC::SetBackground( const wxBrush &brush )
|
||||
return;
|
||||
m_macBrushInstalled = false ;
|
||||
}
|
||||
|
||||
void wxDC::SetLogicalFunction( int function )
|
||||
{
|
||||
if (m_logicalFunction == function)
|
||||
@@ -614,13 +655,16 @@ void wxDC::SetLogicalFunction( int function )
|
||||
m_macBrushInstalled = false ;
|
||||
m_macPenInstalled = false ;
|
||||
}
|
||||
|
||||
extern bool wxDoFloodFill(wxDC *dc, wxCoord x, wxCoord y,
|
||||
const wxColour & col, int style);
|
||||
|
||||
bool wxDC::DoFloodFill(wxCoord x, wxCoord y,
|
||||
const wxColour& col, int style)
|
||||
{
|
||||
return wxDoFloodFill(this, x, y, col, style);
|
||||
}
|
||||
|
||||
bool wxDC::DoGetPixel( wxCoord x, wxCoord y, wxColour *col ) const
|
||||
{
|
||||
wxCHECK_MSG( Ok(), false, wxT("wxDC::DoGetPixel Invalid DC") );
|
||||
@@ -633,6 +677,7 @@ bool wxDC::DoGetPixel( wxCoord x, wxCoord y, wxColour *col ) const
|
||||
colour.blue >> 8);
|
||||
return true ;
|
||||
}
|
||||
|
||||
void wxDC::DoDrawLine( wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2 )
|
||||
{
|
||||
wxCHECK_RET(Ok(), wxT("Invalid DC"));
|
||||
@@ -670,6 +715,7 @@ void wxDC::DoDrawLine( wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2 )
|
||||
::LineTo(xx2, yy2);
|
||||
}
|
||||
}
|
||||
|
||||
void wxDC::DoCrossHair( wxCoord x, wxCoord y )
|
||||
{
|
||||
wxCHECK_RET( Ok(), wxT("wxDC::DoCrossHair Invalid window dc") );
|
||||
@@ -690,14 +736,16 @@ void wxDC::DoCrossHair( wxCoord x, wxCoord y )
|
||||
CalcBoundingBox(x+w, y+h);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* To draw arcs properly the angles need to be converted from the WX style:
|
||||
* Angles start on the +ve X axis and go anti-clockwise (As you would draw on
|
||||
* a normal axis on paper).
|
||||
* TO
|
||||
* the Mac style:
|
||||
* Angles start on the +ve y axis and go clockwise.
|
||||
*/
|
||||
* 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
|
||||
* a normal axis on paper).
|
||||
* TO
|
||||
* the Mac style:
|
||||
* Angles start on the +ve y axis and go clockwise.
|
||||
*/
|
||||
|
||||
static double wxConvertWXangleToMACangle(double angle)
|
||||
{
|
||||
double newAngle = 90 - angle ;
|
||||
@@ -705,6 +753,7 @@ static double wxConvertWXangleToMACangle(double angle)
|
||||
newAngle += 360 ;
|
||||
return newAngle ;
|
||||
}
|
||||
|
||||
void wxDC::DoDrawArc( wxCoord x1, wxCoord y1,
|
||||
wxCoord x2, wxCoord y2,
|
||||
wxCoord xc, wxCoord yc )
|
||||
@@ -755,6 +804,7 @@ void wxDC::DoDrawArc( wxCoord x1, wxCoord y1,
|
||||
FrameArc(&r, alpha1, alpha2);
|
||||
}
|
||||
}
|
||||
|
||||
void wxDC::DoDrawEllipticArc( wxCoord x, wxCoord y, wxCoord w, wxCoord h,
|
||||
double sa, double ea )
|
||||
{
|
||||
@@ -786,6 +836,7 @@ void wxDC::DoDrawEllipticArc( wxCoord x, wxCoord y, wxCoord w, wxCoord h,
|
||||
FrameArc(&r, (short)sa, (short)angle);
|
||||
}
|
||||
}
|
||||
|
||||
void wxDC::DoDrawPoint( wxCoord x, wxCoord y )
|
||||
{
|
||||
wxCHECK_RET(Ok(), wxT("Invalid DC"));
|
||||
@@ -799,6 +850,7 @@ void wxDC::DoDrawPoint( wxCoord x, wxCoord y )
|
||||
CalcBoundingBox(x, y);
|
||||
}
|
||||
}
|
||||
|
||||
void wxDC::DoDrawLines(int n, wxPoint points[],
|
||||
wxCoord xoffset, wxCoord yoffset)
|
||||
{
|
||||
@@ -820,6 +872,7 @@ void wxDC::DoDrawLines(int n, wxPoint points[],
|
||||
::LineTo( x2 - offset, y2 - offset );
|
||||
}
|
||||
}
|
||||
|
||||
void wxDC::DoDrawPolygon(int n, wxPoint points[],
|
||||
wxCoord xoffset, wxCoord yoffset,
|
||||
int fillStyle )
|
||||
@@ -857,6 +910,7 @@ void wxDC::DoDrawPolygon(int n, wxPoint points[],
|
||||
}
|
||||
KillPoly( polygon );
|
||||
}
|
||||
|
||||
void wxDC::DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
|
||||
{
|
||||
wxCHECK_RET(Ok(), wxT("Invalid DC"));
|
||||
@@ -891,6 +945,7 @@ void wxDC::DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
|
||||
::FrameRect( &rect ) ;
|
||||
}
|
||||
}
|
||||
|
||||
void wxDC::DoDrawRoundedRectangle(wxCoord x, wxCoord y,
|
||||
wxCoord width, wxCoord height,
|
||||
double radius)
|
||||
@@ -929,6 +984,7 @@ void wxDC::DoDrawRoundedRectangle(wxCoord x, wxCoord y,
|
||||
::FrameRoundRect( &rect , int(radius * 2) , int(radius * 2) ) ;
|
||||
}
|
||||
}
|
||||
|
||||
void wxDC::DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
|
||||
{
|
||||
wxCHECK_RET(Ok(), wxT("Invalid DC"));
|
||||
@@ -964,7 +1020,6 @@ void wxDC::DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool wxDC::CanDrawBitmap(void) const
|
||||
{
|
||||
return true ;
|
||||
@@ -1217,14 +1272,16 @@ bool wxDC::DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height,
|
||||
m_macFontInstalled = false ;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
inline Fixed IntToFixed( int inInt )
|
||||
{
|
||||
{
|
||||
return (((SInt32) inInt) << 16);
|
||||
}
|
||||
}
|
||||
|
||||
inline int FixedToInt( Fixed inFixed )
|
||||
{
|
||||
{
|
||||
return (((SInt32) inFixed) >> 16);
|
||||
}
|
||||
}
|
||||
|
||||
void wxDC::DoDrawRotatedText(const wxString& str, wxCoord x, wxCoord y,
|
||||
double angle)
|
||||
@@ -1319,6 +1376,7 @@ void wxDC::DoDrawRotatedText(const wxString& str, wxCoord x, wxCoord y,
|
||||
::ATSUDisposeTextLayout(atsuLayout);
|
||||
delete[] buf ;
|
||||
}
|
||||
|
||||
void wxDC::DoDrawText(const wxString& strtext, wxCoord x, wxCoord y)
|
||||
{
|
||||
wxCHECK_RET(Ok(), wxT("wxDC::DoDrawText Invalid DC"));
|
||||
@@ -1452,11 +1510,13 @@ void wxDC::DoDrawText(const wxString& strtext, wxCoord x, wxCoord y)
|
||||
}
|
||||
::TextMode( srcOr ) ;
|
||||
}
|
||||
|
||||
bool wxDC::CanGetTextExtent() const
|
||||
{
|
||||
wxCHECK_MSG(Ok(), false, wxT("Invalid DC"));
|
||||
return true ;
|
||||
}
|
||||
|
||||
void wxDC::DoGetTextExtent( const wxString &string, wxCoord *width, wxCoord *height,
|
||||
wxCoord *descent, wxCoord *externalLeading ,
|
||||
wxFont *theFont ) const
|
||||
@@ -1566,6 +1626,7 @@ void wxDC::DoGetTextExtent( const wxString &string, wxCoord *width, wxCoord *he
|
||||
m_macFontInstalled = false ;
|
||||
}
|
||||
}
|
||||
|
||||
wxCoord wxDC::GetCharWidth(void) const
|
||||
{
|
||||
wxCHECK_MSG(Ok(), 1, wxT("Invalid DC"));
|
||||
@@ -1600,6 +1661,7 @@ wxCoord wxDC::GetCharWidth(void) const
|
||||
}
|
||||
return YDEV2LOGREL(width) ;
|
||||
}
|
||||
|
||||
wxCoord wxDC::GetCharHeight(void) const
|
||||
{
|
||||
wxCHECK_MSG(Ok(), 1, wxT("Invalid DC"));
|
||||
@@ -1609,6 +1671,7 @@ wxCoord wxDC::GetCharHeight(void) const
|
||||
::GetFontInfo( &fi ) ;
|
||||
return YDEV2LOGREL( fi.descent + fi.ascent );
|
||||
}
|
||||
|
||||
void wxDC::Clear(void)
|
||||
{
|
||||
wxCHECK_RET(Ok(), wxT("Invalid DC"));
|
||||
@@ -1622,11 +1685,12 @@ void wxDC::Clear(void)
|
||||
::EraseRect( &rect ) ;
|
||||
}
|
||||
}
|
||||
|
||||
void wxDC::MacInstallFont() const
|
||||
{
|
||||
wxCHECK_RET(Ok(), wxT("Invalid DC"));
|
||||
// if ( m_macFontInstalled )
|
||||
// return ;
|
||||
// if ( m_macFontInstalled )
|
||||
// return ;
|
||||
Pattern blackColor ;
|
||||
MacSetupBackgroundForCurrentPort(m_backgroundBrush) ;
|
||||
wxFontRefData * font = (wxFontRefData*) m_font.GetRefData() ;
|
||||
@@ -1695,8 +1759,8 @@ void wxDC::MacInstallFont() const
|
||||
case wxNAND: // (NOT src) OR (NOT dst)
|
||||
case wxOR: // src OR dst
|
||||
case wxSET: // 1
|
||||
// case wxSRC_OR: // source _bitmap_ OR destination
|
||||
// case wxSRC_AND: // source _bitmap_ AND destination
|
||||
// case wxSRC_OR: // source _bitmap_ OR destination
|
||||
// case wxSRC_AND: // source _bitmap_ AND destination
|
||||
break ;
|
||||
}
|
||||
::PenMode( mode ) ;
|
||||
@@ -1710,8 +1774,8 @@ void wxDC::MacInstallFont() const
|
||||
{
|
||||
kATSUFontTag ,
|
||||
kATSUSizeTag ,
|
||||
// kATSUColorTag ,
|
||||
// kATSUBaselineClassTag ,
|
||||
// kATSUColorTag ,
|
||||
// kATSUBaselineClassTag ,
|
||||
kATSUVerticalCharacterTag,
|
||||
kATSUQDBoldfaceTag ,
|
||||
kATSUQDItalicTag ,
|
||||
@@ -1723,8 +1787,8 @@ void wxDC::MacInstallFont() const
|
||||
{
|
||||
sizeof( ATSUFontID ) ,
|
||||
sizeof( Fixed ) ,
|
||||
// sizeof( RGBColor ) ,
|
||||
// sizeof( BslnBaselineClass ) ,
|
||||
// sizeof( RGBColor ) ,
|
||||
// sizeof( BslnBaselineClass ) ,
|
||||
sizeof( ATSUVerticalCharacterType),
|
||||
sizeof( Boolean ) ,
|
||||
sizeof( Boolean ) ,
|
||||
@@ -1740,8 +1804,8 @@ void wxDC::MacInstallFont() const
|
||||
{
|
||||
&atsuFont ,
|
||||
&atsuSize ,
|
||||
// &MAC_WXCOLORREF( m_textForegroundColour.GetPixel() ) ,
|
||||
// &kBaselineDefault ,
|
||||
// &MAC_WXCOLORREF( m_textForegroundColour.GetPixel() ) ,
|
||||
// &kBaselineDefault ,
|
||||
&kHorizontal,
|
||||
(qdStyle & bold) ? &kTrue : &kFalse ,
|
||||
(qdStyle & italic) ? &kTrue : &kFalse ,
|
||||
@@ -1753,6 +1817,7 @@ void wxDC::MacInstallFont() const
|
||||
atsuTags, atsuSizes, atsuValues);
|
||||
wxASSERT_MSG( status == noErr , "couldn't set create ATSU style" ) ;
|
||||
}
|
||||
|
||||
Pattern gHatchPatterns[] =
|
||||
{
|
||||
{ { 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF } },
|
||||
@@ -1763,6 +1828,7 @@ Pattern gHatchPatterns[] =
|
||||
{ { 0x10 , 0x10 , 0x10 , 0x10 , 0x10 , 0x10 , 0x10 , 0x10 } },
|
||||
{ { 0x81 , 0x42 , 0x24 , 0x18 , 0x18 , 0x24 , 0x42 , 0x81 } }
|
||||
} ;
|
||||
|
||||
static void wxMacGetHatchPattern(int hatchStyle, Pattern *pattern)
|
||||
{
|
||||
int theIndex = 1 ;
|
||||
@@ -1792,12 +1858,13 @@ static void wxMacGetHatchPattern(int hatchStyle, Pattern *pattern)
|
||||
}
|
||||
*pattern = gHatchPatterns[theIndex-1] ;
|
||||
}
|
||||
|
||||
void wxDC::MacInstallPen() const
|
||||
{
|
||||
wxCHECK_RET(Ok(), wxT("Invalid DC"));
|
||||
Pattern blackColor;
|
||||
// if ( m_macPenInstalled )
|
||||
// return ;
|
||||
// if ( m_macPenInstalled )
|
||||
// return ;
|
||||
RGBColor forecolor = MAC_WXCOLORREF( m_pen.GetColour().GetPixel());
|
||||
RGBColor backcolor = MAC_WXCOLORREF( m_backgroundBrush.GetColour().GetPixel());
|
||||
::RGBForeColor( &forecolor );
|
||||
@@ -1872,7 +1939,7 @@ void wxDC::MacInstallPen() const
|
||||
mode = patOr ;
|
||||
break ;
|
||||
case wxINVERT: // NOT dst
|
||||
// ::PenPat(GetQDGlobalsBlack(&blackColor));
|
||||
// ::PenPat(GetQDGlobalsBlack(&blackColor));
|
||||
mode = patXor ;
|
||||
break ;
|
||||
case wxXOR: // src XOR dst
|
||||
@@ -1896,8 +1963,8 @@ void wxDC::MacInstallPen() const
|
||||
case wxNAND: // (NOT src) OR (NOT dst)
|
||||
case wxOR: // src OR dst
|
||||
case wxSET: // 1
|
||||
// case wxSRC_OR: // source _bitmap_ OR destination
|
||||
// case wxSRC_AND: // source _bitmap_ AND destination
|
||||
// case wxSRC_OR: // source _bitmap_ OR destination
|
||||
// case wxSRC_AND: // source _bitmap_ AND destination
|
||||
break ;
|
||||
}
|
||||
::PenMode( mode ) ;
|
||||
@@ -1905,6 +1972,7 @@ void wxDC::MacInstallPen() const
|
||||
m_macBrushInstalled = false ;
|
||||
m_macFontInstalled = false ;
|
||||
}
|
||||
|
||||
void wxDC::MacSetupBackgroundForCurrentPort(const wxBrush& background )
|
||||
{
|
||||
Pattern whiteColor ;
|
||||
@@ -1942,12 +2010,13 @@ void wxDC::MacSetupBackgroundForCurrentPort(const wxBrush& background )
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void wxDC::MacInstallBrush() const
|
||||
{
|
||||
wxCHECK_RET(Ok(), wxT("Invalid DC"));
|
||||
Pattern blackColor ;
|
||||
// if ( m_macBrushInstalled )
|
||||
// return ;
|
||||
// if ( m_macBrushInstalled )
|
||||
// return ;
|
||||
// foreground
|
||||
bool backgroundTransparent = (GetBackgroundMode() == wxTRANSPARENT) ;
|
||||
::RGBForeColor( &MAC_WXCOLORREF( m_brush.GetColour().GetPixel()) );
|
||||
@@ -2074,8 +2143,8 @@ void wxDC::MacInstallBrush() const
|
||||
case wxNAND: // (NOT src) OR (NOT dst)
|
||||
case wxOR: // src OR dst
|
||||
case wxSET: // 1
|
||||
// case wxSRC_OR: // source _bitmap_ OR destination
|
||||
// case wxSRC_AND: // source _bitmap_ AND destination
|
||||
// case wxSRC_OR: // source _bitmap_ OR destination
|
||||
// case wxSRC_AND: // source _bitmap_ AND destination
|
||||
break ;
|
||||
}
|
||||
::PenMode( mode ) ;
|
||||
@@ -2083,6 +2152,7 @@ void wxDC::MacInstallBrush() const
|
||||
m_macPenInstalled = false ;
|
||||
m_macFontInstalled = false ;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// coordinates transformations
|
||||
// ---------------------------------------------------------------------------
|
||||
@@ -2091,30 +2161,37 @@ wxCoord wxDCBase::DeviceToLogicalX(wxCoord x) const
|
||||
{
|
||||
return ((wxDC *)this)->XDEV2LOG(x);
|
||||
}
|
||||
|
||||
wxCoord wxDCBase::DeviceToLogicalY(wxCoord y) const
|
||||
{
|
||||
return ((wxDC *)this)->YDEV2LOG(y);
|
||||
}
|
||||
|
||||
wxCoord wxDCBase::DeviceToLogicalXRel(wxCoord x) const
|
||||
{
|
||||
return ((wxDC *)this)->XDEV2LOGREL(x);
|
||||
}
|
||||
|
||||
wxCoord wxDCBase::DeviceToLogicalYRel(wxCoord y) const
|
||||
{
|
||||
return ((wxDC *)this)->YDEV2LOGREL(y);
|
||||
}
|
||||
|
||||
wxCoord wxDCBase::LogicalToDeviceX(wxCoord x) const
|
||||
{
|
||||
return ((wxDC *)this)->XLOG2DEV(x);
|
||||
}
|
||||
|
||||
wxCoord wxDCBase::LogicalToDeviceY(wxCoord y) const
|
||||
{
|
||||
return ((wxDC *)this)->YLOG2DEV(y);
|
||||
}
|
||||
|
||||
wxCoord wxDCBase::LogicalToDeviceXRel(wxCoord x) const
|
||||
{
|
||||
return ((wxDC *)this)->XLOG2DEVREL(x);
|
||||
}
|
||||
|
||||
wxCoord wxDCBase::LogicalToDeviceYRel(wxCoord y) const
|
||||
{
|
||||
return ((wxDC *)this)->YLOG2DEVREL(y);
|
||||
|
@@ -23,7 +23,7 @@
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxMemoryDC,wxPaintDC)
|
||||
|
||||
wxMemoryDC::wxMemoryDC(void)
|
||||
: m_selected()
|
||||
: m_selected()
|
||||
{
|
||||
m_ok = TRUE;
|
||||
SetBackground(*wxWHITE_BRUSH);
|
||||
@@ -33,7 +33,7 @@ wxMemoryDC::wxMemoryDC(void)
|
||||
};
|
||||
|
||||
wxMemoryDC::wxMemoryDC( wxDC *WXUNUSED(dc) )
|
||||
: m_selected()
|
||||
: m_selected()
|
||||
{
|
||||
m_ok = TRUE;
|
||||
SetBackground(*wxWHITE_BRUSH);
|
||||
|
@@ -57,7 +57,6 @@ bool wxDialog::Create(wxWindow *parent, wxWindowID id,
|
||||
long style,
|
||||
const wxString& name)
|
||||
{
|
||||
|
||||
SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE));
|
||||
|
||||
|
||||
@@ -68,6 +67,7 @@ bool wxDialog::Create(wxWindow *parent, wxWindowID id,
|
||||
|
||||
m_macWindowBackgroundTheme = kThemeBrushDialogBackgroundActive ;
|
||||
SetThemeWindowBackground( (WindowRef) m_macWindow , m_macWindowBackgroundTheme , false ) ;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -96,8 +96,7 @@ wxDialog::~wxDialog()
|
||||
// By default, pressing escape cancels the dialog , on mac command-stop does the same thing
|
||||
void wxDialog::OnCharHook(wxKeyEvent& event)
|
||||
{
|
||||
if (
|
||||
( event.m_keyCode == WXK_ESCAPE ||
|
||||
if (( event.m_keyCode == WXK_ESCAPE ||
|
||||
( event.m_keyCode == '.' && event.MetaDown() ) )
|
||||
&& FindWindow(wxID_CANCEL) )
|
||||
{
|
||||
|
@@ -121,7 +121,6 @@ wxFrame::~wxFrame()
|
||||
m_isBeingDeleted = TRUE;
|
||||
|
||||
DeleteAllBars();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@@ -34,14 +34,14 @@
|
||||
#include "wx/mac/uma.h"
|
||||
|
||||
/*
|
||||
* GLContext implementation
|
||||
*/
|
||||
* GLContext implementation
|
||||
*/
|
||||
|
||||
wxGLContext::wxGLContext(
|
||||
AGLPixelFormat fmt, wxGLCanvas *win,
|
||||
const wxPalette& palette,
|
||||
const wxGLContext *other /* for sharing display lists */
|
||||
)
|
||||
)
|
||||
{
|
||||
m_window = win;
|
||||
|
||||
@@ -108,8 +108,8 @@ void wxGLContext::SetColour(const char *colour)
|
||||
|
||||
|
||||
/*
|
||||
* wxGLCanvas implementation
|
||||
*/
|
||||
* wxGLCanvas implementation
|
||||
*/
|
||||
|
||||
IMPLEMENT_CLASS(wxGLCanvas, wxWindow)
|
||||
|
||||
|
@@ -104,12 +104,12 @@ bool wxICONResourceHandler::LoadFile(wxBitmap *bitmap, const wxString& name, lo
|
||||
Str255 theName ;
|
||||
OSType theType ;
|
||||
|
||||
#if TARGET_CARBON
|
||||
#if TARGET_CARBON
|
||||
c2pstrcpy( (StringPtr) theName , name ) ;
|
||||
#else
|
||||
#else
|
||||
strcpy( (char *) theName , name ) ;
|
||||
c2pstr( (char *) theName ) ;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
Handle resHandle = GetNamedResource( 'cicn' , theName ) ;
|
||||
if ( resHandle != 0L )
|
||||
|
@@ -24,7 +24,7 @@
|
||||
#include "wx/utils.h"
|
||||
|
||||
#if !USE_SHARED_LIBRARY
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxListBox, wxControl)
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxListBox, wxControl)
|
||||
|
||||
BEGIN_EVENT_TABLE(wxListBox, wxControl)
|
||||
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"));
|
||||
#else // !wxUSE_OWNER_DRAWN
|
||||
Append( choices[i] , clientData[i] ) ;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
else
|
||||
Append( choices[i] ) ;
|
||||
@@ -704,7 +704,7 @@ void wxListBox::SetupColours()
|
||||
void wxListBox::Refresh(bool eraseBack, const wxRect *rect)
|
||||
{
|
||||
wxControl::Refresh( eraseBack , rect ) ;
|
||||
// MacRedrawControl() ;
|
||||
// MacRedrawControl() ;
|
||||
}
|
||||
|
||||
#if wxUSE_OWNER_DRAWN
|
||||
@@ -735,9 +735,9 @@ wxOwnerDrawn *wxListBox::CreateItem(size_t n)
|
||||
/*
|
||||
void MacDrawStringCell(Rect *cellRect, Cell lCell, ListHandle theList, long refCon)
|
||||
{
|
||||
wxListBox* list;
|
||||
// typecast our refCon
|
||||
list = (wxListBox*)refCon;
|
||||
wxListBox* list;
|
||||
// typecast our refCon
|
||||
list = (wxListBox*)refCon;
|
||||
|
||||
MoveTo(cellRect->left + 4 , cellRect->top + 10 );
|
||||
const wxString text = list->m_stringArray[lCell.v] ;
|
||||
@@ -746,7 +746,7 @@ void MacDrawStringCell(Rect *cellRect, Cell lCell, ListHandle theList, long refC
|
||||
::TextFace( 0 ) ;
|
||||
DrawText(text, 0 , text.Length());
|
||||
|
||||
}
|
||||
}
|
||||
*/
|
||||
void wxListBox::MacDelete( int N )
|
||||
{
|
||||
@@ -759,7 +759,7 @@ void wxListBox::MacInsert( int n , const char * text)
|
||||
Cell cell = { 0 , 0 } ;
|
||||
cell.v = n ;
|
||||
LAddRow( 1 , cell.v , (ListHandle)m_macList ) ;
|
||||
// LSetCell(text, strlen(text), cell, m_macList);
|
||||
// LSetCell(text, strlen(text), cell, m_macList);
|
||||
Refresh();
|
||||
}
|
||||
|
||||
@@ -804,7 +804,7 @@ bool wxListBox::MacIsSelected( int n ) const
|
||||
|
||||
void wxListBox::MacDestroy()
|
||||
{
|
||||
// DisposeExtLDEFInfo( m_macList ) ;
|
||||
// DisposeExtLDEFInfo( m_macList ) ;
|
||||
}
|
||||
|
||||
int wxListBox::MacGetSelection() const
|
||||
@@ -840,7 +840,7 @@ void wxListBox::MacSet( int n , const char * text )
|
||||
// so we just have to redraw
|
||||
Cell cell = { 0 , 0 } ;
|
||||
cell.v = n ;
|
||||
// LSetCell(text, strlen(text), cell, m_macList);
|
||||
// LSetCell(text, strlen(text), cell, m_macList);
|
||||
Refresh();
|
||||
}
|
||||
|
||||
|
@@ -122,8 +122,8 @@ void wxMacRemoveAllNotifiersForData( wxMacNotifierTableRef table , void* data )
|
||||
|
||||
void wxMacProcessNotifierEvents()
|
||||
{
|
||||
// if ( gInProcessing )
|
||||
// return ;
|
||||
// if ( gInProcessing )
|
||||
// return ;
|
||||
|
||||
gInProcessing = true ;
|
||||
if ( gMacNotificationEvents.top != gMacNotificationEvents.bottom )
|
||||
|
@@ -9,7 +9,6 @@
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation "menu.h"
|
||||
#pragma implementation "menuitem.h"
|
||||
|
@@ -86,7 +86,7 @@ wxMetaFile::~wxMetaFile()
|
||||
bool wxMetaFile::SetClipboard(int width, int height)
|
||||
{
|
||||
#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)
|
||||
return FALSE;
|
||||
|
||||
|
@@ -10,7 +10,7 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation "notebook.h"
|
||||
#pragma implementation "notebook.h"
|
||||
#endif
|
||||
|
||||
// ============================================================================
|
||||
@@ -35,10 +35,10 @@
|
||||
|
||||
static bool constantsSet = false ;
|
||||
|
||||
short kwxMacTabLeftMargin = 0 ;
|
||||
short kwxMacTabTopMargin = 0 ;
|
||||
short kwxMacTabRightMargin = 0 ;
|
||||
short kwxMacTabBottomMargin = 0 ;
|
||||
short kwxMacTabLeftMargin = 0 ;
|
||||
short kwxMacTabTopMargin = 0 ;
|
||||
short kwxMacTabRightMargin = 0 ;
|
||||
short kwxMacTabBottomMargin = 0 ;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// event table
|
||||
@@ -49,12 +49,12 @@ DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED)
|
||||
DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING)
|
||||
|
||||
BEGIN_EVENT_TABLE(wxNotebook, wxControl)
|
||||
EVT_NOTEBOOK_PAGE_CHANGED(-1, wxNotebook::OnSelChange)
|
||||
EVT_MOUSE_EVENTS(wxNotebook::OnMouse)
|
||||
EVT_NOTEBOOK_PAGE_CHANGED(-1, wxNotebook::OnSelChange)
|
||||
EVT_MOUSE_EVENTS(wxNotebook::OnMouse)
|
||||
|
||||
EVT_SIZE(wxNotebook::OnSize)
|
||||
EVT_SET_FOCUS(wxNotebook::OnSetFocus)
|
||||
EVT_NAVIGATION_KEY(wxNotebook::OnNavigationKey)
|
||||
EVT_SIZE(wxNotebook::OnSize)
|
||||
EVT_SET_FOCUS(wxNotebook::OnSetFocus)
|
||||
EVT_NAVIGATION_KEY(wxNotebook::OnNavigationKey)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxNotebook, wxControl)
|
||||
@@ -344,10 +344,10 @@ bool wxNotebook::InsertPage(int nPage,
|
||||
}
|
||||
|
||||
/* Added by Mark Newsam
|
||||
* 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
|
||||
* the user would expect.
|
||||
*/
|
||||
* 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
|
||||
* the user would expect.
|
||||
*/
|
||||
void wxNotebook::MacSetupTabs()
|
||||
{
|
||||
SetControl32BitMaximum( (ControlHandle) m_macControl , GetPageCount() ) ;
|
||||
|
@@ -114,5 +114,5 @@ bool wxPalette::GetRGB(int index, unsigned char *red, unsigned char *green, unsi
|
||||
}
|
||||
|
||||
#endif
|
||||
// wxUSE_PALETTE
|
||||
// wxUSE_PALETTE
|
||||
|
||||
|
@@ -32,7 +32,7 @@ wxPenRefData::wxPenRefData()
|
||||
}
|
||||
|
||||
wxPenRefData::wxPenRefData(const wxPenRefData& data)
|
||||
: wxGDIRefData()
|
||||
: wxGDIRefData()
|
||||
{
|
||||
m_style = data.m_style;
|
||||
m_width = data.m_width;
|
||||
|
@@ -163,7 +163,7 @@ bool wxPNGReader::GetRGB(int x, int y, byte* r, byte* g, byte* b)
|
||||
|
||||
if (m_palette) {
|
||||
return m_palette->GetRGB(GetIndex(x, y), r, g, b);
|
||||
/* PALETTEENTRY entry;
|
||||
/* PALETTEENTRY entry;
|
||||
::GetPaletteEntries((HPALETTE) m_palette->GetHPALETTE(), GetIndex(x, y), 1, &entry);
|
||||
*r = entry.peRed;
|
||||
*g = entry.peGreen;
|
||||
@@ -215,7 +215,7 @@ bool wxPNGReader::SetPalette(wxPalette* colourmap)
|
||||
ColorType |= (COLORTYPE_PALETTE | COLORTYPE_COLOR);
|
||||
m_palette = new wxPalette( *colourmap );
|
||||
return true ;
|
||||
// return (DibSetUsage(lpbi, (HPALETTE) m_palette->GetHPALETTE(), WXIMA_COLORS ) != 0);
|
||||
// return (DibSetUsage(lpbi, (HPALETTE) m_palette->GetHPALETTE(), WXIMA_COLORS ) != 0);
|
||||
}
|
||||
|
||||
bool
|
||||
@@ -231,7 +231,7 @@ wxPNGReader::SetPalette(int n, byte *r, byte *g, byte *b)
|
||||
m_palette->Create(n, r, g, b);
|
||||
ColorType |= (COLORTYPE_PALETTE | COLORTYPE_COLOR);
|
||||
return true ;
|
||||
// return (DibSetUsage(lpbi, (HPALETTE) m_palette->GetHPALETTE(), WXIMA_COLORS ) != 0);
|
||||
// return (DibSetUsage(lpbi, (HPALETTE) m_palette->GetHPALETTE(), WXIMA_COLORS ) != 0);
|
||||
}
|
||||
|
||||
bool
|
||||
@@ -259,7 +259,7 @@ wxPNGReader::SetPalette(int n, rgb_color_struct *rgb_struct)
|
||||
m_palette->Create(n, r, g, b);
|
||||
ColorType |= (COLORTYPE_PALETTE | COLORTYPE_COLOR);
|
||||
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()
|
||||
@@ -314,7 +314,7 @@ bool wxPNGReader::InstantiateBitmap(wxBitmap *bitmap)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
/*
|
||||
/*
|
||||
HDC dc = ::CreateCompatibleDC(NULL);
|
||||
|
||||
if (dc)
|
||||
@@ -381,7 +381,7 @@ wxPalette *wxCopyPalette(const wxPalette *cmap)
|
||||
wxMask *wxPNGReader::CreateMask(void)
|
||||
{
|
||||
/*
|
||||
HBITMAP hBitmap = ::CreateBitmap(GetWidth(), GetHeight(), 1, 1, NULL);
|
||||
HBITMAP hBitmap = ::CreateBitmap(GetWidth(), GetHeight(), 1, 1, NULL);
|
||||
|
||||
HDC dc = ::CreateCompatibleDC(NULL);
|
||||
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);
|
||||
// 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];
|
||||
|
||||
@@ -510,7 +510,7 @@ bool wxPNGReader::ReadFile(char * ImageFileName)
|
||||
number_passes = png_set_interlace_handling(png_ptr);
|
||||
else
|
||||
number_passes = 1;
|
||||
// printf("NP = %d ", number_passes);
|
||||
// printf("NP = %d ", number_passes);
|
||||
|
||||
for (int pass=0; pass< number_passes; pass++)
|
||||
{
|
||||
@@ -619,7 +619,7 @@ bool wxPNGReader::ReadFile(char * ImageFileName)
|
||||
while(iter.PrevRow());
|
||||
SetGWorld( origPort , origDevice ) ;
|
||||
|
||||
// printf("Y=%d ",y);
|
||||
// printf("Y=%d ",y);
|
||||
}
|
||||
delete[] row_pointers;
|
||||
|
||||
@@ -688,7 +688,7 @@ bool wxPNGReader::SaveFile(char * ImageFileName)
|
||||
}
|
||||
//png_set_error(ima_png_error, NULL);
|
||||
|
||||
// printf("writig pg %s ", filename);
|
||||
// printf("writig pg %s ", filename);
|
||||
/* initialize the structures */
|
||||
png_info_init(info_ptr);
|
||||
png_write_init(png_ptr);
|
||||
@@ -709,27 +709,27 @@ bool wxPNGReader::SaveFile(char * ImageFileName)
|
||||
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 */
|
||||
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->palette = new png_color[256];
|
||||
info_ptr->num_palette = 256;
|
||||
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);
|
||||
}
|
||||
// printf("Paleta [%d %d %x]",GetColorType() ,COLORTYPE_PALETTE, GetPalette());
|
||||
// printf("Paleta [%d %d %x]",GetColorType() ,COLORTYPE_PALETTE, GetPalette());
|
||||
|
||||
|
||||
/* optional significant bit chunk */
|
||||
// info_ptr->valid |= PNG_INFO_sBIT;
|
||||
// info_ptr->sig_bit = true_bit_depth;
|
||||
// info_ptr->valid |= PNG_INFO_sBIT;
|
||||
// info_ptr->sig_bit = true_bit_depth;
|
||||
|
||||
/* optional gamma chunk */
|
||||
// info_ptr->valid |= PNG_INFO_gAMA;
|
||||
// info_ptr->gamma = gamma;
|
||||
// info_ptr->valid |= PNG_INFO_gAMA;
|
||||
// info_ptr->gamma = gamma;
|
||||
|
||||
/* other optional chunks */
|
||||
|
||||
@@ -741,33 +741,33 @@ bool wxPNGReader::SaveFile(char * ImageFileName)
|
||||
|
||||
/* shift the pixels up to a legal bit depth and fill in
|
||||
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 */
|
||||
// png_set_packing(png_ptr);
|
||||
// png_set_packing(png_ptr);
|
||||
|
||||
/* 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 */
|
||||
// png_set_swap(png_ptr);
|
||||
// png_set_swap(png_ptr);
|
||||
|
||||
/* 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];
|
||||
iter.upset();
|
||||
do {
|
||||
// (unsigned char *)iter.GetRow();
|
||||
// (unsigned char *)iter.GetRow();
|
||||
iter.GetRow(row_pointers, row_stride);
|
||||
png_write_row(png_ptr, row_pointers);
|
||||
} while(iter.PrevRow());
|
||||
|
||||
delete[] row_pointers;
|
||||
|
||||
/* write the rest of the file */
|
||||
/* write the rest of the file */
|
||||
png_write_end(png_ptr, info_ptr);
|
||||
|
||||
/* 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',
|
||||
'C', 'D', 'E', 'F' };
|
||||
'C', 'D', 'E', 'F' };
|
||||
|
||||
static void DecToHex(int dec, char *buf)
|
||||
{
|
||||
|
@@ -19,7 +19,7 @@
|
||||
#include "wx/msgdlg.h"
|
||||
#include "wx/mac/uma.h"
|
||||
#ifndef __DARWIN__
|
||||
#include "Printing.h"
|
||||
#include "Printing.h"
|
||||
#endif
|
||||
|
||||
#if defined(TARGET_CARBON) && !defined(__DARWIN__)
|
||||
@@ -103,7 +103,7 @@ int wxPrintDialog::ShowModal()
|
||||
}
|
||||
::UMAPrClose(NULL) ;
|
||||
#else
|
||||
#if PM_USE_SESSION_APIS
|
||||
#if PM_USE_SESSION_APIS
|
||||
Boolean accepted;
|
||||
|
||||
{
|
||||
@@ -183,9 +183,9 @@ int wxPrintDialog::ShowModal()
|
||||
wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
|
||||
dialog.ShowModal();
|
||||
}
|
||||
#else
|
||||
#pragma warning "TODO: Printing for carbon without session apis"
|
||||
#endif
|
||||
#else
|
||||
#pragma warning "TODO: Printing for carbon without session apis"
|
||||
#endif
|
||||
#endif
|
||||
return result ;
|
||||
}
|
||||
@@ -196,17 +196,17 @@ wxDC *wxPrintDialog::GetPrintDC()
|
||||
}
|
||||
|
||||
/*
|
||||
* wxPageSetupDialog
|
||||
*/
|
||||
* wxPageSetupDialog
|
||||
*/
|
||||
|
||||
wxPageSetupDialog::wxPageSetupDialog():
|
||||
wxDialog()
|
||||
wxDialog()
|
||||
{
|
||||
m_dialogParent = NULL;
|
||||
}
|
||||
|
||||
wxPageSetupDialog::wxPageSetupDialog(wxWindow *p, wxPageSetupData *data):
|
||||
wxDialog()
|
||||
wxDialog()
|
||||
{
|
||||
Create(p, data);
|
||||
}
|
||||
@@ -251,7 +251,7 @@ int wxPageSetupDialog::ShowModal()
|
||||
}
|
||||
::UMAPrClose(NULL) ;
|
||||
#else
|
||||
#if PM_USE_SESSION_APIS
|
||||
#if PM_USE_SESSION_APIS
|
||||
Boolean accepted;
|
||||
|
||||
{
|
||||
@@ -305,9 +305,9 @@ int wxPageSetupDialog::ShowModal()
|
||||
wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
|
||||
dialog.ShowModal();
|
||||
}
|
||||
#else
|
||||
#pragma warning "TODO: Printing for carbon without session apis"
|
||||
#endif
|
||||
#else
|
||||
#pragma warning "TODO: Printing for carbon without session apis"
|
||||
#endif
|
||||
#endif
|
||||
return result ;
|
||||
}
|
||||
|
@@ -43,11 +43,11 @@ IMPLEMENT_CLASS(wxMacPrintPreview, wxPrintPreviewBase)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Printer
|
||||
*/
|
||||
* Printer
|
||||
*/
|
||||
|
||||
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,
|
||||
wxPrintout *printoutForPrinting,
|
||||
@@ -252,7 +252,7 @@ wxMacPrintPreview::wxMacPrintPreview(wxPrintout *printout,
|
||||
}
|
||||
|
||||
wxMacPrintPreview::wxMacPrintPreview(wxPrintout *printout, wxPrintout *printoutForPrinting, wxPrintData *data):
|
||||
wxPrintPreviewBase(printout, printoutForPrinting, data)
|
||||
wxPrintPreviewBase(printout, printoutForPrinting, data)
|
||||
{
|
||||
DetermineScaling();
|
||||
}
|
||||
|
@@ -10,8 +10,8 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation "radioboxbase.h"
|
||||
#pragma implementation "radiobox.h"
|
||||
#pragma implementation "radioboxbase.h"
|
||||
#pragma implementation "radiobox.h"
|
||||
#endif
|
||||
|
||||
//-------------------------------------------------------------------------------------
|
||||
@@ -126,7 +126,7 @@ bool wxRadioBox::Create(wxWindow *parent, wxWindowID id, const wxString& label,
|
||||
wxDefaultSize , i == 0 ? wxRB_GROUP : 0 ) ;
|
||||
if ( i == 0 )
|
||||
m_radioButtonCycle = radBtn ;
|
||||
// m_radioButtonCycle=radBtn->AddInCycle(m_radioButtonCycle);
|
||||
// m_radioButtonCycle=radBtn->AddInCycle(m_radioButtonCycle);
|
||||
}
|
||||
|
||||
SetSelection(0);
|
||||
@@ -386,7 +386,7 @@ void wxRadioBox::DoSetSize(int x, int y, int width, int height, int sizeFlags)
|
||||
int i;
|
||||
wxRadioButton *current;
|
||||
|
||||
// define the position
|
||||
// define the position
|
||||
|
||||
int x_current, y_current;
|
||||
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))
|
||||
y_offset = y_current;
|
||||
|
||||
// define size
|
||||
// define size
|
||||
|
||||
int charWidth,charHeight;
|
||||
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);
|
||||
|
||||
// arrange radiobuttons
|
||||
// arrange radiobuttons
|
||||
|
||||
int x_start,y_start;
|
||||
|
||||
|
@@ -24,23 +24,22 @@ END_EVENT_TABLE()
|
||||
#endif
|
||||
|
||||
// The dimensions of the different styles of sliders (From Aqua document)
|
||||
#define wxSLIDER_DIMENSIONACROSS 15
|
||||
#define wxSLIDER_DIMENSIONACROSS_WITHTICKMARKS 24
|
||||
#define wxSLIDER_DIMENSIONACROSS_ARROW 18
|
||||
#define wxSLIDER_DIMENSIONACROSS 15
|
||||
#define wxSLIDER_DIMENSIONACROSS_WITHTICKMARKS 24
|
||||
#define wxSLIDER_DIMENSIONACROSS_ARROW 18
|
||||
|
||||
// Distance between slider and text
|
||||
#define wxSLIDER_BORDERTEXT 5
|
||||
// Distance between slider and text
|
||||
#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
|
||||
* 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
|
||||
* eg. if(GetWindowStyle() & wxSL_VERTICAL) {} else { horizontal case }>
|
||||
*/
|
||||
|
||||
|
||||
// Slider
|
||||
wxSlider::wxSlider()
|
||||
// Slider
|
||||
wxSlider::wxSlider()
|
||||
{
|
||||
m_pageSize = 1;
|
||||
m_lineSize = 1;
|
||||
@@ -257,12 +256,12 @@ void wxSlider::MacHandleControlClick( WXWidget control , wxInt16 controlpart )
|
||||
GetEventHandler()->ProcessEvent( cevent );
|
||||
}
|
||||
|
||||
/* 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 */
|
||||
void wxSlider::SetSizeHints( int minW, int minH,
|
||||
/* 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 */
|
||||
void wxSlider::SetSizeHints( int minW, int minH,
|
||||
int maxW , int maxH ,
|
||||
int incW , int incH )
|
||||
{
|
||||
{
|
||||
wxSize size = GetBestSize();
|
||||
|
||||
if(GetWindowStyle() & wxSL_VERTICAL) {
|
||||
@@ -271,10 +270,10 @@ void wxSlider::MacHandleControlClick( WXWidget control , wxInt16 controlpart )
|
||||
else {
|
||||
wxWindow::SetSizeHints(minW, size.y, maxW, size.y, incW, incH);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
wxSize wxSlider::DoGetBestSize() const
|
||||
{
|
||||
wxSize wxSlider::DoGetBestSize() const
|
||||
{
|
||||
wxSize size;
|
||||
int textwidth, textheight;
|
||||
|
||||
@@ -323,14 +322,14 @@ void wxSlider::MacHandleControlClick( WXWidget control , wxInt16 controlpart )
|
||||
size.x = 150;
|
||||
}
|
||||
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 ) ;
|
||||
}
|
||||
}
|
||||
|
||||
void wxSlider::MacUpdateDimensions()
|
||||
void wxSlider::MacUpdateDimensions()
|
||||
{
|
||||
// actually in the current systems this should never be possible, but later reparenting
|
||||
// may become a reality
|
||||
|
@@ -137,13 +137,13 @@ void wxStaticText::OnDraw( wxDC &dc )
|
||||
{
|
||||
if (m_width <= 0 || m_height <= 0)
|
||||
return;
|
||||
/*
|
||||
/*
|
||||
dc.Clear() ;
|
||||
wxRect rect(0,0,m_width,m_height) ;
|
||||
dc.SetFont(*wxSMALL_FONT) ;
|
||||
|
||||
dc.DrawRectangle(rect) ;
|
||||
*/
|
||||
*/
|
||||
if ( !IsWindowHilited( (WindowRef) MacGetRootWindow() ) &&
|
||||
( GetBackgroundColour() == wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE )
|
||||
|| GetBackgroundColour() == wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE) ) )
|
||||
|
@@ -902,5 +902,3 @@ bool WXDLLEXPORT wxIsWaitingForThread()
|
||||
#include "wx/thrimpl.cpp"
|
||||
|
||||
#endif // wxUSE_THREADS
|
||||
|
||||
// vi:sts=4:sw=4:et
|
||||
|
@@ -116,7 +116,6 @@ void wxToolBar::Init()
|
||||
bool wxToolBar::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size,
|
||||
long style, const wxString& name)
|
||||
{
|
||||
|
||||
int x = pos.x;
|
||||
int y = pos.y;
|
||||
int width = size.x;
|
||||
@@ -376,7 +375,7 @@ void wxToolBar::MacSuperChangedPosition()
|
||||
localOrigin.v = ly ;
|
||||
localOrigin.h = lx ;
|
||||
|
||||
// GetParent()->MacGetPortParams( &localOrigin , &clipRect , &window , &win ) ;
|
||||
// GetParent()->MacGetPortParams( &localOrigin , &clipRect , &window , &win ) ;
|
||||
|
||||
Rect toolbarrect = { localOrigin.v ,localOrigin.h ,
|
||||
m_height + localOrigin.v , m_width + localOrigin.h} ;
|
||||
|
@@ -632,7 +632,6 @@ WXWidget wxTopLevelWindowMac::MacGetContainerForEmbedding()
|
||||
|
||||
void wxTopLevelWindowMac::MacUpdate( long timestamp)
|
||||
{
|
||||
|
||||
wxMacPortStateHelper help( (GrafPtr) GetWindowPort( (WindowRef) m_macWindow) ) ;
|
||||
|
||||
BeginUpdate( (WindowRef)m_macWindow ) ;
|
||||
@@ -770,6 +769,7 @@ void wxTopLevelWindowMac::MacFireMouseEvent(
|
||||
MacDispatchMouseEvent( event ) ;
|
||||
}
|
||||
}
|
||||
|
||||
#if !TARGET_CARBON
|
||||
|
||||
void wxTopLevelWindowMac::MacMouseDown( WXEVENTREF ev , short part)
|
||||
|
@@ -692,8 +692,6 @@ OSErr UMASetKeyboardFocus (WindowPtr inWindow,
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// events
|
||||
void UMAUpdateControls( WindowPtr inWindow , RgnHandle inRgn )
|
||||
{
|
||||
@@ -707,7 +705,6 @@ void UMAUpdateControls( WindowPtr inWindow , RgnHandle inRgn )
|
||||
UpdateControls( inWindow , inRgn ) ;
|
||||
InvalWindowRgn( inWindow, updateRgn) ;
|
||||
DisposeRgn( updateRgn ) ;
|
||||
|
||||
}
|
||||
|
||||
bool UMAIsWindowFloating( WindowRef inWindow )
|
||||
@@ -750,6 +747,7 @@ void UMAHighlightAndActivateWindow( WindowRef inWindowRef , bool inActivate )
|
||||
SetPort( port ) ;
|
||||
}
|
||||
}
|
||||
|
||||
OSStatus UMADrawThemePlacard( const Rect *inRect , ThemeDrawState inState )
|
||||
{
|
||||
return ::DrawThemePlacard( inRect , inState ) ;
|
||||
|
@@ -980,7 +980,7 @@ wxWindowMac *wxGetActiveWindow()
|
||||
// Coordinates relative to the window
|
||||
void wxWindowMac::WarpPointer (int x_pos, int y_pos)
|
||||
{
|
||||
// We really dont move the mouse programmatically under mac
|
||||
// We really don't move the mouse programmatically under Mac.
|
||||
}
|
||||
|
||||
const wxBrush& wxWindowMac::MacGetBackgroundBrush()
|
||||
@@ -1045,7 +1045,6 @@ const wxBrush& wxWindowMac::MacGetBackgroundBrush()
|
||||
}
|
||||
|
||||
return m_macBackgroundBrush ;
|
||||
|
||||
}
|
||||
|
||||
void wxWindowMac::OnEraseBackground(wxEraseEvent& event)
|
||||
|
@@ -8,17 +8,22 @@
|
||||
// Copyright: (c) Stefan Csomor
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation "choice.h"
|
||||
#endif
|
||||
|
||||
#include "wx/defs.h"
|
||||
#include "wx/choice.h"
|
||||
#include "wx/menu.h"
|
||||
#include "wx/mac/uma.h"
|
||||
|
||||
#if !USE_SHARED_LIBRARY
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxChoice, wxControl)
|
||||
#endif
|
||||
|
||||
extern MenuHandle NewUniqueMenu() ;
|
||||
|
||||
wxChoice::~wxChoice()
|
||||
{
|
||||
if ( HasClientObjectData() )
|
||||
@@ -32,6 +37,7 @@ wxChoice::~wxChoice()
|
||||
// DeleteMenu( m_macPopUpMenuId ) ;
|
||||
// DisposeMenu( m_macPopUpMenuHandle ) ;
|
||||
}
|
||||
|
||||
bool wxChoice::Create(wxWindow *parent, wxWindowID id,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
@@ -60,6 +66,7 @@ bool wxChoice::Create(wxWindow *parent, wxWindowID id,
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// adding/deleting items to/from the list
|
||||
// ----------------------------------------------------------------------------
|
||||
@@ -73,6 +80,7 @@ int wxChoice::DoAppend(const wxString& item)
|
||||
SetControl32BitMaximum( (ControlHandle) m_macControl , GetCount()) ;
|
||||
return index ;
|
||||
}
|
||||
|
||||
void wxChoice::Delete(int n)
|
||||
{
|
||||
wxCHECK_RET( n < GetCount(), wxT("invalid item index in wxChoice::Delete") );
|
||||
@@ -85,6 +93,7 @@ void wxChoice::Delete(int n)
|
||||
m_datas.RemoveAt( n ) ;
|
||||
SetControl32BitMaximum( (ControlHandle) m_macControl , GetCount()) ;
|
||||
}
|
||||
|
||||
void wxChoice::Clear()
|
||||
{
|
||||
FreeData();
|
||||
@@ -96,6 +105,7 @@ void wxChoice::Clear()
|
||||
m_datas.Empty() ;
|
||||
SetControl32BitMaximum( (ControlHandle) m_macControl , 0 ) ;
|
||||
}
|
||||
|
||||
void wxChoice::FreeData()
|
||||
{
|
||||
if ( HasClientObjectData() )
|
||||
@@ -107,6 +117,7 @@ void wxChoice::FreeData()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// selection
|
||||
// ----------------------------------------------------------------------------
|
||||
@@ -114,17 +125,21 @@ int wxChoice::GetSelection() const
|
||||
{
|
||||
return GetControl32BitValue( (ControlHandle) m_macControl ) -1 ;
|
||||
}
|
||||
|
||||
void wxChoice::SetSelection(int n)
|
||||
{
|
||||
SetControl32BitValue( (ControlHandle) m_macControl , n + 1 ) ;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// string list functions
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
int wxChoice::GetCount() const
|
||||
{
|
||||
return m_strings.GetCount() ;
|
||||
}
|
||||
|
||||
int wxChoice::FindString(const wxString& s) const
|
||||
{
|
||||
for( int i = 0 ; i < GetCount() ; i++ )
|
||||
@@ -134,6 +149,7 @@ int wxChoice::FindString(const wxString& s) const
|
||||
}
|
||||
return wxNOT_FOUND ;
|
||||
}
|
||||
|
||||
void wxChoice::SetString(int n, const wxString& s)
|
||||
{
|
||||
wxFAIL_MSG(wxT("wxChoice::SetString() not yet implemented"));
|
||||
@@ -157,20 +173,24 @@ void wxChoice::DoSetItemClientData( int n, void* clientData )
|
||||
|
||||
m_datas[n] = (char*) clientData ;
|
||||
}
|
||||
|
||||
void *wxChoice::DoGetItemClientData(int n) const
|
||||
{
|
||||
wxCHECK_MSG( n >= 0 && (size_t)n < m_datas.GetCount(), NULL,
|
||||
"invalid index in wxChoice::GetClientData" );
|
||||
return (void *)m_datas[n];
|
||||
}
|
||||
|
||||
void wxChoice::DoSetItemClientObject( int n, wxClientData* clientData )
|
||||
{
|
||||
DoSetItemClientData(n, clientData);
|
||||
}
|
||||
|
||||
wxClientData* wxChoice::DoGetItemClientObject( int n ) const
|
||||
{
|
||||
return (wxClientData *)DoGetItemClientData(n);
|
||||
}
|
||||
|
||||
void wxChoice::MacHandleControlClick( WXWidget control , wxInt16 controlpart )
|
||||
{
|
||||
wxCommandEvent event(wxEVT_COMMAND_CHOICE_SELECTED, m_windowId );
|
||||
@@ -188,6 +208,7 @@ void wxChoice::MacHandleControlClick( WXWidget control , wxInt16 controlpart )
|
||||
ProcessCommand(event);
|
||||
}
|
||||
}
|
||||
|
||||
wxSize wxChoice::DoGetBestSize() const
|
||||
{
|
||||
int lbWidth = 100; // some defaults
|
||||
|
@@ -895,11 +895,10 @@ void wxControl::OnMouseEvent( wxMouseEvent &event )
|
||||
|
||||
bool wxControl::MacCanFocus() const
|
||||
{
|
||||
{ if ( (ControlHandle) m_macControl == NULL )
|
||||
if ( (ControlHandle) m_macControl == NULL )
|
||||
return true ;
|
||||
else
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
|
||||
void wxControl::MacHandleControlClick( WXWidget control , wxInt16 controlpart )
|
||||
|
139
src/mac/dc.cpp
139
src/mac/dc.cpp
@@ -8,9 +8,11 @@
|
||||
// Copyright: (c) Stefan Csomor
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation "dc.h"
|
||||
#endif
|
||||
|
||||
#include "wx/dc.h"
|
||||
#include "wx/app.h"
|
||||
#include "wx/mac/uma.h"
|
||||
@@ -30,9 +32,11 @@ using namespace std ;
|
||||
#if !USE_SHARED_LIBRARY
|
||||
IMPLEMENT_ABSTRACT_CLASS(wxDC, wxObject)
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// constants
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#define mm2inches 0.0393700787402
|
||||
#define inches2mm 25.4
|
||||
#define mm2twips 56.6929133859
|
||||
@@ -45,6 +49,7 @@ const double M_PI = 3.14159265358979 ;
|
||||
const double RAD2DEG = 180.0 / M_PI;
|
||||
const short kEmulatedMode = -1 ;
|
||||
const short kUnsupportedMode = -2 ;
|
||||
|
||||
wxMacPortSetter::wxMacPortSetter( const wxDC* dc ) :
|
||||
m_ph( (GrafPtr) dc->m_macPort )
|
||||
{
|
||||
@@ -52,10 +57,12 @@ wxMacPortSetter::wxMacPortSetter( const wxDC* dc ) :
|
||||
m_dc = dc ;
|
||||
dc->MacSetupPort(&m_ph) ;
|
||||
}
|
||||
|
||||
wxMacPortSetter::~wxMacPortSetter()
|
||||
{
|
||||
m_dc->MacCleanupPort(&m_ph) ;
|
||||
}
|
||||
|
||||
wxMacWindowClipper::wxMacWindowClipper( const wxWindow* win )
|
||||
{
|
||||
m_formerClip = NewRgn() ;
|
||||
@@ -89,24 +96,28 @@ wxMacWindowClipper::wxMacWindowClipper( const wxWindow* win )
|
||||
SetClip( m_newClip ) ;
|
||||
}
|
||||
}
|
||||
|
||||
wxMacWindowClipper::~wxMacWindowClipper()
|
||||
{
|
||||
SetClip( m_formerClip ) ;
|
||||
DisposeRgn( m_newClip ) ;
|
||||
DisposeRgn( m_formerClip ) ;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Local functions
|
||||
//-----------------------------------------------------------------------------
|
||||
static inline double dmin(double a, double b) { return a < b ? a : b; }
|
||||
static inline double dmax(double a, double b) { return a > b ? a : b; }
|
||||
static inline double DegToRad(double deg) { return (deg * M_PI) / 180.0; }
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxDC
|
||||
//-----------------------------------------------------------------------------
|
||||
// this function emulates all wx colour manipulations, used to verify the implementation
|
||||
// by setting the mode in the blitting functions to kEmulatedMode
|
||||
void wxMacCalculateColour( int logical_func , const RGBColor &srcColor , RGBColor &dstColor ) ;
|
||||
|
||||
void wxMacCalculateColour( int logical_func , const RGBColor &srcColor , RGBColor &dstColor )
|
||||
{
|
||||
switch ( logical_func )
|
||||
@@ -190,6 +201,7 @@ void wxMacCalculateColour( int logical_func , const RGBColor &srcColor , RGBColo
|
||||
break ;
|
||||
}
|
||||
}
|
||||
|
||||
wxDC::wxDC()
|
||||
{
|
||||
m_ok = FALSE;
|
||||
@@ -228,11 +240,13 @@ wxDC::wxDC()
|
||||
m_macForegroundPixMap = NULL ;
|
||||
m_macBackgroundPixMap = NULL ;
|
||||
}
|
||||
|
||||
wxDC::~wxDC(void)
|
||||
{
|
||||
DisposeRgn( (RgnHandle) m_macBoundaryClipRgn ) ;
|
||||
DisposeRgn( (RgnHandle) m_macCurrentClipRgn ) ;
|
||||
}
|
||||
|
||||
void wxDC::MacSetupPort(wxMacPortStateHelper* help) const
|
||||
{
|
||||
wxASSERT( m_macCurrentPortStateHelper == NULL ) ;
|
||||
@@ -242,6 +256,7 @@ void wxDC::MacSetupPort(wxMacPortStateHelper* help) const
|
||||
m_macBrushInstalled = false ;
|
||||
m_macPenInstalled = false ;
|
||||
}
|
||||
|
||||
void wxDC::MacCleanupPort(wxMacPortStateHelper* help) const
|
||||
{
|
||||
wxASSERT( m_macCurrentPortStateHelper == help ) ;
|
||||
@@ -271,6 +286,7 @@ void wxDC::MacCleanupPort(wxMacPortStateHelper* help) const
|
||||
m_macBackgroundPixMap = NULL ;
|
||||
}
|
||||
}
|
||||
|
||||
void wxDC::DoDrawBitmap( const wxBitmap &bmp, wxCoord x, wxCoord y, bool useMask )
|
||||
{
|
||||
wxCHECK_RET( Ok(), wxT("invalid window dc") );
|
||||
@@ -356,12 +372,14 @@ void wxDC::DoDrawBitmap( const wxBitmap &bmp, wxCoord x, wxCoord y, bool useMask
|
||||
m_macBrushInstalled = false ;
|
||||
m_macFontInstalled = false ;
|
||||
}
|
||||
|
||||
void wxDC::DoDrawIcon( const wxIcon &icon, wxCoord x, wxCoord y )
|
||||
{
|
||||
wxCHECK_RET(Ok(), wxT("Invalid dc wxDC::DoDrawIcon"));
|
||||
wxCHECK_RET(icon.Ok(), wxT("Invalid icon wxDC::DoDrawIcon"));
|
||||
DoDrawBitmap( icon , x , y , icon.GetMask() != NULL ) ;
|
||||
}
|
||||
|
||||
void wxDC::DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
|
||||
{
|
||||
wxCHECK_RET(Ok(), wxT("wxDC::DoSetClippingRegion Invalid DC"));
|
||||
@@ -388,6 +406,7 @@ void wxDC::DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoord hei
|
||||
m_clipY2 = yy + hh;
|
||||
}
|
||||
}
|
||||
|
||||
void wxDC::DoSetClippingRegionAsRegion( const wxRegion ®ion )
|
||||
{
|
||||
wxCHECK_RET( Ok(), wxT("invalid window dc") ) ;
|
||||
@@ -435,17 +454,20 @@ void wxDC::DoSetClippingRegionAsRegion( const wxRegion ®ion )
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void wxDC::DestroyClippingRegion()
|
||||
{
|
||||
wxMacPortSetter helper(this) ;
|
||||
CopyRgn( (RgnHandle) m_macBoundaryClipRgn , (RgnHandle) m_macCurrentClipRgn ) ;
|
||||
m_clipping = FALSE;
|
||||
}
|
||||
|
||||
void wxDC::DoGetSize( int* width, int* height ) const
|
||||
{
|
||||
*width = m_maxX-m_minX;
|
||||
*height = m_maxY-m_minY;
|
||||
}
|
||||
|
||||
void wxDC::DoGetSizeMM( int* width, int* height ) const
|
||||
{
|
||||
int w = 0;
|
||||
@@ -454,18 +476,21 @@ void wxDC::DoGetSizeMM( int* width, int* height ) const
|
||||
*width = long( double(w) / (m_scaleX*m_mm_to_pix_x) );
|
||||
*height = long( double(h) / (m_scaleY*m_mm_to_pix_y) );
|
||||
}
|
||||
|
||||
void wxDC::SetTextForeground( const wxColour &col )
|
||||
{
|
||||
wxCHECK_RET(Ok(), wxT("Invalid DC"));
|
||||
m_textForegroundColour = col;
|
||||
m_macFontInstalled = false ;
|
||||
}
|
||||
|
||||
void wxDC::SetTextBackground( const wxColour &col )
|
||||
{
|
||||
wxCHECK_RET(Ok(), wxT("Invalid DC"));
|
||||
m_textBackgroundColour = col;
|
||||
m_macFontInstalled = false ;
|
||||
}
|
||||
|
||||
void wxDC::SetMapMode( int mode )
|
||||
{
|
||||
switch (mode)
|
||||
@@ -493,6 +518,7 @@ void wxDC::SetMapMode( int mode )
|
||||
m_needComputeScaleY = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
void wxDC::SetUserScale( double x, double y )
|
||||
{
|
||||
// allow negative ? -> no
|
||||
@@ -500,6 +526,7 @@ void wxDC::SetUserScale( double x, double y )
|
||||
m_userScaleY = y;
|
||||
ComputeScaleAndOrigin();
|
||||
}
|
||||
|
||||
void wxDC::SetLogicalScale( double x, double y )
|
||||
{
|
||||
// allow negative ?
|
||||
@@ -507,18 +534,21 @@ void wxDC::SetLogicalScale( double x, double y )
|
||||
m_logicalScaleY = y;
|
||||
ComputeScaleAndOrigin();
|
||||
}
|
||||
|
||||
void wxDC::SetLogicalOrigin( wxCoord x, wxCoord y )
|
||||
{
|
||||
m_logicalOriginX = x * m_signX; // is this still correct ?
|
||||
m_logicalOriginY = y * m_signY;
|
||||
ComputeScaleAndOrigin();
|
||||
}
|
||||
|
||||
void wxDC::SetDeviceOrigin( wxCoord x, wxCoord y )
|
||||
{
|
||||
m_externalDeviceOriginX = x;
|
||||
m_externalDeviceOriginY = y;
|
||||
ComputeScaleAndOrigin();
|
||||
}
|
||||
|
||||
#if 0
|
||||
void wxDC::SetInternalDeviceOrigin( long x, long y )
|
||||
{
|
||||
@@ -532,16 +562,19 @@ void wxDC::GetInternalDeviceOrigin( long *x, long *y )
|
||||
if (y) *y = m_internalDeviceOriginY;
|
||||
}
|
||||
#endif
|
||||
|
||||
void wxDC::SetAxisOrientation( bool xLeftRight, bool yBottomUp )
|
||||
{
|
||||
m_signX = (xLeftRight ? 1 : -1);
|
||||
m_signY = (yBottomUp ? -1 : 1);
|
||||
ComputeScaleAndOrigin();
|
||||
}
|
||||
|
||||
wxSize wxDC::GetPPI() const
|
||||
{
|
||||
return wxSize(72, 72);
|
||||
}
|
||||
|
||||
int wxDC::GetDepth() const
|
||||
{
|
||||
if ( IsPortColor( (CGrafPtr) m_macPort ) )
|
||||
@@ -550,6 +583,7 @@ int wxDC::GetDepth() const
|
||||
}
|
||||
return 1 ;
|
||||
}
|
||||
|
||||
void wxDC::ComputeScaleAndOrigin()
|
||||
{
|
||||
// CMB: copy scale to see if it changes
|
||||
@@ -570,18 +604,22 @@ void wxDC::ComputeScaleAndOrigin()
|
||||
SetPen(* pen);
|
||||
}
|
||||
}
|
||||
|
||||
void wxDC::SetPalette( const wxPalette& palette )
|
||||
{
|
||||
}
|
||||
|
||||
void wxDC::SetBackgroundMode( int mode )
|
||||
{
|
||||
m_backgroundMode = mode ;
|
||||
}
|
||||
|
||||
void wxDC::SetFont( const wxFont &font )
|
||||
{
|
||||
m_font = font;
|
||||
m_macFontInstalled = false ;
|
||||
}
|
||||
|
||||
void wxDC::SetPen( const wxPen &pen )
|
||||
{
|
||||
if ( m_pen == pen )
|
||||
@@ -589,6 +627,7 @@ void wxDC::SetPen( const wxPen &pen )
|
||||
m_pen = pen;
|
||||
m_macPenInstalled = false ;
|
||||
}
|
||||
|
||||
void wxDC::SetBrush( const wxBrush &brush )
|
||||
{
|
||||
if (m_brush == brush)
|
||||
@@ -596,6 +635,7 @@ void wxDC::SetBrush( const wxBrush &brush )
|
||||
m_brush = brush;
|
||||
m_macBrushInstalled = false ;
|
||||
}
|
||||
|
||||
void wxDC::SetBackground( const wxBrush &brush )
|
||||
{
|
||||
if (m_backgroundBrush == brush)
|
||||
@@ -605,6 +645,7 @@ void wxDC::SetBackground( const wxBrush &brush )
|
||||
return;
|
||||
m_macBrushInstalled = false ;
|
||||
}
|
||||
|
||||
void wxDC::SetLogicalFunction( int function )
|
||||
{
|
||||
if (m_logicalFunction == function)
|
||||
@@ -614,13 +655,16 @@ void wxDC::SetLogicalFunction( int function )
|
||||
m_macBrushInstalled = false ;
|
||||
m_macPenInstalled = false ;
|
||||
}
|
||||
|
||||
extern bool wxDoFloodFill(wxDC *dc, wxCoord x, wxCoord y,
|
||||
const wxColour & col, int style);
|
||||
|
||||
bool wxDC::DoFloodFill(wxCoord x, wxCoord y,
|
||||
const wxColour& col, int style)
|
||||
{
|
||||
return wxDoFloodFill(this, x, y, col, style);
|
||||
}
|
||||
|
||||
bool wxDC::DoGetPixel( wxCoord x, wxCoord y, wxColour *col ) const
|
||||
{
|
||||
wxCHECK_MSG( Ok(), false, wxT("wxDC::DoGetPixel Invalid DC") );
|
||||
@@ -633,6 +677,7 @@ bool wxDC::DoGetPixel( wxCoord x, wxCoord y, wxColour *col ) const
|
||||
colour.blue >> 8);
|
||||
return true ;
|
||||
}
|
||||
|
||||
void wxDC::DoDrawLine( wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2 )
|
||||
{
|
||||
wxCHECK_RET(Ok(), wxT("Invalid DC"));
|
||||
@@ -670,6 +715,7 @@ void wxDC::DoDrawLine( wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2 )
|
||||
::LineTo(xx2, yy2);
|
||||
}
|
||||
}
|
||||
|
||||
void wxDC::DoCrossHair( wxCoord x, wxCoord y )
|
||||
{
|
||||
wxCHECK_RET( Ok(), wxT("wxDC::DoCrossHair Invalid window dc") );
|
||||
@@ -690,14 +736,16 @@ void wxDC::DoCrossHair( wxCoord x, wxCoord y )
|
||||
CalcBoundingBox(x+w, y+h);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* To draw arcs properly the angles need to be converted from the WX style:
|
||||
* Angles start on the +ve X axis and go anti-clockwise (As you would draw on
|
||||
* a normal axis on paper).
|
||||
* TO
|
||||
* the Mac style:
|
||||
* Angles start on the +ve y axis and go clockwise.
|
||||
*/
|
||||
* 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
|
||||
* a normal axis on paper).
|
||||
* TO
|
||||
* the Mac style:
|
||||
* Angles start on the +ve y axis and go clockwise.
|
||||
*/
|
||||
|
||||
static double wxConvertWXangleToMACangle(double angle)
|
||||
{
|
||||
double newAngle = 90 - angle ;
|
||||
@@ -705,6 +753,7 @@ static double wxConvertWXangleToMACangle(double angle)
|
||||
newAngle += 360 ;
|
||||
return newAngle ;
|
||||
}
|
||||
|
||||
void wxDC::DoDrawArc( wxCoord x1, wxCoord y1,
|
||||
wxCoord x2, wxCoord y2,
|
||||
wxCoord xc, wxCoord yc )
|
||||
@@ -755,6 +804,7 @@ void wxDC::DoDrawArc( wxCoord x1, wxCoord y1,
|
||||
FrameArc(&r, alpha1, alpha2);
|
||||
}
|
||||
}
|
||||
|
||||
void wxDC::DoDrawEllipticArc( wxCoord x, wxCoord y, wxCoord w, wxCoord h,
|
||||
double sa, double ea )
|
||||
{
|
||||
@@ -786,6 +836,7 @@ void wxDC::DoDrawEllipticArc( wxCoord x, wxCoord y, wxCoord w, wxCoord h,
|
||||
FrameArc(&r, (short)sa, (short)angle);
|
||||
}
|
||||
}
|
||||
|
||||
void wxDC::DoDrawPoint( wxCoord x, wxCoord y )
|
||||
{
|
||||
wxCHECK_RET(Ok(), wxT("Invalid DC"));
|
||||
@@ -799,6 +850,7 @@ void wxDC::DoDrawPoint( wxCoord x, wxCoord y )
|
||||
CalcBoundingBox(x, y);
|
||||
}
|
||||
}
|
||||
|
||||
void wxDC::DoDrawLines(int n, wxPoint points[],
|
||||
wxCoord xoffset, wxCoord yoffset)
|
||||
{
|
||||
@@ -820,6 +872,7 @@ void wxDC::DoDrawLines(int n, wxPoint points[],
|
||||
::LineTo( x2 - offset, y2 - offset );
|
||||
}
|
||||
}
|
||||
|
||||
void wxDC::DoDrawPolygon(int n, wxPoint points[],
|
||||
wxCoord xoffset, wxCoord yoffset,
|
||||
int fillStyle )
|
||||
@@ -857,6 +910,7 @@ void wxDC::DoDrawPolygon(int n, wxPoint points[],
|
||||
}
|
||||
KillPoly( polygon );
|
||||
}
|
||||
|
||||
void wxDC::DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
|
||||
{
|
||||
wxCHECK_RET(Ok(), wxT("Invalid DC"));
|
||||
@@ -891,6 +945,7 @@ void wxDC::DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
|
||||
::FrameRect( &rect ) ;
|
||||
}
|
||||
}
|
||||
|
||||
void wxDC::DoDrawRoundedRectangle(wxCoord x, wxCoord y,
|
||||
wxCoord width, wxCoord height,
|
||||
double radius)
|
||||
@@ -929,6 +984,7 @@ void wxDC::DoDrawRoundedRectangle(wxCoord x, wxCoord y,
|
||||
::FrameRoundRect( &rect , int(radius * 2) , int(radius * 2) ) ;
|
||||
}
|
||||
}
|
||||
|
||||
void wxDC::DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
|
||||
{
|
||||
wxCHECK_RET(Ok(), wxT("Invalid DC"));
|
||||
@@ -964,7 +1020,6 @@ void wxDC::DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool wxDC::CanDrawBitmap(void) const
|
||||
{
|
||||
return true ;
|
||||
@@ -1217,14 +1272,16 @@ bool wxDC::DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height,
|
||||
m_macFontInstalled = false ;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
inline Fixed IntToFixed( int inInt )
|
||||
{
|
||||
{
|
||||
return (((SInt32) inInt) << 16);
|
||||
}
|
||||
}
|
||||
|
||||
inline int FixedToInt( Fixed inFixed )
|
||||
{
|
||||
{
|
||||
return (((SInt32) inFixed) >> 16);
|
||||
}
|
||||
}
|
||||
|
||||
void wxDC::DoDrawRotatedText(const wxString& str, wxCoord x, wxCoord y,
|
||||
double angle)
|
||||
@@ -1319,6 +1376,7 @@ void wxDC::DoDrawRotatedText(const wxString& str, wxCoord x, wxCoord y,
|
||||
::ATSUDisposeTextLayout(atsuLayout);
|
||||
delete[] buf ;
|
||||
}
|
||||
|
||||
void wxDC::DoDrawText(const wxString& strtext, wxCoord x, wxCoord y)
|
||||
{
|
||||
wxCHECK_RET(Ok(), wxT("wxDC::DoDrawText Invalid DC"));
|
||||
@@ -1452,11 +1510,13 @@ void wxDC::DoDrawText(const wxString& strtext, wxCoord x, wxCoord y)
|
||||
}
|
||||
::TextMode( srcOr ) ;
|
||||
}
|
||||
|
||||
bool wxDC::CanGetTextExtent() const
|
||||
{
|
||||
wxCHECK_MSG(Ok(), false, wxT("Invalid DC"));
|
||||
return true ;
|
||||
}
|
||||
|
||||
void wxDC::DoGetTextExtent( const wxString &string, wxCoord *width, wxCoord *height,
|
||||
wxCoord *descent, wxCoord *externalLeading ,
|
||||
wxFont *theFont ) const
|
||||
@@ -1566,6 +1626,7 @@ void wxDC::DoGetTextExtent( const wxString &string, wxCoord *width, wxCoord *he
|
||||
m_macFontInstalled = false ;
|
||||
}
|
||||
}
|
||||
|
||||
wxCoord wxDC::GetCharWidth(void) const
|
||||
{
|
||||
wxCHECK_MSG(Ok(), 1, wxT("Invalid DC"));
|
||||
@@ -1600,6 +1661,7 @@ wxCoord wxDC::GetCharWidth(void) const
|
||||
}
|
||||
return YDEV2LOGREL(width) ;
|
||||
}
|
||||
|
||||
wxCoord wxDC::GetCharHeight(void) const
|
||||
{
|
||||
wxCHECK_MSG(Ok(), 1, wxT("Invalid DC"));
|
||||
@@ -1609,6 +1671,7 @@ wxCoord wxDC::GetCharHeight(void) const
|
||||
::GetFontInfo( &fi ) ;
|
||||
return YDEV2LOGREL( fi.descent + fi.ascent );
|
||||
}
|
||||
|
||||
void wxDC::Clear(void)
|
||||
{
|
||||
wxCHECK_RET(Ok(), wxT("Invalid DC"));
|
||||
@@ -1622,11 +1685,12 @@ void wxDC::Clear(void)
|
||||
::EraseRect( &rect ) ;
|
||||
}
|
||||
}
|
||||
|
||||
void wxDC::MacInstallFont() const
|
||||
{
|
||||
wxCHECK_RET(Ok(), wxT("Invalid DC"));
|
||||
// if ( m_macFontInstalled )
|
||||
// return ;
|
||||
// if ( m_macFontInstalled )
|
||||
// return ;
|
||||
Pattern blackColor ;
|
||||
MacSetupBackgroundForCurrentPort(m_backgroundBrush) ;
|
||||
wxFontRefData * font = (wxFontRefData*) m_font.GetRefData() ;
|
||||
@@ -1695,8 +1759,8 @@ void wxDC::MacInstallFont() const
|
||||
case wxNAND: // (NOT src) OR (NOT dst)
|
||||
case wxOR: // src OR dst
|
||||
case wxSET: // 1
|
||||
// case wxSRC_OR: // source _bitmap_ OR destination
|
||||
// case wxSRC_AND: // source _bitmap_ AND destination
|
||||
// case wxSRC_OR: // source _bitmap_ OR destination
|
||||
// case wxSRC_AND: // source _bitmap_ AND destination
|
||||
break ;
|
||||
}
|
||||
::PenMode( mode ) ;
|
||||
@@ -1710,8 +1774,8 @@ void wxDC::MacInstallFont() const
|
||||
{
|
||||
kATSUFontTag ,
|
||||
kATSUSizeTag ,
|
||||
// kATSUColorTag ,
|
||||
// kATSUBaselineClassTag ,
|
||||
// kATSUColorTag ,
|
||||
// kATSUBaselineClassTag ,
|
||||
kATSUVerticalCharacterTag,
|
||||
kATSUQDBoldfaceTag ,
|
||||
kATSUQDItalicTag ,
|
||||
@@ -1723,8 +1787,8 @@ void wxDC::MacInstallFont() const
|
||||
{
|
||||
sizeof( ATSUFontID ) ,
|
||||
sizeof( Fixed ) ,
|
||||
// sizeof( RGBColor ) ,
|
||||
// sizeof( BslnBaselineClass ) ,
|
||||
// sizeof( RGBColor ) ,
|
||||
// sizeof( BslnBaselineClass ) ,
|
||||
sizeof( ATSUVerticalCharacterType),
|
||||
sizeof( Boolean ) ,
|
||||
sizeof( Boolean ) ,
|
||||
@@ -1740,8 +1804,8 @@ void wxDC::MacInstallFont() const
|
||||
{
|
||||
&atsuFont ,
|
||||
&atsuSize ,
|
||||
// &MAC_WXCOLORREF( m_textForegroundColour.GetPixel() ) ,
|
||||
// &kBaselineDefault ,
|
||||
// &MAC_WXCOLORREF( m_textForegroundColour.GetPixel() ) ,
|
||||
// &kBaselineDefault ,
|
||||
&kHorizontal,
|
||||
(qdStyle & bold) ? &kTrue : &kFalse ,
|
||||
(qdStyle & italic) ? &kTrue : &kFalse ,
|
||||
@@ -1753,6 +1817,7 @@ void wxDC::MacInstallFont() const
|
||||
atsuTags, atsuSizes, atsuValues);
|
||||
wxASSERT_MSG( status == noErr , "couldn't set create ATSU style" ) ;
|
||||
}
|
||||
|
||||
Pattern gHatchPatterns[] =
|
||||
{
|
||||
{ { 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF } },
|
||||
@@ -1763,6 +1828,7 @@ Pattern gHatchPatterns[] =
|
||||
{ { 0x10 , 0x10 , 0x10 , 0x10 , 0x10 , 0x10 , 0x10 , 0x10 } },
|
||||
{ { 0x81 , 0x42 , 0x24 , 0x18 , 0x18 , 0x24 , 0x42 , 0x81 } }
|
||||
} ;
|
||||
|
||||
static void wxMacGetHatchPattern(int hatchStyle, Pattern *pattern)
|
||||
{
|
||||
int theIndex = 1 ;
|
||||
@@ -1792,12 +1858,13 @@ static void wxMacGetHatchPattern(int hatchStyle, Pattern *pattern)
|
||||
}
|
||||
*pattern = gHatchPatterns[theIndex-1] ;
|
||||
}
|
||||
|
||||
void wxDC::MacInstallPen() const
|
||||
{
|
||||
wxCHECK_RET(Ok(), wxT("Invalid DC"));
|
||||
Pattern blackColor;
|
||||
// if ( m_macPenInstalled )
|
||||
// return ;
|
||||
// if ( m_macPenInstalled )
|
||||
// return ;
|
||||
RGBColor forecolor = MAC_WXCOLORREF( m_pen.GetColour().GetPixel());
|
||||
RGBColor backcolor = MAC_WXCOLORREF( m_backgroundBrush.GetColour().GetPixel());
|
||||
::RGBForeColor( &forecolor );
|
||||
@@ -1872,7 +1939,7 @@ void wxDC::MacInstallPen() const
|
||||
mode = patOr ;
|
||||
break ;
|
||||
case wxINVERT: // NOT dst
|
||||
// ::PenPat(GetQDGlobalsBlack(&blackColor));
|
||||
// ::PenPat(GetQDGlobalsBlack(&blackColor));
|
||||
mode = patXor ;
|
||||
break ;
|
||||
case wxXOR: // src XOR dst
|
||||
@@ -1896,8 +1963,8 @@ void wxDC::MacInstallPen() const
|
||||
case wxNAND: // (NOT src) OR (NOT dst)
|
||||
case wxOR: // src OR dst
|
||||
case wxSET: // 1
|
||||
// case wxSRC_OR: // source _bitmap_ OR destination
|
||||
// case wxSRC_AND: // source _bitmap_ AND destination
|
||||
// case wxSRC_OR: // source _bitmap_ OR destination
|
||||
// case wxSRC_AND: // source _bitmap_ AND destination
|
||||
break ;
|
||||
}
|
||||
::PenMode( mode ) ;
|
||||
@@ -1905,6 +1972,7 @@ void wxDC::MacInstallPen() const
|
||||
m_macBrushInstalled = false ;
|
||||
m_macFontInstalled = false ;
|
||||
}
|
||||
|
||||
void wxDC::MacSetupBackgroundForCurrentPort(const wxBrush& background )
|
||||
{
|
||||
Pattern whiteColor ;
|
||||
@@ -1942,12 +2010,13 @@ void wxDC::MacSetupBackgroundForCurrentPort(const wxBrush& background )
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void wxDC::MacInstallBrush() const
|
||||
{
|
||||
wxCHECK_RET(Ok(), wxT("Invalid DC"));
|
||||
Pattern blackColor ;
|
||||
// if ( m_macBrushInstalled )
|
||||
// return ;
|
||||
// if ( m_macBrushInstalled )
|
||||
// return ;
|
||||
// foreground
|
||||
bool backgroundTransparent = (GetBackgroundMode() == wxTRANSPARENT) ;
|
||||
::RGBForeColor( &MAC_WXCOLORREF( m_brush.GetColour().GetPixel()) );
|
||||
@@ -2074,8 +2143,8 @@ void wxDC::MacInstallBrush() const
|
||||
case wxNAND: // (NOT src) OR (NOT dst)
|
||||
case wxOR: // src OR dst
|
||||
case wxSET: // 1
|
||||
// case wxSRC_OR: // source _bitmap_ OR destination
|
||||
// case wxSRC_AND: // source _bitmap_ AND destination
|
||||
// case wxSRC_OR: // source _bitmap_ OR destination
|
||||
// case wxSRC_AND: // source _bitmap_ AND destination
|
||||
break ;
|
||||
}
|
||||
::PenMode( mode ) ;
|
||||
@@ -2083,6 +2152,7 @@ void wxDC::MacInstallBrush() const
|
||||
m_macPenInstalled = false ;
|
||||
m_macFontInstalled = false ;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// coordinates transformations
|
||||
// ---------------------------------------------------------------------------
|
||||
@@ -2091,30 +2161,37 @@ wxCoord wxDCBase::DeviceToLogicalX(wxCoord x) const
|
||||
{
|
||||
return ((wxDC *)this)->XDEV2LOG(x);
|
||||
}
|
||||
|
||||
wxCoord wxDCBase::DeviceToLogicalY(wxCoord y) const
|
||||
{
|
||||
return ((wxDC *)this)->YDEV2LOG(y);
|
||||
}
|
||||
|
||||
wxCoord wxDCBase::DeviceToLogicalXRel(wxCoord x) const
|
||||
{
|
||||
return ((wxDC *)this)->XDEV2LOGREL(x);
|
||||
}
|
||||
|
||||
wxCoord wxDCBase::DeviceToLogicalYRel(wxCoord y) const
|
||||
{
|
||||
return ((wxDC *)this)->YDEV2LOGREL(y);
|
||||
}
|
||||
|
||||
wxCoord wxDCBase::LogicalToDeviceX(wxCoord x) const
|
||||
{
|
||||
return ((wxDC *)this)->XLOG2DEV(x);
|
||||
}
|
||||
|
||||
wxCoord wxDCBase::LogicalToDeviceY(wxCoord y) const
|
||||
{
|
||||
return ((wxDC *)this)->YLOG2DEV(y);
|
||||
}
|
||||
|
||||
wxCoord wxDCBase::LogicalToDeviceXRel(wxCoord x) const
|
||||
{
|
||||
return ((wxDC *)this)->XLOG2DEVREL(x);
|
||||
}
|
||||
|
||||
wxCoord wxDCBase::LogicalToDeviceYRel(wxCoord y) const
|
||||
{
|
||||
return ((wxDC *)this)->YLOG2DEVREL(y);
|
||||
|
@@ -23,7 +23,7 @@
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxMemoryDC,wxPaintDC)
|
||||
|
||||
wxMemoryDC::wxMemoryDC(void)
|
||||
: m_selected()
|
||||
: m_selected()
|
||||
{
|
||||
m_ok = TRUE;
|
||||
SetBackground(*wxWHITE_BRUSH);
|
||||
@@ -33,7 +33,7 @@ wxMemoryDC::wxMemoryDC(void)
|
||||
};
|
||||
|
||||
wxMemoryDC::wxMemoryDC( wxDC *WXUNUSED(dc) )
|
||||
: m_selected()
|
||||
: m_selected()
|
||||
{
|
||||
m_ok = TRUE;
|
||||
SetBackground(*wxWHITE_BRUSH);
|
||||
|
@@ -57,7 +57,6 @@ bool wxDialog::Create(wxWindow *parent, wxWindowID id,
|
||||
long style,
|
||||
const wxString& name)
|
||||
{
|
||||
|
||||
SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE));
|
||||
|
||||
|
||||
@@ -68,6 +67,7 @@ bool wxDialog::Create(wxWindow *parent, wxWindowID id,
|
||||
|
||||
m_macWindowBackgroundTheme = kThemeBrushDialogBackgroundActive ;
|
||||
SetThemeWindowBackground( (WindowRef) m_macWindow , m_macWindowBackgroundTheme , false ) ;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -96,8 +96,7 @@ wxDialog::~wxDialog()
|
||||
// By default, pressing escape cancels the dialog , on mac command-stop does the same thing
|
||||
void wxDialog::OnCharHook(wxKeyEvent& event)
|
||||
{
|
||||
if (
|
||||
( event.m_keyCode == WXK_ESCAPE ||
|
||||
if (( event.m_keyCode == WXK_ESCAPE ||
|
||||
( event.m_keyCode == '.' && event.MetaDown() ) )
|
||||
&& FindWindow(wxID_CANCEL) )
|
||||
{
|
||||
|
@@ -121,7 +121,6 @@ wxFrame::~wxFrame()
|
||||
m_isBeingDeleted = TRUE;
|
||||
|
||||
DeleteAllBars();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@@ -34,14 +34,14 @@
|
||||
#include "wx/mac/uma.h"
|
||||
|
||||
/*
|
||||
* GLContext implementation
|
||||
*/
|
||||
* GLContext implementation
|
||||
*/
|
||||
|
||||
wxGLContext::wxGLContext(
|
||||
AGLPixelFormat fmt, wxGLCanvas *win,
|
||||
const wxPalette& palette,
|
||||
const wxGLContext *other /* for sharing display lists */
|
||||
)
|
||||
)
|
||||
{
|
||||
m_window = win;
|
||||
|
||||
@@ -108,8 +108,8 @@ void wxGLContext::SetColour(const char *colour)
|
||||
|
||||
|
||||
/*
|
||||
* wxGLCanvas implementation
|
||||
*/
|
||||
* wxGLCanvas implementation
|
||||
*/
|
||||
|
||||
IMPLEMENT_CLASS(wxGLCanvas, wxWindow)
|
||||
|
||||
|
@@ -104,12 +104,12 @@ bool wxICONResourceHandler::LoadFile(wxBitmap *bitmap, const wxString& name, lo
|
||||
Str255 theName ;
|
||||
OSType theType ;
|
||||
|
||||
#if TARGET_CARBON
|
||||
#if TARGET_CARBON
|
||||
c2pstrcpy( (StringPtr) theName , name ) ;
|
||||
#else
|
||||
#else
|
||||
strcpy( (char *) theName , name ) ;
|
||||
c2pstr( (char *) theName ) ;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
Handle resHandle = GetNamedResource( 'cicn' , theName ) ;
|
||||
if ( resHandle != 0L )
|
||||
|
@@ -24,7 +24,7 @@
|
||||
#include "wx/utils.h"
|
||||
|
||||
#if !USE_SHARED_LIBRARY
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxListBox, wxControl)
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxListBox, wxControl)
|
||||
|
||||
BEGIN_EVENT_TABLE(wxListBox, wxControl)
|
||||
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"));
|
||||
#else // !wxUSE_OWNER_DRAWN
|
||||
Append( choices[i] , clientData[i] ) ;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
else
|
||||
Append( choices[i] ) ;
|
||||
@@ -704,7 +704,7 @@ void wxListBox::SetupColours()
|
||||
void wxListBox::Refresh(bool eraseBack, const wxRect *rect)
|
||||
{
|
||||
wxControl::Refresh( eraseBack , rect ) ;
|
||||
// MacRedrawControl() ;
|
||||
// MacRedrawControl() ;
|
||||
}
|
||||
|
||||
#if wxUSE_OWNER_DRAWN
|
||||
@@ -735,9 +735,9 @@ wxOwnerDrawn *wxListBox::CreateItem(size_t n)
|
||||
/*
|
||||
void MacDrawStringCell(Rect *cellRect, Cell lCell, ListHandle theList, long refCon)
|
||||
{
|
||||
wxListBox* list;
|
||||
// typecast our refCon
|
||||
list = (wxListBox*)refCon;
|
||||
wxListBox* list;
|
||||
// typecast our refCon
|
||||
list = (wxListBox*)refCon;
|
||||
|
||||
MoveTo(cellRect->left + 4 , cellRect->top + 10 );
|
||||
const wxString text = list->m_stringArray[lCell.v] ;
|
||||
@@ -746,7 +746,7 @@ void MacDrawStringCell(Rect *cellRect, Cell lCell, ListHandle theList, long refC
|
||||
::TextFace( 0 ) ;
|
||||
DrawText(text, 0 , text.Length());
|
||||
|
||||
}
|
||||
}
|
||||
*/
|
||||
void wxListBox::MacDelete( int N )
|
||||
{
|
||||
@@ -759,7 +759,7 @@ void wxListBox::MacInsert( int n , const char * text)
|
||||
Cell cell = { 0 , 0 } ;
|
||||
cell.v = n ;
|
||||
LAddRow( 1 , cell.v , (ListHandle)m_macList ) ;
|
||||
// LSetCell(text, strlen(text), cell, m_macList);
|
||||
// LSetCell(text, strlen(text), cell, m_macList);
|
||||
Refresh();
|
||||
}
|
||||
|
||||
@@ -804,7 +804,7 @@ bool wxListBox::MacIsSelected( int n ) const
|
||||
|
||||
void wxListBox::MacDestroy()
|
||||
{
|
||||
// DisposeExtLDEFInfo( m_macList ) ;
|
||||
// DisposeExtLDEFInfo( m_macList ) ;
|
||||
}
|
||||
|
||||
int wxListBox::MacGetSelection() const
|
||||
@@ -840,7 +840,7 @@ void wxListBox::MacSet( int n , const char * text )
|
||||
// so we just have to redraw
|
||||
Cell cell = { 0 , 0 } ;
|
||||
cell.v = n ;
|
||||
// LSetCell(text, strlen(text), cell, m_macList);
|
||||
// LSetCell(text, strlen(text), cell, m_macList);
|
||||
Refresh();
|
||||
}
|
||||
|
||||
|
@@ -122,8 +122,8 @@ void wxMacRemoveAllNotifiersForData( wxMacNotifierTableRef table , void* data )
|
||||
|
||||
void wxMacProcessNotifierEvents()
|
||||
{
|
||||
// if ( gInProcessing )
|
||||
// return ;
|
||||
// if ( gInProcessing )
|
||||
// return ;
|
||||
|
||||
gInProcessing = true ;
|
||||
if ( gMacNotificationEvents.top != gMacNotificationEvents.bottom )
|
||||
|
@@ -9,7 +9,6 @@
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation "menu.h"
|
||||
#pragma implementation "menuitem.h"
|
||||
|
@@ -86,7 +86,7 @@ wxMetaFile::~wxMetaFile()
|
||||
bool wxMetaFile::SetClipboard(int width, int height)
|
||||
{
|
||||
#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)
|
||||
return FALSE;
|
||||
|
||||
|
@@ -10,7 +10,7 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation "notebook.h"
|
||||
#pragma implementation "notebook.h"
|
||||
#endif
|
||||
|
||||
// ============================================================================
|
||||
@@ -35,10 +35,10 @@
|
||||
|
||||
static bool constantsSet = false ;
|
||||
|
||||
short kwxMacTabLeftMargin = 0 ;
|
||||
short kwxMacTabTopMargin = 0 ;
|
||||
short kwxMacTabRightMargin = 0 ;
|
||||
short kwxMacTabBottomMargin = 0 ;
|
||||
short kwxMacTabLeftMargin = 0 ;
|
||||
short kwxMacTabTopMargin = 0 ;
|
||||
short kwxMacTabRightMargin = 0 ;
|
||||
short kwxMacTabBottomMargin = 0 ;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// event table
|
||||
@@ -49,12 +49,12 @@ DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED)
|
||||
DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING)
|
||||
|
||||
BEGIN_EVENT_TABLE(wxNotebook, wxControl)
|
||||
EVT_NOTEBOOK_PAGE_CHANGED(-1, wxNotebook::OnSelChange)
|
||||
EVT_MOUSE_EVENTS(wxNotebook::OnMouse)
|
||||
EVT_NOTEBOOK_PAGE_CHANGED(-1, wxNotebook::OnSelChange)
|
||||
EVT_MOUSE_EVENTS(wxNotebook::OnMouse)
|
||||
|
||||
EVT_SIZE(wxNotebook::OnSize)
|
||||
EVT_SET_FOCUS(wxNotebook::OnSetFocus)
|
||||
EVT_NAVIGATION_KEY(wxNotebook::OnNavigationKey)
|
||||
EVT_SIZE(wxNotebook::OnSize)
|
||||
EVT_SET_FOCUS(wxNotebook::OnSetFocus)
|
||||
EVT_NAVIGATION_KEY(wxNotebook::OnNavigationKey)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxNotebook, wxControl)
|
||||
@@ -344,10 +344,10 @@ bool wxNotebook::InsertPage(int nPage,
|
||||
}
|
||||
|
||||
/* Added by Mark Newsam
|
||||
* 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
|
||||
* the user would expect.
|
||||
*/
|
||||
* 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
|
||||
* the user would expect.
|
||||
*/
|
||||
void wxNotebook::MacSetupTabs()
|
||||
{
|
||||
SetControl32BitMaximum( (ControlHandle) m_macControl , GetPageCount() ) ;
|
||||
|
@@ -114,5 +114,5 @@ bool wxPalette::GetRGB(int index, unsigned char *red, unsigned char *green, unsi
|
||||
}
|
||||
|
||||
#endif
|
||||
// wxUSE_PALETTE
|
||||
// wxUSE_PALETTE
|
||||
|
||||
|
@@ -32,7 +32,7 @@ wxPenRefData::wxPenRefData()
|
||||
}
|
||||
|
||||
wxPenRefData::wxPenRefData(const wxPenRefData& data)
|
||||
: wxGDIRefData()
|
||||
: wxGDIRefData()
|
||||
{
|
||||
m_style = data.m_style;
|
||||
m_width = data.m_width;
|
||||
|
@@ -163,7 +163,7 @@ bool wxPNGReader::GetRGB(int x, int y, byte* r, byte* g, byte* b)
|
||||
|
||||
if (m_palette) {
|
||||
return m_palette->GetRGB(GetIndex(x, y), r, g, b);
|
||||
/* PALETTEENTRY entry;
|
||||
/* PALETTEENTRY entry;
|
||||
::GetPaletteEntries((HPALETTE) m_palette->GetHPALETTE(), GetIndex(x, y), 1, &entry);
|
||||
*r = entry.peRed;
|
||||
*g = entry.peGreen;
|
||||
@@ -215,7 +215,7 @@ bool wxPNGReader::SetPalette(wxPalette* colourmap)
|
||||
ColorType |= (COLORTYPE_PALETTE | COLORTYPE_COLOR);
|
||||
m_palette = new wxPalette( *colourmap );
|
||||
return true ;
|
||||
// return (DibSetUsage(lpbi, (HPALETTE) m_palette->GetHPALETTE(), WXIMA_COLORS ) != 0);
|
||||
// return (DibSetUsage(lpbi, (HPALETTE) m_palette->GetHPALETTE(), WXIMA_COLORS ) != 0);
|
||||
}
|
||||
|
||||
bool
|
||||
@@ -231,7 +231,7 @@ wxPNGReader::SetPalette(int n, byte *r, byte *g, byte *b)
|
||||
m_palette->Create(n, r, g, b);
|
||||
ColorType |= (COLORTYPE_PALETTE | COLORTYPE_COLOR);
|
||||
return true ;
|
||||
// return (DibSetUsage(lpbi, (HPALETTE) m_palette->GetHPALETTE(), WXIMA_COLORS ) != 0);
|
||||
// return (DibSetUsage(lpbi, (HPALETTE) m_palette->GetHPALETTE(), WXIMA_COLORS ) != 0);
|
||||
}
|
||||
|
||||
bool
|
||||
@@ -259,7 +259,7 @@ wxPNGReader::SetPalette(int n, rgb_color_struct *rgb_struct)
|
||||
m_palette->Create(n, r, g, b);
|
||||
ColorType |= (COLORTYPE_PALETTE | COLORTYPE_COLOR);
|
||||
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()
|
||||
@@ -314,7 +314,7 @@ bool wxPNGReader::InstantiateBitmap(wxBitmap *bitmap)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
/*
|
||||
/*
|
||||
HDC dc = ::CreateCompatibleDC(NULL);
|
||||
|
||||
if (dc)
|
||||
@@ -381,7 +381,7 @@ wxPalette *wxCopyPalette(const wxPalette *cmap)
|
||||
wxMask *wxPNGReader::CreateMask(void)
|
||||
{
|
||||
/*
|
||||
HBITMAP hBitmap = ::CreateBitmap(GetWidth(), GetHeight(), 1, 1, NULL);
|
||||
HBITMAP hBitmap = ::CreateBitmap(GetWidth(), GetHeight(), 1, 1, NULL);
|
||||
|
||||
HDC dc = ::CreateCompatibleDC(NULL);
|
||||
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);
|
||||
// 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];
|
||||
|
||||
@@ -510,7 +510,7 @@ bool wxPNGReader::ReadFile(char * ImageFileName)
|
||||
number_passes = png_set_interlace_handling(png_ptr);
|
||||
else
|
||||
number_passes = 1;
|
||||
// printf("NP = %d ", number_passes);
|
||||
// printf("NP = %d ", number_passes);
|
||||
|
||||
for (int pass=0; pass< number_passes; pass++)
|
||||
{
|
||||
@@ -619,7 +619,7 @@ bool wxPNGReader::ReadFile(char * ImageFileName)
|
||||
while(iter.PrevRow());
|
||||
SetGWorld( origPort , origDevice ) ;
|
||||
|
||||
// printf("Y=%d ",y);
|
||||
// printf("Y=%d ",y);
|
||||
}
|
||||
delete[] row_pointers;
|
||||
|
||||
@@ -688,7 +688,7 @@ bool wxPNGReader::SaveFile(char * ImageFileName)
|
||||
}
|
||||
//png_set_error(ima_png_error, NULL);
|
||||
|
||||
// printf("writig pg %s ", filename);
|
||||
// printf("writig pg %s ", filename);
|
||||
/* initialize the structures */
|
||||
png_info_init(info_ptr);
|
||||
png_write_init(png_ptr);
|
||||
@@ -709,27 +709,27 @@ bool wxPNGReader::SaveFile(char * ImageFileName)
|
||||
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 */
|
||||
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->palette = new png_color[256];
|
||||
info_ptr->num_palette = 256;
|
||||
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);
|
||||
}
|
||||
// printf("Paleta [%d %d %x]",GetColorType() ,COLORTYPE_PALETTE, GetPalette());
|
||||
// printf("Paleta [%d %d %x]",GetColorType() ,COLORTYPE_PALETTE, GetPalette());
|
||||
|
||||
|
||||
/* optional significant bit chunk */
|
||||
// info_ptr->valid |= PNG_INFO_sBIT;
|
||||
// info_ptr->sig_bit = true_bit_depth;
|
||||
// info_ptr->valid |= PNG_INFO_sBIT;
|
||||
// info_ptr->sig_bit = true_bit_depth;
|
||||
|
||||
/* optional gamma chunk */
|
||||
// info_ptr->valid |= PNG_INFO_gAMA;
|
||||
// info_ptr->gamma = gamma;
|
||||
// info_ptr->valid |= PNG_INFO_gAMA;
|
||||
// info_ptr->gamma = gamma;
|
||||
|
||||
/* other optional chunks */
|
||||
|
||||
@@ -741,33 +741,33 @@ bool wxPNGReader::SaveFile(char * ImageFileName)
|
||||
|
||||
/* shift the pixels up to a legal bit depth and fill in
|
||||
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 */
|
||||
// png_set_packing(png_ptr);
|
||||
// png_set_packing(png_ptr);
|
||||
|
||||
/* 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 */
|
||||
// png_set_swap(png_ptr);
|
||||
// png_set_swap(png_ptr);
|
||||
|
||||
/* 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];
|
||||
iter.upset();
|
||||
do {
|
||||
// (unsigned char *)iter.GetRow();
|
||||
// (unsigned char *)iter.GetRow();
|
||||
iter.GetRow(row_pointers, row_stride);
|
||||
png_write_row(png_ptr, row_pointers);
|
||||
} while(iter.PrevRow());
|
||||
|
||||
delete[] row_pointers;
|
||||
|
||||
/* write the rest of the file */
|
||||
/* write the rest of the file */
|
||||
png_write_end(png_ptr, info_ptr);
|
||||
|
||||
/* 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',
|
||||
'C', 'D', 'E', 'F' };
|
||||
'C', 'D', 'E', 'F' };
|
||||
|
||||
static void DecToHex(int dec, char *buf)
|
||||
{
|
||||
|
@@ -19,7 +19,7 @@
|
||||
#include "wx/msgdlg.h"
|
||||
#include "wx/mac/uma.h"
|
||||
#ifndef __DARWIN__
|
||||
#include "Printing.h"
|
||||
#include "Printing.h"
|
||||
#endif
|
||||
|
||||
#if defined(TARGET_CARBON) && !defined(__DARWIN__)
|
||||
@@ -103,7 +103,7 @@ int wxPrintDialog::ShowModal()
|
||||
}
|
||||
::UMAPrClose(NULL) ;
|
||||
#else
|
||||
#if PM_USE_SESSION_APIS
|
||||
#if PM_USE_SESSION_APIS
|
||||
Boolean accepted;
|
||||
|
||||
{
|
||||
@@ -183,9 +183,9 @@ int wxPrintDialog::ShowModal()
|
||||
wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
|
||||
dialog.ShowModal();
|
||||
}
|
||||
#else
|
||||
#pragma warning "TODO: Printing for carbon without session apis"
|
||||
#endif
|
||||
#else
|
||||
#pragma warning "TODO: Printing for carbon without session apis"
|
||||
#endif
|
||||
#endif
|
||||
return result ;
|
||||
}
|
||||
@@ -196,17 +196,17 @@ wxDC *wxPrintDialog::GetPrintDC()
|
||||
}
|
||||
|
||||
/*
|
||||
* wxPageSetupDialog
|
||||
*/
|
||||
* wxPageSetupDialog
|
||||
*/
|
||||
|
||||
wxPageSetupDialog::wxPageSetupDialog():
|
||||
wxDialog()
|
||||
wxDialog()
|
||||
{
|
||||
m_dialogParent = NULL;
|
||||
}
|
||||
|
||||
wxPageSetupDialog::wxPageSetupDialog(wxWindow *p, wxPageSetupData *data):
|
||||
wxDialog()
|
||||
wxDialog()
|
||||
{
|
||||
Create(p, data);
|
||||
}
|
||||
@@ -251,7 +251,7 @@ int wxPageSetupDialog::ShowModal()
|
||||
}
|
||||
::UMAPrClose(NULL) ;
|
||||
#else
|
||||
#if PM_USE_SESSION_APIS
|
||||
#if PM_USE_SESSION_APIS
|
||||
Boolean accepted;
|
||||
|
||||
{
|
||||
@@ -305,9 +305,9 @@ int wxPageSetupDialog::ShowModal()
|
||||
wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
|
||||
dialog.ShowModal();
|
||||
}
|
||||
#else
|
||||
#pragma warning "TODO: Printing for carbon without session apis"
|
||||
#endif
|
||||
#else
|
||||
#pragma warning "TODO: Printing for carbon without session apis"
|
||||
#endif
|
||||
#endif
|
||||
return result ;
|
||||
}
|
||||
|
@@ -43,11 +43,11 @@ IMPLEMENT_CLASS(wxMacPrintPreview, wxPrintPreviewBase)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Printer
|
||||
*/
|
||||
* Printer
|
||||
*/
|
||||
|
||||
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,
|
||||
wxPrintout *printoutForPrinting,
|
||||
@@ -252,7 +252,7 @@ wxMacPrintPreview::wxMacPrintPreview(wxPrintout *printout,
|
||||
}
|
||||
|
||||
wxMacPrintPreview::wxMacPrintPreview(wxPrintout *printout, wxPrintout *printoutForPrinting, wxPrintData *data):
|
||||
wxPrintPreviewBase(printout, printoutForPrinting, data)
|
||||
wxPrintPreviewBase(printout, printoutForPrinting, data)
|
||||
{
|
||||
DetermineScaling();
|
||||
}
|
||||
|
@@ -10,8 +10,8 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation "radioboxbase.h"
|
||||
#pragma implementation "radiobox.h"
|
||||
#pragma implementation "radioboxbase.h"
|
||||
#pragma implementation "radiobox.h"
|
||||
#endif
|
||||
|
||||
//-------------------------------------------------------------------------------------
|
||||
@@ -126,7 +126,7 @@ bool wxRadioBox::Create(wxWindow *parent, wxWindowID id, const wxString& label,
|
||||
wxDefaultSize , i == 0 ? wxRB_GROUP : 0 ) ;
|
||||
if ( i == 0 )
|
||||
m_radioButtonCycle = radBtn ;
|
||||
// m_radioButtonCycle=radBtn->AddInCycle(m_radioButtonCycle);
|
||||
// m_radioButtonCycle=radBtn->AddInCycle(m_radioButtonCycle);
|
||||
}
|
||||
|
||||
SetSelection(0);
|
||||
@@ -386,7 +386,7 @@ void wxRadioBox::DoSetSize(int x, int y, int width, int height, int sizeFlags)
|
||||
int i;
|
||||
wxRadioButton *current;
|
||||
|
||||
// define the position
|
||||
// define the position
|
||||
|
||||
int x_current, y_current;
|
||||
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))
|
||||
y_offset = y_current;
|
||||
|
||||
// define size
|
||||
// define size
|
||||
|
||||
int charWidth,charHeight;
|
||||
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);
|
||||
|
||||
// arrange radiobuttons
|
||||
// arrange radiobuttons
|
||||
|
||||
int x_start,y_start;
|
||||
|
||||
|
@@ -24,23 +24,22 @@ END_EVENT_TABLE()
|
||||
#endif
|
||||
|
||||
// The dimensions of the different styles of sliders (From Aqua document)
|
||||
#define wxSLIDER_DIMENSIONACROSS 15
|
||||
#define wxSLIDER_DIMENSIONACROSS_WITHTICKMARKS 24
|
||||
#define wxSLIDER_DIMENSIONACROSS_ARROW 18
|
||||
#define wxSLIDER_DIMENSIONACROSS 15
|
||||
#define wxSLIDER_DIMENSIONACROSS_WITHTICKMARKS 24
|
||||
#define wxSLIDER_DIMENSIONACROSS_ARROW 18
|
||||
|
||||
// Distance between slider and text
|
||||
#define wxSLIDER_BORDERTEXT 5
|
||||
// Distance between slider and text
|
||||
#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
|
||||
* 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
|
||||
* eg. if(GetWindowStyle() & wxSL_VERTICAL) {} else { horizontal case }>
|
||||
*/
|
||||
|
||||
|
||||
// Slider
|
||||
wxSlider::wxSlider()
|
||||
// Slider
|
||||
wxSlider::wxSlider()
|
||||
{
|
||||
m_pageSize = 1;
|
||||
m_lineSize = 1;
|
||||
@@ -257,12 +256,12 @@ void wxSlider::MacHandleControlClick( WXWidget control , wxInt16 controlpart )
|
||||
GetEventHandler()->ProcessEvent( cevent );
|
||||
}
|
||||
|
||||
/* 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 */
|
||||
void wxSlider::SetSizeHints( int minW, int minH,
|
||||
/* 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 */
|
||||
void wxSlider::SetSizeHints( int minW, int minH,
|
||||
int maxW , int maxH ,
|
||||
int incW , int incH )
|
||||
{
|
||||
{
|
||||
wxSize size = GetBestSize();
|
||||
|
||||
if(GetWindowStyle() & wxSL_VERTICAL) {
|
||||
@@ -271,10 +270,10 @@ void wxSlider::MacHandleControlClick( WXWidget control , wxInt16 controlpart )
|
||||
else {
|
||||
wxWindow::SetSizeHints(minW, size.y, maxW, size.y, incW, incH);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
wxSize wxSlider::DoGetBestSize() const
|
||||
{
|
||||
wxSize wxSlider::DoGetBestSize() const
|
||||
{
|
||||
wxSize size;
|
||||
int textwidth, textheight;
|
||||
|
||||
@@ -323,14 +322,14 @@ void wxSlider::MacHandleControlClick( WXWidget control , wxInt16 controlpart )
|
||||
size.x = 150;
|
||||
}
|
||||
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 ) ;
|
||||
}
|
||||
}
|
||||
|
||||
void wxSlider::MacUpdateDimensions()
|
||||
void wxSlider::MacUpdateDimensions()
|
||||
{
|
||||
// actually in the current systems this should never be possible, but later reparenting
|
||||
// may become a reality
|
||||
|
@@ -137,13 +137,13 @@ void wxStaticText::OnDraw( wxDC &dc )
|
||||
{
|
||||
if (m_width <= 0 || m_height <= 0)
|
||||
return;
|
||||
/*
|
||||
/*
|
||||
dc.Clear() ;
|
||||
wxRect rect(0,0,m_width,m_height) ;
|
||||
dc.SetFont(*wxSMALL_FONT) ;
|
||||
|
||||
dc.DrawRectangle(rect) ;
|
||||
*/
|
||||
*/
|
||||
if ( !IsWindowHilited( (WindowRef) MacGetRootWindow() ) &&
|
||||
( GetBackgroundColour() == wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE )
|
||||
|| GetBackgroundColour() == wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE) ) )
|
||||
|
@@ -902,5 +902,3 @@ bool WXDLLEXPORT wxIsWaitingForThread()
|
||||
#include "wx/thrimpl.cpp"
|
||||
|
||||
#endif // wxUSE_THREADS
|
||||
|
||||
// vi:sts=4:sw=4:et
|
||||
|
@@ -116,7 +116,6 @@ void wxToolBar::Init()
|
||||
bool wxToolBar::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size,
|
||||
long style, const wxString& name)
|
||||
{
|
||||
|
||||
int x = pos.x;
|
||||
int y = pos.y;
|
||||
int width = size.x;
|
||||
@@ -376,7 +375,7 @@ void wxToolBar::MacSuperChangedPosition()
|
||||
localOrigin.v = ly ;
|
||||
localOrigin.h = lx ;
|
||||
|
||||
// GetParent()->MacGetPortParams( &localOrigin , &clipRect , &window , &win ) ;
|
||||
// GetParent()->MacGetPortParams( &localOrigin , &clipRect , &window , &win ) ;
|
||||
|
||||
Rect toolbarrect = { localOrigin.v ,localOrigin.h ,
|
||||
m_height + localOrigin.v , m_width + localOrigin.h} ;
|
||||
|
@@ -632,7 +632,6 @@ WXWidget wxTopLevelWindowMac::MacGetContainerForEmbedding()
|
||||
|
||||
void wxTopLevelWindowMac::MacUpdate( long timestamp)
|
||||
{
|
||||
|
||||
wxMacPortStateHelper help( (GrafPtr) GetWindowPort( (WindowRef) m_macWindow) ) ;
|
||||
|
||||
BeginUpdate( (WindowRef)m_macWindow ) ;
|
||||
@@ -770,6 +769,7 @@ void wxTopLevelWindowMac::MacFireMouseEvent(
|
||||
MacDispatchMouseEvent( event ) ;
|
||||
}
|
||||
}
|
||||
|
||||
#if !TARGET_CARBON
|
||||
|
||||
void wxTopLevelWindowMac::MacMouseDown( WXEVENTREF ev , short part)
|
||||
|
@@ -692,8 +692,6 @@ OSErr UMASetKeyboardFocus (WindowPtr inWindow,
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// events
|
||||
void UMAUpdateControls( WindowPtr inWindow , RgnHandle inRgn )
|
||||
{
|
||||
@@ -707,7 +705,6 @@ void UMAUpdateControls( WindowPtr inWindow , RgnHandle inRgn )
|
||||
UpdateControls( inWindow , inRgn ) ;
|
||||
InvalWindowRgn( inWindow, updateRgn) ;
|
||||
DisposeRgn( updateRgn ) ;
|
||||
|
||||
}
|
||||
|
||||
bool UMAIsWindowFloating( WindowRef inWindow )
|
||||
@@ -750,6 +747,7 @@ void UMAHighlightAndActivateWindow( WindowRef inWindowRef , bool inActivate )
|
||||
SetPort( port ) ;
|
||||
}
|
||||
}
|
||||
|
||||
OSStatus UMADrawThemePlacard( const Rect *inRect , ThemeDrawState inState )
|
||||
{
|
||||
return ::DrawThemePlacard( inRect , inState ) ;
|
||||
|
@@ -980,7 +980,7 @@ wxWindowMac *wxGetActiveWindow()
|
||||
// Coordinates relative to the window
|
||||
void wxWindowMac::WarpPointer (int x_pos, int y_pos)
|
||||
{
|
||||
// We really dont move the mouse programmatically under mac
|
||||
// We really don't move the mouse programmatically under Mac.
|
||||
}
|
||||
|
||||
const wxBrush& wxWindowMac::MacGetBackgroundBrush()
|
||||
@@ -1045,7 +1045,6 @@ const wxBrush& wxWindowMac::MacGetBackgroundBrush()
|
||||
}
|
||||
|
||||
return m_macBackgroundBrush ;
|
||||
|
||||
}
|
||||
|
||||
void wxWindowMac::OnEraseBackground(wxEraseEvent& event)
|
||||
|
Reference in New Issue
Block a user