Fixing notebook drawing

Workaround for drawing problems under 10.14 as we do not draw the notebook ourselves, this should be ok on all system versions, for details see #18146
This commit is contained in:
Stefan Csomor 2018-06-27 18:33:23 +02:00
parent cc931612ee
commit 616f0ca7f9
3 changed files with 12 additions and 4 deletions

View File

@ -418,7 +418,13 @@ public:
@end
void WXDLLIMPEXP_CORE wxOSXCocoaClassAddWXMethods(Class c);
// this enum declares which methods should not be overridden in the native view classes
enum wxOSXSkipOverrides {
wxOSXSKIP_NONE = 0x0,
wxOSXSKIP_DRAW = 0x1
};
void WXDLLIMPEXP_CORE wxOSXCocoaClassAddWXMethods(Class c, wxOSXSkipOverrides skipFlags = wxOSXSKIP_NONE);
/*
We need this for ShowModal, as the sheet just disables the parent window and

View File

@ -87,7 +87,7 @@
if (!initialized)
{
initialized = YES;
wxOSXCocoaClassAddWXMethods( self );
wxOSXCocoaClassAddWXMethods( self, wxOSXSKIP_DRAW );
}
}

View File

@ -2418,7 +2418,7 @@ void wxWidgetCocoaImpl::controlTextDidChange()
#endif
void wxOSXCocoaClassAddWXMethods(Class c)
void wxOSXCocoaClassAddWXMethods(Class c, wxOSXSkipOverrides skipFlags)
{
#if OBJC_API_VERSION < 2
@ -2465,7 +2465,9 @@ void wxOSXCocoaClassAddWXMethods(Class c)
#if !wxOSX_USE_NATIVE_FLIPPED
wxOSX_CLASS_ADD_METHOD(c, @selector(isFlipped), (IMP) wxOSX_isFlipped, "c@:" )
#endif
wxOSX_CLASS_ADD_METHOD(c, @selector(drawRect:), (IMP) wxOSX_drawRect, "v@:{_NSRect={_NSPoint=ff}{_NSSize=ff}}" )
if ( !(skipFlags & wxOSXSKIP_DRAW) )
wxOSX_CLASS_ADD_METHOD(c, @selector(drawRect:), (IMP) wxOSX_drawRect, "v@:{_NSRect={_NSPoint=ff}{_NSSize=ff}}" )
wxOSX_CLASS_ADD_METHOD(c, @selector(controlAction:), (IMP) wxOSX_controlAction, "v@:@" )
wxOSX_CLASS_ADD_METHOD(c, @selector(controlDoubleAction:), (IMP) wxOSX_controlDoubleAction, "v@:@" )