]> git.saurik.com Git - wxWidgets.git/commitdiff
Override CanFocus because the wxWindow level test will check if the NSTextView's...
authorKevin Ollivier <kevino@theolliviers.com>
Sat, 27 Feb 2010 02:51:45 +0000 (02:51 +0000)
committerKevin Ollivier <kevino@theolliviers.com>
Sat, 27 Feb 2010 02:51:45 +0000 (02:51 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63564 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/osx/cocoa/private/textimpl.h
src/osx/cocoa/textctrl.mm
src/osx/cocoa/window.mm

index 77d6f366b9ac15554987adae6f6521d0b07f41d0..21a60a40c946000bac81ee871abdc988dd305735 100644 (file)
@@ -63,6 +63,8 @@ public:
     virtual bool GetStyle(long position, wxTextAttr& style);
     virtual void SetStyle(long start, long end, const wxTextAttr& style);
     
+    virtual bool CanFocus() const;
+    
     virtual bool HasOwnContextMenu() const { return true; }
     
     virtual void CheckSpelling(bool check);
index 1f100891160bed4a3adf87a6f145c4332a4facf1..d5af7b488c0dfd65334efd4a90de3b5458cde664 100644 (file)
@@ -229,7 +229,6 @@ protected :
     return fieldEditor;
 }
 
-
 - (void) setEnabled:(BOOL) flag
 {
     [super setEnabled: flag];
@@ -322,6 +321,15 @@ wxNSTextViewControl::~wxNSTextViewControl()
         [m_textView setDelegate: nil];
 }
 
+bool wxNSTextViewControl::CanFocus() const
+{
+    // we need to override so that we don't return the CanFocus value of
+    // the text view's overriding scroll view.
+    if (m_textView)
+        return [m_textView canBecomeKeyView];
+    return false;
+}
+
 wxString wxNSTextViewControl::GetStringValue() const
 {
     if (m_textView)
index a2aea90d23c464a829abe7167a13cd2301428b27..a5148d5ee30984fef325994a5749bedbb21af338 100644 (file)
@@ -1644,7 +1644,7 @@ bool wxWidgetCocoaImpl::HasFocus() const
 
 bool wxWidgetCocoaImpl::SetFocus()
 {
-    if ( [m_osxView canBecomeKeyView] == NO )
+    if ( !CanFocus() )
         return false;
 
     [[m_osxView window] makeFirstResponder: m_osxView] ;