Get/SetTitle only for wxTopLevelWindow (wxMac part).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36104 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: private.h
|
// Name: wx/mac/carbon/private.h
|
||||||
// Purpose: Private declarations: as this header is only included by
|
// Purpose: Private declarations: as this header is only included by
|
||||||
// wxWidgets itself, it may contain identifiers which don't start
|
// wxWidgets itself, it may contain identifiers which don't start
|
||||||
// with "wx".
|
// with "wx".
|
||||||
@@ -67,12 +67,12 @@ inline int FixedToInt( Fixed inFixed )
|
|||||||
#include "wx/window.h"
|
#include "wx/window.h"
|
||||||
#include "wx/toplevel.h"
|
#include "wx/toplevel.h"
|
||||||
|
|
||||||
class wxMacPortStateHelper
|
class wxMacPortStateHelper
|
||||||
{
|
{
|
||||||
DECLARE_NO_COPY_CLASS(wxMacPortStateHelper)
|
DECLARE_NO_COPY_CLASS(wxMacPortStateHelper)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
wxMacPortStateHelper( GrafPtr newport) ;
|
wxMacPortStateHelper( GrafPtr newport) ;
|
||||||
wxMacPortStateHelper() ;
|
wxMacPortStateHelper() ;
|
||||||
~wxMacPortStateHelper() ;
|
~wxMacPortStateHelper() ;
|
||||||
|
|
||||||
@@ -95,9 +95,9 @@ private:
|
|||||||
class WXDLLEXPORT wxMacPortSaver
|
class WXDLLEXPORT wxMacPortSaver
|
||||||
{
|
{
|
||||||
DECLARE_NO_COPY_CLASS(wxMacPortSaver)
|
DECLARE_NO_COPY_CLASS(wxMacPortSaver)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
wxMacPortSaver( GrafPtr port )
|
wxMacPortSaver( GrafPtr port )
|
||||||
{
|
{
|
||||||
::GetPort( &m_port ) ;
|
::GetPort( &m_port ) ;
|
||||||
::SetPort( port ) ;
|
::SetPort( port ) ;
|
||||||
@@ -113,7 +113,7 @@ private :
|
|||||||
class WXDLLEXPORT wxMacPortSetter
|
class WXDLLEXPORT wxMacPortSetter
|
||||||
{
|
{
|
||||||
DECLARE_NO_COPY_CLASS(wxMacPortSetter)
|
DECLARE_NO_COPY_CLASS(wxMacPortSetter)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
wxMacPortSetter( const wxDC* dc ) ;
|
wxMacPortSetter( const wxDC* dc ) ;
|
||||||
~wxMacPortSetter() ;
|
~wxMacPortSetter() ;
|
||||||
@@ -125,11 +125,11 @@ private:
|
|||||||
/*
|
/*
|
||||||
Clips to the visible region of a control within the current port
|
Clips to the visible region of a control within the current port
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class WXDLLEXPORT wxMacWindowClipper : public wxMacPortSaver
|
class WXDLLEXPORT wxMacWindowClipper : public wxMacPortSaver
|
||||||
{
|
{
|
||||||
DECLARE_NO_COPY_CLASS(wxMacWindowClipper)
|
DECLARE_NO_COPY_CLASS(wxMacWindowClipper)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
wxMacWindowClipper( const wxWindow* win ) ;
|
wxMacWindowClipper( const wxWindow* win ) ;
|
||||||
~wxMacWindowClipper() ;
|
~wxMacWindowClipper() ;
|
||||||
@@ -142,7 +142,7 @@ private:
|
|||||||
class WXDLLEXPORT wxMacWindowStateSaver : public wxMacWindowClipper
|
class WXDLLEXPORT wxMacWindowStateSaver : public wxMacWindowClipper
|
||||||
{
|
{
|
||||||
DECLARE_NO_COPY_CLASS(wxMacWindowStateSaver)
|
DECLARE_NO_COPY_CLASS(wxMacWindowStateSaver)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
wxMacWindowStateSaver( const wxWindow* win ) ;
|
wxMacWindowStateSaver( const wxWindow* win ) ;
|
||||||
~wxMacWindowStateSaver() ;
|
~wxMacWindowStateSaver() ;
|
||||||
@@ -152,17 +152,17 @@ private:
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
#if wxMAC_USE_CORE_GRAPHICS
|
#if wxMAC_USE_CORE_GRAPHICS
|
||||||
class WXDLLEXPORT wxMacCGContextStateSaver
|
class WXDLLEXPORT wxMacCGContextStateSaver
|
||||||
{
|
{
|
||||||
DECLARE_NO_COPY_CLASS(wxMacCGContextStateSaver)
|
DECLARE_NO_COPY_CLASS(wxMacCGContextStateSaver)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
wxMacCGContextStateSaver( CGContextRef cg )
|
wxMacCGContextStateSaver( CGContextRef cg )
|
||||||
{
|
{
|
||||||
m_cg = cg ;
|
m_cg = cg ;
|
||||||
CGContextSaveGState( cg ) ;
|
CGContextSaveGState( cg ) ;
|
||||||
}
|
}
|
||||||
~wxMacCGContextStateSaver()
|
~wxMacCGContextStateSaver()
|
||||||
{
|
{
|
||||||
CGContextRestoreGState( m_cg ) ;
|
CGContextRestoreGState( m_cg ) ;
|
||||||
}
|
}
|
||||||
@@ -175,7 +175,7 @@ private:
|
|||||||
class wxMacDrawingHelper
|
class wxMacDrawingHelper
|
||||||
{
|
{
|
||||||
DECLARE_NO_COPY_CLASS(wxMacDrawingHelper)
|
DECLARE_NO_COPY_CLASS(wxMacDrawingHelper)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
wxMacDrawingHelper( wxWindowMac * theWindow , bool clientArea = false ) ;
|
wxMacDrawingHelper( wxWindowMac * theWindow , bool clientArea = false ) ;
|
||||||
~wxMacDrawingHelper() ;
|
~wxMacDrawingHelper() ;
|
||||||
@@ -235,34 +235,34 @@ template<> inline EventParamType wxMacGetEventParamType<CGContextRef>() { return
|
|||||||
|
|
||||||
class wxMacCarbonEvent
|
class wxMacCarbonEvent
|
||||||
{
|
{
|
||||||
|
|
||||||
public :
|
public :
|
||||||
wxMacCarbonEvent()
|
wxMacCarbonEvent()
|
||||||
{
|
{
|
||||||
m_eventRef = 0 ;
|
m_eventRef = 0 ;
|
||||||
m_release = false ;
|
m_release = false ;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxMacCarbonEvent( EventRef event , bool release = false )
|
wxMacCarbonEvent( EventRef event , bool release = false )
|
||||||
{
|
{
|
||||||
m_eventRef = event ;
|
m_eventRef = event ;
|
||||||
m_release = release ;
|
m_release = release ;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxMacCarbonEvent(UInt32 inClassID,UInt32 inKind,EventTime inWhen = 0 /*now*/,EventAttributes inAttributes=kEventAttributeNone)
|
wxMacCarbonEvent(UInt32 inClassID,UInt32 inKind,EventTime inWhen = 0 /*now*/,EventAttributes inAttributes=kEventAttributeNone)
|
||||||
{
|
{
|
||||||
m_eventRef = NULL ;
|
m_eventRef = NULL ;
|
||||||
verify_noerr( MacCreateEvent( NULL , inClassID, inKind,inWhen,inAttributes,&m_eventRef) ) ;
|
verify_noerr( MacCreateEvent( NULL , inClassID, inKind,inWhen,inAttributes,&m_eventRef) ) ;
|
||||||
m_release = true ;
|
m_release = true ;
|
||||||
}
|
}
|
||||||
|
|
||||||
~wxMacCarbonEvent()
|
~wxMacCarbonEvent()
|
||||||
{
|
{
|
||||||
if ( m_release )
|
if ( m_release )
|
||||||
ReleaseEvent( m_eventRef ) ;
|
ReleaseEvent( m_eventRef ) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
OSStatus Create(UInt32 inClassID,UInt32 inKind,EventTime inWhen = 0 /*now*/,EventAttributes inAttributes=kEventAttributeNone)
|
OSStatus Create(UInt32 inClassID,UInt32 inKind,EventTime inWhen = 0 /*now*/,EventAttributes inAttributes=kEventAttributeNone)
|
||||||
{
|
{
|
||||||
verify( (m_eventRef == NULL) || m_release ) ;
|
verify( (m_eventRef == NULL) || m_release ) ;
|
||||||
if ( m_eventRef && m_release )
|
if ( m_eventRef && m_release )
|
||||||
@@ -270,16 +270,15 @@ public :
|
|||||||
ReleaseEvent( m_eventRef ) ;
|
ReleaseEvent( m_eventRef ) ;
|
||||||
m_release = false ;
|
m_release = false ;
|
||||||
m_eventRef = NULL ;
|
m_eventRef = NULL ;
|
||||||
|
|
||||||
}
|
}
|
||||||
OSStatus err = MacCreateEvent( NULL , inClassID, inKind,inWhen,inAttributes,&m_eventRef) ;
|
OSStatus err = MacCreateEvent( NULL , inClassID, inKind,inWhen,inAttributes,&m_eventRef) ;
|
||||||
if ( err == noErr )
|
if ( err == noErr )
|
||||||
m_release = true ;
|
m_release = true ;
|
||||||
return err ;
|
return err ;
|
||||||
}
|
}
|
||||||
|
|
||||||
OSStatus GetParameter( EventParamName inName, EventParamType inDesiredType, UInt32 inBufferSize, void * outData) ;
|
OSStatus GetParameter( EventParamName inName, EventParamType inDesiredType, UInt32 inBufferSize, void * outData) ;
|
||||||
|
|
||||||
template <typename T> OSStatus GetParameter( EventParamName inName, EventParamType type , T *data )
|
template <typename T> OSStatus GetParameter( EventParamName inName, EventParamType type , T *data )
|
||||||
{
|
{
|
||||||
return GetParameter( inName, type , sizeof( T ) , data ) ;
|
return GetParameter( inName, type , sizeof( T ) , data ) ;
|
||||||
@@ -288,7 +287,7 @@ public :
|
|||||||
{
|
{
|
||||||
return GetParameter<T>( inName, wxMacGetEventParamType<T>() , data ) ;
|
return GetParameter<T>( inName, wxMacGetEventParamType<T>() , data ) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T> T GetParameter( EventParamName inName )
|
template <typename T> T GetParameter( EventParamName inName )
|
||||||
{
|
{
|
||||||
T value ;
|
T value ;
|
||||||
@@ -301,7 +300,7 @@ public :
|
|||||||
verify_noerr( GetParameter<T>( inName, inDesiredType , &value ) ) ;
|
verify_noerr( GetParameter<T>( inName, inDesiredType , &value ) ) ;
|
||||||
return value ;
|
return value ;
|
||||||
}
|
}
|
||||||
|
|
||||||
OSStatus SetParameter( EventParamName inName, EventParamType inType, UInt32 inSize, const void * inData) ;
|
OSStatus SetParameter( EventParamName inName, EventParamType inType, UInt32 inSize, const void * inData) ;
|
||||||
template <typename T> OSStatus SetParameter( EventParamName inName, EventParamType inDesiredType , const T *data )
|
template <typename T> OSStatus SetParameter( EventParamName inName, EventParamType inDesiredType , const T *data )
|
||||||
{
|
{
|
||||||
@@ -339,13 +338,13 @@ public :
|
|||||||
{
|
{
|
||||||
return ::SetEventTime( m_eventRef , GetCurrentEventTime() ) ;
|
return ::SetEventTime( m_eventRef , GetCurrentEventTime() ) ;
|
||||||
}
|
}
|
||||||
OSStatus SetTime( EventTime when )
|
OSStatus SetTime( EventTime when )
|
||||||
{
|
{
|
||||||
return ::SetEventTime( m_eventRef , when ) ;
|
return ::SetEventTime( m_eventRef , when ) ;
|
||||||
}
|
}
|
||||||
operator EventRef () { return m_eventRef; }
|
operator EventRef () { return m_eventRef; }
|
||||||
|
|
||||||
bool IsValid() { return m_eventRef != 0 ; }
|
bool IsValid() { return m_eventRef != 0 ; }
|
||||||
protected :
|
protected :
|
||||||
EventRef m_eventRef ;
|
EventRef m_eventRef ;
|
||||||
bool m_release ;
|
bool m_release ;
|
||||||
@@ -379,27 +378,27 @@ template <typename refType> class wxMacCFRefHolder
|
|||||||
{
|
{
|
||||||
public :
|
public :
|
||||||
wxMacCFRefHolder()
|
wxMacCFRefHolder()
|
||||||
: m_ref(NULL) , m_release(false)
|
: m_ref(NULL) , m_release(false)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
wxMacCFRefHolder( refType ref , bool release = true )
|
wxMacCFRefHolder( refType ref , bool release = true )
|
||||||
: m_ref(ref) , m_release(release)
|
: m_ref(ref) , m_release(release)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
~wxMacCFRefHolder()
|
~wxMacCFRefHolder()
|
||||||
{
|
{
|
||||||
CFRelease( m_ref ) ;
|
CFRelease( m_ref ) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Release()
|
void Release()
|
||||||
{
|
{
|
||||||
if ( m_release && m_ref != NULL )
|
if ( m_release && m_ref != NULL )
|
||||||
CFRelease( m_ref ) ;
|
CFRelease( m_ref ) ;
|
||||||
m_ref = NULL ;
|
m_ref = NULL ;
|
||||||
}
|
}
|
||||||
|
|
||||||
refType Detach()
|
refType Detach()
|
||||||
{
|
{
|
||||||
refType val = m_ref ;
|
refType val = m_ref ;
|
||||||
@@ -407,20 +406,20 @@ public :
|
|||||||
m_ref = NULL ;
|
m_ref = NULL ;
|
||||||
return val ;
|
return val ;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Set( refType ref , bool release = true )
|
void Set( refType ref , bool release = true )
|
||||||
{
|
{
|
||||||
Release() ;
|
Release() ;
|
||||||
m_release = release ;
|
m_release = release ;
|
||||||
m_ref = ref ;
|
m_ref = ref ;
|
||||||
}
|
}
|
||||||
|
|
||||||
operator refType () const { return m_ref; }
|
operator refType () const { return m_ref; }
|
||||||
|
|
||||||
private :
|
private :
|
||||||
refType m_ref ;
|
refType m_ref ;
|
||||||
bool m_release ;
|
bool m_release ;
|
||||||
|
|
||||||
DECLARE_NO_COPY_CLASS( wxMacCFRefHolder )
|
DECLARE_NO_COPY_CLASS( wxMacCFRefHolder )
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
@@ -450,7 +449,7 @@ void wxMacReleaseBitmapButton( ControlButtonContentInfo*info ) ;
|
|||||||
struct wxOpaqueWindowRef
|
struct wxOpaqueWindowRef
|
||||||
{
|
{
|
||||||
wxOpaqueWindowRef( WindowRef ref ) { m_data = ref ; }
|
wxOpaqueWindowRef( WindowRef ref ) { m_data = ref ; }
|
||||||
operator WindowRef() { return m_data ; }
|
operator WindowRef() { return m_data ; }
|
||||||
private :
|
private :
|
||||||
WindowRef m_data ;
|
WindowRef m_data ;
|
||||||
} ;
|
} ;
|
||||||
@@ -473,25 +472,25 @@ ControlActionUPP GetwxMacLiveScrollbarActionProc() ;
|
|||||||
class wxMacControl
|
class wxMacControl
|
||||||
{
|
{
|
||||||
public :
|
public :
|
||||||
wxMacControl( wxWindow* peer , bool isRootControl = false ) ;
|
wxMacControl( wxWindow* peer , bool isRootControl = false ) ;
|
||||||
wxMacControl( wxWindow* peer , ControlRef control ) ;
|
wxMacControl( wxWindow* peer , ControlRef control ) ;
|
||||||
wxMacControl( wxWindow* peer , WXWidget control ) ;
|
wxMacControl( wxWindow* peer , WXWidget control ) ;
|
||||||
virtual ~wxMacControl() ;
|
virtual ~wxMacControl() ;
|
||||||
|
|
||||||
void Init() ;
|
void Init() ;
|
||||||
|
|
||||||
virtual void Dispose() ;
|
virtual void Dispose() ;
|
||||||
|
|
||||||
bool Ok() const { return GetControlRef() != NULL ; }
|
bool Ok() const { return GetControlRef() != NULL ; }
|
||||||
|
|
||||||
virtual ControlRef * GetControlRefAddr() { return &m_controlRef; }
|
|
||||||
virtual ControlRef GetControlRef() const { return m_controlRef ; }
|
|
||||||
|
|
||||||
virtual void SetReference( SInt32 data ) ;
|
virtual ControlRef * GetControlRefAddr() { return &m_controlRef; }
|
||||||
|
virtual ControlRef GetControlRef() const { return m_controlRef ; }
|
||||||
|
|
||||||
|
virtual void SetReference( SInt32 data ) ;
|
||||||
/*
|
/*
|
||||||
void operator= (ControlRef c) { m_controlRef = c ; }
|
void operator= (ControlRef c) { m_controlRef = c ; }
|
||||||
operator ControlRef () { return m_controlRef; }
|
operator ControlRef () { return m_controlRef; }
|
||||||
operator ControlRef * () { return &m_controlRef; }
|
operator ControlRef * () { return &m_controlRef; }
|
||||||
*/
|
*/
|
||||||
// accessing data and values
|
// accessing data and values
|
||||||
|
|
||||||
@@ -506,19 +505,19 @@ public :
|
|||||||
virtual SInt32 GetValue() const ;
|
virtual SInt32 GetValue() const ;
|
||||||
virtual SInt32 GetMaximum() const ;
|
virtual SInt32 GetMaximum() const ;
|
||||||
virtual SInt32 GetMinimum() const ;
|
virtual SInt32 GetMinimum() const ;
|
||||||
|
|
||||||
virtual void SetValue( SInt32 v ) ;
|
virtual void SetValue( SInt32 v ) ;
|
||||||
virtual void SetMinimum( SInt32 v ) ;
|
virtual void SetMinimum( SInt32 v ) ;
|
||||||
virtual void SetMaximum( SInt32 v ) ;
|
virtual void SetMaximum( SInt32 v ) ;
|
||||||
|
|
||||||
virtual void SetValueAndRange( SInt32 value , SInt32 minimum , SInt32 maximum ) ;
|
virtual void SetValueAndRange( SInt32 value , SInt32 minimum , SInt32 maximum ) ;
|
||||||
virtual void SetRange( SInt32 minimum , SInt32 maximum ) ;
|
virtual void SetRange( SInt32 minimum , SInt32 maximum ) ;
|
||||||
|
|
||||||
virtual OSStatus SetFocus( ControlFocusPart focusPart ) ;
|
virtual OSStatus SetFocus( ControlFocusPart focusPart ) ;
|
||||||
virtual bool HasFocus() const ;
|
virtual bool HasFocus() const ;
|
||||||
virtual bool NeedsFocusRect() const ;
|
virtual bool NeedsFocusRect() const ;
|
||||||
virtual void SetNeedsFocusRect( bool needs ) ;
|
virtual void SetNeedsFocusRect( bool needs ) ;
|
||||||
|
|
||||||
// templated helpers
|
// templated helpers
|
||||||
|
|
||||||
Size GetDataSize( ControlPartCode inPartCode , ResType inTag ) const
|
Size GetDataSize( ControlPartCode inPartCode , ResType inTag ) const
|
||||||
@@ -546,7 +545,7 @@ public :
|
|||||||
verify_noerr( GetData<T>( inPartCode , inTag , &value ) ) ;
|
verify_noerr( GetData<T>( inPartCode , inTag , &value ) ) ;
|
||||||
return value ;
|
return value ;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Flash the control for the specified amount of time
|
// Flash the control for the specified amount of time
|
||||||
virtual void Flash( ControlPartCode part , UInt32 ticks = 8 ) ;
|
virtual void Flash( ControlPartCode part , UInt32 ticks = 8 ) ;
|
||||||
|
|
||||||
@@ -560,13 +559,13 @@ public :
|
|||||||
void SetActionProc( ControlActionUPP actionProc ) ;
|
void SetActionProc( ControlActionUPP actionProc ) ;
|
||||||
void SetViewSize( SInt32 viewSize ) ;
|
void SetViewSize( SInt32 viewSize ) ;
|
||||||
SInt32 GetViewSize() const ;
|
SInt32 GetViewSize() const ;
|
||||||
|
|
||||||
virtual bool IsVisible() const ;
|
virtual bool IsVisible() const ;
|
||||||
virtual void SetVisibility( bool visible , bool redraw ) ;
|
virtual void SetVisibility( bool visible , bool redraw ) ;
|
||||||
virtual bool IsEnabled() const ;
|
virtual bool IsEnabled() const ;
|
||||||
virtual bool IsActive() const ;
|
virtual bool IsActive() const ;
|
||||||
virtual void Enable( bool enable ) ;
|
virtual void Enable( bool enable ) ;
|
||||||
|
|
||||||
// invalidates this control and all children
|
// invalidates this control and all children
|
||||||
virtual void InvalidateWithChildren() ;
|
virtual void InvalidateWithChildren() ;
|
||||||
virtual void SetDrawingEnabled( bool enable ) ;
|
virtual void SetDrawingEnabled( bool enable ) ;
|
||||||
@@ -578,7 +577,7 @@ public :
|
|||||||
// where is in native window relative coordinates
|
// where is in native window relative coordinates
|
||||||
virtual void SetNeedsDisplay( Rect* where = NULL ) ;
|
virtual void SetNeedsDisplay( Rect* where = NULL ) ;
|
||||||
|
|
||||||
// if rect = NULL, entire view
|
// if rect = NULL, entire view
|
||||||
virtual void ScrollRect( wxRect *rect , int dx , int dy ) ;
|
virtual void ScrollRect( wxRect *rect , int dx , int dy ) ;
|
||||||
|
|
||||||
// in native parent window relative coordinates
|
// in native parent window relative coordinates
|
||||||
@@ -589,15 +588,15 @@ public :
|
|||||||
|
|
||||||
virtual void GetRectInWindowCoords( Rect *r ) ;
|
virtual void GetRectInWindowCoords( Rect *r ) ;
|
||||||
virtual void GetBestRect( Rect *r ) ;
|
virtual void GetBestRect( Rect *r ) ;
|
||||||
virtual void SetTitle( const wxString &title ) ;
|
virtual void SetLabel( const wxString &title ) ;
|
||||||
// converts from Toplevel-Content relative to local
|
// converts from Toplevel-Content relative to local
|
||||||
static void Convert( wxPoint *pt , wxMacControl *convert , wxMacControl *to ) ;
|
static void Convert( wxPoint *pt , wxMacControl *convert , wxMacControl *to ) ;
|
||||||
|
|
||||||
virtual void GetFeatures( UInt32 *features ) ;
|
virtual void GetFeatures( UInt32 *features ) ;
|
||||||
virtual OSStatus GetRegion( ControlPartCode partCode , RgnHandle region ) ;
|
virtual OSStatus GetRegion( ControlPartCode partCode , RgnHandle region ) ;
|
||||||
virtual OSStatus SetZOrder( bool above , wxMacControl* other ) ;
|
virtual OSStatus SetZOrder( bool above , wxMacControl* other ) ;
|
||||||
// to be moved into a databrowser subclass
|
// to be moved into a databrowser subclass
|
||||||
|
|
||||||
virtual OSStatus SetSelectionFlags( DataBrowserSelectionFlags ) ;
|
virtual OSStatus SetSelectionFlags( DataBrowserSelectionFlags ) ;
|
||||||
virtual OSStatus AddListViewColumn( DataBrowserListViewColumnDesc *columnDesc,
|
virtual OSStatus AddListViewColumn( DataBrowserListViewColumnDesc *columnDesc,
|
||||||
DataBrowserTableViewColumnIndex position ) ;
|
DataBrowserTableViewColumnIndex position ) ;
|
||||||
@@ -607,14 +606,14 @@ public :
|
|||||||
virtual OSStatus SetListViewHeaderBtnHeight(UInt16 height) ;
|
virtual OSStatus SetListViewHeaderBtnHeight(UInt16 height) ;
|
||||||
virtual OSStatus SetCallbacks(const DataBrowserCallbacks * callbacks) ;
|
virtual OSStatus SetCallbacks(const DataBrowserCallbacks * callbacks) ;
|
||||||
virtual OSStatus UpdateItems( DataBrowserItemID container, UInt32 numItems,
|
virtual OSStatus UpdateItems( DataBrowserItemID container, UInt32 numItems,
|
||||||
const DataBrowserItemID* items,
|
const DataBrowserItemID* items,
|
||||||
DataBrowserPropertyID preSortProperty,
|
DataBrowserPropertyID preSortProperty,
|
||||||
DataBrowserPropertyID propertyID ) ;
|
DataBrowserPropertyID propertyID ) ;
|
||||||
virtual OSStatus AddItems( DataBrowserItemID container, UInt32 numItems,
|
virtual OSStatus AddItems( DataBrowserItemID container, UInt32 numItems,
|
||||||
const DataBrowserItemID* items,
|
const DataBrowserItemID* items,
|
||||||
DataBrowserPropertyID preSortProperty ) ;
|
DataBrowserPropertyID preSortProperty ) ;
|
||||||
virtual OSStatus RemoveItems( DataBrowserItemID container, UInt32 numItems,
|
virtual OSStatus RemoveItems( DataBrowserItemID container, UInt32 numItems,
|
||||||
const DataBrowserItemID* items,
|
const DataBrowserItemID* items,
|
||||||
DataBrowserPropertyID preSortProperty ) ;
|
DataBrowserPropertyID preSortProperty ) ;
|
||||||
virtual OSStatus RevealItem( DataBrowserItemID item,
|
virtual OSStatus RevealItem( DataBrowserItemID item,
|
||||||
DataBrowserPropertyID propertyID,
|
DataBrowserPropertyID propertyID,
|
||||||
@@ -624,16 +623,16 @@ public :
|
|||||||
virtual OSStatus SetSelectedItems(UInt32 numItems,
|
virtual OSStatus SetSelectedItems(UInt32 numItems,
|
||||||
const DataBrowserItemID * items,
|
const DataBrowserItemID * items,
|
||||||
DataBrowserSetOption operation ) ;
|
DataBrowserSetOption operation ) ;
|
||||||
|
|
||||||
// to be moved into a tab control class
|
// to be moved into a tab control class
|
||||||
|
|
||||||
virtual OSStatus SetTabEnabled( SInt16 tabNo , bool enable ) ;
|
virtual OSStatus SetTabEnabled( SInt16 tabNo , bool enable ) ;
|
||||||
bool IsCompositing() { return m_isCompositing ; }
|
bool IsCompositing() { return m_isCompositing ; }
|
||||||
bool IsRootControl() { return m_isRootControl ; }
|
bool IsRootControl() { return m_isRootControl ; }
|
||||||
protected :
|
protected :
|
||||||
ControlRef m_controlRef ;
|
ControlRef m_controlRef ;
|
||||||
wxFont m_font ;
|
wxFont m_font ;
|
||||||
long m_windowStyle ;
|
long m_windowStyle ;
|
||||||
wxWindow* m_peer ;
|
wxWindow* m_peer ;
|
||||||
bool m_needsFocusRect ;
|
bool m_needsFocusRect ;
|
||||||
bool m_isCompositing ;
|
bool m_isCompositing ;
|
||||||
@@ -642,23 +641,23 @@ protected :
|
|||||||
|
|
||||||
#if wxMAC_USE_CORE_GRAPHICS
|
#if wxMAC_USE_CORE_GRAPHICS
|
||||||
|
|
||||||
class WXDLLEXPORT wxMacCGPath : public wxGraphicPath
|
class WXDLLEXPORT wxMacCGPath : public wxGraphicPath
|
||||||
{
|
{
|
||||||
DECLARE_NO_COPY_CLASS(wxMacCGPath)
|
DECLARE_NO_COPY_CLASS(wxMacCGPath)
|
||||||
public :
|
public :
|
||||||
wxMacCGPath() ;
|
wxMacCGPath() ;
|
||||||
~wxMacCGPath() ;
|
~wxMacCGPath() ;
|
||||||
|
|
||||||
// Starts a new subpath at
|
// Starts a new subpath at
|
||||||
void MoveToPoint( wxCoord x1 , wxCoord y1 ) ;
|
void MoveToPoint( wxCoord x1 , wxCoord y1 ) ;
|
||||||
void AddLineToPoint( wxCoord x1 , wxCoord y1 ) ;
|
void AddLineToPoint( wxCoord x1 , wxCoord y1 ) ;
|
||||||
void AddQuadCurveToPoint( wxCoord cx1, wxCoord cy1, wxCoord x1, wxCoord y1 ) ;
|
void AddQuadCurveToPoint( wxCoord cx1, wxCoord cy1, wxCoord x1, wxCoord y1 ) ;
|
||||||
void AddRectangle( wxCoord x, wxCoord y, wxCoord w, wxCoord h ) ;
|
void AddRectangle( wxCoord x, wxCoord y, wxCoord w, wxCoord h ) ;
|
||||||
void AddCircle( wxCoord x, wxCoord y , wxCoord r ) ;
|
void AddCircle( wxCoord x, wxCoord y , wxCoord r ) ;
|
||||||
|
|
||||||
// closes the current subpath
|
// closes the current subpath
|
||||||
void CloseSubpath() ;
|
void CloseSubpath() ;
|
||||||
|
|
||||||
CGPathRef GetPath() const ;
|
CGPathRef GetPath() const ;
|
||||||
private :
|
private :
|
||||||
CGMutablePathRef m_path ;
|
CGMutablePathRef m_path ;
|
||||||
@@ -667,7 +666,7 @@ private :
|
|||||||
class WXDLLEXPORT wxMacCGContext : public wxGraphicContext
|
class WXDLLEXPORT wxMacCGContext : public wxGraphicContext
|
||||||
{
|
{
|
||||||
DECLARE_NO_COPY_CLASS(wxMacCGContext)
|
DECLARE_NO_COPY_CLASS(wxMacCGContext)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
wxMacCGContext( CGrafPtr port ) ;
|
wxMacCGContext( CGrafPtr port ) ;
|
||||||
wxMacCGContext( CGContextRef cgcontext ) ;
|
wxMacCGContext( CGContextRef cgcontext ) ;
|
||||||
@@ -678,9 +677,9 @@ public:
|
|||||||
virtual void StrokePath( const wxGraphicPath *p ) ;
|
virtual void StrokePath( const wxGraphicPath *p ) ;
|
||||||
virtual void DrawPath( const wxGraphicPath *p , int fillStyle = wxWINDING_RULE ) ;
|
virtual void DrawPath( const wxGraphicPath *p , int fillStyle = wxWINDING_RULE ) ;
|
||||||
virtual void FillPath( const wxGraphicPath *p , const wxColor &fillColor , int fillStyle = wxWINDING_RULE ) ;
|
virtual void FillPath( const wxGraphicPath *p , const wxColor &fillColor , int fillStyle = wxWINDING_RULE ) ;
|
||||||
|
|
||||||
virtual wxGraphicPath* CreatePath() ;
|
virtual wxGraphicPath* CreatePath() ;
|
||||||
virtual void SetPen( const wxPen &pen ) ;
|
virtual void SetPen( const wxPen &pen ) ;
|
||||||
virtual void SetBrush( const wxBrush &brush ) ;
|
virtual void SetBrush( const wxBrush &brush ) ;
|
||||||
CGContextRef GetNativeContext() ;
|
CGContextRef GetNativeContext() ;
|
||||||
void SetNativeContext( CGContextRef cg ) ;
|
void SetNativeContext( CGContextRef cg ) ;
|
||||||
@@ -705,7 +704,7 @@ void wxMacMemoryBufferReleaseProc(void *info, const void *data, size_t size) ;
|
|||||||
class WXDLLEXPORT wxBitmapRefData: public wxGDIRefData
|
class WXDLLEXPORT wxBitmapRefData: public wxGDIRefData
|
||||||
{
|
{
|
||||||
DECLARE_NO_COPY_CLASS(wxBitmapRefData)
|
DECLARE_NO_COPY_CLASS(wxBitmapRefData)
|
||||||
|
|
||||||
friend class WXDLLEXPORT wxIcon;
|
friend class WXDLLEXPORT wxIcon;
|
||||||
friend class WXDLLEXPORT wxCursor;
|
friend class WXDLLEXPORT wxCursor;
|
||||||
public:
|
public:
|
||||||
@@ -716,7 +715,7 @@ public:
|
|||||||
void Free() ;
|
void Free() ;
|
||||||
bool Ok() const { return m_ok ; }
|
bool Ok() const { return m_ok ; }
|
||||||
void SetOk( bool isOk) { m_ok = isOk ; }
|
void SetOk( bool isOk) { m_ok = isOk ; }
|
||||||
|
|
||||||
void SetWidth( int width ) { m_width = width ; }
|
void SetWidth( int width ) { m_width = width ; }
|
||||||
void SetHeight( int height ) { m_height = height ; }
|
void SetHeight( int height ) { m_height = height ; }
|
||||||
void SetDepth( int depth ) { m_depth = depth ; }
|
void SetDepth( int depth ) { m_depth = depth ; }
|
||||||
@@ -724,7 +723,7 @@ public:
|
|||||||
int GetWidth() const { return m_width ; }
|
int GetWidth() const { return m_width ; }
|
||||||
int GetHeight() const { return m_height ; }
|
int GetHeight() const { return m_height ; }
|
||||||
int GetDepth() const { return m_depth ; }
|
int GetDepth() const { return m_depth ; }
|
||||||
|
|
||||||
void *GetRawAccess() const ;
|
void *GetRawAccess() const ;
|
||||||
void *BeginRawAccess() ;
|
void *BeginRawAccess() ;
|
||||||
void EndRawAccess() ;
|
void EndRawAccess() ;
|
||||||
@@ -736,23 +735,23 @@ public:
|
|||||||
#if wxUSE_PALETTE
|
#if wxUSE_PALETTE
|
||||||
wxPalette m_bitmapPalette;
|
wxPalette m_bitmapPalette;
|
||||||
#endif // wxUSE_PALETTE
|
#endif // wxUSE_PALETTE
|
||||||
|
|
||||||
wxMask * m_bitmapMask; // Optional mask
|
wxMask * m_bitmapMask; // Optional mask
|
||||||
#ifdef __WXMAC_OSX__
|
#ifdef __WXMAC_OSX__
|
||||||
CGImageRef CGImageCreate() const ;
|
CGImageRef CGImageCreate() const ;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// returns true if the bitmap has a size that
|
// returns true if the bitmap has a size that
|
||||||
// can be natively transferred into a true icon
|
// can be natively transferred into a true icon
|
||||||
// if no is returned GetIconRef will still produce
|
// if no is returned GetIconRef will still produce
|
||||||
// an icon but it will be generated via a PICT and
|
// an icon but it will be generated via a PICT and
|
||||||
// rescaled to 16 x 16
|
// rescaled to 16 x 16
|
||||||
bool HasNativeSize() ;
|
bool HasNativeSize() ;
|
||||||
|
|
||||||
// caller should increase ref count if needed longer
|
// caller should increase ref count if needed longer
|
||||||
// than the bitmap exists
|
// than the bitmap exists
|
||||||
IconRef GetIconRef() ;
|
IconRef GetIconRef() ;
|
||||||
|
|
||||||
// returns a Pict from the bitmap content
|
// returns a Pict from the bitmap content
|
||||||
PicHandle GetPictHandle() ;
|
PicHandle GetPictHandle() ;
|
||||||
GWorldPtr GetHBITMAP(GWorldPtr * mask = NULL ) const ;
|
GWorldPtr GetHBITMAP(GWorldPtr * mask = NULL ) const ;
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: wx/mac/toplevel.h
|
// Name: wx/mac/carbon/toplevel.h
|
||||||
// Purpose: wxTopLevelWindowMac is the Mac implementation of wxTLW
|
// Purpose: wxTopLevelWindowMac is the Mac implementation of wxTLW
|
||||||
// Author: Stefan Csomor
|
// Author: Stefan Csomor
|
||||||
// Modified by:
|
// Modified by:
|
||||||
@@ -56,9 +56,9 @@ public:
|
|||||||
virtual void RequestUserAttention(int flags = wxUSER_ATTENTION_INFO);
|
virtual void RequestUserAttention(int flags = wxUSER_ATTENTION_INFO);
|
||||||
|
|
||||||
// implement base class pure virtuals
|
// implement base class pure virtuals
|
||||||
virtual void Maximize(bool maximize = TRUE);
|
virtual void Maximize(bool maximize = true);
|
||||||
virtual bool IsMaximized() const;
|
virtual bool IsMaximized() const;
|
||||||
virtual void Iconize(bool iconize = TRUE);
|
virtual void Iconize(bool iconize = true);
|
||||||
virtual bool IsIconized() const;
|
virtual bool IsIconized() const;
|
||||||
virtual void SetIcon(const wxIcon& icon);
|
virtual void SetIcon(const wxIcon& icon);
|
||||||
virtual void SetIcons(const wxIconBundle& icons) { SetIcon( icons.GetIcon( -1 ) ); }
|
virtual void SetIcons(const wxIconBundle& icons) { SetIcon( icons.GetIcon( -1 ) ); }
|
||||||
@@ -84,14 +84,16 @@ public:
|
|||||||
virtual void MacActivate( long timestamp , bool inIsActivating ) ;
|
virtual void MacActivate( long timestamp , bool inIsActivating ) ;
|
||||||
virtual void MacPerformUpdates() ;
|
virtual void MacPerformUpdates() ;
|
||||||
|
|
||||||
|
virtual void SetTitle( const wxString& title);
|
||||||
|
virtual wxString GetTitle() const;
|
||||||
|
|
||||||
virtual void Raise();
|
virtual void Raise();
|
||||||
virtual void Lower();
|
virtual void Lower();
|
||||||
virtual void SetTitle( const wxString& title);
|
virtual bool Show( bool show = true );
|
||||||
virtual bool Show( bool show = TRUE );
|
|
||||||
|
|
||||||
virtual void MacSetBackgroundBrush( const wxBrush &brush ) ;
|
virtual void MacSetBackgroundBrush( const wxBrush &brush ) ;
|
||||||
|
|
||||||
bool MacUsesCompositing() { return m_macUsesCompositing; }
|
bool MacUsesCompositing() { return m_macUsesCompositing; }
|
||||||
virtual void MacInstallTopLevelWindowEventHandler() ;
|
virtual void MacInstallTopLevelWindowEventHandler() ;
|
||||||
|
|
||||||
void MacSetMetalAppearance( bool on ) ;
|
void MacSetMetalAppearance( bool on ) ;
|
||||||
@@ -137,4 +139,3 @@ private :
|
|||||||
extern WXDLLEXPORT_DATA(wxWindowList) wxModelessWindows;
|
extern WXDLLEXPORT_DATA(wxWindowList) wxModelessWindows;
|
||||||
|
|
||||||
#endif // _WX_MSW_TOPLEVEL_H_
|
#endif // _WX_MSW_TOPLEVEL_H_
|
||||||
|
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: window.h
|
// Name: wx/mac/carbon/window.h
|
||||||
// Purpose: wxWindowMac class
|
// Purpose: wxWindowMac class
|
||||||
// Author: Stefan Csomor
|
// Author: Stefan Csomor
|
||||||
// Modified by:
|
// Modified by:
|
||||||
@@ -34,12 +34,12 @@ class wxMacControl ;
|
|||||||
class WXDLLEXPORT wxWindowMac: public wxWindowBase
|
class WXDLLEXPORT wxWindowMac: public wxWindowBase
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxWindowMac)
|
DECLARE_DYNAMIC_CLASS(wxWindowMac)
|
||||||
|
|
||||||
friend class wxDC;
|
friend class wxDC;
|
||||||
friend class wxPaintDC;
|
friend class wxPaintDC;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
wxWindowMac() ;
|
wxWindowMac() ;
|
||||||
|
|
||||||
wxWindowMac(wxWindowMac *parent,
|
wxWindowMac(wxWindowMac *parent,
|
||||||
@@ -60,20 +60,20 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
// implement base class pure virtuals
|
// implement base class pure virtuals
|
||||||
virtual void SetTitle( const wxString& title);
|
virtual void SetLabel( const wxString& label);
|
||||||
virtual wxString GetTitle() const;
|
virtual wxString GetLabel() const;
|
||||||
|
|
||||||
virtual void Raise();
|
virtual void Raise();
|
||||||
virtual void Lower();
|
virtual void Lower();
|
||||||
|
|
||||||
virtual bool Show( bool show = TRUE );
|
virtual bool Show( bool show = true );
|
||||||
virtual bool Enable( bool enable = TRUE );
|
virtual bool Enable( bool enable = true );
|
||||||
|
|
||||||
virtual void SetFocus();
|
virtual void SetFocus();
|
||||||
|
|
||||||
virtual void WarpPointer(int x, int y);
|
virtual void WarpPointer(int x, int y);
|
||||||
|
|
||||||
virtual void Refresh( bool eraseBackground = TRUE,
|
virtual void Refresh( bool eraseBackground = true,
|
||||||
const wxRect *rect = (const wxRect *) NULL );
|
const wxRect *rect = (const wxRect *) NULL );
|
||||||
virtual void Freeze() ;
|
virtual void Freeze() ;
|
||||||
virtual void Thaw() ;
|
virtual void Thaw() ;
|
||||||
@@ -98,8 +98,8 @@ public:
|
|||||||
virtual bool DoPopupMenu( wxMenu *menu, int x, int y );
|
virtual bool DoPopupMenu( wxMenu *menu, int x, int y );
|
||||||
|
|
||||||
virtual void SetScrollbar( int orient, int pos, int thumbVisible,
|
virtual void SetScrollbar( int orient, int pos, int thumbVisible,
|
||||||
int range, bool refresh = TRUE );
|
int range, bool refresh = true );
|
||||||
virtual void SetScrollPos( int orient, int pos, bool refresh = TRUE );
|
virtual void SetScrollPos( int orient, int pos, bool refresh = true );
|
||||||
virtual int GetScrollPos( int orient ) const;
|
virtual int GetScrollPos( int orient ) const;
|
||||||
virtual int GetScrollThumb( int orient ) const;
|
virtual int GetScrollThumb( int orient ) const;
|
||||||
virtual int GetScrollRange( int orient ) const;
|
virtual int GetScrollRange( int orient ) const;
|
||||||
@@ -125,7 +125,7 @@ public:
|
|||||||
|
|
||||||
void MacRootWindowToWindow( int *x , int *y ) const ;
|
void MacRootWindowToWindow( int *x , int *y ) const ;
|
||||||
void MacRootWindowToWindow( short *x , short *y ) const ;
|
void MacRootWindowToWindow( short *x , short *y ) const ;
|
||||||
|
|
||||||
virtual wxString MacGetToolTipString( wxPoint &where ) ;
|
virtual wxString MacGetToolTipString( wxPoint &where ) ;
|
||||||
|
|
||||||
// simple accessors
|
// simple accessors
|
||||||
@@ -135,7 +135,7 @@ public:
|
|||||||
|
|
||||||
#if WXWIN_COMPATIBILITY_2_4
|
#if WXWIN_COMPATIBILITY_2_4
|
||||||
bool GetTransparentBackground() const { return m_backgroundTransparent; }
|
bool GetTransparentBackground() const { return m_backgroundTransparent; }
|
||||||
void SetTransparent(bool t = TRUE) { m_backgroundTransparent = t; }
|
void SetTransparent(bool t = true) { m_backgroundTransparent = t; }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// event handlers
|
// event handlers
|
||||||
@@ -147,7 +147,7 @@ public:
|
|||||||
void OnMouseEvent( wxMouseEvent &event ) ;
|
void OnMouseEvent( wxMouseEvent &event ) ;
|
||||||
|
|
||||||
void MacOnScroll(wxScrollEvent&event ) ;
|
void MacOnScroll(wxScrollEvent&event ) ;
|
||||||
|
|
||||||
bool AcceptsFocus() const ;
|
bool AcceptsFocus() const ;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@@ -158,13 +158,13 @@ public:
|
|||||||
virtual wxPoint GetClientAreaOrigin() const;
|
virtual wxPoint GetClientAreaOrigin() const;
|
||||||
|
|
||||||
wxWindowMac *FindItem(long id) const;
|
wxWindowMac *FindItem(long id) const;
|
||||||
wxWindowMac *FindItemByHWND(WXHWND hWnd, bool controlOnly = FALSE) const;
|
wxWindowMac *FindItemByHWND(WXHWND hWnd, bool controlOnly = false) const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual void MacHandleControlClick( WXWidget control , wxInt16 controlpart , bool mouseStillDown ) ;
|
virtual void MacHandleControlClick( WXWidget control , wxInt16 controlpart , bool mouseStillDown ) ;
|
||||||
virtual bool MacDoRedraw( WXHRGN updatergn , long time ) ;
|
virtual bool MacDoRedraw( WXHRGN updatergn , long time ) ;
|
||||||
virtual bool MacCanFocus() const ;
|
virtual bool MacCanFocus() const ;
|
||||||
|
|
||||||
// this should not be overriden in classes above wxWindowMac because it is called from its destructor via DeleteChildren
|
// this should not be overriden in classes above wxWindowMac because it is called from its destructor via DeleteChildren
|
||||||
virtual void RemoveChild( wxWindowBase *child );
|
virtual void RemoveChild( wxWindowBase *child );
|
||||||
virtual void MacPaintBorders( int left , int top ) ;
|
virtual void MacPaintBorders( int left , int top ) ;
|
||||||
@@ -173,35 +173,35 @@ public:
|
|||||||
void MacInvalidateBorders() ;
|
void MacInvalidateBorders() ;
|
||||||
WXWindow MacGetTopLevelWindowRef() const ;
|
WXWindow MacGetTopLevelWindowRef() const ;
|
||||||
wxTopLevelWindowMac* MacGetTopLevelWindow() const ;
|
wxTopLevelWindowMac* MacGetTopLevelWindow() const ;
|
||||||
|
|
||||||
virtual long MacGetLeftBorderSize() const ;
|
virtual long MacGetLeftBorderSize() const ;
|
||||||
virtual long MacGetRightBorderSize() const ;
|
virtual long MacGetRightBorderSize() const ;
|
||||||
virtual long MacGetTopBorderSize() const ;
|
virtual long MacGetTopBorderSize() const ;
|
||||||
virtual long MacGetBottomBorderSize() const ;
|
virtual long MacGetBottomBorderSize() const ;
|
||||||
|
|
||||||
static long MacRemoveBordersFromStyle( long style ) ;
|
static long MacRemoveBordersFromStyle( long style ) ;
|
||||||
|
|
||||||
virtual void MacSuperChangedPosition() ;
|
virtual void MacSuperChangedPosition() ;
|
||||||
// the absolute coortinates of this window's root have changed
|
// the absolute coortinates of this window's root have changed
|
||||||
virtual void MacTopLevelWindowChangedPosition() ;
|
virtual void MacTopLevelWindowChangedPosition() ;
|
||||||
|
|
||||||
virtual void MacChildAdded() ;
|
virtual void MacChildAdded() ;
|
||||||
virtual void MacVisibilityChanged() ;
|
virtual void MacVisibilityChanged() ;
|
||||||
virtual void MacEnabledStateChanged() ;
|
virtual void MacEnabledStateChanged() ;
|
||||||
virtual void MacHiliteChanged() ;
|
virtual void MacHiliteChanged() ;
|
||||||
virtual wxInt32 MacControlHit( WXEVENTHANDLERREF handler , WXEVENTREF event ) ;
|
virtual wxInt32 MacControlHit( WXEVENTHANDLERREF handler , WXEVENTREF event ) ;
|
||||||
|
|
||||||
bool MacIsReallyShown() ;
|
bool MacIsReallyShown() ;
|
||||||
bool MacIsReallyEnabled() ;
|
bool MacIsReallyEnabled() ;
|
||||||
bool MacIsReallyHilited() ;
|
bool MacIsReallyHilited() ;
|
||||||
|
|
||||||
bool MacIsUserPane() { return m_macIsUserPane; }
|
bool MacIsUserPane() { return m_macIsUserPane; }
|
||||||
|
|
||||||
virtual bool MacSetupCursor( const wxPoint& pt ) ;
|
virtual bool MacSetupCursor( const wxPoint& pt ) ;
|
||||||
|
|
||||||
virtual void MacSetBackgroundBrush( const wxBrush &brush ) ;
|
virtual void MacSetBackgroundBrush( const wxBrush &brush ) ;
|
||||||
const wxBrush& MacGetBackgroundBrush() const { return m_macBackgroundBrush ; }
|
const wxBrush& MacGetBackgroundBrush() const { return m_macBackgroundBrush ; }
|
||||||
|
|
||||||
// return the rectangle that would be visible of this control, regardless whether controls are hidden
|
// return the rectangle that would be visible of this control, regardless whether controls are hidden
|
||||||
// only taking into account clipping by parent windows
|
// only taking into account clipping by parent windows
|
||||||
const wxRect& MacGetClippedClientRect() const ;
|
const wxRect& MacGetClippedClientRect() const ;
|
||||||
@@ -210,16 +210,16 @@ public:
|
|||||||
// returns the visible region of this control in window ie non-client coordinates
|
// returns the visible region of this control in window ie non-client coordinates
|
||||||
const wxRegion& MacGetVisibleRegion( bool includeOuterStructures = false ) ;
|
const wxRegion& MacGetVisibleRegion( bool includeOuterStructures = false ) ;
|
||||||
// returns true if children have to clipped to the content area (eg scrolled window)
|
// returns true if children have to clipped to the content area (eg scrolled window)
|
||||||
bool MacClipChildren() const { return m_clipChildren ; }
|
bool MacClipChildren() const { return m_clipChildren ; }
|
||||||
void MacSetClipChildren( bool clip ) { m_clipChildren = clip ; }
|
void MacSetClipChildren( bool clip ) { m_clipChildren = clip ; }
|
||||||
// returns true if the grandchildren have to be clipped to the children's content area (eg
|
// returns true if the grandchildren have to be clipped to the children's content area (eg
|
||||||
// splitter window)
|
// splitter window)
|
||||||
virtual bool MacClipGrandChildren() const { return false ; }
|
virtual bool MacClipGrandChildren() const { return false ; }
|
||||||
bool MacIsWindowScrollbar( const wxScrollBar* sb )
|
bool MacIsWindowScrollbar( const wxScrollBar* sb )
|
||||||
{ return (m_hScrollBar == sb || m_vScrollBar == sb) ; }
|
{ return (m_hScrollBar == sb || m_vScrollBar == sb) ; }
|
||||||
|
|
||||||
wxList& GetSubcontrols() { return m_subControls; }
|
wxList& GetSubcontrols() { return m_subControls; }
|
||||||
virtual void MacInstallEventHandler(WXWidget native) ;
|
virtual void MacInstallEventHandler(WXWidget native) ;
|
||||||
WXEVENTHANDLERREF MacGetControlEventHandler() { return m_macControlEventHandler ; }
|
WXEVENTHANDLERREF MacGetControlEventHandler() { return m_macControlEventHandler ; }
|
||||||
void MacPostControlCreate(const wxPoint& pos, const wxSize& size) ;
|
void MacPostControlCreate(const wxPoint& pos, const wxSize& size) ;
|
||||||
#ifndef __WXMAC_OSX__
|
#ifndef __WXMAC_OSX__
|
||||||
@@ -235,7 +235,7 @@ public:
|
|||||||
// translate wxWidgets coords into ones suitable to be passed to
|
// translate wxWidgets coords into ones suitable to be passed to
|
||||||
// the CreateControl calls
|
// the CreateControl calls
|
||||||
//
|
//
|
||||||
// returns TRUE if non default coords are returned, FALSE otherwise
|
// returns true if non default coords are returned, false otherwise
|
||||||
bool MacGetBoundsForControl(const wxPoint& pos,
|
bool MacGetBoundsForControl(const wxPoint& pos,
|
||||||
const wxSize& size,
|
const wxSize& size,
|
||||||
int& x, int& y,
|
int& x, int& y,
|
||||||
@@ -275,13 +275,13 @@ protected:
|
|||||||
mutable wxRegion m_cachedClippedRegion ;
|
mutable wxRegion m_cachedClippedRegion ;
|
||||||
mutable wxRegion m_cachedClippedClientRegion ;
|
mutable wxRegion m_cachedClippedClientRegion ;
|
||||||
// true if is is not a native control but a wxWindow control
|
// true if is is not a native control but a wxWindow control
|
||||||
bool m_macIsUserPane ;
|
bool m_macIsUserPane ;
|
||||||
wxBrush m_macBackgroundBrush ;
|
wxBrush m_macBackgroundBrush ;
|
||||||
// topleft inset of the mac control from the wx top left corner
|
// topleft inset of the mac control from the wx top left corner
|
||||||
wxPoint m_macTopLeftInset ;
|
wxPoint m_macTopLeftInset ;
|
||||||
// bottom right inset of the mac control from the wx bottom right corner
|
// bottom right inset of the mac control from the wx bottom right corner
|
||||||
wxPoint m_macBottomRightInset ;
|
wxPoint m_macBottomRightInset ;
|
||||||
|
|
||||||
wxScrollBar* m_hScrollBar ;
|
wxScrollBar* m_hScrollBar ;
|
||||||
wxScrollBar* m_vScrollBar ;
|
wxScrollBar* m_vScrollBar ;
|
||||||
wxString m_label ;
|
wxString m_label ;
|
||||||
@@ -289,9 +289,9 @@ protected:
|
|||||||
// must be dynamic as eg a panel normally is not clipping precisely, but if
|
// must be dynamic as eg a panel normally is not clipping precisely, but if
|
||||||
// it becomes the target window of a scrolled window it has to...
|
// it becomes the target window of a scrolled window it has to...
|
||||||
bool m_clipChildren ;
|
bool m_clipChildren ;
|
||||||
|
|
||||||
virtual bool MacIsChildOfClientArea( const wxWindow* child ) const ;
|
virtual bool MacIsChildOfClientArea( const wxWindow* child ) const ;
|
||||||
|
|
||||||
void MacCreateScrollBars( long style ) ;
|
void MacCreateScrollBars( long style ) ;
|
||||||
void MacRepositionScrollBars() ;
|
void MacRepositionScrollBars() ;
|
||||||
void MacUpdateControlFont() ;
|
void MacUpdateControlFont() ;
|
||||||
@@ -299,15 +299,15 @@ protected:
|
|||||||
void MacPropagateVisibilityChanged() ;
|
void MacPropagateVisibilityChanged() ;
|
||||||
void MacPropagateEnabledStateChanged() ;
|
void MacPropagateEnabledStateChanged() ;
|
||||||
void MacPropagateHiliteChanged() ;
|
void MacPropagateHiliteChanged() ;
|
||||||
|
|
||||||
|
|
||||||
#if WXWIN_COMPATIBILITY_2_4
|
#if WXWIN_COMPATIBILITY_2_4
|
||||||
bool m_backgroundTransparent ;
|
bool m_backgroundTransparent ;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// implement the base class pure virtuals
|
// implement the base class pure virtuals
|
||||||
virtual wxSize DoGetBestSize() const;
|
virtual wxSize DoGetBestSize() const;
|
||||||
virtual wxSize DoGetSizeFromClientSize( const wxSize & size ) const;
|
virtual wxSize DoGetSizeFromClientSize( const wxSize & size ) const;
|
||||||
virtual void DoClientToScreen( int *x, int *y ) const;
|
virtual void DoClientToScreen( int *x, int *y ) const;
|
||||||
virtual void DoScreenToClient( int *x, int *y ) const;
|
virtual void DoScreenToClient( int *x, int *y ) const;
|
||||||
virtual void DoGetPosition( int *x, int *y ) const;
|
virtual void DoGetPosition( int *x, int *y ) const;
|
||||||
@@ -327,7 +327,7 @@ protected:
|
|||||||
// themselves inside the given rectangle
|
// themselves inside the given rectangle
|
||||||
virtual void DoMoveWindow(int x, int y, int width, int height);
|
virtual void DoMoveWindow(int x, int y, int width, int height);
|
||||||
virtual void DoSetWindowVariant( wxWindowVariant variant ) ;
|
virtual void DoSetWindowVariant( wxWindowVariant variant ) ;
|
||||||
|
|
||||||
|
|
||||||
#if wxUSE_TOOLTIPS
|
#if wxUSE_TOOLTIPS
|
||||||
virtual void DoSetToolTip( wxToolTip *tip );
|
virtual void DoSetToolTip( wxToolTip *tip );
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: wx/mac/toplevel.h
|
// Name: wx/mac/classic/toplevel.h
|
||||||
// Purpose: wxTopLevelWindowMac is the Mac implementation of wxTLW
|
// Purpose: wxTopLevelWindowMac is the Mac implementation of wxTLW
|
||||||
// Author: Stefan Csomor
|
// Author: Stefan Csomor
|
||||||
// Modified by:
|
// Modified by:
|
||||||
@@ -50,9 +50,9 @@ public:
|
|||||||
virtual ~wxTopLevelWindowMac();
|
virtual ~wxTopLevelWindowMac();
|
||||||
|
|
||||||
// implement base class pure virtuals
|
// implement base class pure virtuals
|
||||||
virtual void Maximize(bool maximize = TRUE);
|
virtual void Maximize(bool maximize = true);
|
||||||
virtual bool IsMaximized() const;
|
virtual bool IsMaximized() const;
|
||||||
virtual void Iconize(bool iconize = TRUE);
|
virtual void Iconize(bool iconize = true);
|
||||||
virtual bool IsIconized() const;
|
virtual bool IsIconized() const;
|
||||||
virtual void SetIcon(const wxIcon& icon);
|
virtual void SetIcon(const wxIcon& icon);
|
||||||
virtual void SetIcons(const wxIconBundle& icons) { SetIcon( icons.GetIcon( -1 ) ); }
|
virtual void SetIcons(const wxIconBundle& icons) { SetIcon( icons.GetIcon( -1 ) ); }
|
||||||
@@ -61,8 +61,8 @@ public:
|
|||||||
virtual bool SetShape(const wxRegion& region);
|
virtual bool SetShape(const wxRegion& region);
|
||||||
|
|
||||||
virtual bool ShowFullScreen(bool WXUNUSED(show), long WXUNUSED(style) = wxFULLSCREEN_ALL)
|
virtual bool ShowFullScreen(bool WXUNUSED(show), long WXUNUSED(style) = wxFULLSCREEN_ALL)
|
||||||
{ return FALSE; }
|
{ return false; }
|
||||||
virtual bool IsFullScreen() const { return FALSE; }
|
virtual bool IsFullScreen() const { return false; }
|
||||||
|
|
||||||
// implementation from now on
|
// implementation from now on
|
||||||
// --------------------------
|
// --------------------------
|
||||||
@@ -87,15 +87,18 @@ public:
|
|||||||
virtual void MacKeyDown( WXEVENTREF ev ) ;
|
virtual void MacKeyDown( WXEVENTREF ev ) ;
|
||||||
#endif
|
#endif
|
||||||
virtual void MacFireMouseEvent( wxUint16 kind , wxInt32 x , wxInt32 y ,wxUint32 modifiers , long timestamp ) ;
|
virtual void MacFireMouseEvent( wxUint16 kind , wxInt32 x , wxInt32 y ,wxUint32 modifiers , long timestamp ) ;
|
||||||
|
|
||||||
|
virtual void SetTitle( const wxString& title);
|
||||||
|
virtual wxString GetTitle() const;
|
||||||
|
|
||||||
virtual void Raise();
|
virtual void Raise();
|
||||||
virtual void Lower();
|
virtual void Lower();
|
||||||
virtual void SetTitle( const wxString& title);
|
virtual bool Show( bool show = true );
|
||||||
virtual bool Show( bool show = TRUE );
|
|
||||||
virtual void DoMoveWindow(int x, int y, int width, int height);
|
virtual void DoMoveWindow(int x, int y, int width, int height);
|
||||||
void MacInvalidate( const WXRECTPTR rect, bool eraseBackground ) ;
|
void MacInvalidate( const WXRECTPTR rect, bool eraseBackground ) ;
|
||||||
short MacGetWindowBackgroundTheme() const { return m_macWindowBackgroundTheme ; }
|
short MacGetWindowBackgroundTheme() const { return m_macWindowBackgroundTheme ; }
|
||||||
static bool MacEnableCompositing( bool useCompositing );
|
static bool MacEnableCompositing( bool useCompositing );
|
||||||
bool MacUsesCompositing() { return m_macUsesCompositing; }
|
bool MacUsesCompositing() { return m_macUsesCompositing; }
|
||||||
|
|
||||||
#if TARGET_CARBON
|
#if TARGET_CARBON
|
||||||
WXEVENTHANDLERREF MacGetEventHandler() { return m_macEventHandler ; }
|
WXEVENTHANDLERREF MacGetEventHandler() { return m_macEventHandler ; }
|
||||||
@@ -138,4 +141,3 @@ void wxRemoveMacWindowAssociation(wxTopLevelWindowMac *win) ;
|
|||||||
|
|
||||||
|
|
||||||
#endif // _WX_MSW_TOPLEVEL_H_
|
#endif // _WX_MSW_TOPLEVEL_H_
|
||||||
|
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: window.h
|
// Name: wx/mac/carbon/window.h
|
||||||
// Purpose: wxWindowMac class
|
// Purpose: wxWindowMac class
|
||||||
// Author: Stefan Csomor
|
// Author: Stefan Csomor
|
||||||
// Modified by:
|
// Modified by:
|
||||||
@@ -29,12 +29,12 @@ class WXDLLEXPORT wxTopLevelWindowMac;
|
|||||||
class WXDLLEXPORT wxWindowMac: public wxWindowBase
|
class WXDLLEXPORT wxWindowMac: public wxWindowBase
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxWindowMac)
|
DECLARE_DYNAMIC_CLASS(wxWindowMac)
|
||||||
|
|
||||||
friend class wxDC;
|
friend class wxDC;
|
||||||
friend class wxPaintDC;
|
friend class wxPaintDC;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
wxWindowMac()
|
wxWindowMac()
|
||||||
: m_macBackgroundBrush()
|
: m_macBackgroundBrush()
|
||||||
, m_macVisibleRegion()
|
, m_macVisibleRegion()
|
||||||
@@ -65,20 +65,20 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
// implement base class pure virtuals
|
// implement base class pure virtuals
|
||||||
virtual void SetTitle( const wxString& title);
|
virtual void SetLabel( const wxString& title);
|
||||||
virtual wxString GetTitle() const;
|
virtual wxString GetLabel() const;
|
||||||
|
|
||||||
virtual void Raise();
|
virtual void Raise();
|
||||||
virtual void Lower();
|
virtual void Lower();
|
||||||
|
|
||||||
virtual bool Show( bool show = TRUE );
|
virtual bool Show( bool show = true );
|
||||||
virtual bool Enable( bool enable = TRUE );
|
virtual bool Enable( bool enable = true );
|
||||||
|
|
||||||
virtual void SetFocus();
|
virtual void SetFocus();
|
||||||
|
|
||||||
virtual void WarpPointer(int x, int y);
|
virtual void WarpPointer(int x, int y);
|
||||||
|
|
||||||
virtual void Refresh( bool eraseBackground = TRUE,
|
virtual void Refresh( bool eraseBackground = true,
|
||||||
const wxRect *rect = (const wxRect *) NULL );
|
const wxRect *rect = (const wxRect *) NULL );
|
||||||
|
|
||||||
virtual bool SetCursor( const wxCursor &cursor );
|
virtual bool SetCursor( const wxCursor &cursor );
|
||||||
@@ -96,8 +96,8 @@ public:
|
|||||||
virtual bool DoPopupMenu( wxMenu *menu, int x, int y );
|
virtual bool DoPopupMenu( wxMenu *menu, int x, int y );
|
||||||
|
|
||||||
virtual void SetScrollbar( int orient, int pos, int thumbVisible,
|
virtual void SetScrollbar( int orient, int pos, int thumbVisible,
|
||||||
int range, bool refresh = TRUE );
|
int range, bool refresh = true );
|
||||||
virtual void SetScrollPos( int orient, int pos, bool refresh = TRUE );
|
virtual void SetScrollPos( int orient, int pos, bool refresh = true );
|
||||||
virtual int GetScrollPos( int orient ) const;
|
virtual int GetScrollPos( int orient ) const;
|
||||||
virtual int GetScrollThumb( int orient ) const;
|
virtual int GetScrollThumb( int orient ) const;
|
||||||
virtual int GetScrollRange( int orient ) const;
|
virtual int GetScrollRange( int orient ) const;
|
||||||
@@ -123,7 +123,7 @@ public:
|
|||||||
void MacRootWindowToClient( int *x , int *y ) const ;
|
void MacRootWindowToClient( int *x , int *y ) const ;
|
||||||
void MacWindowToRootWindow( int *x , int *y ) const ;
|
void MacWindowToRootWindow( int *x , int *y ) const ;
|
||||||
void MacRootWindowToWindow( int *x , int *y ) const ;
|
void MacRootWindowToWindow( int *x , int *y ) const ;
|
||||||
|
|
||||||
virtual wxString MacGetToolTipString( wxPoint &where ) ;
|
virtual wxString MacGetToolTipString( wxPoint &where ) ;
|
||||||
|
|
||||||
// simple accessors
|
// simple accessors
|
||||||
@@ -134,7 +134,7 @@ public:
|
|||||||
virtual WXWidget GetHandle() const { return (WXWidget) NULL ; }
|
virtual WXWidget GetHandle() const { return (WXWidget) NULL ; }
|
||||||
|
|
||||||
bool GetTransparentBackground() const { return m_backgroundTransparent; }
|
bool GetTransparentBackground() const { return m_backgroundTransparent; }
|
||||||
void SetTransparent(bool t = TRUE) { m_backgroundTransparent = t; }
|
void SetTransparent(bool t = true) { m_backgroundTransparent = t; }
|
||||||
|
|
||||||
// event handlers
|
// event handlers
|
||||||
// --------------
|
// --------------
|
||||||
@@ -144,7 +144,7 @@ public:
|
|||||||
void OnMouseEvent( wxMouseEvent &event ) ;
|
void OnMouseEvent( wxMouseEvent &event ) ;
|
||||||
|
|
||||||
void MacOnScroll(wxScrollEvent&event ) ;
|
void MacOnScroll(wxScrollEvent&event ) ;
|
||||||
|
|
||||||
bool AcceptsFocus() const ;
|
bool AcceptsFocus() const ;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@@ -155,16 +155,16 @@ public:
|
|||||||
virtual wxPoint GetClientAreaOrigin() const;
|
virtual wxPoint GetClientAreaOrigin() const;
|
||||||
|
|
||||||
wxWindowMac *FindItem(long id) const;
|
wxWindowMac *FindItem(long id) const;
|
||||||
wxWindowMac *FindItemByHWND(WXHWND hWnd, bool controlOnly = FALSE) const;
|
wxWindowMac *FindItemByHWND(WXHWND hWnd, bool controlOnly = false) const;
|
||||||
|
|
||||||
// Make a Windows extended style from the given wxWidgets window style
|
// Make a Windows extended style from the given wxWidgets window style
|
||||||
static WXDWORD MakeExtendedStyle(long style,
|
static WXDWORD MakeExtendedStyle(long style,
|
||||||
bool eliminateBorders = TRUE);
|
bool eliminateBorders = true);
|
||||||
// Determine whether 3D effects are wanted
|
// Determine whether 3D effects are wanted
|
||||||
WXDWORD Determine3DEffects(WXDWORD defaultBorderStyle, bool *want3D) const;
|
WXDWORD Determine3DEffects(WXDWORD defaultBorderStyle, bool *want3D) const;
|
||||||
|
|
||||||
// MSW only: TRUE if this control is part of the main control
|
// MSW only: true if this control is part of the main control
|
||||||
virtual bool ContainsHWND(WXHWND WXUNUSED(hWnd)) const { return FALSE; };
|
virtual bool ContainsHWND(WXHWND WXUNUSED(hWnd)) const { return false; };
|
||||||
|
|
||||||
// Setup background and foreground colours correctly
|
// Setup background and foreground colours correctly
|
||||||
virtual void SetupColours();
|
virtual void SetupColours();
|
||||||
@@ -174,21 +174,21 @@ public:
|
|||||||
virtual bool MacGetWindowFromPointSub( const wxPoint &point , wxWindowMac** outWin ) ;
|
virtual bool MacGetWindowFromPointSub( const wxPoint &point , wxWindowMac** outWin ) ;
|
||||||
virtual void MacRedraw( WXHRGN updatergn , long time , bool erase) ;
|
virtual void MacRedraw( WXHRGN updatergn , long time , bool erase) ;
|
||||||
virtual bool MacCanFocus() const { return true ; }
|
virtual bool MacCanFocus() const { return true ; }
|
||||||
|
|
||||||
virtual bool MacDispatchMouseEvent(wxMouseEvent& event ) ;
|
virtual bool MacDispatchMouseEvent(wxMouseEvent& event ) ;
|
||||||
// this should not be overriden in classes above wxWindowMac because it is called from its destructor via DeleteChildren
|
// this should not be overriden in classes above wxWindowMac because it is called from its destructor via DeleteChildren
|
||||||
virtual void RemoveChild( wxWindowBase *child );
|
virtual void RemoveChild( wxWindowBase *child );
|
||||||
virtual void MacPaintBorders( int left , int top ) ;
|
virtual void MacPaintBorders( int left , int top ) ;
|
||||||
WXWindow MacGetRootWindow() const ;
|
WXWindow MacGetRootWindow() const ;
|
||||||
wxTopLevelWindowMac* MacGetTopLevelWindow() const ;
|
wxTopLevelWindowMac* MacGetTopLevelWindow() const ;
|
||||||
|
|
||||||
virtual WXWidget MacGetContainerForEmbedding() ;
|
virtual WXWidget MacGetContainerForEmbedding() ;
|
||||||
|
|
||||||
virtual long MacGetLeftBorderSize() const ;
|
virtual long MacGetLeftBorderSize() const ;
|
||||||
virtual long MacGetRightBorderSize() const ;
|
virtual long MacGetRightBorderSize() const ;
|
||||||
virtual long MacGetTopBorderSize() const ;
|
virtual long MacGetTopBorderSize() const ;
|
||||||
virtual long MacGetBottomBorderSize() const ;
|
virtual long MacGetBottomBorderSize() const ;
|
||||||
|
|
||||||
static long MacRemoveBordersFromStyle( long style ) ;
|
static long MacRemoveBordersFromStyle( long style ) ;
|
||||||
virtual void MacSuperChangedPosition() ;
|
virtual void MacSuperChangedPosition() ;
|
||||||
// the absolute coordinates of this item within the toplevel window may have changed
|
// the absolute coordinates of this item within the toplevel window may have changed
|
||||||
@@ -202,7 +202,7 @@ public:
|
|||||||
// for compatibility
|
// for compatibility
|
||||||
void MacUpdateImmediately() { Update() ; }
|
void MacUpdateImmediately() { Update() ; }
|
||||||
virtual bool MacSetupCursor( const wxPoint& pt ) ;
|
virtual bool MacSetupCursor( const wxPoint& pt ) ;
|
||||||
|
|
||||||
// virtual bool MacSetPortDrawingParams( const Point & localOrigin, const Rect & clipRect, WindowRef window , wxWindowMac* rootwin ) ;
|
// virtual bool MacSetPortDrawingParams( const Point & localOrigin, const Rect & clipRect, WindowRef window , wxWindowMac* rootwin ) ;
|
||||||
// virtual void MacGetPortParams(Point* localOrigin, Rect* clipRect, WindowRef *window , wxWindowMac** rootwin ) ;
|
// virtual void MacGetPortParams(Point* localOrigin, Rect* clipRect, WindowRef *window , wxWindowMac** rootwin ) ;
|
||||||
// virtual void MacGetPortClientParams(Point* localOrigin, Rect* clipRect, WindowRef *window , wxWindowMac** rootwin) ;
|
// virtual void MacGetPortClientParams(Point* localOrigin, Rect* clipRect, WindowRef *window , wxWindowMac** rootwin) ;
|
||||||
@@ -219,11 +219,11 @@ protected:
|
|||||||
int m_y ;
|
int m_y ;
|
||||||
int m_width ;
|
int m_width ;
|
||||||
int m_height ;
|
int m_height ;
|
||||||
|
|
||||||
wxScrollBar* m_hScrollBar ;
|
wxScrollBar* m_hScrollBar ;
|
||||||
wxScrollBar* m_vScrollBar ;
|
wxScrollBar* m_vScrollBar ;
|
||||||
wxString m_label ;
|
wxString m_label ;
|
||||||
|
|
||||||
void MacCreateScrollBars( long style ) ;
|
void MacCreateScrollBars( long style ) ;
|
||||||
void MacRepositionScrollBars() ;
|
void MacRepositionScrollBars() ;
|
||||||
|
|
||||||
|
@@ -158,6 +158,7 @@ public:
|
|||||||
defined(__WXMGL__) || \
|
defined(__WXMGL__) || \
|
||||||
defined(__WXMOTIF__) || \
|
defined(__WXMOTIF__) || \
|
||||||
defined(__WXPM__) || \
|
defined(__WXPM__) || \
|
||||||
|
defined(__WXMAC__) || \
|
||||||
defined(__WXGTK__)
|
defined(__WXGTK__)
|
||||||
|
|
||||||
// FIXME: This is work in progress about moving SetTitle/GetTitle from wxWindow
|
// FIXME: This is work in progress about moving SetTitle/GetTitle from wxWindow
|
||||||
|
@@ -172,6 +172,7 @@ public:
|
|||||||
!defined(__WXMGL__) && \
|
!defined(__WXMGL__) && \
|
||||||
!defined(__WXMOTIF__) && \
|
!defined(__WXMOTIF__) && \
|
||||||
!defined(__WXPM__) && \
|
!defined(__WXPM__) && \
|
||||||
|
!defined(__WXMAC__) && \
|
||||||
!defined(__WXGTK__)
|
!defined(__WXGTK__)
|
||||||
|
|
||||||
// FIXME: This is work in progress about moving SetTitle/GetTitle from wxWindow
|
// FIXME: This is work in progress about moving SetTitle/GetTitle from wxWindow
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: radiobox.cpp
|
// Name: src/mac/carbon/radiobox.cpp
|
||||||
// Purpose: wxRadioBox
|
// Purpose: wxRadioBox
|
||||||
// Author: Stefan Csomor
|
// Author: Stefan Csomor
|
||||||
// Modified by: JS Lair (99/11/15) first implementation
|
// Modified by: JS Lair (99/11/15) first implementation
|
||||||
@@ -535,7 +535,7 @@ wxSize wxRadioBox::DoGetBestSize() const
|
|||||||
totHeight = sz.y ;
|
totHeight = sz.y ;
|
||||||
|
|
||||||
// handle radio box title as well
|
// handle radio box title as well
|
||||||
GetTextExtent(GetTitle(), &eachWidth, NULL);
|
GetTextExtent(GetLabel(), &eachWidth, NULL);
|
||||||
eachWidth = (int)(eachWidth + RADIO_SIZE) + 3 * charWidth ;
|
eachWidth = (int)(eachWidth + RADIO_SIZE) + 3 * charWidth ;
|
||||||
if (totWidth < eachWidth)
|
if (totWidth < eachWidth)
|
||||||
totWidth = eachWidth;
|
totWidth = eachWidth;
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: mac/toplevel.cpp
|
// Name: src/mac/carbon/toplevel.cpp
|
||||||
// Purpose: implements wxTopLevelWindow for Mac
|
// Purpose: implements wxTopLevelWindow for Mac
|
||||||
// Author: Stefan Csomor
|
// Author: Stefan Csomor
|
||||||
// Modified by:
|
// Modified by:
|
||||||
@@ -479,7 +479,7 @@ pascal OSStatus wxMacTopLevelMouseEventHandler( EventHandlerCallRef handler , Ev
|
|||||||
windowPart = inContent ;
|
windowPart = inContent ;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if ( window )
|
if ( window )
|
||||||
{
|
{
|
||||||
QDGlobalToLocalPoint( UMAGetWindowPort(window ) , &windowMouseLocation ) ;
|
QDGlobalToLocalPoint( UMAGetWindowPort(window ) , &windowMouseLocation ) ;
|
||||||
@@ -919,7 +919,7 @@ bool wxTopLevelWindowMac::Create(wxWindow *parent,
|
|||||||
SetName(name);
|
SetName(name);
|
||||||
|
|
||||||
m_windowId = id == -1 ? NewControlId() : id;
|
m_windowId = id == -1 ? NewControlId() : id;
|
||||||
wxWindow::SetTitle( title ) ;
|
wxWindow::SetLabel( title ) ;
|
||||||
|
|
||||||
MacCreateRealWindow( title, pos , size , MacRemoveBordersFromStyle(style) , name ) ;
|
MacCreateRealWindow( title, pos , size , MacRemoveBordersFromStyle(style) , name ) ;
|
||||||
|
|
||||||
@@ -1266,10 +1266,15 @@ void wxTopLevelWindowMac::MacActivate( long timestamp , bool inIsActivating )
|
|||||||
|
|
||||||
void wxTopLevelWindowMac::SetTitle(const wxString& title)
|
void wxTopLevelWindowMac::SetTitle(const wxString& title)
|
||||||
{
|
{
|
||||||
wxWindow::SetTitle( title ) ;
|
wxWindow::SetLabel( title ) ;
|
||||||
UMASetWTitle( (WindowRef)m_macWindow , title , m_font.GetEncoding() ) ;
|
UMASetWTitle( (WindowRef)m_macWindow , title , m_font.GetEncoding() ) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual wxString wxTopLevelWindowMac::GetTitle() const
|
||||||
|
{
|
||||||
|
return wxWindow::GetLabel();
|
||||||
|
}
|
||||||
|
|
||||||
bool wxTopLevelWindowMac::Show(bool show)
|
bool wxTopLevelWindowMac::Show(bool show)
|
||||||
{
|
{
|
||||||
if ( !wxTopLevelWindowBase::Show(show) )
|
if ( !wxTopLevelWindowBase::Show(show) )
|
||||||
@@ -1703,4 +1708,3 @@ static pascal long wxShapedMacWindowDef(short varCode, WindowRef window, SInt16
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: utils.cpp
|
// Name: src/mac/carbon/utils.cpp
|
||||||
// Purpose: Various utilities
|
// Purpose: Various utilities
|
||||||
// Author: Stefan Csomor
|
// Author: Stefan Csomor
|
||||||
// Modified by:
|
// Modified by:
|
||||||
@@ -769,7 +769,7 @@ void wxMacWakeUp()
|
|||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
void wxMacRectToNative( const wxRect *wx , Rect *n )
|
void wxMacRectToNative( const wxRect *wx , Rect *n )
|
||||||
{
|
{
|
||||||
n->left = wx->x ;
|
n->left = wx->x ;
|
||||||
n->top = wx->y ;
|
n->top = wx->y ;
|
||||||
@@ -777,7 +777,7 @@ void wxMacRectToNative( const wxRect *wx , Rect *n )
|
|||||||
n->bottom = wx->y + wx->height ;
|
n->bottom = wx->y + wx->height ;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxMacNativeToRect( const Rect *n , wxRect* wx )
|
void wxMacNativeToRect( const Rect *n , wxRect* wx )
|
||||||
{
|
{
|
||||||
wx->x = n->left ;
|
wx->x = n->left ;
|
||||||
wx->y = n->top ;
|
wx->y = n->top ;
|
||||||
@@ -785,13 +785,13 @@ void wxMacNativeToRect( const Rect *n , wxRect* wx )
|
|||||||
wx->height = n->bottom - n->top ;
|
wx->height = n->bottom - n->top ;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxMacPointToNative( const wxPoint* wx , Point *n )
|
void wxMacPointToNative( const wxPoint* wx , Point *n )
|
||||||
{
|
{
|
||||||
n->h = wx->x ;
|
n->h = wx->x ;
|
||||||
n->v = wx->y ;
|
n->v = wx->y ;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxMacNativeToPoint( const Point *n , wxPoint* wx )
|
void wxMacNativeToPoint( const Point *n , wxPoint* wx )
|
||||||
{
|
{
|
||||||
wx->x = n->h ;
|
wx->x = n->h ;
|
||||||
wx->y = n->v ;
|
wx->y = n->v ;
|
||||||
@@ -824,7 +824,7 @@ wxMacControl::wxMacControl(wxWindow* peer , bool isRootControl )
|
|||||||
m_isCompositing = peer->MacGetTopLevelWindow()->MacUsesCompositing() ;
|
m_isCompositing = peer->MacGetTopLevelWindow()->MacUsesCompositing() ;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxMacControl::wxMacControl( wxWindow* peer , ControlRef control )
|
wxMacControl::wxMacControl( wxWindow* peer , ControlRef control )
|
||||||
{
|
{
|
||||||
Init() ;
|
Init() ;
|
||||||
m_peer = peer ;
|
m_peer = peer ;
|
||||||
@@ -963,7 +963,7 @@ bool wxMacControl::HasFocus() const
|
|||||||
return control == m_controlRef ;
|
return control == m_controlRef ;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxMacControl::SetNeedsFocusRect( bool needs )
|
void wxMacControl::SetNeedsFocusRect( bool needs )
|
||||||
{
|
{
|
||||||
m_needsFocusRect = needs ;
|
m_needsFocusRect = needs ;
|
||||||
}
|
}
|
||||||
@@ -1109,21 +1109,21 @@ bool wxMacControl::GetNeedsDisplay() const
|
|||||||
if ( m_isCompositing )
|
if ( m_isCompositing )
|
||||||
{
|
{
|
||||||
return HIViewGetNeedsDisplay( m_controlRef ) ;
|
return HIViewGetNeedsDisplay( m_controlRef ) ;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
if ( !IsVisible() )
|
if ( !IsVisible() )
|
||||||
return false ;
|
return false ;
|
||||||
|
|
||||||
Rect controlBounds ;
|
Rect controlBounds ;
|
||||||
GetControlBounds( m_controlRef, &controlBounds ) ;
|
GetControlBounds( m_controlRef, &controlBounds ) ;
|
||||||
RgnHandle rgn = NewRgn() ;
|
RgnHandle rgn = NewRgn() ;
|
||||||
GetWindowRegion ( GetControlOwner( m_controlRef ) , kWindowUpdateRgn , rgn ) ;
|
GetWindowRegion ( GetControlOwner( m_controlRef ) , kWindowUpdateRgn , rgn ) ;
|
||||||
Boolean intersect = RectInRgn ( &controlBounds , rgn ) ;
|
Boolean intersect = RectInRgn ( &controlBounds , rgn ) ;
|
||||||
DisposeRgn( rgn ) ;
|
DisposeRgn( rgn ) ;
|
||||||
return intersect ;
|
return intersect ;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -1132,7 +1132,7 @@ void wxMacControl::SetNeedsDisplay( RgnHandle where )
|
|||||||
{
|
{
|
||||||
if ( !IsVisible() )
|
if ( !IsVisible() )
|
||||||
return ;
|
return ;
|
||||||
|
|
||||||
#if TARGET_API_MAC_OSX
|
#if TARGET_API_MAC_OSX
|
||||||
if ( m_isCompositing )
|
if ( m_isCompositing )
|
||||||
{
|
{
|
||||||
@@ -1141,12 +1141,12 @@ void wxMacControl::SetNeedsDisplay( RgnHandle where )
|
|||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
Rect controlBounds ;
|
Rect controlBounds ;
|
||||||
GetControlBounds( m_controlRef, &controlBounds ) ;
|
GetControlBounds( m_controlRef, &controlBounds ) ;
|
||||||
RgnHandle update = NewRgn() ;
|
RgnHandle update = NewRgn() ;
|
||||||
CopyRgn( where , update ) ;
|
CopyRgn( where , update ) ;
|
||||||
OffsetRgn( update , controlBounds.left , controlBounds.top ) ;
|
OffsetRgn( update , controlBounds.left , controlBounds.top ) ;
|
||||||
InvalWindowRgn( GetControlOwner( m_controlRef) , update ) ;
|
InvalWindowRgn( GetControlOwner( m_controlRef) , update ) ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1171,7 +1171,7 @@ void wxMacControl::SetNeedsDisplay( Rect* where )
|
|||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
Rect controlBounds ;
|
Rect controlBounds ;
|
||||||
GetControlBounds( m_controlRef, &controlBounds ) ;
|
GetControlBounds( m_controlRef, &controlBounds ) ;
|
||||||
if ( where )
|
if ( where )
|
||||||
{
|
{
|
||||||
@@ -1179,7 +1179,7 @@ void wxMacControl::SetNeedsDisplay( Rect* where )
|
|||||||
OffsetRect( &whereLocal , controlBounds.left , controlBounds.top ) ;
|
OffsetRect( &whereLocal , controlBounds.left , controlBounds.top ) ;
|
||||||
SectRect( &controlBounds , &whereLocal, &controlBounds ) ;
|
SectRect( &controlBounds , &whereLocal, &controlBounds ) ;
|
||||||
}
|
}
|
||||||
InvalWindowRect( GetControlOwner( m_controlRef) , &controlBounds ) ;
|
InvalWindowRect( GetControlOwner( m_controlRef) , &controlBounds ) ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1205,8 +1205,8 @@ void wxMacControl::Convert( wxPoint *pt , wxMacControl *from , wxMacControl *to
|
|||||||
if ( from->m_isRootControl )
|
if ( from->m_isRootControl )
|
||||||
fromRect.left = fromRect.top = 0 ;
|
fromRect.left = fromRect.top = 0 ;
|
||||||
if ( to->m_isRootControl )
|
if ( to->m_isRootControl )
|
||||||
toRect.left = toRect.top = 0 ;
|
toRect.left = toRect.top = 0 ;
|
||||||
|
|
||||||
pt->x = pt->x + fromRect.left - toRect.left ;
|
pt->x = pt->x + fromRect.left - toRect.left ;
|
||||||
pt->y = pt->y + fromRect.top - toRect.top ;
|
pt->y = pt->y + fromRect.top - toRect.top ;
|
||||||
}
|
}
|
||||||
@@ -1234,9 +1234,9 @@ void wxMacControl::SetRect( Rect *r )
|
|||||||
GetControlBounds( m_controlRef , &former ) ;
|
GetControlBounds( m_controlRef , &former ) ;
|
||||||
InvalWindowRect( GetControlOwner( m_controlRef ) , &former ) ;
|
InvalWindowRect( GetControlOwner( m_controlRef ) , &former ) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
Rect controlBounds = *r ;
|
Rect controlBounds = *r ;
|
||||||
|
|
||||||
// since the rect passed in is always (even in non-compositing) relative
|
// since the rect passed in is always (even in non-compositing) relative
|
||||||
// to the (native) parent, we have to adjust to window relative here
|
// to the (native) parent, we have to adjust to window relative here
|
||||||
wxMacControl* parent = m_peer->GetParent()->GetPeer() ;
|
wxMacControl* parent = m_peer->GetParent()->GetPeer() ;
|
||||||
@@ -1246,7 +1246,7 @@ void wxMacControl::SetRect( Rect *r )
|
|||||||
GetControlBounds( parent->m_controlRef , &superRect ) ;
|
GetControlBounds( parent->m_controlRef , &superRect ) ;
|
||||||
OffsetRect( &controlBounds , superRect.left , superRect.top ) ;
|
OffsetRect( &controlBounds , superRect.left , superRect.top ) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
SetControlBounds( m_controlRef , &controlBounds ) ;
|
SetControlBounds( m_controlRef , &controlBounds ) ;
|
||||||
if ( vis )
|
if ( vis )
|
||||||
{
|
{
|
||||||
@@ -1260,7 +1260,7 @@ void wxMacControl::GetRect( Rect *r )
|
|||||||
GetControlBounds( m_controlRef , r ) ;
|
GetControlBounds( m_controlRef , r ) ;
|
||||||
if ( m_isCompositing == false )
|
if ( m_isCompositing == false )
|
||||||
{
|
{
|
||||||
// correct the case of the root control
|
// correct the case of the root control
|
||||||
if ( m_isRootControl )
|
if ( m_isRootControl )
|
||||||
{
|
{
|
||||||
WindowRef wr = GetControlOwner( m_controlRef ) ;
|
WindowRef wr = GetControlOwner( m_controlRef ) ;
|
||||||
@@ -1270,7 +1270,7 @@ void wxMacControl::GetRect( Rect *r )
|
|||||||
r->left = 0 ;
|
r->left = 0 ;
|
||||||
r->top = 0 ;
|
r->top = 0 ;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
wxMacControl* parent = m_peer->GetParent()->GetPeer() ;
|
wxMacControl* parent = m_peer->GetParent()->GetPeer() ;
|
||||||
if( parent->m_isRootControl == false )
|
if( parent->m_isRootControl == false )
|
||||||
@@ -1294,7 +1294,7 @@ void wxMacControl::GetBestRect( Rect *r )
|
|||||||
GetBestControlRect( m_controlRef , r , &baselineoffset ) ;
|
GetBestControlRect( m_controlRef , r , &baselineoffset ) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxMacControl::SetTitle( const wxString &title )
|
void wxMacControl::SetLabel( const wxString &title )
|
||||||
{
|
{
|
||||||
wxFontEncoding encoding;
|
wxFontEncoding encoding;
|
||||||
|
|
||||||
@@ -1321,7 +1321,7 @@ OSStatus wxMacControl::GetRegion( ControlPartCode partCode , RgnHandle region )
|
|||||||
Rect r ;
|
Rect r ;
|
||||||
GetControlBounds(m_controlRef, &r ) ;
|
GetControlBounds(m_controlRef, &r ) ;
|
||||||
if ( !EmptyRgn( region ) )
|
if ( !EmptyRgn( region ) )
|
||||||
OffsetRgn( region , -r.left , -r.top ) ;
|
OffsetRgn( region , -r.left , -r.top ) ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return err ;
|
return err ;
|
||||||
@@ -1367,29 +1367,29 @@ void wxMacControl::InvalidateWithChildren()
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxMacControl::ScrollRect( wxRect *r , int dx , int dy )
|
void wxMacControl::ScrollRect( wxRect *r , int dx , int dy )
|
||||||
{
|
{
|
||||||
wxASSERT( r != NULL ) ;
|
wxASSERT( r != NULL ) ;
|
||||||
#if TARGET_API_MAC_OSX
|
#if TARGET_API_MAC_OSX
|
||||||
if ( m_isCompositing )
|
if ( m_isCompositing )
|
||||||
{
|
{
|
||||||
HIRect scrollarea = CGRectMake( r->x , r->y , r->width , r->height) ;
|
HIRect scrollarea = CGRectMake( r->x , r->y , r->width , r->height) ;
|
||||||
HIViewScrollRect ( m_controlRef , &scrollarea , dx ,dy ) ;
|
HIViewScrollRect ( m_controlRef , &scrollarea , dx ,dy ) ;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
Rect bounds ;
|
Rect bounds ;
|
||||||
GetControlBounds( m_controlRef , &bounds ) ;
|
GetControlBounds( m_controlRef , &bounds ) ;
|
||||||
bounds.left += r->x ;
|
bounds.left += r->x ;
|
||||||
bounds.top += r->y ;
|
bounds.top += r->y ;
|
||||||
bounds.bottom = bounds.top + r->height ;
|
bounds.bottom = bounds.top + r->height ;
|
||||||
bounds.right = bounds.left + r->width ;
|
bounds.right = bounds.left + r->width ;
|
||||||
wxMacWindowClipper clip( m_peer ) ;
|
wxMacWindowClipper clip( m_peer ) ;
|
||||||
RgnHandle updateRgn = NewRgn() ;
|
RgnHandle updateRgn = NewRgn() ;
|
||||||
::ScrollRect( &bounds , dx , dy , updateRgn ) ;
|
::ScrollRect( &bounds , dx , dy , updateRgn ) ;
|
||||||
InvalWindowRgn( GetControlOwner( m_controlRef ) , updateRgn ) ;
|
InvalWindowRgn( GetControlOwner( m_controlRef ) , updateRgn ) ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1497,31 +1497,31 @@ OSStatus wxMacControl::SetTabEnabled( SInt16 tabNo , bool enable )
|
|||||||
#ifdef __WXMAC_OSX__
|
#ifdef __WXMAC_OSX__
|
||||||
// snippets from Sketch Sample from Apple :
|
// snippets from Sketch Sample from Apple :
|
||||||
|
|
||||||
#define kGenericRGBProfilePathStr "/System/Library/ColorSync/Profiles/Generic RGB Profile.icc"
|
#define kGenericRGBProfilePathStr "/System/Library/ColorSync/Profiles/Generic RGB Profile.icc"
|
||||||
/*
|
/*
|
||||||
This function locates, opens, and returns the profile reference for the calibrated
|
This function locates, opens, and returns the profile reference for the calibrated
|
||||||
Generic RGB color space. It is up to the caller to call CMCloseProfile when done
|
Generic RGB color space. It is up to the caller to call CMCloseProfile when done
|
||||||
with the profile reference this function returns.
|
with the profile reference this function returns.
|
||||||
*/
|
*/
|
||||||
CMProfileRef wxMacOpenGenericProfile(void)
|
CMProfileRef wxMacOpenGenericProfile(void)
|
||||||
{
|
{
|
||||||
static CMProfileRef cachedRGBProfileRef = NULL;
|
static CMProfileRef cachedRGBProfileRef = NULL;
|
||||||
|
|
||||||
// we only create the profile reference once
|
// we only create the profile reference once
|
||||||
if (cachedRGBProfileRef == NULL)
|
if (cachedRGBProfileRef == NULL)
|
||||||
{
|
{
|
||||||
CMProfileLocation loc;
|
CMProfileLocation loc;
|
||||||
|
|
||||||
loc.locType = cmPathBasedProfile;
|
loc.locType = cmPathBasedProfile;
|
||||||
strcpy(loc.u.pathLoc.path, kGenericRGBProfilePathStr);
|
strcpy(loc.u.pathLoc.path, kGenericRGBProfilePathStr);
|
||||||
|
|
||||||
verify_noerr( CMOpenProfile(&cachedRGBProfileRef, &loc) );
|
verify_noerr( CMOpenProfile(&cachedRGBProfileRef, &loc) );
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cachedRGBProfileRef)
|
if (cachedRGBProfileRef)
|
||||||
{
|
{
|
||||||
// clone the profile reference so that the caller has their own reference, not our cached one
|
// clone the profile reference so that the caller has their own reference, not our cached one
|
||||||
CMCloneProfileRef(cachedRGBProfileRef);
|
CMCloneProfileRef(cachedRGBProfileRef);
|
||||||
}
|
}
|
||||||
|
|
||||||
return cachedRGBProfileRef;
|
return cachedRGBProfileRef;
|
||||||
@@ -1532,7 +1532,7 @@ CMProfileRef wxMacOpenGenericProfile(void)
|
|||||||
not release the returned value unless the caller retains it first. Usually callers
|
not release the returned value unless the caller retains it first. Usually callers
|
||||||
of this routine will immediately use the returned colorspace with CoreGraphics
|
of this routine will immediately use the returned colorspace with CoreGraphics
|
||||||
so they typically do not need to retain it themselves.
|
so they typically do not need to retain it themselves.
|
||||||
|
|
||||||
This function creates the generic RGB color space once and hangs onto it so it can
|
This function creates the generic RGB color space once and hangs onto it so it can
|
||||||
return it whenever this function is called.
|
return it whenever this function is called.
|
||||||
*/
|
*/
|
||||||
@@ -1541,22 +1541,21 @@ CGColorSpaceRef wxMacGetGenericRGBColorSpace()
|
|||||||
{
|
{
|
||||||
static CGColorSpaceRef genericRGBColorSpace = NULL;
|
static CGColorSpaceRef genericRGBColorSpace = NULL;
|
||||||
|
|
||||||
if (genericRGBColorSpace == NULL)
|
if (genericRGBColorSpace == NULL)
|
||||||
{
|
{
|
||||||
CMProfileRef genericRGBProfile = wxMacOpenGenericProfile();
|
CMProfileRef genericRGBProfile = wxMacOpenGenericProfile();
|
||||||
|
|
||||||
if (genericRGBProfile)
|
if (genericRGBProfile)
|
||||||
{
|
{
|
||||||
genericRGBColorSpace = CGColorSpaceCreateWithPlatformColorSpace(genericRGBProfile);
|
genericRGBColorSpace = CGColorSpaceCreateWithPlatformColorSpace(genericRGBProfile);
|
||||||
wxASSERT_MSG( genericRGBColorSpace != NULL, wxT("couldn't create the generic RGB color space") ) ;
|
wxASSERT_MSG( genericRGBColorSpace != NULL, wxT("couldn't create the generic RGB color space") ) ;
|
||||||
|
|
||||||
// we opened the profile so it is up to us to close it
|
// we opened the profile so it is up to us to close it
|
||||||
CMCloseProfile(genericRGBProfile);
|
CMCloseProfile(genericRGBProfile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return genericRGBColorSpace;
|
return genericRGBColorSpace;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif // wxUSE_GUI
|
#endif // wxUSE_GUI
|
||||||
|
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: windows.cpp
|
// Name: src/mac/carbon/window.cpp
|
||||||
// Purpose: wxWindowMac
|
// Purpose: wxWindowMac
|
||||||
// Author: Stefan Csomor
|
// Author: Stefan Csomor
|
||||||
// Modified by:
|
// Modified by:
|
||||||
@@ -431,7 +431,7 @@ static pascal OSStatus wxMacWindowServiceEventHandler( EventHandlerCallRef handl
|
|||||||
val = val.Mid( from , to - from ) ;
|
val = val.Mid( from , to - from ) ;
|
||||||
ScrapRef scrapRef = cEvent.GetParameter< ScrapRef > ( kEventParamScrapRef , typeScrapRef ) ;
|
ScrapRef scrapRef = cEvent.GetParameter< ScrapRef > ( kEventParamScrapRef , typeScrapRef ) ;
|
||||||
verify_noerr( ClearScrap( &scrapRef ) ) ;
|
verify_noerr( ClearScrap( &scrapRef ) ) ;
|
||||||
verify_noerr( PutScrapFlavor( scrapRef , kTXNTextData , 0 , val.Length() , val.c_str() ) ) ;
|
verify_noerr( PutScrapFlavor( scrapRef , kTXNTextData , 0 , val.length() , val.c_str() ) ) ;
|
||||||
result = noErr ;
|
result = noErr ;
|
||||||
}
|
}
|
||||||
break ;
|
break ;
|
||||||
@@ -599,10 +599,10 @@ void wxWindowMac::MacControlUserPaneActivateProc(bool activating)
|
|||||||
|
|
||||||
wxInt16 wxWindowMac::MacControlUserPaneFocusProc(wxInt16 action)
|
wxInt16 wxWindowMac::MacControlUserPaneFocusProc(wxInt16 action)
|
||||||
{
|
{
|
||||||
if ( AcceptsFocus() )
|
if ( AcceptsFocus() )
|
||||||
return 1 ;
|
return 1 ;
|
||||||
else
|
else
|
||||||
return kControlNoPart ;
|
return kControlNoPart ;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindowMac::MacControlUserPaneBackgroundProc(void* info)
|
void wxWindowMac::MacControlUserPaneBackgroundProc(void* info)
|
||||||
@@ -900,7 +900,7 @@ void wxWindowMac::MacPostControlCreate(const wxPoint& pos, const wxSize& size)
|
|||||||
// adjust font, controlsize etc
|
// adjust font, controlsize etc
|
||||||
DoSetWindowVariant( m_windowVariant ) ;
|
DoSetWindowVariant( m_windowVariant ) ;
|
||||||
|
|
||||||
m_peer->SetTitle( wxStripMenuCodes(m_label) ) ;
|
m_peer->SetLabel( wxStripMenuCodes(m_label) ) ;
|
||||||
|
|
||||||
if (!m_macIsUserPane)
|
if (!m_macIsUserPane)
|
||||||
{
|
{
|
||||||
@@ -1883,18 +1883,18 @@ void wxWindowMac::DoSetClientSize(int clientwidth, int clientheight)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindowMac::SetTitle(const wxString& title)
|
void wxWindowMac::SetLabel(const wxString& title)
|
||||||
{
|
{
|
||||||
m_label = wxStripMenuCodes(title) ;
|
m_label = wxStripMenuCodes(title) ;
|
||||||
|
|
||||||
if ( m_peer && m_peer->Ok() )
|
if ( m_peer && m_peer->Ok() )
|
||||||
{
|
{
|
||||||
m_peer->SetTitle( m_label ) ;
|
m_peer->SetLabel( m_label ) ;
|
||||||
}
|
}
|
||||||
Refresh() ;
|
Refresh() ;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxString wxWindowMac::GetTitle() const
|
wxString wxWindowMac::GetLabel() const
|
||||||
{
|
{
|
||||||
return m_label ;
|
return m_label ;
|
||||||
}
|
}
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: radiobox.cpp
|
// Name: src/mac/classic/radiobox.cpp
|
||||||
// Purpose: wxRadioBox
|
// Purpose: wxRadioBox
|
||||||
// Author: Stefan Csomor
|
// Author: Stefan Csomor
|
||||||
// Modified by: JS Lair (99/11/15) first implementation
|
// Modified by: JS Lair (99/11/15) first implementation
|
||||||
@@ -526,7 +526,7 @@ wxSize wxRadioBox::DoGetBestSize() const
|
|||||||
totHeight = totHeight + 10; //how many exactly should this be to meet the HIG?
|
totHeight = totHeight + 10; //how many exactly should this be to meet the HIG?
|
||||||
}
|
}
|
||||||
// handle radio box title as well
|
// handle radio box title as well
|
||||||
GetTextExtent(GetTitle(), &eachWidth, NULL);
|
GetTextExtent(GetLabel(), &eachWidth, NULL);
|
||||||
eachWidth = (int)(eachWidth + RADIO_SIZE) + 3 * charWidth ;
|
eachWidth = (int)(eachWidth + RADIO_SIZE) + 3 * charWidth ;
|
||||||
if (totWidth < eachWidth)
|
if (totWidth < eachWidth)
|
||||||
totWidth = eachWidth;
|
totWidth = eachWidth;
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: stattext.cpp
|
// Name: src/mac/classic/stattext.cpp
|
||||||
// Purpose: wxStaticText
|
// Purpose: wxStaticText
|
||||||
// Author: Stefan Csomor
|
// Author: Stefan Csomor
|
||||||
// Modified by:
|
// Modified by:
|
||||||
@@ -53,33 +53,33 @@ const wxString punct = wxT(" ,.-;:!?");
|
|||||||
void wxStaticText::DrawParagraph(wxDC &dc, wxString paragraph, int &y)
|
void wxStaticText::DrawParagraph(wxDC &dc, wxString paragraph, int &y)
|
||||||
{
|
{
|
||||||
long width, height ;
|
long width, height ;
|
||||||
|
|
||||||
if (paragraph.Length() == 0)
|
if (paragraph.length() == 0)
|
||||||
{
|
{
|
||||||
// empty line
|
// empty line
|
||||||
dc.GetTextExtent( wxT("H"), &width, &height );
|
dc.GetTextExtent( wxT("H"), &width, &height );
|
||||||
y += height;
|
y += height;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int x = 0 ;
|
int x = 0 ;
|
||||||
|
|
||||||
bool linedrawn = true;
|
bool linedrawn = true;
|
||||||
while( paragraph.Length() > 0 )
|
while( paragraph.length() > 0 )
|
||||||
{
|
{
|
||||||
dc.GetTextExtent( paragraph , &width , &height ) ;
|
dc.GetTextExtent( paragraph , &width , &height ) ;
|
||||||
|
|
||||||
if ( width > m_width )
|
if ( width > m_width )
|
||||||
{
|
{
|
||||||
for ( size_t p = paragraph.Length() - 1 ; p > 0 ; --p )
|
for ( size_t p = paragraph.length() - 1 ; p > 0 ; --p )
|
||||||
{
|
{
|
||||||
if ((punct.Find(paragraph[p]) != wxNOT_FOUND) || !linedrawn)
|
if ((punct.Find(paragraph[p]) != wxNOT_FOUND) || !linedrawn)
|
||||||
{
|
{
|
||||||
int blank = (paragraph[p] == ' ') ? 0 : 1;
|
int blank = (paragraph[p] == ' ') ? 0 : 1;
|
||||||
|
|
||||||
dc.GetTextExtent( paragraph.Left(p + blank) , &width , &height ) ;
|
dc.GetTextExtent( paragraph.Left(p + blank) , &width , &height ) ;
|
||||||
|
|
||||||
if ( width <= m_width )
|
if ( width <= m_width )
|
||||||
{
|
{
|
||||||
int pos = x ;
|
int pos = x ;
|
||||||
@@ -91,7 +91,7 @@ void wxStaticText::DrawParagraph(wxDC &dc, wxString paragraph, int &y)
|
|||||||
{
|
{
|
||||||
pos += ( m_width - width ) ;
|
pos += ( m_width - width ) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
dc.DrawText( paragraph.Left(p + blank), pos , y) ;
|
dc.DrawText( paragraph.Left(p + blank), pos , y) ;
|
||||||
y += height ;
|
y += height ;
|
||||||
paragraph = paragraph.Mid(p+1) ;
|
paragraph = paragraph.Mid(p+1) ;
|
||||||
@@ -100,7 +100,7 @@ void wxStaticText::DrawParagraph(wxDC &dc, wxString paragraph, int &y)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
linedrawn = false;
|
linedrawn = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -114,7 +114,7 @@ void wxStaticText::DrawParagraph(wxDC &dc, wxString paragraph, int &y)
|
|||||||
{
|
{
|
||||||
pos += ( m_width - width ) ;
|
pos += ( m_width - width ) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
dc.DrawText( paragraph, pos , y) ;
|
dc.DrawText( paragraph, pos , y) ;
|
||||||
paragraph=wxEmptyString;
|
paragraph=wxEmptyString;
|
||||||
y += height ;
|
y += height ;
|
||||||
@@ -130,7 +130,7 @@ void wxStaticText::OnDraw( wxDC &dc )
|
|||||||
dc.Clear() ;
|
dc.Clear() ;
|
||||||
wxRect rect(0,0,m_width,m_height) ;
|
wxRect rect(0,0,m_width,m_height) ;
|
||||||
dc.SetFont(*wxSMALL_FONT) ;
|
dc.SetFont(*wxSMALL_FONT) ;
|
||||||
|
|
||||||
dc.DrawRectangle(rect) ;
|
dc.DrawRectangle(rect) ;
|
||||||
*/
|
*/
|
||||||
if ( !IsWindowHilited( (WindowRef) MacGetRootWindow() ) &&
|
if ( !IsWindowHilited( (WindowRef) MacGetRootWindow() ) &&
|
||||||
@@ -143,14 +143,14 @@ void wxStaticText::OnDraw( wxDC &dc )
|
|||||||
{
|
{
|
||||||
dc.SetTextForeground( GetForegroundColour() ) ;
|
dc.SetTextForeground( GetForegroundColour() ) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxString paragraph;
|
wxString paragraph;
|
||||||
size_t i = 0 ;
|
size_t i = 0 ;
|
||||||
wxString text = m_label;
|
wxString text = m_label;
|
||||||
int y = 0 ;
|
int y = 0 ;
|
||||||
while (i < text.Length())
|
while (i < text.length())
|
||||||
{
|
{
|
||||||
|
|
||||||
if (text[i] == 13 || text[i] == 10)
|
if (text[i] == 13 || text[i] == 10)
|
||||||
{
|
{
|
||||||
DrawParagraph(dc, paragraph,y);
|
DrawParagraph(dc, paragraph,y);
|
||||||
@@ -162,7 +162,7 @@ void wxStaticText::OnDraw( wxDC &dc )
|
|||||||
}
|
}
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
if (paragraph.Length() > 0)
|
if (paragraph.length() > 0)
|
||||||
DrawParagraph(dc, paragraph,y);
|
DrawParagraph(dc, paragraph,y);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -224,7 +224,7 @@ wxSize wxStaticText::DoGetBestSize() const
|
|||||||
|
|
||||||
void wxStaticText::SetLabel(const wxString& st )
|
void wxStaticText::SetLabel(const wxString& st )
|
||||||
{
|
{
|
||||||
SetTitle( st ) ;
|
wxStaticTextBase::SetLabel( st ) ;
|
||||||
m_label = st ;
|
m_label = st ;
|
||||||
if ( !(GetWindowStyle() & wxST_NO_AUTORESIZE) )
|
if ( !(GetWindowStyle() & wxST_NO_AUTORESIZE) )
|
||||||
{
|
{
|
||||||
@@ -241,18 +241,18 @@ bool wxStaticText::SetFont(const wxFont& font)
|
|||||||
{
|
{
|
||||||
bool ret = wxControl::SetFont(font);
|
bool ret = wxControl::SetFont(font);
|
||||||
|
|
||||||
if ( ret )
|
if ( ret )
|
||||||
{
|
{
|
||||||
// adjust the size of the window to fit to the label unless autoresizing is
|
// adjust the size of the window to fit to the label unless autoresizing is
|
||||||
// disabled
|
// disabled
|
||||||
if ( !(GetWindowStyle() & wxST_NO_AUTORESIZE) )
|
if ( !(GetWindowStyle() & wxST_NO_AUTORESIZE) )
|
||||||
{
|
{
|
||||||
// temporary fix until layout measurement and drawing are in synch again
|
// temporary fix until layout measurement and drawing are in synch again
|
||||||
Refresh() ;
|
Refresh() ;
|
||||||
InvalidateBestSize();
|
InvalidateBestSize();
|
||||||
SetSize( GetBestSize() );
|
SetSize( GetBestSize() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: mac/toplevel.cpp
|
// Name: src/mac/classic/toplevel.cpp
|
||||||
// Purpose: implements wxTopLevelWindow for Mac
|
// Purpose: implements wxTopLevelWindow for Mac
|
||||||
// Author: Stefan Csomor
|
// Author: Stefan Csomor
|
||||||
// Modified by:
|
// Modified by:
|
||||||
@@ -265,17 +265,17 @@ pascal OSStatus MouseEventHandler( EventHandlerCallRef handler , EventRef event
|
|||||||
if ( button == 0 || GetEventKind( event ) == kEventMouseUp )
|
if ( button == 0 || GetEventKind( event ) == kEventMouseUp )
|
||||||
modifiers += btnState ;
|
modifiers += btnState ;
|
||||||
|
|
||||||
// temporary hack to support true two button mouse
|
// temporary hack to support true two button mouse
|
||||||
if ( button == kEventMouseButtonSecondary )
|
if ( button == kEventMouseButtonSecondary )
|
||||||
{
|
{
|
||||||
modifiers |= controlKey ;
|
modifiers |= controlKey ;
|
||||||
}
|
}
|
||||||
WindowRef window ;
|
WindowRef window ;
|
||||||
short windowPart = ::FindWindow(point, &window);
|
short windowPart = ::FindWindow(point, &window);
|
||||||
|
|
||||||
// either we really are active or we are capturing mouse events
|
// either we really are active or we are capturing mouse events
|
||||||
|
|
||||||
if ( (IsWindowActive(window) && windowPart == inContent) ||
|
if ( (IsWindowActive(window) && windowPart == inContent) ||
|
||||||
(wxTheApp->s_captureWindow && wxTheApp->s_captureWindow->MacGetTopLevelWindow() == toplevelWindow) )
|
(wxTheApp->s_captureWindow && wxTheApp->s_captureWindow->MacGetTopLevelWindow() == toplevelWindow) )
|
||||||
{
|
{
|
||||||
switch ( GetEventKind( event ) )
|
switch ( GetEventKind( event ) )
|
||||||
@@ -310,17 +310,17 @@ pascal OSStatus MouseEventHandler( EventHandlerCallRef handler , EventRef event
|
|||||||
NULL, sizeof(Point), NULL, &mouseLoc) == noErr)
|
NULL, sizeof(Point), NULL, &mouseLoc) == noErr)
|
||||||
{
|
{
|
||||||
wxMouseEvent wheelEvent(wxEVT_MOUSEWHEEL);
|
wxMouseEvent wheelEvent(wxEVT_MOUSEWHEEL);
|
||||||
|
|
||||||
wheelEvent.m_x = mouseLoc.h;
|
wheelEvent.m_x = mouseLoc.h;
|
||||||
wheelEvent.m_y = mouseLoc.v;
|
wheelEvent.m_y = mouseLoc.v;
|
||||||
|
|
||||||
wheelEvent.m_wheelRotation = delta;
|
wheelEvent.m_wheelRotation = delta;
|
||||||
wheelEvent.m_wheelDelta = 1;
|
wheelEvent.m_wheelDelta = 1;
|
||||||
wheelEvent.m_linesPerAction = 1;
|
wheelEvent.m_linesPerAction = 1;
|
||||||
|
|
||||||
wxWindow* currentMouseWindow = NULL;
|
wxWindow* currentMouseWindow = NULL;
|
||||||
wxWindow::MacGetWindowFromPoint(wxPoint(mouseLoc.h, mouseLoc.v), ¤tMouseWindow);
|
wxWindow::MacGetWindowFromPoint(wxPoint(mouseLoc.h, mouseLoc.v), ¤tMouseWindow);
|
||||||
|
|
||||||
if (currentMouseWindow)
|
if (currentMouseWindow)
|
||||||
{
|
{
|
||||||
currentMouseWindow->GetEventHandler()->ProcessEvent(wheelEvent);
|
currentMouseWindow->GetEventHandler()->ProcessEvent(wheelEvent);
|
||||||
@@ -365,10 +365,10 @@ static pascal OSStatus WindowEventHandler( EventHandlerCallRef handler , EventRe
|
|||||||
toplevelWindow->MacActivate( EventTimeToTicks( GetEventTime( event ) ) , false) ;
|
toplevelWindow->MacActivate( EventTimeToTicks( GetEventTime( event ) ) , false) ;
|
||||||
result = noErr ;
|
result = noErr ;
|
||||||
break ;
|
break ;
|
||||||
case kEventWindowShown :
|
case kEventWindowShown :
|
||||||
toplevelWindow->Refresh() ;
|
toplevelWindow->Refresh() ;
|
||||||
result = noErr ;
|
result = noErr ;
|
||||||
break ;
|
break ;
|
||||||
case kEventWindowClose :
|
case kEventWindowClose :
|
||||||
toplevelWindow->Close() ;
|
toplevelWindow->Close() ;
|
||||||
result = noErr ;
|
result = noErr ;
|
||||||
@@ -402,12 +402,12 @@ static pascal OSStatus WindowEventHandler( EventHandlerCallRef handler , EventRe
|
|||||||
|
|
||||||
wxSize formerSize = toplevelWindow->GetSize() ;
|
wxSize formerSize = toplevelWindow->GetSize() ;
|
||||||
|
|
||||||
if ( (attributes & kWindowBoundsChangeSizeChanged ) ||
|
if ( (attributes & kWindowBoundsChangeSizeChanged ) ||
|
||||||
( attributes & kWindowBoundsChangeOriginChanged ) )
|
( attributes & kWindowBoundsChangeOriginChanged ) )
|
||||||
toplevelWindow->SetSize( newContentRect.left , newContentRect.top ,
|
toplevelWindow->SetSize( newContentRect.left , newContentRect.top ,
|
||||||
newContentRect.right - newContentRect.left ,
|
newContentRect.right - newContentRect.left ,
|
||||||
newContentRect.bottom - newContentRect.top, wxSIZE_USE_EXISTING);
|
newContentRect.bottom - newContentRect.top, wxSIZE_USE_EXISTING);
|
||||||
|
|
||||||
int x , y , w , h ;
|
int x , y , w , h ;
|
||||||
toplevelWindow->GetPosition( &x , &y ) ;
|
toplevelWindow->GetPosition( &x , &y ) ;
|
||||||
toplevelWindow->GetSize( &w , &h ) ;
|
toplevelWindow->GetSize( &w , &h ) ;
|
||||||
@@ -417,10 +417,10 @@ static pascal OSStatus WindowEventHandler( EventHandlerCallRef handler , EventRe
|
|||||||
{
|
{
|
||||||
SetEventParameter( event , kEventParamCurrentBounds , typeQDRectangle, sizeof( adjustedRect ) , &adjustedRect ) ;
|
SetEventParameter( event , kEventParamCurrentBounds , typeQDRectangle, sizeof( adjustedRect ) , &adjustedRect ) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( toplevelWindow->GetSize() != formerSize )
|
if ( toplevelWindow->GetSize() != formerSize )
|
||||||
toplevelWindow->Update() ;
|
toplevelWindow->Update() ;
|
||||||
|
|
||||||
result = noErr ;
|
result = noErr ;
|
||||||
}
|
}
|
||||||
break ;
|
break ;
|
||||||
@@ -498,16 +498,16 @@ void wxRemoveMacWindowAssociation(wxTopLevelWindowMac *win)
|
|||||||
|
|
||||||
WXWindow wxTopLevelWindowMac::s_macWindowInUpdate = NULL;
|
WXWindow wxTopLevelWindowMac::s_macWindowInUpdate = NULL;
|
||||||
wxTopLevelWindowMac *wxTopLevelWindowMac::s_macDeactivateWindow = NULL;
|
wxTopLevelWindowMac *wxTopLevelWindowMac::s_macDeactivateWindow = NULL;
|
||||||
bool wxTopLevelWindowMac::s_macWindowCompositing = FALSE;
|
bool wxTopLevelWindowMac::s_macWindowCompositing = false;
|
||||||
|
|
||||||
void wxTopLevelWindowMac::Init()
|
void wxTopLevelWindowMac::Init()
|
||||||
{
|
{
|
||||||
m_iconized =
|
m_iconized =
|
||||||
m_maximizeOnShow = FALSE;
|
m_maximizeOnShow = false;
|
||||||
m_macNoEraseUpdateRgn = NewRgn() ;
|
m_macNoEraseUpdateRgn = NewRgn() ;
|
||||||
m_macNeedsErasing = false ;
|
m_macNeedsErasing = false ;
|
||||||
m_macWindow = NULL ;
|
m_macWindow = NULL ;
|
||||||
m_macUsesCompositing = FALSE ;
|
m_macUsesCompositing = false ;
|
||||||
#if TARGET_CARBON
|
#if TARGET_CARBON
|
||||||
m_macEventHandler = NULL ;
|
m_macEventHandler = NULL ;
|
||||||
#endif
|
#endif
|
||||||
@@ -550,7 +550,7 @@ bool wxTopLevelWindowMac::Create(wxWindow *parent,
|
|||||||
if ( parent )
|
if ( parent )
|
||||||
parent->AddChild(this);
|
parent->AddChild(this);
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxTopLevelWindowMac::~wxTopLevelWindowMac()
|
wxTopLevelWindowMac::~wxTopLevelWindowMac()
|
||||||
@@ -641,7 +641,7 @@ void wxTopLevelWindowMac::MacCreateRealWindow( const wxString& title,
|
|||||||
OSStatus err = noErr ;
|
OSStatus err = noErr ;
|
||||||
SetName(name);
|
SetName(name);
|
||||||
m_windowStyle = style;
|
m_windowStyle = style;
|
||||||
m_isShown = FALSE;
|
m_isShown = false;
|
||||||
|
|
||||||
// create frame.
|
// create frame.
|
||||||
|
|
||||||
@@ -738,21 +738,21 @@ void wxTopLevelWindowMac::MacCreateRealWindow( const wxString& title,
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//this setup lets us have compositing and non-compositing
|
//this setup lets us have compositing and non-compositing
|
||||||
//windows in the same application.
|
//windows in the same application.
|
||||||
|
|
||||||
#if UNIVERSAL_INTERFACES_VERSION >= 0x0400
|
#if UNIVERSAL_INTERFACES_VERSION >= 0x0400
|
||||||
if ( wxTopLevelWindowMac::s_macWindowCompositing )
|
if ( wxTopLevelWindowMac::s_macWindowCompositing )
|
||||||
{
|
{
|
||||||
attr |= kWindowCompositingAttribute;
|
attr |= kWindowCompositingAttribute;
|
||||||
m_macUsesCompositing = TRUE;
|
m_macUsesCompositing = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
m_macUsesCompositing = FALSE;
|
m_macUsesCompositing = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if TARGET_CARBON
|
#if TARGET_CARBON
|
||||||
if ( HasFlag(wxFRAME_SHAPED) )
|
if ( HasFlag(wxFRAME_SHAPED) )
|
||||||
{
|
{
|
||||||
@@ -805,8 +805,8 @@ void wxTopLevelWindowMac::MacCreateRealWindow( const wxString& title,
|
|||||||
bool wxTopLevelWindowMac::MacEnableCompositing( bool useCompositing )
|
bool wxTopLevelWindowMac::MacEnableCompositing( bool useCompositing )
|
||||||
{
|
{
|
||||||
bool oldval = s_macWindowCompositing;
|
bool oldval = s_macWindowCompositing;
|
||||||
s_macWindowCompositing = useCompositing;
|
s_macWindowCompositing = useCompositing;
|
||||||
return oldval;
|
return oldval;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxTopLevelWindowMac::MacGetPortParams(WXPOINTPTR localOrigin, WXRECTPTR clipRect, WXWindow *window , wxWindowMac** rootwin)
|
void wxTopLevelWindowMac::MacGetPortParams(WXPOINTPTR localOrigin, WXRECTPTR clipRect, WXWindow *window , wxWindowMac** rootwin)
|
||||||
@@ -902,7 +902,7 @@ void wxTopLevelWindowMac::MacFireMouseEvent(
|
|||||||
|
|
||||||
event.m_leftDown = isDown && !controlDown;
|
event.m_leftDown = isDown && !controlDown;
|
||||||
|
|
||||||
event.m_middleDown = FALSE;
|
event.m_middleDown = false;
|
||||||
event.m_rightDown = isDown && controlDown;
|
event.m_rightDown = isDown && controlDown;
|
||||||
|
|
||||||
if ( kind == mouseDown )
|
if ( kind == mouseDown )
|
||||||
@@ -1059,13 +1059,13 @@ void wxTopLevelWindowMac::MacActivate( long timestamp , bool inIsActivating )
|
|||||||
long osVersion = UMAGetSystemVersion();
|
long osVersion = UMAGetSystemVersion();
|
||||||
if (osVersion >= 0x1000 && osVersion < 0x1020 )
|
if (osVersion >= 0x1000 && osVersion < 0x1020 )
|
||||||
{
|
{
|
||||||
Refresh(TRUE);
|
Refresh(true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// for the moment we have to resolve some redrawing issues like this
|
// for the moment we have to resolve some redrawing issues like this
|
||||||
// the OS is stealing some redrawing areas as soon as it draws a control
|
// the OS is stealing some redrawing areas as soon as it draws a control
|
||||||
Refresh(TRUE);
|
Refresh(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1079,18 +1079,23 @@ void wxTopLevelWindowMac::MacKeyDown( WXEVENTREF ev )
|
|||||||
|
|
||||||
void wxTopLevelWindowMac::SetTitle(const wxString& title)
|
void wxTopLevelWindowMac::SetTitle(const wxString& title)
|
||||||
{
|
{
|
||||||
wxWindow::SetTitle( title ) ;
|
wxWindow::SetLabel( title ) ;
|
||||||
UMASetWTitle( (WindowRef)m_macWindow , title , m_font.GetEncoding() ) ;
|
UMASetWTitle( (WindowRef)m_macWindow , title , m_font.GetEncoding() ) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual wxString wxTopLevelWindowMac::GetTitle() const
|
||||||
|
{
|
||||||
|
return wxWindow::GetLabel();
|
||||||
|
}
|
||||||
|
|
||||||
bool wxTopLevelWindowMac::Show(bool show)
|
bool wxTopLevelWindowMac::Show(bool show)
|
||||||
{
|
{
|
||||||
if ( !wxWindow::Show(show) )
|
if ( !wxWindow::Show(show) )
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
if (show)
|
if (show)
|
||||||
{
|
{
|
||||||
#if wxUSE_SYSTEM_OPTIONS //code contributed by Ryan Wilcox December 18, 2003
|
#if wxUSE_SYSTEM_OPTIONS //code contributed by Ryan Wilcox December 18, 2003
|
||||||
if ( (wxSystemOptions::HasOption(wxMAC_WINDOW_PLAIN_TRANSITION) ) && ( wxSystemOptions::GetOptionInt( wxMAC_WINDOW_PLAIN_TRANSITION ) == 1) )
|
if ( (wxSystemOptions::HasOption(wxMAC_WINDOW_PLAIN_TRANSITION) ) && ( wxSystemOptions::GetOptionInt( wxMAC_WINDOW_PLAIN_TRANSITION ) == 1) )
|
||||||
{
|
{
|
||||||
::ShowWindow( (WindowRef)m_macWindow );
|
::ShowWindow( (WindowRef)m_macWindow );
|
||||||
@@ -1130,7 +1135,7 @@ bool wxTopLevelWindowMac::Show(bool show)
|
|||||||
Refresh() ;
|
Refresh() ;
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxTopLevelWindowMac::DoMoveWindow(int x, int y, int width, int height)
|
void wxTopLevelWindowMac::DoMoveWindow(int x, int y, int width, int height)
|
||||||
@@ -1195,10 +1200,10 @@ void wxTopLevelWindowMac::DoMoveWindow(int x, int y, int width, int height)
|
|||||||
wxFrame* frame = (wxFrame*) this ;
|
wxFrame* frame = (wxFrame*) this ;
|
||||||
#if wxUSE_STATUSBAR
|
#if wxUSE_STATUSBAR
|
||||||
frame->PositionStatusBar();
|
frame->PositionStatusBar();
|
||||||
#endif
|
#endif
|
||||||
#if wxUSE_TOOLBAR
|
#if wxUSE_TOOLBAR
|
||||||
frame->PositionToolBar();
|
frame->PositionToolBar();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
if ( doMove )
|
if ( doMove )
|
||||||
wxWindowMac::MacTopLevelWindowChangedPosition() ; // like this only children will be notified
|
wxWindowMac::MacTopLevelWindowChangedPosition() ; // like this only children will be notified
|
||||||
@@ -1290,7 +1295,7 @@ void wxTopLevelWindowMac::MacInvalidate( const WXRECTPTR rect, bool eraseBackgro
|
|||||||
|
|
||||||
bool wxTopLevelWindowMac::SetShape(const wxRegion& region)
|
bool wxTopLevelWindowMac::SetShape(const wxRegion& region)
|
||||||
{
|
{
|
||||||
wxCHECK_MSG( HasFlag(wxFRAME_SHAPED), FALSE,
|
wxCHECK_MSG( HasFlag(wxFRAME_SHAPED), false,
|
||||||
_T("Shaped windows must be created with the wxFRAME_SHAPED style."));
|
_T("Shaped windows must be created with the wxFRAME_SHAPED style."));
|
||||||
|
|
||||||
#if TARGET_CARBON
|
#if TARGET_CARBON
|
||||||
@@ -1317,9 +1322,9 @@ bool wxTopLevelWindowMac::SetShape(const wxRegion& region)
|
|||||||
|
|
||||||
// Tell the window manager that the window has changed shape
|
// Tell the window manager that the window has changed shape
|
||||||
ReshapeCustomWindow((WindowRef)MacGetWindowRef());
|
ReshapeCustomWindow((WindowRef)MacGetWindowRef());
|
||||||
return TRUE;
|
return true;
|
||||||
#else
|
#else
|
||||||
return FALSE;
|
return false;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1386,10 +1391,10 @@ static void wxShapedMacWindowStructureRegion(WindowRef window, RgnHandle rgn)
|
|||||||
if (cachedRegion)
|
if (cachedRegion)
|
||||||
{
|
{
|
||||||
Rect windowRect;
|
Rect windowRect;
|
||||||
wxShapedMacWindowGetPos(window, &windowRect); //how big is the window
|
wxShapedMacWindowGetPos(window, &windowRect); //how big is the window
|
||||||
CopyRgn(cachedRegion, rgn); //make a copy of our cached region
|
CopyRgn(cachedRegion, rgn); //make a copy of our cached region
|
||||||
OffsetRgn(rgn, windowRect.left, windowRect.top); // position it over window
|
OffsetRgn(rgn, windowRect.left, windowRect.top); // position it over window
|
||||||
//MapRgn(rgn, &mMaskSize, &windowRect); //scale it to our actual window size
|
//MapRgn(rgn, &mMaskSize, &windowRect); //scale it to our actual window size
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1424,7 +1429,7 @@ static SInt32 wxShapedMacWindowHitTest(WindowRef window,SInt32 param)
|
|||||||
static RgnHandle tempRgn=nil;
|
static RgnHandle tempRgn=nil;
|
||||||
|
|
||||||
if(!tempRgn)
|
if(!tempRgn)
|
||||||
tempRgn=NewRgn();
|
tempRgn=NewRgn();
|
||||||
|
|
||||||
SetPt(&hitPoint,LoWord(param),HiWord(param));//get the point clicked
|
SetPt(&hitPoint,LoWord(param),HiWord(param));//get the point clicked
|
||||||
|
|
||||||
@@ -1457,4 +1462,3 @@ static pascal long wxShapedMacWindowDef(short varCode, WindowRef window, SInt16
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: windows.cpp
|
// Name: src/mac/classic/window.cpp
|
||||||
// Purpose: wxWindowMac
|
// Purpose: wxWindowMac
|
||||||
// Author: Stefan Csomor
|
// Author: Stefan Csomor
|
||||||
// Modified by:
|
// Modified by:
|
||||||
@@ -90,10 +90,10 @@ END_EVENT_TABLE()
|
|||||||
|
|
||||||
void wxWindowMac::Init()
|
void wxWindowMac::Init()
|
||||||
{
|
{
|
||||||
m_backgroundTransparent = FALSE;
|
m_backgroundTransparent = false;
|
||||||
|
|
||||||
// as all windows are created with WS_VISIBLE style...
|
// as all windows are created with WS_VISIBLE style...
|
||||||
m_isShown = TRUE;
|
m_isShown = true;
|
||||||
|
|
||||||
m_x = 0;
|
m_x = 0;
|
||||||
m_y = 0 ;
|
m_y = 0 ;
|
||||||
@@ -123,7 +123,7 @@ wxWindowMac::~wxWindowMac()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m_isBeingDeleted = TRUE;
|
m_isBeingDeleted = true;
|
||||||
|
|
||||||
#ifndef __WXUNIVERSAL__
|
#ifndef __WXUNIVERSAL__
|
||||||
// VS: make sure there's no wxFrame with last focus set to us:
|
// VS: make sure there's no wxFrame with last focus set to us:
|
||||||
@@ -177,7 +177,7 @@ bool wxWindowMac::Create(wxWindowMac *parent, wxWindowID id,
|
|||||||
long style,
|
long style,
|
||||||
const wxString& name)
|
const wxString& name)
|
||||||
{
|
{
|
||||||
wxCHECK_MSG( parent, FALSE, wxT("can't create wxWindowMac without parent") );
|
wxCHECK_MSG( parent, false, wxT("can't create wxWindowMac without parent") );
|
||||||
|
|
||||||
#if wxUSE_STATBOX
|
#if wxUSE_STATBOX
|
||||||
// wxGTK doesn't allow to create controls with static box as the parent so
|
// wxGTK doesn't allow to create controls with static box as the parent so
|
||||||
@@ -191,7 +191,7 @@ bool wxWindowMac::Create(wxWindowMac *parent, wxWindowID id,
|
|||||||
#endif // wxUSE_STATBOX
|
#endif // wxUSE_STATBOX
|
||||||
|
|
||||||
if ( !CreateBase(parent, id, pos, size, style, wxDefaultValidator, name) )
|
if ( !CreateBase(parent, id, pos, size, style, wxDefaultValidator, name) )
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
parent->AddChild(this);
|
parent->AddChild(this);
|
||||||
|
|
||||||
@@ -212,7 +212,7 @@ bool wxWindowMac::Create(wxWindowMac *parent, wxWindowID id,
|
|||||||
wxWindowCreateEvent event(this);
|
wxWindowCreateEvent event(this);
|
||||||
GetEventHandler()->AddPendingEvent(event);
|
GetEventHandler()->AddPendingEvent(event);
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindowMac::SetFocus()
|
void wxWindowMac::SetFocus()
|
||||||
@@ -281,11 +281,11 @@ void wxWindowMac::SetFocus()
|
|||||||
bool wxWindowMac::Enable(bool enable)
|
bool wxWindowMac::Enable(bool enable)
|
||||||
{
|
{
|
||||||
if ( !wxWindowBase::Enable(enable) )
|
if ( !wxWindowBase::Enable(enable) )
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
MacSuperEnabled( enable ) ;
|
MacSuperEnabled( enable ) ;
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindowMac::DoCaptureMouse()
|
void wxWindowMac::DoCaptureMouse()
|
||||||
@@ -354,7 +354,7 @@ bool wxWindowMac::DoPopupMenu(wxMenu *menu, int x, int y)
|
|||||||
{
|
{
|
||||||
menu->SetInvokingWindow(this);
|
menu->SetInvokingWindow(this);
|
||||||
menu->UpdateUI();
|
menu->UpdateUI();
|
||||||
|
|
||||||
if ( x == -1 && y == -1 )
|
if ( x == -1 && y == -1 )
|
||||||
{
|
{
|
||||||
wxPoint mouse = wxGetMousePosition();
|
wxPoint mouse = wxGetMousePosition();
|
||||||
@@ -384,7 +384,7 @@ bool wxWindowMac::DoPopupMenu(wxMenu *menu, int x, int y)
|
|||||||
|
|
||||||
menu->SetInvokingWindow(NULL);
|
menu->SetInvokingWindow(NULL);
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -478,17 +478,17 @@ void wxWindowMac::MacRootWindowToWindow( int *x , int *y ) const
|
|||||||
bool wxWindowMac::SetCursor(const wxCursor& cursor)
|
bool wxWindowMac::SetCursor(const wxCursor& cursor)
|
||||||
{
|
{
|
||||||
if (m_cursor == cursor)
|
if (m_cursor == cursor)
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
if (wxNullCursor == cursor)
|
if (wxNullCursor == cursor)
|
||||||
{
|
{
|
||||||
if ( ! wxWindowBase::SetCursor( *wxSTANDARD_CURSOR ) )
|
if ( ! wxWindowBase::SetCursor( *wxSTANDARD_CURSOR ) )
|
||||||
return FALSE ;
|
return false ;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ( ! wxWindowBase::SetCursor( cursor ) )
|
if ( ! wxWindowBase::SetCursor( cursor ) )
|
||||||
return FALSE ;
|
return false ;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxASSERT_MSG( m_cursor.Ok(),
|
wxASSERT_MSG( m_cursor.Ok(),
|
||||||
@@ -508,7 +508,7 @@ bool wxWindowMac::SetCursor(const wxCursor& cursor)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE ;
|
return true ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -637,40 +637,40 @@ void wxWindowMac::DoMoveWindow(int x, int y, int width, int height)
|
|||||||
oldRgn = NewRgn() ;
|
oldRgn = NewRgn() ;
|
||||||
newRgn = NewRgn() ;
|
newRgn = NewRgn() ;
|
||||||
diffRgn = NewRgn() ;
|
diffRgn = NewRgn() ;
|
||||||
|
|
||||||
// invalidate the differences between the old and the new area
|
// invalidate the differences between the old and the new area
|
||||||
|
|
||||||
SetRectRgn(oldRgn , oldPos.x , oldPos.y , oldPos.x + m_width , oldPos.y + m_height ) ;
|
SetRectRgn(oldRgn , oldPos.x , oldPos.y , oldPos.x + m_width , oldPos.y + m_height ) ;
|
||||||
SetRectRgn(newRgn , newPos.x , newPos.y , newPos.x + actualWidth , newPos.y + actualHeight ) ;
|
SetRectRgn(newRgn , newPos.x , newPos.y , newPos.x + actualWidth , newPos.y + actualHeight ) ;
|
||||||
DiffRgn( newRgn , oldRgn , diffRgn ) ;
|
DiffRgn( newRgn , oldRgn , diffRgn ) ;
|
||||||
InvalWindowRgn( (WindowRef) MacGetRootWindow() , diffRgn ) ;
|
InvalWindowRgn( (WindowRef) MacGetRootWindow() , diffRgn ) ;
|
||||||
DiffRgn( oldRgn , newRgn , diffRgn ) ;
|
DiffRgn( oldRgn , newRgn , diffRgn ) ;
|
||||||
InvalWindowRgn( (WindowRef) MacGetRootWindow() , diffRgn ) ;
|
InvalWindowRgn( (WindowRef) MacGetRootWindow() , diffRgn ) ;
|
||||||
|
|
||||||
// we also must invalidate the border areas, someone might optimize this one day to invalidate only the really
|
// we also must invalidate the border areas, someone might optimize this one day to invalidate only the really
|
||||||
// changing pixels...
|
// changing pixels...
|
||||||
|
|
||||||
if ( MacGetLeftBorderSize() != 0 || MacGetRightBorderSize() != 0 ||
|
|
||||||
MacGetTopBorderSize() != 0 || MacGetBottomBorderSize() != 0 )
|
|
||||||
{
|
|
||||||
RgnHandle innerOldRgn, innerNewRgn ;
|
|
||||||
innerOldRgn = NewRgn() ;
|
|
||||||
innerNewRgn = NewRgn() ;
|
|
||||||
|
|
||||||
SetRectRgn(innerOldRgn , oldPos.x + MacGetLeftBorderSize() , oldPos.y + MacGetTopBorderSize() ,
|
|
||||||
oldPos.x + m_width - MacGetRightBorderSize() , oldPos.y + m_height - MacGetBottomBorderSize() ) ;
|
|
||||||
DiffRgn( oldRgn , innerOldRgn , diffRgn ) ;
|
|
||||||
InvalWindowRgn( (WindowRef) MacGetRootWindow() , diffRgn ) ;
|
|
||||||
|
|
||||||
SetRectRgn(innerNewRgn , newPos.x + MacGetLeftBorderSize() , newPos.y + MacGetTopBorderSize() ,
|
if ( MacGetLeftBorderSize() != 0 || MacGetRightBorderSize() != 0 ||
|
||||||
newPos.x + actualWidth - MacGetRightBorderSize() , newPos.y + actualHeight - MacGetBottomBorderSize() ) ;
|
MacGetTopBorderSize() != 0 || MacGetBottomBorderSize() != 0 )
|
||||||
DiffRgn( newRgn , innerNewRgn , diffRgn ) ;
|
{
|
||||||
InvalWindowRgn( (WindowRef) MacGetRootWindow() , diffRgn ) ;
|
RgnHandle innerOldRgn, innerNewRgn ;
|
||||||
|
innerOldRgn = NewRgn() ;
|
||||||
DisposeRgn( innerOldRgn ) ;
|
innerNewRgn = NewRgn() ;
|
||||||
DisposeRgn( innerNewRgn ) ;
|
|
||||||
|
SetRectRgn(innerOldRgn , oldPos.x + MacGetLeftBorderSize() , oldPos.y + MacGetTopBorderSize() ,
|
||||||
|
oldPos.x + m_width - MacGetRightBorderSize() , oldPos.y + m_height - MacGetBottomBorderSize() ) ;
|
||||||
|
DiffRgn( oldRgn , innerOldRgn , diffRgn ) ;
|
||||||
|
InvalWindowRgn( (WindowRef) MacGetRootWindow() , diffRgn ) ;
|
||||||
|
|
||||||
|
SetRectRgn(innerNewRgn , newPos.x + MacGetLeftBorderSize() , newPos.y + MacGetTopBorderSize() ,
|
||||||
|
newPos.x + actualWidth - MacGetRightBorderSize() , newPos.y + actualHeight - MacGetBottomBorderSize() ) ;
|
||||||
|
DiffRgn( newRgn , innerNewRgn , diffRgn ) ;
|
||||||
|
InvalWindowRgn( (WindowRef) MacGetRootWindow() , diffRgn ) ;
|
||||||
|
|
||||||
|
DisposeRgn( innerOldRgn ) ;
|
||||||
|
DisposeRgn( innerNewRgn ) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
DisposeRgn(oldRgn) ;
|
DisposeRgn(oldRgn) ;
|
||||||
DisposeRgn(newRgn) ;
|
DisposeRgn(newRgn) ;
|
||||||
DisposeRgn(diffRgn) ;
|
DisposeRgn(diffRgn) ;
|
||||||
@@ -792,12 +792,12 @@ wxPoint wxWindowMac::GetClientAreaOrigin() const
|
|||||||
return wxPoint(MacGetLeftBorderSize( ) , MacGetTopBorderSize( ) );
|
return wxPoint(MacGetLeftBorderSize( ) , MacGetTopBorderSize( ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindowMac::SetTitle(const wxString& title)
|
void wxWindowMac::SetLabel(const wxString& label)
|
||||||
{
|
{
|
||||||
m_label = title ;
|
m_label = label ;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxString wxWindowMac::GetTitle() const
|
wxString wxWindowMac::GetLabel() const
|
||||||
{
|
{
|
||||||
return m_label ;
|
return m_label ;
|
||||||
}
|
}
|
||||||
@@ -805,12 +805,12 @@ wxString wxWindowMac::GetTitle() const
|
|||||||
bool wxWindowMac::Show(bool show)
|
bool wxWindowMac::Show(bool show)
|
||||||
{
|
{
|
||||||
if ( !wxWindowBase::Show(show) )
|
if ( !wxWindowBase::Show(show) )
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
MacSuperShown( show ) ;
|
MacSuperShown( show ) ;
|
||||||
Refresh() ;
|
Refresh() ;
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindowMac::MacSuperShown( bool show )
|
void wxWindowMac::MacSuperShown( bool show )
|
||||||
@@ -904,8 +904,8 @@ void wxWindowMac::Refresh(bool eraseBack, const wxRect *rect)
|
|||||||
return ;
|
return ;
|
||||||
|
|
||||||
if ( !MacIsReallyShown() )
|
if ( !MacIsReallyShown() )
|
||||||
return ;
|
return ;
|
||||||
|
|
||||||
wxPoint client = GetClientAreaOrigin();
|
wxPoint client = GetClientAreaOrigin();
|
||||||
int x1 = -client.x;
|
int x1 = -client.x;
|
||||||
int y1 = -client.y;
|
int y1 = -client.y;
|
||||||
@@ -1094,26 +1094,26 @@ void wxWindowMac::MacPaintBorders( int left , int top )
|
|||||||
{
|
{
|
||||||
if( IsTopLevel() )
|
if( IsTopLevel() )
|
||||||
return ;
|
return ;
|
||||||
|
|
||||||
int major,minor;
|
int major,minor;
|
||||||
wxGetOsVersion( &major, &minor );
|
wxGetOsVersion( &major, &minor );
|
||||||
|
|
||||||
RGBColor white = { 0xFFFF, 0xFFFF , 0xFFFF } ;
|
RGBColor white = { 0xFFFF, 0xFFFF , 0xFFFF } ;
|
||||||
RGBColor face = { 0xDDDD, 0xDDDD , 0xDDDD } ;
|
RGBColor face = { 0xDDDD, 0xDDDD , 0xDDDD } ;
|
||||||
|
|
||||||
RGBColor darkShadow = { 0x0000, 0x0000 , 0x0000 } ;
|
RGBColor darkShadow = { 0x0000, 0x0000 , 0x0000 } ;
|
||||||
RGBColor lightShadow = { 0x4444, 0x4444 , 0x4444 } ;
|
RGBColor lightShadow = { 0x4444, 0x4444 , 0x4444 } ;
|
||||||
// OS X has lighter border edges than classic:
|
// OS X has lighter border edges than classic:
|
||||||
if (major >= 10)
|
if (major >= 10)
|
||||||
{
|
{
|
||||||
darkShadow.red = 0x8E8E;
|
darkShadow.red = 0x8E8E;
|
||||||
darkShadow.green = 0x8E8E;
|
darkShadow.green = 0x8E8E;
|
||||||
darkShadow.blue = 0x8E8E;
|
darkShadow.blue = 0x8E8E;
|
||||||
lightShadow.red = 0xBDBD;
|
lightShadow.red = 0xBDBD;
|
||||||
lightShadow.green = 0xBDBD;
|
lightShadow.green = 0xBDBD;
|
||||||
lightShadow.blue = 0xBDBD;
|
lightShadow.blue = 0xBDBD;
|
||||||
}
|
}
|
||||||
|
|
||||||
PenNormal() ;
|
PenNormal() ;
|
||||||
|
|
||||||
if (HasFlag(wxRAISED_BORDER) || HasFlag( wxSUNKEN_BORDER) || HasFlag(wxDOUBLE_BORDER) )
|
if (HasFlag(wxRAISED_BORDER) || HasFlag( wxSUNKEN_BORDER) || HasFlag(wxDOUBLE_BORDER) )
|
||||||
@@ -1224,7 +1224,7 @@ void wxWindowMac::ScrollWindow(int dx, int dy, const wxRect *rect)
|
|||||||
{
|
{
|
||||||
if( dx == 0 && dy ==0 )
|
if( dx == 0 && dy ==0 )
|
||||||
return ;
|
return ;
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
wxClientDC dc(this) ;
|
wxClientDC dc(this) ;
|
||||||
@@ -1243,7 +1243,7 @@ void wxWindowMac::ScrollWindow(int dx, int dy, const wxRect *rect)
|
|||||||
SectRect( &scrollrect , &r , &scrollrect ) ;
|
SectRect( &scrollrect , &r , &scrollrect ) ;
|
||||||
}
|
}
|
||||||
ScrollRect( &scrollrect , dx , dy , updateRgn ) ;
|
ScrollRect( &scrollrect , dx , dy , updateRgn ) ;
|
||||||
// we also have to scroll the update rgn in this rectangle
|
// we also have to scroll the update rgn in this rectangle
|
||||||
// in order not to loose updates
|
// in order not to loose updates
|
||||||
WindowRef rootWindow = (WindowRef) MacGetRootWindow() ;
|
WindowRef rootWindow = (WindowRef) MacGetRootWindow() ;
|
||||||
RgnHandle formerUpdateRgn = NewRgn() ;
|
RgnHandle formerUpdateRgn = NewRgn() ;
|
||||||
@@ -1285,10 +1285,10 @@ void wxWindowMac::ScrollWindow(int dx, int dy, const wxRect *rect)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
child->SetSize( x+dx, y+dy, w, h );
|
child->SetSize( x+dx, y+dy, w, h );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Update() ;
|
Update() ;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1396,13 +1396,13 @@ bool wxWindowMac::MacGetWindowFromPointSub( const wxPoint &point , wxWindowMac**
|
|||||||
{
|
{
|
||||||
if ((point.x < 0) || (point.y < 0) ||
|
if ((point.x < 0) || (point.y < 0) ||
|
||||||
(point.x > (m_width)) || (point.y > (m_height)))
|
(point.x > (m_width)) || (point.y > (m_height)))
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ((point.x < m_x) || (point.y < m_y) ||
|
if ((point.x < m_x) || (point.y < m_y) ||
|
||||||
(point.x > (m_x + m_width)) || (point.y > (m_y + m_height)))
|
(point.x > (m_x + m_width)) || (point.y > (m_y + m_height)))
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
WindowRef window = (WindowRef) MacGetRootWindow() ;
|
WindowRef window = (WindowRef) MacGetRootWindow() ;
|
||||||
@@ -1422,12 +1422,12 @@ bool wxWindowMac::MacGetWindowFromPointSub( const wxPoint &point , wxWindowMac**
|
|||||||
if ( child->MacGetRootWindow() == (WXWindow) window && child->m_isShown )
|
if ( child->MacGetRootWindow() == (WXWindow) window && child->m_isShown )
|
||||||
{
|
{
|
||||||
if (child->MacGetWindowFromPointSub(newPoint , outWin ))
|
if (child->MacGetWindowFromPointSub(newPoint , outWin ))
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
*outWin = this ;
|
*outWin = this ;
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxWindowMac::MacGetWindowFromPoint( const wxPoint &screenpoint , wxWindowMac** outWin )
|
bool wxWindowMac::MacGetWindowFromPoint( const wxPoint &screenpoint , wxWindowMac** outWin )
|
||||||
@@ -1455,7 +1455,7 @@ bool wxWindowMac::MacGetWindowFromPoint( const wxPoint &screenpoint , wxWindowMa
|
|||||||
return win->MacGetWindowFromPointSub( point , outWin ) ;
|
return win->MacGetWindowFromPointSub( point , outWin ) ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return FALSE ;
|
return false ;
|
||||||
}
|
}
|
||||||
|
|
||||||
static wxWindow *gs_lastWhich = NULL;
|
static wxWindow *gs_lastWhich = NULL;
|
||||||
@@ -1503,14 +1503,14 @@ bool wxWindowMac::MacSetupCursor( const wxPoint& pt)
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool wxWindowMac::MacDispatchMouseEvent(wxMouseEvent& event)
|
bool wxWindowMac::MacDispatchMouseEvent(wxMouseEvent& event)
|
||||||
{
|
{
|
||||||
if ((event.m_x < m_x) || (event.m_y < m_y) ||
|
if ((event.m_x < m_x) || (event.m_y < m_y) ||
|
||||||
(event.m_x > (m_x + m_width)) || (event.m_y > (m_y + m_height)))
|
(event.m_x > (m_x + m_width)) || (event.m_y > (m_y + m_height)))
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
|
|
||||||
if ( IsKindOf( CLASSINFO ( wxStaticBox ) ) /* || IsKindOf( CLASSINFO( wxSpinCtrl ) ) */)
|
if ( IsKindOf( CLASSINFO ( wxStaticBox ) ) /* || IsKindOf( CLASSINFO( wxSpinCtrl ) ) */)
|
||||||
return FALSE ;
|
return false ;
|
||||||
|
|
||||||
WindowRef window = (WindowRef) MacGetRootWindow() ;
|
WindowRef window = (WindowRef) MacGetRootWindow() ;
|
||||||
|
|
||||||
@@ -1526,7 +1526,7 @@ bool wxWindowMac::MacDispatchMouseEvent(wxMouseEvent& event)
|
|||||||
if ( child->MacGetRootWindow() == (WXWindow) window && child->IsShown() && child->IsEnabled() )
|
if ( child->MacGetRootWindow() == (WXWindow) window && child->IsShown() && child->IsEnabled() )
|
||||||
{
|
{
|
||||||
if (child->MacDispatchMouseEvent(event))
|
if (child->MacDispatchMouseEvent(event))
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1569,14 +1569,14 @@ bool wxWindowMac::MacDispatchMouseEvent(wxMouseEvent& event)
|
|||||||
|
|
||||||
// Same for mouse up events
|
// Same for mouse up events
|
||||||
if (event.GetEventType() == wxEVT_LEFT_UP)
|
if (event.GetEventType() == wxEVT_LEFT_UP)
|
||||||
return TRUE;
|
return true;
|
||||||
if (event.GetEventType() == wxEVT_RIGHT_UP)
|
if (event.GetEventType() == wxEVT_RIGHT_UP)
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
GetEventHandler()->ProcessEvent( event ) ;
|
GetEventHandler()->ProcessEvent( event ) ;
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxString wxWindowMac::MacGetToolTipString( wxPoint &pt )
|
wxString wxWindowMac::MacGetToolTipString( wxPoint &pt )
|
||||||
@@ -1594,7 +1594,7 @@ void wxWindowMac::Update()
|
|||||||
int top = 0 , left = 0 ;
|
int top = 0 , left = 0 ;
|
||||||
MacWindowToRootWindow( &left , &top ) ;
|
MacWindowToRootWindow( &left , &top ) ;
|
||||||
WindowRef rootWindow = (WindowRef) MacGetRootWindow() ;
|
WindowRef rootWindow = (WindowRef) MacGetRootWindow() ;
|
||||||
RgnHandle updateRgn = NewRgn() ;
|
RgnHandle updateRgn = NewRgn() ;
|
||||||
// getting the update region in macos local coordinates
|
// getting the update region in macos local coordinates
|
||||||
GetWindowUpdateRgn( rootWindow , updateRgn ) ;
|
GetWindowUpdateRgn( rootWindow , updateRgn ) ;
|
||||||
GrafPtr port ;
|
GrafPtr port ;
|
||||||
@@ -1692,7 +1692,7 @@ const wxRegion& wxWindowMac::MacGetVisibleRegion( bool respectChildrenAndSibling
|
|||||||
int borderOther = 4 ;
|
int borderOther = 4 ;
|
||||||
if ( UMAGetSystemVersion() >= 0x1030 )
|
if ( UMAGetSystemVersion() >= 0x1030 )
|
||||||
borderTop += 2 ;
|
borderTop += 2 ;
|
||||||
|
|
||||||
SetRectRgn( tempStaticBoxRgn , child->m_x + borderOther , child->m_y + borderTop , child->m_x + child->m_width - borderOther , child->m_y + child->m_height - borderOther ) ;
|
SetRectRgn( tempStaticBoxRgn , child->m_x + borderOther , child->m_y + borderTop , child->m_x + child->m_width - borderOther , child->m_y + child->m_height - borderOther ) ;
|
||||||
DiffRgn( tempRgn , tempStaticBoxRgn , tempRgn ) ;
|
DiffRgn( tempRgn , tempStaticBoxRgn , tempRgn ) ;
|
||||||
}
|
}
|
||||||
@@ -1795,12 +1795,12 @@ void wxWindowMac::MacRedraw( WXHRGN updatergnr , long time, bool erase)
|
|||||||
hiddenWindows.Append( child ) ;
|
hiddenWindows.Append( child ) ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
wxPaintEvent event;
|
wxPaintEvent event;
|
||||||
event.SetTimestamp(time);
|
event.SetTimestamp(time);
|
||||||
event.SetEventObject(this);
|
event.SetEventObject(this);
|
||||||
GetEventHandler()->ProcessEvent(event);
|
GetEventHandler()->ProcessEvent(event);
|
||||||
|
|
||||||
for (wxWindowListNode *node = hiddenWindows.GetFirst(); node; node = node->GetNext())
|
for (wxWindowListNode *node = hiddenWindows.GetFirst(); node; node = node->GetNext())
|
||||||
{
|
{
|
||||||
wxControl *child = wxDynamicCast( ( wxWindow*)node->GetData() , wxControl ) ;
|
wxControl *child = wxDynamicCast( ( wxWindow*)node->GetData() , wxControl ) ;
|
||||||
@@ -2072,9 +2072,9 @@ wxPoint wxGetMousePosition()
|
|||||||
|
|
||||||
void wxWindowMac::OnMouseEvent( wxMouseEvent &event )
|
void wxWindowMac::OnMouseEvent( wxMouseEvent &event )
|
||||||
{
|
{
|
||||||
if ( event.GetEventType() == wxEVT_RIGHT_DOWN )
|
if ( event.GetEventType() == wxEVT_RIGHT_DOWN )
|
||||||
{
|
{
|
||||||
// copied from wxGTK : CS
|
// copied from wxGTK : CS
|
||||||
// generate a "context menu" event: this is similar to wxEVT_RIGHT_DOWN
|
// generate a "context menu" event: this is similar to wxEVT_RIGHT_DOWN
|
||||||
// except that:
|
// except that:
|
||||||
//
|
//
|
||||||
@@ -2086,10 +2086,9 @@ void wxWindowMac::OnMouseEvent( wxMouseEvent &event )
|
|||||||
this->ClientToScreen(event.GetPosition()));
|
this->ClientToScreen(event.GetPosition()));
|
||||||
if ( ! GetEventHandler()->ProcessEvent(evtCtx) )
|
if ( ! GetEventHandler()->ProcessEvent(evtCtx) )
|
||||||
event.Skip() ;
|
event.Skip() ;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
event.Skip() ;
|
event.Skip() ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user