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:
Włodzimierz Skiba
2005-11-07 14:37:19 +00:00
parent cdc059191b
commit fb5246bead
15 changed files with 436 additions and 426 deletions

View File

@@ -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".
@@ -67,12 +67,12 @@ inline int FixedToInt( Fixed inFixed )
#include "wx/window.h"
#include "wx/toplevel.h"
class wxMacPortStateHelper
class wxMacPortStateHelper
{
DECLARE_NO_COPY_CLASS(wxMacPortStateHelper)
public:
wxMacPortStateHelper( GrafPtr newport) ;
wxMacPortStateHelper( GrafPtr newport) ;
wxMacPortStateHelper() ;
~wxMacPortStateHelper() ;
@@ -95,9 +95,9 @@ private:
class WXDLLEXPORT wxMacPortSaver
{
DECLARE_NO_COPY_CLASS(wxMacPortSaver)
public:
wxMacPortSaver( GrafPtr port )
wxMacPortSaver( GrafPtr port )
{
::GetPort( &m_port ) ;
::SetPort( port ) ;
@@ -113,7 +113,7 @@ private :
class WXDLLEXPORT wxMacPortSetter
{
DECLARE_NO_COPY_CLASS(wxMacPortSetter)
public:
wxMacPortSetter( const wxDC* dc ) ;
~wxMacPortSetter() ;
@@ -125,11 +125,11 @@ private:
/*
Clips to the visible region of a control within the current port
*/
class WXDLLEXPORT wxMacWindowClipper : public wxMacPortSaver
{
DECLARE_NO_COPY_CLASS(wxMacWindowClipper)
public:
wxMacWindowClipper( const wxWindow* win ) ;
~wxMacWindowClipper() ;
@@ -142,7 +142,7 @@ private:
class WXDLLEXPORT wxMacWindowStateSaver : public wxMacWindowClipper
{
DECLARE_NO_COPY_CLASS(wxMacWindowStateSaver)
public:
wxMacWindowStateSaver( const wxWindow* win ) ;
~wxMacWindowStateSaver() ;
@@ -152,17 +152,17 @@ private:
} ;
#if wxMAC_USE_CORE_GRAPHICS
class WXDLLEXPORT wxMacCGContextStateSaver
class WXDLLEXPORT wxMacCGContextStateSaver
{
DECLARE_NO_COPY_CLASS(wxMacCGContextStateSaver)
public:
wxMacCGContextStateSaver( CGContextRef cg )
wxMacCGContextStateSaver( CGContextRef cg )
{
m_cg = cg ;
CGContextSaveGState( cg ) ;
}
~wxMacCGContextStateSaver()
~wxMacCGContextStateSaver()
{
CGContextRestoreGState( m_cg ) ;
}
@@ -175,7 +175,7 @@ private:
class wxMacDrawingHelper
{
DECLARE_NO_COPY_CLASS(wxMacDrawingHelper)
public:
wxMacDrawingHelper( wxWindowMac * theWindow , bool clientArea = false ) ;
~wxMacDrawingHelper() ;
@@ -235,34 +235,34 @@ template<> inline EventParamType wxMacGetEventParamType<CGContextRef>() { return
class wxMacCarbonEvent
{
public :
wxMacCarbonEvent()
{
m_eventRef = 0 ;
m_release = false ;
}
wxMacCarbonEvent( EventRef event , bool release = false )
wxMacCarbonEvent( EventRef event , bool release = false )
{
m_eventRef = event ;
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 ;
verify_noerr( MacCreateEvent( NULL , inClassID, inKind,inWhen,inAttributes,&m_eventRef) ) ;
m_release = true ;
}
~wxMacCarbonEvent()
{
if ( m_release )
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 ) ;
if ( m_eventRef && m_release )
@@ -270,16 +270,15 @@ public :
ReleaseEvent( m_eventRef ) ;
m_release = false ;
m_eventRef = NULL ;
}
OSStatus err = MacCreateEvent( NULL , inClassID, inKind,inWhen,inAttributes,&m_eventRef) ;
if ( err == noErr )
m_release = true ;
return err ;
}
OSStatus GetParameter( EventParamName inName, EventParamType inDesiredType, UInt32 inBufferSize, void * outData) ;
template <typename T> OSStatus GetParameter( EventParamName inName, EventParamType type , T *data )
{
return GetParameter( inName, type , sizeof( T ) , data ) ;
@@ -288,7 +287,7 @@ public :
{
return GetParameter<T>( inName, wxMacGetEventParamType<T>() , data ) ;
}
template <typename T> T GetParameter( EventParamName inName )
{
T value ;
@@ -301,7 +300,7 @@ public :
verify_noerr( GetParameter<T>( inName, inDesiredType , &value ) ) ;
return value ;
}
OSStatus SetParameter( EventParamName inName, EventParamType inType, UInt32 inSize, const void * inData) ;
template <typename T> OSStatus SetParameter( EventParamName inName, EventParamType inDesiredType , const T *data )
{
@@ -339,13 +338,13 @@ public :
{
return ::SetEventTime( m_eventRef , GetCurrentEventTime() ) ;
}
OSStatus SetTime( EventTime when )
OSStatus SetTime( EventTime when )
{
return ::SetEventTime( m_eventRef , when ) ;
}
operator EventRef () { return m_eventRef; }
bool IsValid() { return m_eventRef != 0 ; }
bool IsValid() { return m_eventRef != 0 ; }
protected :
EventRef m_eventRef ;
bool m_release ;
@@ -379,27 +378,27 @@ template <typename refType> class wxMacCFRefHolder
{
public :
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)
{
}
~wxMacCFRefHolder()
{
CFRelease( m_ref ) ;
}
void Release()
{
if ( m_release && m_ref != NULL )
CFRelease( m_ref ) ;
m_ref = NULL ;
}
refType Detach()
{
refType val = m_ref ;
@@ -407,20 +406,20 @@ public :
m_ref = NULL ;
return val ;
}
void Set( refType ref , bool release = true )
{
Release() ;
m_release = release ;
m_ref = ref ;
}
operator refType () const { return m_ref; }
private :
refType m_ref ;
bool m_release ;
bool m_release ;
DECLARE_NO_COPY_CLASS( wxMacCFRefHolder )
} ;
@@ -450,7 +449,7 @@ void wxMacReleaseBitmapButton( ControlButtonContentInfo*info ) ;
struct wxOpaqueWindowRef
{
wxOpaqueWindowRef( WindowRef ref ) { m_data = ref ; }
operator WindowRef() { return m_data ; }
operator WindowRef() { return m_data ; }
private :
WindowRef m_data ;
} ;
@@ -473,25 +472,25 @@ ControlActionUPP GetwxMacLiveScrollbarActionProc() ;
class wxMacControl
{
public :
wxMacControl( wxWindow* peer , bool isRootControl = false ) ;
wxMacControl( wxWindow* peer , bool isRootControl = false ) ;
wxMacControl( wxWindow* peer , ControlRef control ) ;
wxMacControl( wxWindow* peer , WXWidget control ) ;
virtual ~wxMacControl() ;
void Init() ;
virtual void Dispose() ;
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 ; }
operator ControlRef () { return m_controlRef; }
operator ControlRef * () { return &m_controlRef; }
operator ControlRef () { return m_controlRef; }
operator ControlRef * () { return &m_controlRef; }
*/
// accessing data and values
@@ -506,19 +505,19 @@ public :
virtual SInt32 GetValue() const ;
virtual SInt32 GetMaximum() const ;
virtual SInt32 GetMinimum() const ;
virtual void SetValue( SInt32 v ) ;
virtual void SetMinimum( SInt32 v ) ;
virtual void SetMaximum( SInt32 v ) ;
virtual void SetValueAndRange( SInt32 value , SInt32 minimum , SInt32 maximum ) ;
virtual void SetRange( SInt32 minimum , SInt32 maximum ) ;
virtual OSStatus SetFocus( ControlFocusPart focusPart ) ;
virtual bool HasFocus() const ;
virtual bool NeedsFocusRect() const ;
virtual void SetNeedsFocusRect( bool needs ) ;
// templated helpers
Size GetDataSize( ControlPartCode inPartCode , ResType inTag ) const
@@ -546,7 +545,7 @@ public :
verify_noerr( GetData<T>( inPartCode , inTag , &value ) ) ;
return value ;
}
// Flash the control for the specified amount of time
virtual void Flash( ControlPartCode part , UInt32 ticks = 8 ) ;
@@ -560,13 +559,13 @@ public :
void SetActionProc( ControlActionUPP actionProc ) ;
void SetViewSize( SInt32 viewSize ) ;
SInt32 GetViewSize() const ;
virtual bool IsVisible() const ;
virtual void SetVisibility( bool visible , bool redraw ) ;
virtual bool IsEnabled() const ;
virtual bool IsActive() const ;
virtual void Enable( bool enable ) ;
// invalidates this control and all children
virtual void InvalidateWithChildren() ;
virtual void SetDrawingEnabled( bool enable ) ;
@@ -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,15 +588,15 @@ 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 ) ;
virtual void GetFeatures( UInt32 *features ) ;
virtual OSStatus GetRegion( ControlPartCode partCode , RgnHandle region ) ;
virtual OSStatus SetZOrder( bool above , wxMacControl* other ) ;
// to be moved into a databrowser subclass
virtual OSStatus SetSelectionFlags( DataBrowserSelectionFlags ) ;
virtual OSStatus AddListViewColumn( DataBrowserListViewColumnDesc *columnDesc,
DataBrowserTableViewColumnIndex position ) ;
@@ -607,14 +606,14 @@ public :
virtual OSStatus SetListViewHeaderBtnHeight(UInt16 height) ;
virtual OSStatus SetCallbacks(const DataBrowserCallbacks * callbacks) ;
virtual OSStatus UpdateItems( DataBrowserItemID container, UInt32 numItems,
const DataBrowserItemID* items,
const DataBrowserItemID* items,
DataBrowserPropertyID preSortProperty,
DataBrowserPropertyID propertyID ) ;
virtual OSStatus AddItems( DataBrowserItemID container, UInt32 numItems,
const DataBrowserItemID* items,
const DataBrowserItemID* items,
DataBrowserPropertyID preSortProperty ) ;
virtual OSStatus RemoveItems( DataBrowserItemID container, UInt32 numItems,
const DataBrowserItemID* items,
const DataBrowserItemID* items,
DataBrowserPropertyID preSortProperty ) ;
virtual OSStatus RevealItem( DataBrowserItemID item,
DataBrowserPropertyID propertyID,
@@ -624,16 +623,16 @@ public :
virtual OSStatus SetSelectedItems(UInt32 numItems,
const DataBrowserItemID * items,
DataBrowserSetOption operation ) ;
// to be moved into a tab control class
virtual OSStatus SetTabEnabled( SInt16 tabNo , bool enable ) ;
bool IsCompositing() { return m_isCompositing ; }
bool IsRootControl() { return m_isRootControl ; }
protected :
ControlRef m_controlRef ;
wxFont m_font ;
long m_windowStyle ;
long m_windowStyle ;
wxWindow* m_peer ;
bool m_needsFocusRect ;
bool m_isCompositing ;
@@ -642,23 +641,23 @@ protected :
#if wxMAC_USE_CORE_GRAPHICS
class WXDLLEXPORT wxMacCGPath : public wxGraphicPath
class WXDLLEXPORT wxMacCGPath : public wxGraphicPath
{
DECLARE_NO_COPY_CLASS(wxMacCGPath)
public :
wxMacCGPath() ;
~wxMacCGPath() ;
// Starts a new subpath at
void MoveToPoint( wxCoord x1 , wxCoord y1 ) ;
void AddLineToPoint( 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 AddCircle( wxCoord x, wxCoord y , wxCoord r ) ;
// closes the current subpath
void CloseSubpath() ;
CGPathRef GetPath() const ;
private :
CGMutablePathRef m_path ;
@@ -667,7 +666,7 @@ private :
class WXDLLEXPORT wxMacCGContext : public wxGraphicContext
{
DECLARE_NO_COPY_CLASS(wxMacCGContext)
public:
wxMacCGContext( CGrafPtr port ) ;
wxMacCGContext( CGContextRef cgcontext ) ;
@@ -678,9 +677,9 @@ public:
virtual void StrokePath( const wxGraphicPath *p ) ;
virtual void DrawPath( const wxGraphicPath *p , int fillStyle = wxWINDING_RULE ) ;
virtual void FillPath( const wxGraphicPath *p , const wxColor &fillColor , int fillStyle = wxWINDING_RULE ) ;
virtual wxGraphicPath* CreatePath() ;
virtual void SetPen( const wxPen &pen ) ;
virtual void SetPen( const wxPen &pen ) ;
virtual void SetBrush( const wxBrush &brush ) ;
CGContextRef GetNativeContext() ;
void SetNativeContext( CGContextRef cg ) ;
@@ -705,7 +704,7 @@ void wxMacMemoryBufferReleaseProc(void *info, const void *data, size_t size) ;
class WXDLLEXPORT wxBitmapRefData: public wxGDIRefData
{
DECLARE_NO_COPY_CLASS(wxBitmapRefData)
friend class WXDLLEXPORT wxIcon;
friend class WXDLLEXPORT wxCursor;
public:
@@ -716,7 +715,7 @@ public:
void Free() ;
bool Ok() const { return m_ok ; }
void SetOk( bool isOk) { m_ok = isOk ; }
void SetWidth( int width ) { m_width = width ; }
void SetHeight( int height ) { m_height = height ; }
void SetDepth( int depth ) { m_depth = depth ; }
@@ -724,7 +723,7 @@ public:
int GetWidth() const { return m_width ; }
int GetHeight() const { return m_height ; }
int GetDepth() const { return m_depth ; }
void *GetRawAccess() const ;
void *BeginRawAccess() ;
void EndRawAccess() ;
@@ -736,23 +735,23 @@ public:
#if wxUSE_PALETTE
wxPalette m_bitmapPalette;
#endif // wxUSE_PALETTE
wxMask * m_bitmapMask; // Optional mask
#ifdef __WXMAC_OSX__
CGImageRef CGImageCreate() const ;
#endif
// returns true if the bitmap has a size that
// can be natively transferred into a true icon
// if no is returned GetIconRef will still produce
// an icon but it will be generated via a PICT and
// rescaled to 16 x 16
// rescaled to 16 x 16
bool HasNativeSize() ;
// caller should increase ref count if needed longer
// than the bitmap exists
IconRef GetIconRef() ;
// returns a Pict from the bitmap content
PicHandle GetPictHandle() ;
GWorldPtr GetHBITMAP(GWorldPtr * mask = NULL ) const ;

View File

@@ -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,14 +84,16 @@ 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 ) ;
bool MacUsesCompositing() { return m_macUsesCompositing; }
bool MacUsesCompositing() { return m_macUsesCompositing; }
virtual void MacInstallTopLevelWindowEventHandler() ;
void MacSetMetalAppearance( bool on ) ;
@@ -137,4 +139,3 @@ private :
extern WXDLLEXPORT_DATA(wxWindowList) wxModelessWindows;
#endif // _WX_MSW_TOPLEVEL_H_

View File

@@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////////
// Name: window.h
// Name: wx/mac/carbon/window.h
// Purpose: wxWindowMac class
// Author: Stefan Csomor
// Modified by:
@@ -34,12 +34,12 @@ class wxMacControl ;
class WXDLLEXPORT wxWindowMac: public wxWindowBase
{
DECLARE_DYNAMIC_CLASS(wxWindowMac)
friend class wxDC;
friend class wxPaintDC;
public:
wxWindowMac() ;
wxWindowMac(wxWindowMac *parent,
@@ -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;
@@ -125,7 +125,7 @@ public:
void MacRootWindowToWindow( int *x , int *y ) const ;
void MacRootWindowToWindow( short *x , short *y ) const ;
virtual wxString MacGetToolTipString( wxPoint &where ) ;
// simple accessors
@@ -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
@@ -147,7 +147,7 @@ public:
void OnMouseEvent( wxMouseEvent &event ) ;
void MacOnScroll(wxScrollEvent&event ) ;
bool AcceptsFocus() const ;
public:
@@ -158,13 +158,13 @@ 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 ) ;
virtual bool MacDoRedraw( WXHRGN updatergn , long time ) ;
virtual bool MacCanFocus() const ;
// 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 MacPaintBorders( int left , int top ) ;
@@ -173,35 +173,35 @@ public:
void MacInvalidateBorders() ;
WXWindow MacGetTopLevelWindowRef() const ;
wxTopLevelWindowMac* MacGetTopLevelWindow() const ;
virtual long MacGetLeftBorderSize() const ;
virtual long MacGetRightBorderSize() const ;
virtual long MacGetTopBorderSize() const ;
virtual long MacGetBottomBorderSize() const ;
static long MacRemoveBordersFromStyle( long style ) ;
virtual void MacSuperChangedPosition() ;
// the absolute coortinates of this window's root have changed
virtual void MacTopLevelWindowChangedPosition() ;
virtual void MacChildAdded() ;
virtual void MacVisibilityChanged() ;
virtual void MacEnabledStateChanged() ;
virtual void MacHiliteChanged() ;
virtual wxInt32 MacControlHit( WXEVENTHANDLERREF handler , WXEVENTREF event ) ;
bool MacIsReallyShown() ;
bool MacIsReallyEnabled() ;
bool MacIsReallyHilited() ;
bool MacIsUserPane() { return m_macIsUserPane; }
bool MacIsUserPane() { return m_macIsUserPane; }
virtual bool MacSetupCursor( const wxPoint& pt ) ;
virtual void MacSetBackgroundBrush( const wxBrush &brush ) ;
const wxBrush& MacGetBackgroundBrush() const { return m_macBackgroundBrush ; }
// return the rectangle that would be visible of this control, regardless whether controls are hidden
// only taking into account clipping by parent windows
const wxRect& MacGetClippedClientRect() const ;
@@ -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,13 +275,13 @@ 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 ;
// bottom right inset of the mac control from the wx bottom right corner
wxPoint m_macBottomRightInset ;
wxScrollBar* m_hScrollBar ;
wxScrollBar* m_vScrollBar ;
wxString m_label ;
@@ -289,9 +289,9 @@ protected:
// 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...
bool m_clipChildren ;
virtual bool MacIsChildOfClientArea( const wxWindow* child ) const ;
void MacCreateScrollBars( long style ) ;
void MacRepositionScrollBars() ;
void MacUpdateControlFont() ;
@@ -299,15 +299,15 @@ protected:
void MacPropagateVisibilityChanged() ;
void MacPropagateEnabledStateChanged() ;
void MacPropagateHiliteChanged() ;
#if WXWIN_COMPATIBILITY_2_4
bool m_backgroundTransparent ;
#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;
@@ -327,7 +327,7 @@ protected:
// themselves inside the given rectangle
virtual void DoMoveWindow(int x, int y, int width, int height);
virtual void DoSetWindowVariant( wxWindowVariant variant ) ;
#if wxUSE_TOOLTIPS
virtual void DoSetToolTip( wxToolTip *tip );

View File

@@ -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,15 +87,18 @@ 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 ; }
static bool MacEnableCompositing( bool useCompositing );
bool MacUsesCompositing() { return m_macUsesCompositing; }
static bool MacEnableCompositing( bool useCompositing );
bool MacUsesCompositing() { return m_macUsesCompositing; }
#if TARGET_CARBON
WXEVENTHANDLERREF MacGetEventHandler() { return m_macEventHandler ; }
@@ -138,4 +141,3 @@ void wxRemoveMacWindowAssociation(wxTopLevelWindowMac *win) ;
#endif // _WX_MSW_TOPLEVEL_H_

View File

@@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////////
// Name: window.h
// Name: wx/mac/carbon/window.h
// Purpose: wxWindowMac class
// Author: Stefan Csomor
// Modified by:
@@ -29,12 +29,12 @@ class WXDLLEXPORT wxTopLevelWindowMac;
class WXDLLEXPORT wxWindowMac: public wxWindowBase
{
DECLARE_DYNAMIC_CLASS(wxWindowMac)
friend class wxDC;
friend class wxPaintDC;
public:
wxWindowMac()
: m_macBackgroundBrush()
, m_macVisibleRegion()
@@ -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;
@@ -123,7 +123,7 @@ public:
void MacRootWindowToClient( int *x , int *y ) const ;
void MacWindowToRootWindow( int *x , int *y ) const ;
void MacRootWindowToWindow( int *x , int *y ) const ;
virtual wxString MacGetToolTipString( wxPoint &where ) ;
// simple accessors
@@ -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
// --------------
@@ -144,7 +144,7 @@ public:
void OnMouseEvent( wxMouseEvent &event ) ;
void MacOnScroll(wxScrollEvent&event ) ;
bool AcceptsFocus() const ;
public:
@@ -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();
@@ -174,21 +174,21 @@ public:
virtual bool MacGetWindowFromPointSub( const wxPoint &point , wxWindowMac** outWin ) ;
virtual void MacRedraw( WXHRGN updatergn , long time , bool erase) ;
virtual bool MacCanFocus() const { return true ; }
virtual bool MacDispatchMouseEvent(wxMouseEvent& event ) ;
// 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 MacPaintBorders( int left , int top ) ;
WXWindow MacGetRootWindow() const ;
wxTopLevelWindowMac* MacGetTopLevelWindow() const ;
virtual WXWidget MacGetContainerForEmbedding() ;
virtual long MacGetLeftBorderSize() const ;
virtual long MacGetRightBorderSize() const ;
virtual long MacGetTopBorderSize() const ;
virtual long MacGetBottomBorderSize() const ;
static long MacRemoveBordersFromStyle( long style ) ;
virtual void MacSuperChangedPosition() ;
// the absolute coordinates of this item within the toplevel window may have changed
@@ -202,7 +202,7 @@ public:
// for compatibility
void MacUpdateImmediately() { Update() ; }
virtual bool MacSetupCursor( const wxPoint& pt ) ;
// 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 MacGetPortClientParams(Point* localOrigin, Rect* clipRect, WindowRef *window , wxWindowMac** rootwin) ;
@@ -219,11 +219,11 @@ protected:
int m_y ;
int m_width ;
int m_height ;
wxScrollBar* m_hScrollBar ;
wxScrollBar* m_vScrollBar ;
wxString m_label ;
void MacCreateScrollBars( long style ) ;
void MacRepositionScrollBars() ;