#include "wx/spinctrl.h"
#include "wx/log.h"
#include "wx/geometry.h"
+#include "wx/textctrl.h"
#include "wx/toolbar.h"
#include "wx/dc.h"
#ifndef __DARWIN__
#include <Windows.h>
#include <ToolUtils.h>
+#include <Scrap.h>
+#include <MacTextEditor.h>
#endif
#if TARGET_API_MAC_OSX
#include <string.h>
extern wxList wxPendingDelete;
-wxWindowMac* gFocusWindow = NULL ;
#ifdef __WXUNIVERSAL__
IMPLEMENT_ABSTRACT_CLASS(wxWindowMac, wxWindowBase)
// TODO EVT_PAINT(wxWindowMac::OnPaint)
EVT_SYS_COLOUR_CHANGED(wxWindowMac::OnSysColourChanged)
EVT_INIT_DIALOG(wxWindowMac::OnInitDialog)
- EVT_SET_FOCUS(wxWindowMac::OnSetFocus)
+// EVT_SET_FOCUS(wxWindowMac::OnSetFocus)
EVT_MOUSE_EVENTS(wxWindowMac::OnMouseEvent)
END_EVENT_TABLE()
extern long wxMacTranslateKey(unsigned char key, unsigned char code) ;
pascal OSStatus wxMacSetupControlBackground( ControlRef iControl , SInt16 iMessage , SInt16 iDepth , Boolean iIsColor ) ;
-#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_3
+#if TARGET_API_MAC_OSX
+
+#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_3
enum {
kEventControlVisibilityChanged = 157
};
#endif
+#endif
+
static const EventTypeSpec eventList[] =
{
+ { kEventClassControl , kEventControlHit } ,
#if TARGET_API_MAC_OSX
{ kEventClassControl , kEventControlDraw } ,
{ kEventClassControl , kEventControlVisibilityChanged } ,
{ kEventClassControl , kEventControlEnabledStateChanged } ,
{ kEventClassControl , kEventControlHiliteChanged } ,
-// { kEventClassControl , kEventControlInvalidateForSizeChange } , // 10.3 only
+ { kEventClassControl , kEventControlSetFocusPart } ,
+
+ { kEventClassService , kEventServiceGetTypes },
+ { kEventClassService , kEventServiceCopy },
+ { kEventClassService , kEventServicePaste },
+
+ // { kEventClassControl , kEventControlInvalidateForSizeChange } , // 10.3 only
// { kEventClassControl , kEventControlBoundsChanged } ,
-
- {}
-#else
- {}
#endif
} ;
switch( GetEventKind( event ) )
{
+#if TARGET_API_MAC_OSX
case kEventControlDraw :
{
RgnHandle updateRgn = NULL ;
// GrafPtr myport = cEvent.GetParameter<GrafPtr>(kEventParamGrafPort,typeGrafPtr) ;
#if 0
- // in case we would need a coregraphics compliant background erase first
+ // in case we would need a coregraphics compliant background erase first
// now usable to track redraws
CGContextRef cgContext = cEvent.GetParameter<CGContextRef>(kEventParamCGContextRef) ;
if ( thisWindow->MacIsUserPane() )
case kEventControlHiliteChanged :
thisWindow->MacHiliteChanged() ;
break ;
+ case kEventControlSetFocusPart :
+ {
+ Boolean focusEverything = false ;
+ ControlPartCode controlPart = cEvent.GetParameter<ControlPartCode>(kEventParamControlPart , typeControlPartCode );
+ if ( cEvent.GetParameter<Boolean>(kEventParamControlFocusEverything , &focusEverything ) == noErr )
+ {
+ }
+ if ( controlPart == kControlFocusNoPart )
+ {
+ #if wxUSE_CARET
+ if ( thisWindow->GetCaret() )
+ {
+ thisWindow->GetCaret()->OnKillFocus();
+ }
+ #endif // wxUSE_CARET
+ wxFocusEvent event(wxEVT_KILL_FOCUS, thisWindow->GetId());
+ event.SetEventObject(thisWindow);
+ thisWindow->GetEventHandler()->ProcessEvent(event) ;
+ }
+ else
+ {
+ // panel wants to track the window which was the last to have focus in it
+ wxChildFocusEvent eventFocus(thisWindow);
+ thisWindow->GetEventHandler()->ProcessEvent(eventFocus);
+
+ #if wxUSE_CARET
+ if ( thisWindow->GetCaret() )
+ {
+ thisWindow->GetCaret()->OnSetFocus();
+ }
+ #endif // wxUSE_CARET
+
+ wxFocusEvent event(wxEVT_SET_FOCUS, thisWindow->GetId());
+ event.SetEventObject(thisWindow);
+ thisWindow->GetEventHandler()->ProcessEvent(event) ;
+ }
+ if ( thisWindow->MacIsUserPane() )
+ result = noErr ;
+ }
+ break ;
+#endif
+ case kEventControlHit :
+ {
+ result = thisWindow->MacControlHit( handler , event ) ;
+ }
+ break ;
default :
break ;
}
return result ;
}
+static pascal OSStatus wxMacWindowServiceEventHandler( EventHandlerCallRef handler , EventRef event , void *data )
+{
+ OSStatus result = eventNotHandledErr ;
+
+ wxMacCarbonEvent cEvent( event ) ;
+
+ ControlRef controlRef ;
+ wxWindowMac* thisWindow = (wxWindowMac*) data ;
+ wxTextCtrl* textCtrl = wxDynamicCast( thisWindow , wxTextCtrl ) ;
+ cEvent.GetParameter( kEventParamDirectObject , &controlRef ) ;
+
+ switch( GetEventKind( event ) )
+ {
+ case kEventServiceGetTypes :
+ if( textCtrl )
+ {
+ long from, to ;
+ textCtrl->GetSelection( &from , &to ) ;
+
+ CFMutableArrayRef copyTypes = 0 , pasteTypes = 0;
+ if( from != to )
+ copyTypes = cEvent.GetParameter< CFMutableArrayRef >( kEventParamServiceCopyTypes , typeCFMutableArrayRef ) ;
+ if ( textCtrl->IsEditable() )
+ pasteTypes = cEvent.GetParameter< CFMutableArrayRef >( kEventParamServicePasteTypes , typeCFMutableArrayRef ) ;
+
+ static const OSType textDataTypes[] = { kTXNTextData /* , 'utxt' , 'PICT', 'MooV', 'AIFF' */ };
+ for ( size_t i = 0 ; i < WXSIZEOF(textDataTypes) ; ++i )
+ {
+ CFStringRef typestring = CreateTypeStringWithOSType(textDataTypes[i]);
+ if ( typestring )
+ {
+ if ( copyTypes )
+ CFArrayAppendValue (copyTypes, typestring) ;
+ if ( pasteTypes )
+ CFArrayAppendValue (pasteTypes, typestring) ;
+ CFRelease( typestring ) ;
+ }
+ }
+ result = noErr ;
+ }
+ break ;
+ case kEventServiceCopy :
+ if ( textCtrl )
+ {
+ long from, to ;
+ textCtrl->GetSelection( &from , &to ) ;
+ wxString val = textCtrl->GetValue() ;
+ 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() ) ) ;
+ result = noErr ;
+ }
+ break ;
+ case kEventServicePaste :
+ if ( textCtrl )
+ {
+ ScrapRef scrapRef = cEvent.GetParameter< ScrapRef > ( kEventParamScrapRef , typeScrapRef ) ;
+ Size textSize, pastedSize ;
+ verify_noerr( GetScrapFlavorSize (scrapRef, kTXNTextData, &textSize) ) ;
+ textSize++ ;
+ char *content = new char[textSize] ;
+ GetScrapFlavorData (scrapRef, kTXNTextData, &pastedSize, content );
+ content[textSize-1] = 0 ;
+#if wxUSE_UNICODE
+ textCtrl->WriteText( wxString( content , wxConvLocal ) );
+#else
+ textCtrl->WriteText( wxString( content ) ) ;
+#endif
+ delete[] content ;
+ result = noErr ;
+ }
+ break ;
+ }
+
+ return result ;
+}
+
pascal OSStatus wxMacWindowEventHandler( EventHandlerCallRef handler , EventRef event , void *data )
{
OSStatus result = eventNotHandledErr ;
case kEventClassControl :
result = wxMacWindowControlEventHandler( handler, event, data ) ;
break ;
+ case kEventClassService :
+ result = wxMacWindowServiceEventHandler( handler, event , data ) ;
default :
break ;
}
// constructors and such
// ----------------------------------------------------------------------------
+wxWindowMac::wxWindowMac()
+{
+ Init();
+}
+
+wxWindowMac::wxWindowMac(wxWindowMac *parent,
+ wxWindowID id,
+ const wxPoint& pos ,
+ const wxSize& size ,
+ long style ,
+ const wxString& name )
+{
+ Init();
+ Create(parent, id, pos, size, style, name);
+}
+
void wxWindowMac::Init()
{
+ m_peer = NULL ;
m_frozenness = 0 ;
+#if WXWIN_COMPATIBILITY_2_4
m_backgroundTransparent = FALSE;
+#endif
// as all windows are created with WS_VISIBLE style...
m_isShown = TRUE;
m_vScrollBar = NULL ;
m_macBackgroundBrush = wxNullBrush ;
- m_macControl = NULL ;
-
m_macIsUserPane = TRUE;
// make sure all proc ptrs are available
if (parent->GetDefaultItem() == (wxButton*) this)
parent->SetDefaultItem(NULL);
}
- if ( (ControlRef) m_macControl )
+ if ( m_peer && m_peer->Ok() )
{
// in case the callback might be called during destruction
wxRemoveMacControlAssociation( this) ;
- ::SetControlColorProc( (ControlRef) m_macControl , NULL ) ;
- ::DisposeControl( (ControlRef) m_macControl ) ;
- m_macControl = NULL ;
+ ::SetControlColorProc( *m_peer , NULL ) ;
+ ::DisposeControl( *m_peer ) ;
}
if ( g_MacLastWindow == this )
frame->SetLastFocus( NULL ) ;
}
- if ( gFocusWindow == this )
- {
- gFocusWindow = NULL ;
- }
-
DestroyChildren();
// delete our drop target if we've got one
m_dropTarget = NULL;
}
#endif // wxUSE_DRAG_AND_DROP
+ delete m_peer ;
+}
+
+WXWidget wxWindowMac::GetHandle() const
+{
+ return (WXWidget) (ControlRef) *m_peer ;
}
-//
void wxWindowMac::MacInstallEventHandler()
{
- InstallControlEventHandler( (ControlRef) m_macControl, GetwxMacWindowEventHandlerUPP(),
+ wxAssociateControlWithMacControl( *m_peer , this ) ;
+ InstallControlEventHandler( *m_peer, GetwxMacWindowEventHandlerUPP(),
GetEventTypeCount(eventList), eventList, this,
(EventHandlerRef *)&m_macControlEventHandler);
{
Rect bounds = wxMacGetBoundsForControl( this , pos , size ) ;
- UInt32 features = kControlSupportsEmbedding | kControlSupportsLiveFeedback | kControlHasSpecialBackground |
- kControlSupportsCalcBestRect | kControlHandlesTracking | kControlSupportsFocus | kControlWantsActivate | kControlWantsIdle;
-
- ::CreateUserPaneControl( MAC_WXHWND(GetParent()->MacGetTopLevelWindowRef()) , &bounds, kControlSupportsEmbedding , (ControlRef*) &m_macControl);
+ UInt32 features = 0
+ | kControlSupportsEmbedding
+// | kControlSupportsLiveFeedback
+// | kControlHasSpecialBackground
+// | kControlSupportsCalcBestRect
+// | kControlHandlesTracking
+ | kControlSupportsFocus
+// | kControlWantsActivate
+// | kControlWantsIdle
+ ;
+
+ m_peer = new wxMacControl() ;
+ ::CreateUserPaneControl( MAC_WXHWND(GetParent()->MacGetTopLevelWindowRef()) , &bounds, features , *m_peer);
+
MacPostControlCreate(pos,size) ;
#if !TARGET_API_MAC_OSX
- SetControlData((ControlRef) m_macControl,kControlEntireControl,kControlUserPaneDrawProcTag,
+ SetControlData(*m_peer,kControlEntireControl,kControlUserPaneDrawProcTag,
sizeof(gControlUserPaneDrawUPP),(Ptr) &gControlUserPaneDrawUPP);
- SetControlData((ControlRef) m_macControl,kControlEntireControl,kControlUserPaneHitTestProcTag,
+ SetControlData(*m_peer,kControlEntireControl,kControlUserPaneHitTestProcTag,
sizeof(gControlUserPaneHitTestUPP),(Ptr) &gControlUserPaneHitTestUPP);
- SetControlData((ControlRef) m_macControl,kControlEntireControl,kControlUserPaneTrackingProcTag,
+ SetControlData(*m_peer,kControlEntireControl,kControlUserPaneTrackingProcTag,
sizeof(gControlUserPaneTrackingUPP),(Ptr) &gControlUserPaneTrackingUPP);
- SetControlData((ControlRef) m_macControl,kControlEntireControl,kControlUserPaneIdleProcTag,
+ SetControlData(*m_peer,kControlEntireControl,kControlUserPaneIdleProcTag,
sizeof(gControlUserPaneIdleUPP),(Ptr) &gControlUserPaneIdleUPP);
- SetControlData((ControlRef) m_macControl,kControlEntireControl,kControlUserPaneKeyDownProcTag,
+ SetControlData(*m_peer,kControlEntireControl,kControlUserPaneKeyDownProcTag,
sizeof(gControlUserPaneKeyDownUPP),(Ptr) &gControlUserPaneKeyDownUPP);
- SetControlData((ControlRef) m_macControl,kControlEntireControl,kControlUserPaneActivateProcTag,
+ SetControlData(*m_peer,kControlEntireControl,kControlUserPaneActivateProcTag,
sizeof(gControlUserPaneActivateUPP),(Ptr) &gControlUserPaneActivateUPP);
- SetControlData((ControlRef) m_macControl,kControlEntireControl,kControlUserPaneFocusProcTag,
+ SetControlData(*m_peer,kControlEntireControl,kControlUserPaneFocusProcTag,
sizeof(gControlUserPaneFocusUPP),(Ptr) &gControlUserPaneFocusUPP);
- SetControlData((ControlRef) m_macControl,kControlEntireControl,kControlUserPaneBackgroundProcTag,
+ SetControlData(*m_peer,kControlEntireControl,kControlUserPaneBackgroundProcTag,
sizeof(gControlUserPaneBackgroundUPP),(Ptr) &gControlUserPaneBackgroundUPP);
#endif
}
void wxWindowMac::MacPostControlCreate(const wxPoint& pos, const wxSize& size)
{
- wxASSERT_MSG( (ControlRef) m_macControl != NULL , wxT("No valid mac control") ) ;
+ wxASSERT_MSG( m_peer != NULL && m_peer->Ok() , wxT("No valid mac control") ) ;
- wxAssociateControlWithMacControl( (ControlRef) m_macControl , this ) ;
- ::SetControlReference( (ControlRef) m_macControl , (long) this ) ;
+ ::SetControlReference( *m_peer , (long) this ) ;
MacInstallEventHandler();
ControlRef container = (ControlRef) GetParent()->GetHandle() ;
wxASSERT_MSG( container != NULL , wxT("No valid mac container control") ) ;
- ::EmbedControl( (ControlRef) m_macControl , container ) ;
+ ::EmbedControl( *m_peer , container ) ;
// adjust font, controlsize etc
DoSetWindowVariant( m_windowVariant ) ;
#if !TARGET_API_MAC_OSX
// eventually we can fix some clipping issues be reactivating this hook
//if ( m_macIsUserPane )
- // SetControlColorProc( (ControlRef) m_macControl , wxMacSetupControlBackgroundUPP ) ;
+ // SetControlColorProc( *m_peer , wxMacSetupControlBackgroundUPP ) ;
#endif
- UMASetControlTitle( (ControlRef) m_macControl , wxStripMenuCodes(m_label) , m_font.GetEncoding() ) ;
+ UMASetControlTitle( *m_peer , wxStripMenuCodes(m_label) , m_font.GetEncoding() ) ;
- wxSize new_size = size ;
if (!m_macIsUserPane)
- {
- wxSize best_size( DoGetBestSize() );
-
- if (size.x == -1) {
- new_size.x = best_size.x;
- }
- if (size.y == -1) {
- new_size.y = best_size.y;
- }
- SetSize( pos.x, pos.y , new_size.x, new_size.y,wxSIZE_USE_EXISTING );
+ {
+ SetInitialBestSize(size);
}
SetCursor( *wxSTANDARD_CURSOR ) ;
-
}
void wxWindowMac::DoSetWindowVariant( wxWindowVariant variant )
{
- wxASSERT( m_macControl != NULL ) ;
+ // Don't assert, in case we set the window variant before
+ // the window is created
+ // wxASSERT( m_peer->Ok() ) ;
+
+ m_windowVariant = variant ;
- m_windowVariant = variant ;
+ if (m_peer == NULL || !m_peer->Ok())
+ return;
ControlSize size ;
ThemeFontID themeFont = kThemeSystemFont ;
wxFAIL_MSG(_T("unexpected window variant"));
break ;
}
- ::SetControlData( (ControlRef) m_macControl , kControlEntireControl, kControlSizeTag, sizeof( ControlSize ), &size );
+ ::SetControlData( *m_peer , kControlEntireControl, kControlSizeTag, sizeof( ControlSize ), &size );
wxFont font ;
font.MacCreateThemeFont( themeFont ) ;
fontStyle.foreColor = MAC_WXCOLORREF(GetForegroundColour().GetPixel() ) ;
fontStyle.flags |= kControlUseForeColorMask ;
- ::SetControlFontStyle( (ControlRef) m_macControl , &fontStyle );
+ ::SetControlFontStyle( *m_peer , &fontStyle );
Refresh() ;
}
bool wxWindowMac::MacCanFocus() const
{
- wxASSERT( m_macControl != NULL ) ;
-
- return true ;
+ // there is currently no way to determine whether the window is running in full keyboard
+ // access mode, therefore we cannot rely on these features, yet the only other way would be
+ // to issue a SetKeyboardFocus event and verify after whether it succeeded, this would risk problems
+ // in event handlers...
+ UInt32 features = 0 ;
+ GetControlFeatures( *m_peer , &features ) ;
+ return features & ( kControlSupportsFocus | kControlGetsFocusOnClick ) ;
}
void wxWindowMac::SetFocus()
{
- if ( gFocusWindow == this )
- return ;
-
if ( AcceptsFocus() )
{
- if (gFocusWindow )
- {
-#if wxUSE_CARET
- // Deal with caret
- if ( gFocusWindow->m_caret )
- {
- gFocusWindow->m_caret->OnKillFocus();
- }
-#endif // wxUSE_CARET
-#ifndef __WXUNIVERSAL__
- wxWindow* control = wxDynamicCast( gFocusWindow , wxWindow ) ;
- // TODO we must use the built-in focusing
- if ( control && control->GetHandle() /* && control->MacIsReallyShown() */ )
- {
- UMASetKeyboardFocus( (WindowRef) gFocusWindow->MacGetTopLevelWindowRef() , (ControlRef) control->GetHandle() , kControlFocusNoPart ) ;
- control->MacRedrawControl() ;
- }
+#if !TARGET_API_MAC_OSX
+ wxWindow* former = FindFocus() ;
#endif
- // Without testing the window id, for some reason
- // a kill focus event can still be sent to
- // the control just being focussed.
- int thisId = this->m_windowId;
- int gFocusWindowId = gFocusWindow->m_windowId;
- if (gFocusWindowId != thisId)
- {
- wxFocusEvent event(wxEVT_KILL_FOCUS, gFocusWindow->m_windowId);
- event.SetEventObject(gFocusWindow);
- gFocusWindow->GetEventHandler()->ProcessEvent(event) ;
- }
+ OSStatus err = SetKeyboardFocus( (WindowRef) MacGetTopLevelWindowRef() , (ControlRef) GetHandle() , kControlFocusNextPart ) ;
+ // as we cannot rely on the control features to find out whether we are in full keyboard mode, we can only
+ // leave in case of an error
+ if ( err == errCouldntSetFocus )
+ return ;
+
+#if !TARGET_API_MAC_OSX
+ // emulate carbon events when running under carbonlib where they are not natively available
+ if ( former )
+ {
+ EventRef evRef = NULL ;
+ verify_noerr( MacCreateEvent( NULL , kEventClassControl , kEventControlSetFocusPart , TicksToEventTime( TickCount() ) , kEventAttributeUserEvent ,
+ &evRef ) );
+
+ wxMacCarbonEvent cEvent( evRef ) ;
+ cEvent.SetParameter<ControlRef>( kEventParamDirectObject , (ControlRef) former->GetHandle() ) ;
+ cEvent.SetParameter<ControlPartCode>(kEventParamControlPart , typeControlPartCode , kControlFocusNoPart ) ;
+
+ wxMacWindowEventHandler( NULL , evRef , former ) ;
+ ReleaseEvent(evRef) ;
}
- gFocusWindow = this ;
+ // send new focus event
{
- #if wxUSE_CARET
- // Deal with caret
- if ( m_caret )
- {
- m_caret->OnSetFocus();
- }
- #endif // wxUSE_CARET
- // panel wants to track the window which was the last to have focus in it
- wxChildFocusEvent eventFocus(this);
- GetEventHandler()->ProcessEvent(eventFocus);
-
- #ifndef __WXUNIVERSAL__
- wxControl* control = wxDynamicCast( gFocusWindow , wxControl ) ;
- if ( control && control->GetHandle() )
- {
- UMASetKeyboardFocus( (WindowRef) gFocusWindow->MacGetTopLevelWindowRef() , (ControlRef) control->GetHandle() , kControlFocusNextPart ) ;
- }
- #endif
- wxFocusEvent event(wxEVT_SET_FOCUS, m_windowId);
- event.SetEventObject(this);
- GetEventHandler()->ProcessEvent(event) ;
+ EventRef evRef = NULL ;
+ verify_noerr( MacCreateEvent( NULL , kEventClassControl , kEventControlSetFocusPart , TicksToEventTime( TickCount() ) , kEventAttributeUserEvent ,
+ &evRef ) );
+
+ wxMacCarbonEvent cEvent( evRef ) ;
+ cEvent.SetParameter<ControlRef>( kEventParamDirectObject , (ControlRef) GetHandle() ) ;
+ cEvent.SetParameter<ControlPartCode>(kEventParamControlPart , typeControlPartCode , kControlFocusNextPart ) ;
+
+ wxMacWindowEventHandler( NULL , evRef , this ) ;
+ ReleaseEvent(evRef) ;
}
+#endif
}
}
int& w, int& h) const
{
Rect bounds ;
- GetControlBounds( (ControlRef) m_macControl , &bounds ) ;
+ GetControlBounds( *m_peer , &bounds ) ;
x = bounds.left ;
if ( tlw )
{
Point tlworigin = { 0 , 0 } ;
- GrafPtr port ;
- ::GetPort( &port ) ;
- ::SetPort( UMAGetWindowPort( (WindowRef) tlw->MacGetWindowRef() ) ) ;
- ::LocalToGlobal( &tlworigin ) ;
- ::SetPort( port ) ;
+ QDLocalToGlobalPoint( UMAGetWindowPort( (WindowRef) tlw->MacGetWindowRef() ) , &tlworigin ) ;
x = tlworigin.h ;
y = tlworigin.v ;
}
#else
Rect bounds ;
- GetControlBounds( (ControlRef) m_macControl , &bounds ) ;
+ GetControlBounds( *m_peer , &bounds ) ;
if(x) *x = bounds.right - bounds.left ;
if(y) *y = bounds.bottom - bounds.top ;
#endif
if(y) *y = y1 ;
#else
Rect bounds ;
- GetControlBounds( (ControlRef) m_macControl , &bounds ) ;
+ GetControlBounds( *m_peer , &bounds ) ;
wxCHECK_RET( GetParent() , wxT("Missing Parent") ) ;
int xx = bounds.left ;
if(x) localwhere.h = * x ;
if(y) localwhere.v = * y ;
- wxMacPortSaver s((GrafPtr)GetWindowPort( window )) ;
- ::GlobalToLocal( &localwhere ) ;
+ QDGlobalToLocalPoint( GetWindowPort( window ) , &localwhere ) ;
if(x) *x = localwhere.h ;
if(y) *y = localwhere.v ;
Point localwhere = { 0,0 };
if(x) localwhere.h = * x ;
if(y) localwhere.v = * y ;
-
- wxMacPortSaver s((GrafPtr)GetWindowPort( window )) ;
- ::LocalToGlobal( &localwhere ) ;
+ QDLocalToGlobalPoint( GetWindowPort( window ) , &localwhere ) ;
if(x) *x = localwhere.h ;
if(y) *y = localwhere.v ;
}
if ( x ) pt.x = *x ;
if ( y ) pt.y = *y ;
- HIViewConvertPoint( &pt , (ControlRef) m_macControl , (ControlRef) MacGetTopLevelWindow()->GetHandle() ) ;
+ if ( !IsTopLevel() )
+ {
+ wxTopLevelWindowMac* top = MacGetTopLevelWindow();
+ if (top)
+ HIViewConvertPoint( &pt , *m_peer , (ControlRef) top->GetHandle() ) ;
+ }
if ( x ) *x = (int) pt.x ;
if ( y ) *y = (int) pt.y ;
if ( !IsTopLevel() )
{
Rect bounds ;
- GetControlBounds( (ControlRef) m_macControl , &bounds ) ;
+ GetControlBounds( *m_peer , &bounds ) ;
if(x) *x += bounds.left ;
if(y) *y += bounds.top ;
}
if ( x ) pt.x = *x ;
if ( y ) pt.y = *y ;
- HIViewConvertPoint( &pt , (ControlRef) MacGetTopLevelWindow()->GetHandle() , (ControlRef) m_macControl ) ;
+ if ( !IsTopLevel() )
+ HIViewConvertPoint( &pt , (ControlRef) MacGetTopLevelWindow()->GetHandle() , *m_peer ) ;
if ( x ) *x = (int) pt.x ;
if ( y ) *y = (int) pt.y ;
if ( !IsTopLevel() )
{
Rect bounds ;
- GetControlBounds( (ControlRef) m_macControl , &bounds ) ;
+ GetControlBounds( *m_peer , &bounds ) ;
if(x) *x -= bounds.left ;
if(y) *y -= bounds.top ;
}
if ( y ) *y = y1 ;
}
+void wxWindowMac::MacGetContentAreaInset( int &left , int &top , int &right , int &bottom )
+{
+ RgnHandle rgn = NewRgn() ;
+ Rect content ;
+ if ( GetControlRegion( *m_peer , kControlContentMetaPart , rgn ) == noErr )
+ {
+ GetRegionBounds( rgn , &content ) ;
+ DisposeRgn( rgn ) ;
+ }
+ else
+ {
+ GetControlBounds( *m_peer , &content ) ;
+ }
+ Rect structure ;
+ GetControlBounds( *m_peer , &structure ) ;
+#if !TARGET_API_MAC_OSX
+ OffsetRect( &content , -structure.left , -structure.top ) ;
+#endif
+ left = content.left - structure.left ;
+ top = content.top - structure.top ;
+ right = structure.right - content.right ;
+ bottom = structure.bottom - content.bottom ;
+}
+
wxSize wxWindowMac::DoGetSizeFromClientSize( const wxSize & size ) const
{
wxSize sizeTotal = size;
Rect content ;
- if ( GetControlRegion( (ControlRef) m_macControl , kControlContentMetaPart , rgn ) == noErr )
+ if ( GetControlRegion( *m_peer , kControlContentMetaPart , rgn ) == noErr )
{
GetRegionBounds( rgn , &content ) ;
DisposeRgn( rgn ) ;
}
else
{
- GetControlBounds( (ControlRef) m_macControl , &content ) ;
+ GetControlBounds( *m_peer , &content ) ;
}
Rect structure ;
- GetControlBounds( (ControlRef) m_macControl , &structure ) ;
+ GetControlBounds( *m_peer , &structure ) ;
#if !TARGET_API_MAC_OSX
OffsetRect( &content , -structure.left , -structure.top ) ;
#endif
RgnHandle rgn = NewRgn() ;
Rect content ;
- if ( GetControlRegion( (ControlRef) m_macControl , kControlContentMetaPart , rgn ) == noErr )
+ if ( GetControlRegion( *m_peer , kControlContentMetaPart , rgn ) == noErr )
{
GetRegionBounds( rgn , &content ) ;
DisposeRgn( rgn ) ;
}
else
{
- GetControlBounds( (ControlRef) m_macControl , &content ) ;
+ GetControlBounds( *m_peer , &content ) ;
}
#if !TARGET_API_MAC_OSX
Rect structure ;
- GetControlBounds( (ControlRef) m_macControl , &structure ) ;
+ GetControlBounds( *m_peer , &structure ) ;
OffsetRect( &content , -structure.left , -structure.top ) ;
#endif
ww = content.right - content.left ;
{
menu->SetInvokingWindow(this);
menu->UpdateUI();
- ClientToScreen( &x , &y ) ;
+
+ if ( x == -1 && y == -1 )
+ {
+ wxPoint mouse = wxGetMousePosition();
+ x = mouse.x; y = mouse.y;
+ }
+ else
+ {
+ ClientToScreen( &x , &y ) ;
+ }
menu->MacBeforeDisplay( true ) ;
long menuResult = ::PopUpMenuSelect((MenuHandle) menu->GetHMenu() ,y,x, 0) ;
{
// we don't adjust twice for the origin
Rect r = wxMacGetBoundsForControl(this , wxPoint( actualX,actualY), wxSize( actualWidth, actualHeight ) , false ) ;
- bool vis = IsControlVisible( (ControlRef) m_macControl ) ;
+ bool vis = IsControlVisible( *m_peer ) ;
#if TARGET_API_MAC_OSX
// the HIViewSetFrame call itself should invalidate the areas, but when testing with the UnicodeTextCtrl it does not !
if ( vis )
- SetControlVisibility( (ControlRef)m_macControl , false , true ) ;
+ SetControlVisibility( *m_peer , false , true ) ;
HIRect hir = { r.left , r.top , r.right - r.left , r.bottom - r.top } ;
- HIViewSetFrame ( (ControlRef) m_macControl , &hir ) ;
+ HIViewSetFrame ( *m_peer , &hir ) ;
if ( vis )
- SetControlVisibility( (ControlRef)m_macControl , true , true ) ;
+ SetControlVisibility( *m_peer , true , true ) ;
#else
-// TODO TEST SetControlBounds( (ControlRef) m_macControl , &r ) ;
if ( vis )
- SetControlVisibility( (ControlRef)m_macControl , false , true ) ;
- if ( doMove )
- MoveControl( (ControlRef) m_macControl , r.left , r.top ) ;
- if ( doSize )
- SizeControl( (ControlRef) m_macControl , r.right-r.left , r.bottom-r.top ) ;
+ SetControlVisibility( *m_peer , false , true ) ;
+ SetControlBounds( *m_peer , &r ) ;
if ( vis )
- SetControlVisibility( (ControlRef)m_macControl , true , true ) ;
+ SetControlVisibility( *m_peer , true , true ) ;
#endif
MacRepositionScrollBars() ;
if ( doMove )
Rect bestsize = { 0 , 0 , 0 , 0 } ;
short baselineoffset ;
int bestWidth, bestHeight ;
- ::GetBestControlRect( (ControlRef) m_macControl , &bestsize , &baselineoffset ) ;
+ ::GetBestControlRect( *m_peer , &bestsize , &baselineoffset ) ;
if ( EmptyRect( &bestsize ) )
{
{
RgnHandle rgn = NewRgn() ;
Rect content ;
- GetControlRegion( (ControlRef) m_macControl , kControlContentMetaPart , rgn ) ;
+ GetControlRegion( *m_peer , kControlContentMetaPart , rgn ) ;
GetRegionBounds( rgn , &content ) ;
DisposeRgn( rgn ) ;
#if !TARGET_API_MAC_OSX
- Rect structure ;
- GetControlBounds( (ControlRef) m_macControl , &structure ) ;
- OffsetRect( &content , -structure.left , -structure.top ) ;
+ // if the content rgn is empty / not supported
+ // don't attempt to correct the coordinates to wxWindow relative ones
+ if (!::EmptyRect( &content ) )
+ {
+ Rect structure ;
+ GetControlBounds( *m_peer , &structure ) ;
+ OffsetRect( &content , -structure.left , -structure.top ) ;
+ }
#endif
return wxPoint( content.left + MacGetLeftBorderSize( ) , content.top + MacGetTopBorderSize( ) );
{
m_label = wxStripMenuCodes(title) ;
- if ( m_macControl )
+ if ( m_peer && m_peer->Ok() )
{
- UMASetControlTitle( (ControlRef) m_macControl , m_label , m_font.GetEncoding() ) ;
+ UMASetControlTitle( *m_peer , m_label , m_font.GetEncoding() ) ;
}
Refresh() ;
}
// TODO use visibilityChanged Carbon Event for OSX
bool former = MacIsReallyShown() ;
- SetControlVisibility( (ControlRef) m_macControl , show , true ) ;
+ SetControlVisibility( *m_peer , show , true ) ;
if ( former != MacIsReallyShown() )
MacPropagateVisibilityChanged() ;
return TRUE;
bool wxWindowMac::Enable(bool enable)
{
- wxASSERT( m_macControl != NULL ) ;
+ wxASSERT( m_peer->Ok() ) ;
if ( !wxWindowBase::Enable(enable) )
return FALSE;
bool former = MacIsReallyEnabled() ;
+#if TARGET_API_MAC_OSX
+ if ( enable )
+ EnableControl( *m_peer ) ;
+ else
+ DisableControl( *m_peer ) ;
+#else
if ( enable )
- EnableControl( (ControlRef) m_macControl ) ;
+ ActivateControl( *m_peer ) ;
else
- DisableControl( (ControlRef) m_macControl ) ;
+ DeactivateControl( *m_peer ) ;
+#endif
if ( former != MacIsReallyEnabled() )
MacPropagateEnabledStateChanged() ;
{
// only under OSX the visibility of the TLW is taken into account
#if TARGET_API_MAC_OSX
- return IsControlVisible( (ControlRef) m_macControl ) ;
+ return IsControlVisible( *m_peer ) ;
#else
wxWindow* win = this ;
while( win->IsShown() )
bool wxWindowMac::MacIsReallyEnabled()
{
- return IsControlEnabled( (ControlRef) m_macControl ) ;
+#if TARGET_API_MAC_OSX
+ return IsControlEnabled( *m_peer ) ;
+#else
+ return IsControlActive( *m_peer ) ;
+#endif
}
bool wxWindowMac::MacIsReallyHilited()
{
- return IsControlActive( (ControlRef) m_macControl ) ;
+ return IsControlActive( *m_peer ) ;
+}
+
+void wxWindowMac::MacFlashInvalidAreas()
+{
+#if TARGET_API_MAC_OSX
+ HIViewFlashDirtyArea( (WindowRef) MacGetTopLevelWindowRef() ) ;
+#endif
}
//
{
#if TARGET_API_MAC_OSX
if ( rect == NULL )
- HIViewSetNeedsDisplay( (ControlRef) m_macControl , true ) ;
+ HIViewSetNeedsDisplay( *m_peer , true ) ;
else
{
RgnHandle update = NewRgn() ;
SectRgn( (RgnHandle) MacGetVisibleRegion().GetWXHRGN() , update , update ) ;
wxPoint origin = GetClientAreaOrigin() ;
OffsetRgn( update, origin.x , origin.y ) ;
- HIViewSetNeedsDisplayInRegion( (ControlRef) m_macControl , update , true ) ;
+ HIViewSetNeedsDisplayInRegion( *m_peer , update , true ) ;
}
#else
/*
InvalWindowRgn( (WindowRef) MacGetTopLevelWindowRef() , updateRgn ) ;
DisposeRgn(updateRgn) ;
*/
- if ( IsControlVisible( (ControlRef) m_macControl ) )
+ if ( IsControlVisible( *m_peer ) )
{
- SetControlVisibility( (ControlRef) m_macControl , false , false ) ;
- SetControlVisibility( (ControlRef) m_macControl , true , true ) ;
+ SetControlVisibility( *m_peer , false , false ) ;
+ SetControlVisibility( *m_peer , true , true ) ;
}
/*
if ( MacGetTopLevelWindow() == NULL )
return ;
- if ( !IsControlVisible( (ControlRef) m_macControl ) )
+ if ( !IsControlVisible( *m_peer ) )
return ;
wxPoint client = GetClientAreaOrigin();
#if TARGET_API_MAC_OSX
if ( !m_frozenness++ )
{
- HIViewSetDrawingEnabled( (HIViewRef) m_macControl , false ) ;
+ HIViewSetDrawingEnabled( *m_peer , false ) ;
}
#endif
}
+#if TARGET_API_MAC_OSX
+static void InvalidateControlAndChildren( HIViewRef control )
+{
+ HIViewSetNeedsDisplay( control , true ) ;
+ UInt16 childrenCount = 0 ;
+ OSStatus err = CountSubControls( control , &childrenCount ) ;
+ if ( err == errControlIsNotEmbedder )
+ return ;
+ wxASSERT_MSG( err == noErr , wxT("Unexpected error when accessing subcontrols") ) ;
+
+ for ( UInt16 i = childrenCount ; i >=1 ; --i )
+ {
+ HIViewRef child ;
+ err = GetIndexedSubControl( control , i , & child ) ;
+ if ( err == errControlIsNotEmbedder )
+ return ;
+ InvalidateControlAndChildren( child ) ;
+ }
+}
+#endif
+
void wxWindowMac::Thaw()
{
#if TARGET_API_MAC_OSX
if ( !--m_frozenness )
{
- HIViewSetDrawingEnabled( (HIViewRef) m_macControl , true ) ;
- HIViewSetNeedsDisplay( (HIViewRef) m_macControl , true ) ;
+ HIViewSetDrawingEnabled( *m_peer , true ) ;
+ InvalidateControlAndChildren( *m_peer ) ;
+ // HIViewSetNeedsDisplay( *m_peer , true ) ;
}
#endif
}
void wxWindowMac::MacRedrawControl()
{
/*
- if ( (ControlRef) m_macControl && MacGetTopLevelWindowRef() && IsControlVisible( (ControlRef) m_macControl ) )
+ if ( *m_peer && MacGetTopLevelWindowRef() && IsControlVisible( *m_peer ) )
{
#if TARGET_API_MAC_CARBON
Update() ;
wxMacPortSetter helper(&dc) ;
wxMacWindowClipper clipper(this) ;
wxDC::MacSetupBackgroundForCurrentPort( MacGetBackgroundBrush() ) ;
- UMADrawControl( (ControlRef) m_macControl ) ;
+ UMADrawControl( *m_peer ) ;
#endif
}
*/
{
- wxClientDC dc(this) ;
- wxMacPortSetter helper(&dc) ;
int width , height ;
GetClientSize( &width , &height ) ;
-
+#if TARGET_API_MAC_OSX
+ // note there currently is a bug in OSX which makes inefficient refreshes in case an entire control
+ // area is scrolled, this does not occur if width and height are 2 pixels less,
+ // TODO write optimal workaround
+ HIRect scrollrect = CGRectMake( MacGetLeftBorderSize() , MacGetTopBorderSize() , width , height ) ;
+ if ( rect )
+ {
+ HIRect scrollarea = CGRectMake( rect->x , rect->y , rect->width , rect->height) ;
+ scrollrect = CGRectIntersection( scrollrect , scrollarea ) ;
+ }
+ if ( HIViewGetNeedsDisplay( *m_peer ) )
+ {
+ // becuase HIViewScrollRect does not scroll the already invalidated area we have two options
+ // either immediate redraw or full invalidate
+#if 1
+ // is the better overall solution, as it does not slow down scrolling
+ HIViewSetNeedsDisplay( *m_peer , true ) ;
+#else
+ // this would be the preferred version for fast drawing controls
+ if( UMAGetSystemVersion() < 0x1030 )
+ Update() ;
+ else
+ HIViewRender(*m_peer) ;
+#endif
+ }
+ HIViewScrollRect ( *m_peer , &scrollrect , dx ,dy ) ;
+#else
wxPoint pos;
pos.x = pos.y = 0;
-
+
Rect scrollrect;
- // TODO take out the boundaries
- GetControlBounds( (ControlRef) m_macControl, &scrollrect);
-
RgnHandle updateRgn = NewRgn() ;
- if ( rect )
- {
- Rect r = { dc.YLOG2DEVMAC(rect->y) , dc.XLOG2DEVMAC(rect->x) , dc.YLOG2DEVMAC(rect->y + rect->height) ,
- dc.XLOG2DEVMAC(rect->x + rect->width) } ;
- SectRect( &scrollrect , &r , &scrollrect ) ;
- }
- ScrollRect( &scrollrect , dx , dy , updateRgn ) ;
-#if TARGET_CARBON
- //KO: The docs say ScrollRect creates an update region, which thus calls an update event
- // but it seems the update only refreshes the background of the control, rather than calling
- // kEventControlDraw, so we need to force a proper update here. There has to be a better
- // way of doing this... (Note that code below under !TARGET_CARBON does not work either...)
- Update();
-#endif
- // we also have to scroll the update rgn in this rectangle
- // in order not to loose updates
-#if !TARGET_CARBON
- WindowRef rootWindow = (WindowRef) MacGetTopLevelWindowRef() ;
- RgnHandle formerUpdateRgn = NewRgn() ;
- RgnHandle scrollRgn = NewRgn() ;
- RectRgn( scrollRgn , &scrollrect ) ;
- GetWindowUpdateRgn( rootWindow , formerUpdateRgn ) ;
- Point pt = {0,0} ;
- LocalToGlobal( &pt ) ;
- OffsetRgn( formerUpdateRgn , -pt.h , -pt.v ) ;
- SectRgn( formerUpdateRgn , scrollRgn , formerUpdateRgn ) ;
- if ( !EmptyRgn( formerUpdateRgn ) )
- {
- MacOffsetRgn( formerUpdateRgn , dx , dy ) ;
- SectRgn( formerUpdateRgn , scrollRgn , formerUpdateRgn ) ;
- InvalWindowRgn(rootWindow , formerUpdateRgn ) ;
+
+ {
+ wxClientDC dc(this) ;
+ wxMacPortSetter helper(&dc) ;
+
+ GetControlBounds( *m_peer, &scrollrect);
+ scrollrect.top += MacGetTopBorderSize() ;
+ scrollrect.left += MacGetLeftBorderSize() ;
+ scrollrect.bottom = scrollrect.top + height ;
+ scrollrect.right = scrollrect.left + width ;
+
+ if ( rect )
+ {
+ Rect r = { dc.YLOG2DEVMAC(rect->y) , dc.XLOG2DEVMAC(rect->x) , dc.YLOG2DEVMAC(rect->y + rect->height) ,
+ dc.XLOG2DEVMAC(rect->x + rect->width) } ;
+ SectRect( &scrollrect , &r , &scrollrect ) ;
+ }
+ ScrollRect( &scrollrect , dx , dy , updateRgn ) ;
}
- InvalWindowRgn(rootWindow , updateRgn ) ;
- DisposeRgn( updateRgn ) ;
- DisposeRgn( formerUpdateRgn ) ;
- DisposeRgn( scrollRgn ) ;
+ // ScrollWindowRect( (WindowRef) MacGetTopLevelWindowRef() , &scrollrect , dx , dy , kScrollWindowInvalidate, updateRgn ) ;
#endif
}
child->SetSize( x+dx, y+dy, w, h );
}
}
-
-// TODO remove, was moved higher up Update() ;
-
}
void wxWindowMac::MacOnScroll(wxScrollEvent &event )
// Get the window with the focus
wxWindowMac *wxWindowBase::FindFocus()
{
- return gFocusWindow ;
+ ControlRef control ;
+ GetKeyboardFocus( GetUserFocusWindow() , &control ) ;
+ return wxFindControlFromMacControl( control ) ;
}
void wxWindowMac::OnSetFocus(wxFocusEvent& event)
// Raise the window to the top of the Z order
void wxWindowMac::Raise()
{
+#if TARGET_API_MAC_OSX
+ HIViewSetZOrder(*m_peer,kHIViewZOrderAbove, NULL) ;
+#endif
}
// Lower the window to the bottom of the Z order
void wxWindowMac::Lower()
{
+#if TARGET_API_MAC_OSX
+ HIViewSetZOrder(*m_peer,kHIViewZOrderBelow, NULL) ;
+#endif
}
void wxWindowMac::Update()
{
#if TARGET_API_MAC_OSX
- HIViewSetNeedsDisplay( (ControlRef) m_macControl , true ) ;
+ WindowRef window = (WindowRef)MacGetTopLevelWindowRef() ;
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3
+ // for composited windows this also triggers a redraw of all
+ // invalid views in the window
+ if( UMAGetSystemVersion() >= 0x1030 )
+ HIWindowFlush(window) ;
+ else
+#endif
+ {
+ // the only way to trigger the redrawing on earlier systems is to call
+ // ReceiveNextEvent
+
+ EventRef currentEvent = (EventRef) wxTheApp->MacGetCurrentEvent() ;
+ UInt32 currentEventClass = 0 ;
+ UInt32 currentEventKind = 0 ;
+ if ( currentEvent != NULL )
+ {
+ currentEventClass = ::GetEventClass( currentEvent ) ;
+ currentEventKind = ::GetEventKind( currentEvent ) ;
+ }
+ if ( currentEventClass != kEventClassMenu )
+ {
+ // when tracking a menu, strange redraw errors occur if we flush now, so leave..
+
+ EventRef theEvent;
+ OSStatus status = noErr ;
+ status = ReceiveNextEvent( 0 , NULL , kEventDurationNoWait , false , &theEvent ) ;
+ }
+ else
+ HIViewSetNeedsDisplay( *m_peer , true ) ;
+ }
#else
- ::Draw1Control( (ControlRef) m_macControl ) ;
+ ::Draw1Control( *m_peer ) ;
#endif
}
Rect r ;
RgnHandle visRgn = NewRgn() ;
RgnHandle tempRgn = NewRgn() ;
- if ( IsControlVisible( (ControlRef) m_macControl ) )
+ if ( IsControlVisible( *m_peer ) )
{
- GetControlBounds( (ControlRef) m_macControl , &r ) ;
+ GetControlBounds( *m_peer , &r ) ;
if (! MacGetTopLevelWindow()->MacUsesCompositing() )
{
MacRootWindowToWindow( &r.left , & r.top ) ;
*/
bool wxWindowMac::MacDoRedraw( WXHRGN updatergnr , long time )
{
- // we let the OS handle root control redraws
- if ( m_macControl == MacGetTopLevelWindow()->GetHandle() )
- return false ;
-
RgnHandle updatergn = (RgnHandle) updatergnr ;
bool handled = false ;
if ( MacGetTopLevelWindow()->MacUsesCompositing() == false )
{
Rect bounds;
- UMAGetControlBoundsInWindowCoords( (ControlRef)m_macControl, &bounds );
+ UMAGetControlBoundsInWindowCoords( *m_peer, &bounds );
RgnHandle controlRgn = NewRgn();
RectRgn( controlRgn, &bounds );
//KO: This sets the ownUpdateRgn to the area of this control that is inside
if ( ! GetEventHandler()->ProcessEvent(evtCtx) )
event.Skip() ;
}
- else if (event.GetEventType() == wxEVT_LEFT_DOWN || event.GetEventType() == wxEVT_LEFT_DCLICK )
- {
-
- int x = event.m_x ;
- int y = event.m_y ;
-
- if ( MacGetTopLevelWindow()->MacUsesCompositing() == false )
- {
- // OS Needs it in tlw content area coordinates
- MacClientToRootWindow( &x , &y ) ;
- }
- else
- {
- // OS Needs it in window not client coordinates
- wxPoint origin = GetClientAreaOrigin() ;
- x += origin.x ;
- y += origin.y ;
- }
- Point localwhere ;
- SInt16 controlpart ;
-
- localwhere.h = x ;
- localwhere.v = y ;
-
- short modifiers = 0;
-
- if ( !event.m_leftDown && !event.m_rightDown )
- modifiers |= btnState ;
-
- if ( event.m_shiftDown )
- modifiers |= shiftKey ;
-
- if ( event.m_controlDown )
- modifiers |= controlKey ;
-
- if ( event.m_altDown )
- modifiers |= optionKey ;
-
- if ( event.m_metaDown )
- modifiers |= cmdKey ;
-
- bool handled = false ;
-
- if ( ::IsControlActive( (ControlRef) m_macControl ) )
- {
- controlpart = ::HandleControlClick( (ControlRef) m_macControl , localwhere , modifiers , (ControlActionUPP) -1 ) ;
- wxTheApp->s_lastMouseDown = 0 ;
- if ( controlpart != kControlNoPart )
- {
- MacHandleControlClick((WXWidget) (ControlRef) m_macControl , controlpart , false /* mouse not down anymore */ ) ;
- handled = true ;
- }
- }
- if ( !handled )
- event.Skip() ;
- }
else
{
event.Skip() ;
void wxWindowMac::MacHandleControlClick( WXWidget control , wxInt16 controlpart , bool WXUNUSED( mouseStillDown ) )
{
- wxASSERT_MSG( (ControlRef) m_macControl != NULL , wxT("No valid mac control") ) ;
}
Rect wxMacGetBoundsForControl( wxWindow* window , const wxPoint& pos , const wxSize &size , bool adjustForOrigin )
return bounds ;
}
+wxInt32 wxWindowMac::MacControlHit(WXEVENTHANDLERREF WXUNUSED(handler) , WXEVENTREF WXUNUSED(event) )
+{
+ return eventNotHandledErr ;
+}
+