git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59557
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
- (void)setImage:(NSImage *)image;
- (void)setControlSize:(NSControlSize)size;
- (void)setImage:(NSImage *)image;
- (void)setControlSize:(NSControlSize)size;
+- (void)setFont:(NSFont *)fontObject;
+
- (id)contentView;
- (void)setTarget:(id)anObject;
- (id)contentView;
- (void)setTarget:(id)anObject;
{
wxOSX_FocusHandlerPtr superimpl = (wxOSX_FocusHandlerPtr) [[slf superclass] instanceMethodForSelector:(SEL)_cmd];
// get the current focus before running becomeFirstResponder
{
wxOSX_FocusHandlerPtr superimpl = (wxOSX_FocusHandlerPtr) [[slf superclass] instanceMethodForSelector:(SEL)_cmd];
// get the current focus before running becomeFirstResponder
- NSView* otherView = [[NSApp keyWindow] firstResponder];
+ NSResponder* currentResponder = [[NSApp keyWindow] firstResponder];
+ NSView* otherView = (currentResponder != nil && [currentResponder isKindOfClass:[NSView class]]) ? (NSView*) currentResponder : NULL;
wxWidgetImpl* otherWindow = FindFromWXWidget(otherView);
BOOL r = superimpl(slf, (SEL)_cmd);
if ( r )
wxWidgetImpl* otherWindow = FindFromWXWidget(otherView);
BOOL r = superimpl(slf, (SEL)_cmd);
if ( r )
wxOSX_FocusHandlerPtr superimpl = (wxOSX_FocusHandlerPtr) [[slf superclass] instanceMethodForSelector:(SEL)_cmd];
BOOL r = superimpl(slf, (SEL)_cmd);
// get the current focus after running resignFirstResponder
wxOSX_FocusHandlerPtr superimpl = (wxOSX_FocusHandlerPtr) [[slf superclass] instanceMethodForSelector:(SEL)_cmd];
BOOL r = superimpl(slf, (SEL)_cmd);
// get the current focus after running resignFirstResponder
- NSView* otherView = [[NSApp keyWindow] firstResponder];
+ NSResponder* currentResponder = [[NSApp keyWindow] firstResponder];
+ NSView* otherView = (currentResponder != nil && [currentResponder isKindOfClass:[NSView class]]) ? (NSView*) currentResponder : NULL;
wxWidgetImpl* otherWindow = FindFromWXWidget(otherView);
if ( r )
DoNotifyFocusEvent( false, otherWindow );
wxWidgetImpl* otherWindow = FindFromWXWidget(otherView);
if ( r )
DoNotifyFocusEvent( false, otherWindow );
{
if ([m_osxView respondsToSelector:@selector(setFont:)])
#if wxOSX_USE_CORE_TEXT
{
if ([m_osxView respondsToSelector:@selector(setFont:)])
#if wxOSX_USE_CORE_TEXT
- [m_osxView setFont: (CTFontRef)font.MacGetCTFont()];
+ [m_osxView setFont: (NSFont*)font.MacGetCTFont()];