- (void)setImage:(NSImage *)image;
- (void)setControlSize:(NSControlSize)size;
+- (void)setFont:(NSFont *)fontObject;
+
- (id)contentView;
- (void)setTarget:(id)anObject;
{
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 )
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 );
wxWindowMac* parent = GetWXPeer()->GetParent();
// under Cocoa we might have a contentView in the wxParent to which we have to
// adjust the coordinates
- if (parent)
+ if (parent && [m_osxView superview] != parent->GetHandle() )
{
int cx = 0,cy = 0,cw = 0,ch = 0;
if ( parent->GetPeer() )
void wxWidgetCocoaImpl::SetFont(wxFont const& font, wxColour const&, long, bool)
{
if ([m_osxView respondsToSelector:@selector(setFont:)])
-#if wxOSX_USE_CORE_TEXT
- [m_osxView setFont: (CTFontRef)font.MacGetCTFont()];
-#else
-
-#endif
+ [m_osxView setFont: font.GetNSFont()];
}
void wxWidgetCocoaImpl::InstallEventHandler( WXWidget control )