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
|
||||
// wxWidgets itself, it may contain identifiers which don't start
|
||||
// with "wx".
|
||||
@@ -270,7 +270,6 @@ public :
|
||||
ReleaseEvent( m_eventRef ) ;
|
||||
m_release = false ;
|
||||
m_eventRef = NULL ;
|
||||
|
||||
}
|
||||
OSStatus err = MacCreateEvent( NULL , inClassID, inKind,inWhen,inAttributes,&m_eventRef) ;
|
||||
if ( err == noErr )
|
||||
@@ -578,7 +577,7 @@ public :
|
||||
// where is in native window relative coordinates
|
||||
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 ) ;
|
||||
|
||||
// in native parent window relative coordinates
|
||||
@@ -589,7 +588,7 @@ public :
|
||||
|
||||
virtual void GetRectInWindowCoords( 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
|
||||
static void Convert( wxPoint *pt , wxMacControl *convert , wxMacControl *to ) ;
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/mac/toplevel.h
|
||||
// Name: wx/mac/carbon/toplevel.h
|
||||
// Purpose: wxTopLevelWindowMac is the Mac implementation of wxTLW
|
||||
// Author: Stefan Csomor
|
||||
// Modified by:
|
||||
@@ -56,9 +56,9 @@ public:
|
||||
virtual void RequestUserAttention(int flags = wxUSER_ATTENTION_INFO);
|
||||
|
||||
// implement base class pure virtuals
|
||||
virtual void Maximize(bool maximize = TRUE);
|
||||
virtual void Maximize(bool maximize = true);
|
||||
virtual bool IsMaximized() const;
|
||||
virtual void Iconize(bool iconize = TRUE);
|
||||
virtual void Iconize(bool iconize = true);
|
||||
virtual bool IsIconized() const;
|
||||
virtual void SetIcon(const wxIcon& icon);
|
||||
virtual void SetIcons(const wxIconBundle& icons) { SetIcon( icons.GetIcon( -1 ) ); }
|
||||
@@ -84,10 +84,12 @@ public:
|
||||
virtual void MacActivate( long timestamp , bool inIsActivating ) ;
|
||||
virtual void MacPerformUpdates() ;
|
||||
|
||||
virtual void SetTitle( const wxString& title);
|
||||
virtual wxString GetTitle() const;
|
||||
|
||||
virtual void Raise();
|
||||
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 ) ;
|
||||
|
||||
@@ -137,4 +139,3 @@ private :
|
||||
extern WXDLLEXPORT_DATA(wxWindowList) wxModelessWindows;
|
||||
|
||||
#endif // _WX_MSW_TOPLEVEL_H_
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: window.h
|
||||
// Name: wx/mac/carbon/window.h
|
||||
// Purpose: wxWindowMac class
|
||||
// Author: Stefan Csomor
|
||||
// Modified by:
|
||||
@@ -60,20 +60,20 @@ public:
|
||||
|
||||
|
||||
// implement base class pure virtuals
|
||||
virtual void SetTitle( const wxString& title);
|
||||
virtual wxString GetTitle() const;
|
||||
virtual void SetLabel( const wxString& label);
|
||||
virtual wxString GetLabel() const;
|
||||
|
||||
virtual void Raise();
|
||||
virtual void Lower();
|
||||
|
||||
virtual bool Show( bool show = TRUE );
|
||||
virtual bool Enable( bool enable = TRUE );
|
||||
virtual bool Show( bool show = true );
|
||||
virtual bool Enable( bool enable = true );
|
||||
|
||||
virtual void SetFocus();
|
||||
|
||||
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 );
|
||||
virtual void Freeze() ;
|
||||
virtual void Thaw() ;
|
||||
@@ -98,8 +98,8 @@ public:
|
||||
virtual bool DoPopupMenu( wxMenu *menu, int x, int y );
|
||||
|
||||
virtual void SetScrollbar( int orient, int pos, int thumbVisible,
|
||||
int range, bool refresh = TRUE );
|
||||
virtual void SetScrollPos( int orient, int pos, bool refresh = TRUE );
|
||||
int range, bool refresh = true );
|
||||
virtual void SetScrollPos( int orient, int pos, bool refresh = true );
|
||||
virtual int GetScrollPos( int orient ) const;
|
||||
virtual int GetScrollThumb( int orient ) const;
|
||||
virtual int GetScrollRange( int orient ) const;
|
||||
@@ -135,7 +135,7 @@ public:
|
||||
|
||||
#if WXWIN_COMPATIBILITY_2_4
|
||||
bool GetTransparentBackground() const { return m_backgroundTransparent; }
|
||||
void SetTransparent(bool t = TRUE) { m_backgroundTransparent = t; }
|
||||
void SetTransparent(bool t = true) { m_backgroundTransparent = t; }
|
||||
#endif
|
||||
|
||||
// event handlers
|
||||
@@ -158,7 +158,7 @@ public:
|
||||
virtual wxPoint GetClientAreaOrigin() const;
|
||||
|
||||
wxWindowMac *FindItem(long id) const;
|
||||
wxWindowMac *FindItemByHWND(WXHWND hWnd, bool controlOnly = FALSE) const;
|
||||
wxWindowMac *FindItemByHWND(WXHWND hWnd, bool controlOnly = false) const;
|
||||
|
||||
public:
|
||||
virtual void MacHandleControlClick( WXWidget control , wxInt16 controlpart , bool mouseStillDown ) ;
|
||||
@@ -195,7 +195,7 @@ public:
|
||||
bool MacIsReallyEnabled() ;
|
||||
bool MacIsReallyHilited() ;
|
||||
|
||||
bool MacIsUserPane() { return m_macIsUserPane; }
|
||||
bool MacIsUserPane() { return m_macIsUserPane; }
|
||||
|
||||
virtual bool MacSetupCursor( const wxPoint& pt ) ;
|
||||
|
||||
@@ -210,16 +210,16 @@ public:
|
||||
// returns the visible region of this control in window ie non-client coordinates
|
||||
const wxRegion& MacGetVisibleRegion( bool includeOuterStructures = false ) ;
|
||||
// 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 ; }
|
||||
// returns true if the grandchildren have to be clipped to the children's content area (eg
|
||||
// splitter window)
|
||||
virtual bool MacClipGrandChildren() const { return false ; }
|
||||
virtual bool MacClipGrandChildren() const { return false ; }
|
||||
bool MacIsWindowScrollbar( const wxScrollBar* sb )
|
||||
{ return (m_hScrollBar == sb || m_vScrollBar == sb) ; }
|
||||
|
||||
wxList& GetSubcontrols() { return m_subControls; }
|
||||
virtual void MacInstallEventHandler(WXWidget native) ;
|
||||
virtual void MacInstallEventHandler(WXWidget native) ;
|
||||
WXEVENTHANDLERREF MacGetControlEventHandler() { return m_macControlEventHandler ; }
|
||||
void MacPostControlCreate(const wxPoint& pos, const wxSize& size) ;
|
||||
#ifndef __WXMAC_OSX__
|
||||
@@ -235,7 +235,7 @@ public:
|
||||
// translate wxWidgets coords into ones suitable to be passed to
|
||||
// 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,
|
||||
const wxSize& size,
|
||||
int& x, int& y,
|
||||
@@ -275,7 +275,7 @@ protected:
|
||||
mutable wxRegion m_cachedClippedRegion ;
|
||||
mutable wxRegion m_cachedClippedClientRegion ;
|
||||
// true if is is not a native control but a wxWindow control
|
||||
bool m_macIsUserPane ;
|
||||
bool m_macIsUserPane ;
|
||||
wxBrush m_macBackgroundBrush ;
|
||||
// topleft inset of the mac control from the wx top left corner
|
||||
wxPoint m_macTopLeftInset ;
|
||||
@@ -306,8 +306,8 @@ protected:
|
||||
#endif
|
||||
|
||||
// implement the base class pure virtuals
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
virtual wxSize DoGetSizeFromClientSize( const wxSize & size ) const;
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
virtual wxSize DoGetSizeFromClientSize( const wxSize & size ) const;
|
||||
virtual void DoClientToScreen( int *x, int *y ) const;
|
||||
virtual void DoScreenToClient( int *x, int *y ) const;
|
||||
virtual void DoGetPosition( int *x, int *y ) const;
|
||||
|
@@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/mac/toplevel.h
|
||||
// Name: wx/mac/classic/toplevel.h
|
||||
// Purpose: wxTopLevelWindowMac is the Mac implementation of wxTLW
|
||||
// Author: Stefan Csomor
|
||||
// Modified by:
|
||||
@@ -50,9 +50,9 @@ public:
|
||||
virtual ~wxTopLevelWindowMac();
|
||||
|
||||
// implement base class pure virtuals
|
||||
virtual void Maximize(bool maximize = TRUE);
|
||||
virtual void Maximize(bool maximize = true);
|
||||
virtual bool IsMaximized() const;
|
||||
virtual void Iconize(bool iconize = TRUE);
|
||||
virtual void Iconize(bool iconize = true);
|
||||
virtual bool IsIconized() const;
|
||||
virtual void SetIcon(const wxIcon& icon);
|
||||
virtual void SetIcons(const wxIconBundle& icons) { SetIcon( icons.GetIcon( -1 ) ); }
|
||||
@@ -61,8 +61,8 @@ public:
|
||||
virtual bool SetShape(const wxRegion& region);
|
||||
|
||||
virtual bool ShowFullScreen(bool WXUNUSED(show), long WXUNUSED(style) = wxFULLSCREEN_ALL)
|
||||
{ return FALSE; }
|
||||
virtual bool IsFullScreen() const { return FALSE; }
|
||||
{ return false; }
|
||||
virtual bool IsFullScreen() const { return false; }
|
||||
|
||||
// implementation from now on
|
||||
// --------------------------
|
||||
@@ -87,10 +87,13 @@ public:
|
||||
virtual void MacKeyDown( WXEVENTREF ev ) ;
|
||||
#endif
|
||||
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 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);
|
||||
void MacInvalidate( const WXRECTPTR rect, bool eraseBackground ) ;
|
||||
short MacGetWindowBackgroundTheme() const { return m_macWindowBackgroundTheme ; }
|
||||
@@ -138,4 +141,3 @@ void wxRemoveMacWindowAssociation(wxTopLevelWindowMac *win) ;
|
||||
|
||||
|
||||
#endif // _WX_MSW_TOPLEVEL_H_
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: window.h
|
||||
// Name: wx/mac/carbon/window.h
|
||||
// Purpose: wxWindowMac class
|
||||
// Author: Stefan Csomor
|
||||
// Modified by:
|
||||
@@ -65,20 +65,20 @@ public:
|
||||
|
||||
|
||||
// implement base class pure virtuals
|
||||
virtual void SetTitle( const wxString& title);
|
||||
virtual wxString GetTitle() const;
|
||||
virtual void SetLabel( const wxString& title);
|
||||
virtual wxString GetLabel() const;
|
||||
|
||||
virtual void Raise();
|
||||
virtual void Lower();
|
||||
|
||||
virtual bool Show( bool show = TRUE );
|
||||
virtual bool Enable( bool enable = TRUE );
|
||||
virtual bool Show( bool show = true );
|
||||
virtual bool Enable( bool enable = true );
|
||||
|
||||
virtual void SetFocus();
|
||||
|
||||
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 );
|
||||
|
||||
virtual bool SetCursor( const wxCursor &cursor );
|
||||
@@ -96,8 +96,8 @@ public:
|
||||
virtual bool DoPopupMenu( wxMenu *menu, int x, int y );
|
||||
|
||||
virtual void SetScrollbar( int orient, int pos, int thumbVisible,
|
||||
int range, bool refresh = TRUE );
|
||||
virtual void SetScrollPos( int orient, int pos, bool refresh = TRUE );
|
||||
int range, bool refresh = true );
|
||||
virtual void SetScrollPos( int orient, int pos, bool refresh = true );
|
||||
virtual int GetScrollPos( int orient ) const;
|
||||
virtual int GetScrollThumb( int orient ) const;
|
||||
virtual int GetScrollRange( int orient ) const;
|
||||
@@ -134,7 +134,7 @@ public:
|
||||
virtual WXWidget GetHandle() const { return (WXWidget) NULL ; }
|
||||
|
||||
bool GetTransparentBackground() const { return m_backgroundTransparent; }
|
||||
void SetTransparent(bool t = TRUE) { m_backgroundTransparent = t; }
|
||||
void SetTransparent(bool t = true) { m_backgroundTransparent = t; }
|
||||
|
||||
// event handlers
|
||||
// --------------
|
||||
@@ -155,16 +155,16 @@ public:
|
||||
virtual wxPoint GetClientAreaOrigin() 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
|
||||
static WXDWORD MakeExtendedStyle(long style,
|
||||
bool eliminateBorders = TRUE);
|
||||
bool eliminateBorders = true);
|
||||
// Determine whether 3D effects are wanted
|
||||
WXDWORD Determine3DEffects(WXDWORD defaultBorderStyle, bool *want3D) const;
|
||||
|
||||
// MSW only: TRUE if this control is part of the main control
|
||||
virtual bool ContainsHWND(WXHWND WXUNUSED(hWnd)) const { return FALSE; };
|
||||
// MSW only: true if this control is part of the main control
|
||||
virtual bool ContainsHWND(WXHWND WXUNUSED(hWnd)) const { return false; };
|
||||
|
||||
// Setup background and foreground colours correctly
|
||||
virtual void SetupColours();
|
||||
|
@@ -158,6 +158,7 @@ public:
|
||||
defined(__WXMGL__) || \
|
||||
defined(__WXMOTIF__) || \
|
||||
defined(__WXPM__) || \
|
||||
defined(__WXMAC__) || \
|
||||
defined(__WXGTK__)
|
||||
|
||||
// FIXME: This is work in progress about moving SetTitle/GetTitle from wxWindow
|
||||
|
@@ -172,6 +172,7 @@ public:
|
||||
!defined(__WXMGL__) && \
|
||||
!defined(__WXMOTIF__) && \
|
||||
!defined(__WXPM__) && \
|
||||
!defined(__WXMAC__) && \
|
||||
!defined(__WXGTK__)
|
||||
|
||||
// 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
|
||||
// Author: Stefan Csomor
|
||||
// Modified by: JS Lair (99/11/15) first implementation
|
||||
@@ -535,7 +535,7 @@ wxSize wxRadioBox::DoGetBestSize() const
|
||||
totHeight = sz.y ;
|
||||
|
||||
// handle radio box title as well
|
||||
GetTextExtent(GetTitle(), &eachWidth, NULL);
|
||||
GetTextExtent(GetLabel(), &eachWidth, NULL);
|
||||
eachWidth = (int)(eachWidth + RADIO_SIZE) + 3 * charWidth ;
|
||||
if (totWidth < eachWidth)
|
||||
totWidth = eachWidth;
|
||||
|
@@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: mac/toplevel.cpp
|
||||
// Name: src/mac/carbon/toplevel.cpp
|
||||
// Purpose: implements wxTopLevelWindow for Mac
|
||||
// Author: Stefan Csomor
|
||||
// Modified by:
|
||||
@@ -919,7 +919,7 @@ bool wxTopLevelWindowMac::Create(wxWindow *parent,
|
||||
SetName(name);
|
||||
|
||||
m_windowId = id == -1 ? NewControlId() : id;
|
||||
wxWindow::SetTitle( title ) ;
|
||||
wxWindow::SetLabel( title ) ;
|
||||
|
||||
MacCreateRealWindow( title, pos , size , MacRemoveBordersFromStyle(style) , name ) ;
|
||||
|
||||
@@ -1266,10 +1266,15 @@ void wxTopLevelWindowMac::MacActivate( long timestamp , bool inIsActivating )
|
||||
|
||||
void wxTopLevelWindowMac::SetTitle(const wxString& title)
|
||||
{
|
||||
wxWindow::SetTitle( title ) ;
|
||||
wxWindow::SetLabel( title ) ;
|
||||
UMASetWTitle( (WindowRef)m_macWindow , title , m_font.GetEncoding() ) ;
|
||||
}
|
||||
|
||||
virtual wxString wxTopLevelWindowMac::GetTitle() const
|
||||
{
|
||||
return wxWindow::GetLabel();
|
||||
}
|
||||
|
||||
bool wxTopLevelWindowMac::Show(bool 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
|
||||
// Author: Stefan Csomor
|
||||
// Modified by:
|
||||
@@ -1109,21 +1109,21 @@ bool wxMacControl::GetNeedsDisplay() const
|
||||
if ( m_isCompositing )
|
||||
{
|
||||
return HIViewGetNeedsDisplay( m_controlRef ) ;
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
if ( !IsVisible() )
|
||||
{
|
||||
if ( !IsVisible() )
|
||||
return false ;
|
||||
|
||||
Rect controlBounds ;
|
||||
GetControlBounds( m_controlRef, &controlBounds ) ;
|
||||
RgnHandle rgn = NewRgn() ;
|
||||
GetWindowRegion ( GetControlOwner( m_controlRef ) , kWindowUpdateRgn , rgn ) ;
|
||||
Boolean intersect = RectInRgn ( &controlBounds , rgn ) ;
|
||||
DisposeRgn( rgn ) ;
|
||||
return intersect ;
|
||||
}
|
||||
Rect controlBounds ;
|
||||
GetControlBounds( m_controlRef, &controlBounds ) ;
|
||||
RgnHandle rgn = NewRgn() ;
|
||||
GetWindowRegion ( GetControlOwner( m_controlRef ) , kWindowUpdateRgn , rgn ) ;
|
||||
Boolean intersect = RectInRgn ( &controlBounds , rgn ) ;
|
||||
DisposeRgn( rgn ) ;
|
||||
return intersect ;
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
@@ -1294,7 +1294,7 @@ void wxMacControl::GetBestRect( Rect *r )
|
||||
GetBestControlRect( m_controlRef , r , &baselineoffset ) ;
|
||||
}
|
||||
|
||||
void wxMacControl::SetTitle( const wxString &title )
|
||||
void wxMacControl::SetLabel( const wxString &title )
|
||||
{
|
||||
wxFontEncoding encoding;
|
||||
|
||||
@@ -1369,27 +1369,27 @@ void wxMacControl::InvalidateWithChildren()
|
||||
|
||||
void wxMacControl::ScrollRect( wxRect *r , int dx , int dy )
|
||||
{
|
||||
wxASSERT( r != NULL ) ;
|
||||
wxASSERT( r != NULL ) ;
|
||||
#if TARGET_API_MAC_OSX
|
||||
if ( m_isCompositing )
|
||||
{
|
||||
HIRect scrollarea = CGRectMake( r->x , r->y , r->width , r->height) ;
|
||||
if ( m_isCompositing )
|
||||
{
|
||||
HIRect scrollarea = CGRectMake( r->x , r->y , r->width , r->height) ;
|
||||
HIViewScrollRect ( m_controlRef , &scrollarea , dx ,dy ) ;
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
Rect bounds ;
|
||||
GetControlBounds( m_controlRef , &bounds ) ;
|
||||
bounds.left += r->x ;
|
||||
bounds.top += r->y ;
|
||||
bounds.bottom = bounds.top + r->height ;
|
||||
bounds.right = bounds.left + r->width ;
|
||||
wxMacWindowClipper clip( m_peer ) ;
|
||||
RgnHandle updateRgn = NewRgn() ;
|
||||
::ScrollRect( &bounds , dx , dy , updateRgn ) ;
|
||||
InvalWindowRgn( GetControlOwner( m_controlRef ) , updateRgn ) ;
|
||||
}
|
||||
{
|
||||
Rect bounds ;
|
||||
GetControlBounds( m_controlRef , &bounds ) ;
|
||||
bounds.left += r->x ;
|
||||
bounds.top += r->y ;
|
||||
bounds.bottom = bounds.top + r->height ;
|
||||
bounds.right = bounds.left + r->width ;
|
||||
wxMacWindowClipper clip( m_peer ) ;
|
||||
RgnHandle updateRgn = NewRgn() ;
|
||||
::ScrollRect( &bounds , dx , dy , updateRgn ) ;
|
||||
InvalWindowRgn( GetControlOwner( m_controlRef ) , updateRgn ) ;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1497,7 +1497,7 @@ OSStatus wxMacControl::SetTabEnabled( SInt16 tabNo , bool enable )
|
||||
#ifdef __WXMAC_OSX__
|
||||
// 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
|
||||
Generic RGB color space. It is up to the caller to call CMCloseProfile when done
|
||||
@@ -1510,18 +1510,18 @@ CMProfileRef wxMacOpenGenericProfile(void)
|
||||
// we only create the profile reference once
|
||||
if (cachedRGBProfileRef == NULL)
|
||||
{
|
||||
CMProfileLocation loc;
|
||||
CMProfileLocation loc;
|
||||
|
||||
loc.locType = cmPathBasedProfile;
|
||||
strcpy(loc.u.pathLoc.path, kGenericRGBProfilePathStr);
|
||||
loc.locType = cmPathBasedProfile;
|
||||
strcpy(loc.u.pathLoc.path, kGenericRGBProfilePathStr);
|
||||
|
||||
verify_noerr( CMOpenProfile(&cachedRGBProfileRef, &loc) );
|
||||
verify_noerr( CMOpenProfile(&cachedRGBProfileRef, &loc) );
|
||||
}
|
||||
|
||||
if (cachedRGBProfileRef)
|
||||
{
|
||||
// clone the profile reference so that the caller has their own reference, not our cached one
|
||||
CMCloneProfileRef(cachedRGBProfileRef);
|
||||
// clone the profile reference so that the caller has their own reference, not our cached one
|
||||
CMCloneProfileRef(cachedRGBProfileRef);
|
||||
}
|
||||
|
||||
return cachedRGBProfileRef;
|
||||
@@ -1541,22 +1541,21 @@ CGColorSpaceRef wxMacGetGenericRGBColorSpace()
|
||||
{
|
||||
static CGColorSpaceRef genericRGBColorSpace = NULL;
|
||||
|
||||
if (genericRGBColorSpace == NULL)
|
||||
{
|
||||
CMProfileRef genericRGBProfile = wxMacOpenGenericProfile();
|
||||
if (genericRGBColorSpace == NULL)
|
||||
{
|
||||
CMProfileRef genericRGBProfile = wxMacOpenGenericProfile();
|
||||
|
||||
if (genericRGBProfile)
|
||||
{
|
||||
genericRGBColorSpace = CGColorSpaceCreateWithPlatformColorSpace(genericRGBProfile);
|
||||
wxASSERT_MSG( genericRGBColorSpace != NULL, wxT("couldn't create the generic RGB color space") ) ;
|
||||
if (genericRGBProfile)
|
||||
{
|
||||
genericRGBColorSpace = CGColorSpaceCreateWithPlatformColorSpace(genericRGBProfile);
|
||||
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
|
||||
CMCloseProfile(genericRGBProfile);
|
||||
}
|
||||
}
|
||||
// we opened the profile so it is up to us to close it
|
||||
CMCloseProfile(genericRGBProfile);
|
||||
}
|
||||
}
|
||||
return genericRGBColorSpace;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // wxUSE_GUI
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: windows.cpp
|
||||
// Name: src/mac/carbon/window.cpp
|
||||
// Purpose: wxWindowMac
|
||||
// Author: Stefan Csomor
|
||||
// Modified by:
|
||||
@@ -431,7 +431,7 @@ static pascal OSStatus wxMacWindowServiceEventHandler( EventHandlerCallRef handl
|
||||
val = val.Mid( from , to - from ) ;
|
||||
ScrapRef scrapRef = cEvent.GetParameter< ScrapRef > ( kEventParamScrapRef , typeScrapRef ) ;
|
||||
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 ;
|
||||
}
|
||||
break ;
|
||||
@@ -599,10 +599,10 @@ void wxWindowMac::MacControlUserPaneActivateProc(bool activating)
|
||||
|
||||
wxInt16 wxWindowMac::MacControlUserPaneFocusProc(wxInt16 action)
|
||||
{
|
||||
if ( AcceptsFocus() )
|
||||
return 1 ;
|
||||
else
|
||||
return kControlNoPart ;
|
||||
if ( AcceptsFocus() )
|
||||
return 1 ;
|
||||
else
|
||||
return kControlNoPart ;
|
||||
}
|
||||
|
||||
void wxWindowMac::MacControlUserPaneBackgroundProc(void* info)
|
||||
@@ -900,7 +900,7 @@ void wxWindowMac::MacPostControlCreate(const wxPoint& pos, const wxSize& size)
|
||||
// adjust font, controlsize etc
|
||||
DoSetWindowVariant( m_windowVariant ) ;
|
||||
|
||||
m_peer->SetTitle( wxStripMenuCodes(m_label) ) ;
|
||||
m_peer->SetLabel( wxStripMenuCodes(m_label) ) ;
|
||||
|
||||
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) ;
|
||||
|
||||
if ( m_peer && m_peer->Ok() )
|
||||
{
|
||||
m_peer->SetTitle( m_label ) ;
|
||||
m_peer->SetLabel( m_label ) ;
|
||||
}
|
||||
Refresh() ;
|
||||
}
|
||||
|
||||
wxString wxWindowMac::GetTitle() const
|
||||
wxString wxWindowMac::GetLabel() const
|
||||
{
|
||||
return m_label ;
|
||||
}
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: radiobox.cpp
|
||||
// Name: src/mac/classic/radiobox.cpp
|
||||
// Purpose: wxRadioBox
|
||||
// Author: Stefan Csomor
|
||||
// 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?
|
||||
}
|
||||
// handle radio box title as well
|
||||
GetTextExtent(GetTitle(), &eachWidth, NULL);
|
||||
GetTextExtent(GetLabel(), &eachWidth, NULL);
|
||||
eachWidth = (int)(eachWidth + RADIO_SIZE) + 3 * charWidth ;
|
||||
if (totWidth < eachWidth)
|
||||
totWidth = eachWidth;
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: stattext.cpp
|
||||
// Name: src/mac/classic/stattext.cpp
|
||||
// Purpose: wxStaticText
|
||||
// Author: Stefan Csomor
|
||||
// Modified by:
|
||||
@@ -54,7 +54,7 @@ void wxStaticText::DrawParagraph(wxDC &dc, wxString paragraph, int &y)
|
||||
{
|
||||
long width, height ;
|
||||
|
||||
if (paragraph.Length() == 0)
|
||||
if (paragraph.length() == 0)
|
||||
{
|
||||
// empty line
|
||||
dc.GetTextExtent( wxT("H"), &width, &height );
|
||||
@@ -66,13 +66,13 @@ void wxStaticText::DrawParagraph(wxDC &dc, wxString paragraph, int &y)
|
||||
int x = 0 ;
|
||||
|
||||
bool linedrawn = true;
|
||||
while( paragraph.Length() > 0 )
|
||||
while( paragraph.length() > 0 )
|
||||
{
|
||||
dc.GetTextExtent( paragraph , &width , &height ) ;
|
||||
|
||||
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)
|
||||
{
|
||||
@@ -148,7 +148,7 @@ void wxStaticText::OnDraw( wxDC &dc )
|
||||
size_t i = 0 ;
|
||||
wxString text = m_label;
|
||||
int y = 0 ;
|
||||
while (i < text.Length())
|
||||
while (i < text.length())
|
||||
{
|
||||
|
||||
if (text[i] == 13 || text[i] == 10)
|
||||
@@ -162,7 +162,7 @@ void wxStaticText::OnDraw( wxDC &dc )
|
||||
}
|
||||
++i;
|
||||
}
|
||||
if (paragraph.Length() > 0)
|
||||
if (paragraph.length() > 0)
|
||||
DrawParagraph(dc, paragraph,y);
|
||||
}
|
||||
|
||||
@@ -224,7 +224,7 @@ wxSize wxStaticText::DoGetBestSize() const
|
||||
|
||||
void wxStaticText::SetLabel(const wxString& st )
|
||||
{
|
||||
SetTitle( st ) ;
|
||||
wxStaticTextBase::SetLabel( st ) ;
|
||||
m_label = st ;
|
||||
if ( !(GetWindowStyle() & wxST_NO_AUTORESIZE) )
|
||||
{
|
||||
@@ -241,18 +241,18 @@ bool wxStaticText::SetFont(const wxFont& font)
|
||||
{
|
||||
bool ret = wxControl::SetFont(font);
|
||||
|
||||
if ( ret )
|
||||
{
|
||||
// adjust the size of the window to fit to the label unless autoresizing is
|
||||
// disabled
|
||||
if ( !(GetWindowStyle() & wxST_NO_AUTORESIZE) )
|
||||
{
|
||||
// temporary fix until layout measurement and drawing are in synch again
|
||||
Refresh() ;
|
||||
InvalidateBestSize();
|
||||
SetSize( GetBestSize() );
|
||||
}
|
||||
}
|
||||
if ( ret )
|
||||
{
|
||||
// adjust the size of the window to fit to the label unless autoresizing is
|
||||
// disabled
|
||||
if ( !(GetWindowStyle() & wxST_NO_AUTORESIZE) )
|
||||
{
|
||||
// temporary fix until layout measurement and drawing are in synch again
|
||||
Refresh() ;
|
||||
InvalidateBestSize();
|
||||
SetSize( GetBestSize() );
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: mac/toplevel.cpp
|
||||
// Name: src/mac/classic/toplevel.cpp
|
||||
// Purpose: implements wxTopLevelWindow for Mac
|
||||
// Author: Stefan Csomor
|
||||
// Modified by:
|
||||
@@ -265,11 +265,11 @@ pascal OSStatus MouseEventHandler( EventHandlerCallRef handler , EventRef event
|
||||
if ( button == 0 || GetEventKind( event ) == kEventMouseUp )
|
||||
modifiers += btnState ;
|
||||
|
||||
// temporary hack to support true two button mouse
|
||||
if ( button == kEventMouseButtonSecondary )
|
||||
{
|
||||
modifiers |= controlKey ;
|
||||
}
|
||||
// temporary hack to support true two button mouse
|
||||
if ( button == kEventMouseButtonSecondary )
|
||||
{
|
||||
modifiers |= controlKey ;
|
||||
}
|
||||
WindowRef window ;
|
||||
short windowPart = ::FindWindow(point, &window);
|
||||
|
||||
@@ -365,10 +365,10 @@ static pascal OSStatus WindowEventHandler( EventHandlerCallRef handler , EventRe
|
||||
toplevelWindow->MacActivate( EventTimeToTicks( GetEventTime( event ) ) , false) ;
|
||||
result = noErr ;
|
||||
break ;
|
||||
case kEventWindowShown :
|
||||
toplevelWindow->Refresh() ;
|
||||
result = noErr ;
|
||||
break ;
|
||||
case kEventWindowShown :
|
||||
toplevelWindow->Refresh() ;
|
||||
result = noErr ;
|
||||
break ;
|
||||
case kEventWindowClose :
|
||||
toplevelWindow->Close() ;
|
||||
result = noErr ;
|
||||
@@ -498,16 +498,16 @@ void wxRemoveMacWindowAssociation(wxTopLevelWindowMac *win)
|
||||
|
||||
WXWindow wxTopLevelWindowMac::s_macWindowInUpdate = NULL;
|
||||
wxTopLevelWindowMac *wxTopLevelWindowMac::s_macDeactivateWindow = NULL;
|
||||
bool wxTopLevelWindowMac::s_macWindowCompositing = FALSE;
|
||||
bool wxTopLevelWindowMac::s_macWindowCompositing = false;
|
||||
|
||||
void wxTopLevelWindowMac::Init()
|
||||
{
|
||||
m_iconized =
|
||||
m_maximizeOnShow = FALSE;
|
||||
m_maximizeOnShow = false;
|
||||
m_macNoEraseUpdateRgn = NewRgn() ;
|
||||
m_macNeedsErasing = false ;
|
||||
m_macWindow = NULL ;
|
||||
m_macUsesCompositing = FALSE ;
|
||||
m_macUsesCompositing = false ;
|
||||
#if TARGET_CARBON
|
||||
m_macEventHandler = NULL ;
|
||||
#endif
|
||||
@@ -550,7 +550,7 @@ bool wxTopLevelWindowMac::Create(wxWindow *parent,
|
||||
if ( parent )
|
||||
parent->AddChild(this);
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
wxTopLevelWindowMac::~wxTopLevelWindowMac()
|
||||
@@ -641,7 +641,7 @@ void wxTopLevelWindowMac::MacCreateRealWindow( const wxString& title,
|
||||
OSStatus err = noErr ;
|
||||
SetName(name);
|
||||
m_windowStyle = style;
|
||||
m_isShown = FALSE;
|
||||
m_isShown = false;
|
||||
|
||||
// create frame.
|
||||
|
||||
@@ -745,12 +745,12 @@ void wxTopLevelWindowMac::MacCreateRealWindow( const wxString& title,
|
||||
if ( wxTopLevelWindowMac::s_macWindowCompositing )
|
||||
{
|
||||
attr |= kWindowCompositingAttribute;
|
||||
m_macUsesCompositing = TRUE;
|
||||
m_macUsesCompositing = true;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
m_macUsesCompositing = FALSE;
|
||||
m_macUsesCompositing = false;
|
||||
}
|
||||
|
||||
#if TARGET_CARBON
|
||||
@@ -902,7 +902,7 @@ void wxTopLevelWindowMac::MacFireMouseEvent(
|
||||
|
||||
event.m_leftDown = isDown && !controlDown;
|
||||
|
||||
event.m_middleDown = FALSE;
|
||||
event.m_middleDown = false;
|
||||
event.m_rightDown = isDown && controlDown;
|
||||
|
||||
if ( kind == mouseDown )
|
||||
@@ -1059,13 +1059,13 @@ void wxTopLevelWindowMac::MacActivate( long timestamp , bool inIsActivating )
|
||||
long osVersion = UMAGetSystemVersion();
|
||||
if (osVersion >= 0x1000 && osVersion < 0x1020 )
|
||||
{
|
||||
Refresh(TRUE);
|
||||
Refresh(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
// 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
|
||||
Refresh(TRUE);
|
||||
Refresh(true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1079,18 +1079,23 @@ void wxTopLevelWindowMac::MacKeyDown( WXEVENTREF ev )
|
||||
|
||||
void wxTopLevelWindowMac::SetTitle(const wxString& title)
|
||||
{
|
||||
wxWindow::SetTitle( title ) ;
|
||||
wxWindow::SetLabel( title ) ;
|
||||
UMASetWTitle( (WindowRef)m_macWindow , title , m_font.GetEncoding() ) ;
|
||||
}
|
||||
|
||||
virtual wxString wxTopLevelWindowMac::GetTitle() const
|
||||
{
|
||||
return wxWindow::GetLabel();
|
||||
}
|
||||
|
||||
bool wxTopLevelWindowMac::Show(bool show)
|
||||
{
|
||||
if ( !wxWindow::Show(show) )
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
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) )
|
||||
{
|
||||
::ShowWindow( (WindowRef)m_macWindow );
|
||||
@@ -1130,7 +1135,7 @@ bool wxTopLevelWindowMac::Show(bool show)
|
||||
Refresh() ;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxTopLevelWindowMac::DoMoveWindow(int x, int y, int width, int height)
|
||||
@@ -1290,7 +1295,7 @@ void wxTopLevelWindowMac::MacInvalidate( const WXRECTPTR rect, bool eraseBackgro
|
||||
|
||||
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."));
|
||||
|
||||
#if TARGET_CARBON
|
||||
@@ -1317,9 +1322,9 @@ bool wxTopLevelWindowMac::SetShape(const wxRegion& region)
|
||||
|
||||
// Tell the window manager that the window has changed shape
|
||||
ReshapeCustomWindow((WindowRef)MacGetWindowRef());
|
||||
return TRUE;
|
||||
return true;
|
||||
#else
|
||||
return FALSE;
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1386,10 +1391,10 @@ static void wxShapedMacWindowStructureRegion(WindowRef window, RgnHandle rgn)
|
||||
if (cachedRegion)
|
||||
{
|
||||
Rect windowRect;
|
||||
wxShapedMacWindowGetPos(window, &windowRect); //how big is the window
|
||||
CopyRgn(cachedRegion, rgn); //make a copy of our cached region
|
||||
wxShapedMacWindowGetPos(window, &windowRect); //how big is the window
|
||||
CopyRgn(cachedRegion, rgn); //make a copy of our cached region
|
||||
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;
|
||||
|
||||
if(!tempRgn)
|
||||
tempRgn=NewRgn();
|
||||
tempRgn=NewRgn();
|
||||
|
||||
SetPt(&hitPoint,LoWord(param),HiWord(param));//get the point clicked
|
||||
|
||||
@@ -1457,4 +1462,3 @@ static pascal long wxShapedMacWindowDef(short varCode, WindowRef window, SInt16
|
||||
|
||||
#endif
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: windows.cpp
|
||||
// Name: src/mac/classic/window.cpp
|
||||
// Purpose: wxWindowMac
|
||||
// Author: Stefan Csomor
|
||||
// Modified by:
|
||||
@@ -90,10 +90,10 @@ END_EVENT_TABLE()
|
||||
|
||||
void wxWindowMac::Init()
|
||||
{
|
||||
m_backgroundTransparent = FALSE;
|
||||
m_backgroundTransparent = false;
|
||||
|
||||
// as all windows are created with WS_VISIBLE style...
|
||||
m_isShown = TRUE;
|
||||
m_isShown = true;
|
||||
|
||||
m_x = 0;
|
||||
m_y = 0 ;
|
||||
@@ -123,7 +123,7 @@ wxWindowMac::~wxWindowMac()
|
||||
}
|
||||
}
|
||||
|
||||
m_isBeingDeleted = TRUE;
|
||||
m_isBeingDeleted = true;
|
||||
|
||||
#ifndef __WXUNIVERSAL__
|
||||
// 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,
|
||||
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
|
||||
// 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
|
||||
|
||||
if ( !CreateBase(parent, id, pos, size, style, wxDefaultValidator, name) )
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
parent->AddChild(this);
|
||||
|
||||
@@ -212,7 +212,7 @@ bool wxWindowMac::Create(wxWindowMac *parent, wxWindowID id,
|
||||
wxWindowCreateEvent event(this);
|
||||
GetEventHandler()->AddPendingEvent(event);
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxWindowMac::SetFocus()
|
||||
@@ -281,11 +281,11 @@ void wxWindowMac::SetFocus()
|
||||
bool wxWindowMac::Enable(bool enable)
|
||||
{
|
||||
if ( !wxWindowBase::Enable(enable) )
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
MacSuperEnabled( enable ) ;
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxWindowMac::DoCaptureMouse()
|
||||
@@ -384,7 +384,7 @@ bool wxWindowMac::DoPopupMenu(wxMenu *menu, int x, int y)
|
||||
|
||||
menu->SetInvokingWindow(NULL);
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -478,17 +478,17 @@ void wxWindowMac::MacRootWindowToWindow( int *x , int *y ) const
|
||||
bool wxWindowMac::SetCursor(const wxCursor& cursor)
|
||||
{
|
||||
if (m_cursor == cursor)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
if (wxNullCursor == cursor)
|
||||
{
|
||||
if ( ! wxWindowBase::SetCursor( *wxSTANDARD_CURSOR ) )
|
||||
return FALSE ;
|
||||
return false ;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( ! wxWindowBase::SetCursor( cursor ) )
|
||||
return FALSE ;
|
||||
return false ;
|
||||
}
|
||||
|
||||
wxASSERT_MSG( m_cursor.Ok(),
|
||||
@@ -508,7 +508,7 @@ bool wxWindowMac::SetCursor(const wxCursor& cursor)
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE ;
|
||||
return true ;
|
||||
}
|
||||
|
||||
|
||||
@@ -651,24 +651,24 @@ void wxWindowMac::DoMoveWindow(int x, int y, int width, int height)
|
||||
// changing pixels...
|
||||
|
||||
if ( MacGetLeftBorderSize() != 0 || MacGetRightBorderSize() != 0 ||
|
||||
MacGetTopBorderSize() != 0 || MacGetBottomBorderSize() != 0 )
|
||||
MacGetTopBorderSize() != 0 || MacGetBottomBorderSize() != 0 )
|
||||
{
|
||||
RgnHandle innerOldRgn, innerNewRgn ;
|
||||
innerOldRgn = NewRgn() ;
|
||||
innerNewRgn = NewRgn() ;
|
||||
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(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 ) ;
|
||||
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( innerOldRgn ) ;
|
||||
DisposeRgn( innerNewRgn ) ;
|
||||
}
|
||||
|
||||
DisposeRgn(oldRgn) ;
|
||||
@@ -792,12 +792,12 @@ wxPoint wxWindowMac::GetClientAreaOrigin() const
|
||||
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 ;
|
||||
}
|
||||
@@ -805,12 +805,12 @@ wxString wxWindowMac::GetTitle() const
|
||||
bool wxWindowMac::Show(bool show)
|
||||
{
|
||||
if ( !wxWindowBase::Show(show) )
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
MacSuperShown( show ) ;
|
||||
Refresh() ;
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxWindowMac::MacSuperShown( bool show )
|
||||
@@ -904,7 +904,7 @@ void wxWindowMac::Refresh(bool eraseBack, const wxRect *rect)
|
||||
return ;
|
||||
|
||||
if ( !MacIsReallyShown() )
|
||||
return ;
|
||||
return ;
|
||||
|
||||
wxPoint client = GetClientAreaOrigin();
|
||||
int x1 = -client.x;
|
||||
@@ -1106,13 +1106,13 @@ void wxWindowMac::MacPaintBorders( int left , int top )
|
||||
// OS X has lighter border edges than classic:
|
||||
if (major >= 10)
|
||||
{
|
||||
darkShadow.red = 0x8E8E;
|
||||
darkShadow.green = 0x8E8E;
|
||||
darkShadow.blue = 0x8E8E;
|
||||
lightShadow.red = 0xBDBD;
|
||||
lightShadow.green = 0xBDBD;
|
||||
lightShadow.blue = 0xBDBD;
|
||||
}
|
||||
darkShadow.red = 0x8E8E;
|
||||
darkShadow.green = 0x8E8E;
|
||||
darkShadow.blue = 0x8E8E;
|
||||
lightShadow.red = 0xBDBD;
|
||||
lightShadow.green = 0xBDBD;
|
||||
lightShadow.blue = 0xBDBD;
|
||||
}
|
||||
|
||||
PenNormal() ;
|
||||
|
||||
@@ -1396,13 +1396,13 @@ bool wxWindowMac::MacGetWindowFromPointSub( const wxPoint &point , wxWindowMac**
|
||||
{
|
||||
if ((point.x < 0) || (point.y < 0) ||
|
||||
(point.x > (m_width)) || (point.y > (m_height)))
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((point.x < m_x) || (point.y < m_y) ||
|
||||
(point.x > (m_x + m_width)) || (point.y > (m_y + m_height)))
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
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->MacGetWindowFromPointSub(newPoint , outWin ))
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
*outWin = this ;
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
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 FALSE ;
|
||||
return false ;
|
||||
}
|
||||
|
||||
static wxWindow *gs_lastWhich = NULL;
|
||||
@@ -1506,11 +1506,11 @@ bool wxWindowMac::MacDispatchMouseEvent(wxMouseEvent& event)
|
||||
{
|
||||
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)))
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
|
||||
if ( IsKindOf( CLASSINFO ( wxStaticBox ) ) /* || IsKindOf( CLASSINFO( wxSpinCtrl ) ) */)
|
||||
return FALSE ;
|
||||
return false ;
|
||||
|
||||
WindowRef window = (WindowRef) MacGetRootWindow() ;
|
||||
|
||||
@@ -1526,7 +1526,7 @@ bool wxWindowMac::MacDispatchMouseEvent(wxMouseEvent& event)
|
||||
if ( child->MacGetRootWindow() == (WXWindow) window && child->IsShown() && child->IsEnabled() )
|
||||
{
|
||||
if (child->MacDispatchMouseEvent(event))
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1569,14 +1569,14 @@ bool wxWindowMac::MacDispatchMouseEvent(wxMouseEvent& event)
|
||||
|
||||
// Same for mouse up events
|
||||
if (event.GetEventType() == wxEVT_LEFT_UP)
|
||||
return TRUE;
|
||||
return true;
|
||||
if (event.GetEventType() == wxEVT_RIGHT_UP)
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
GetEventHandler()->ProcessEvent( event ) ;
|
||||
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
wxString wxWindowMac::MacGetToolTipString( wxPoint &pt )
|
||||
@@ -2072,9 +2072,9 @@ wxPoint wxGetMousePosition()
|
||||
|
||||
void wxWindowMac::OnMouseEvent( wxMouseEvent &event )
|
||||
{
|
||||
if ( event.GetEventType() == wxEVT_RIGHT_DOWN )
|
||||
{
|
||||
// copied from wxGTK : CS
|
||||
if ( event.GetEventType() == wxEVT_RIGHT_DOWN )
|
||||
{
|
||||
// copied from wxGTK : CS
|
||||
// generate a "context menu" event: this is similar to wxEVT_RIGHT_DOWN
|
||||
// except that:
|
||||
//
|
||||
@@ -2086,10 +2086,9 @@ void wxWindowMac::OnMouseEvent( wxMouseEvent &event )
|
||||
this->ClientToScreen(event.GetPosition()));
|
||||
if ( ! GetEventHandler()->ProcessEvent(evtCtx) )
|
||||
event.Skip() ;
|
||||
}
|
||||
else
|
||||
{
|
||||
event.Skip() ;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
event.Skip() ;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user