Override CanFocus because the wxWindow level test will check if the NSTextView's parent scrollview can get keyboard focus, and will return no, meaning that wx won't set the focus to the text ctrl.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63564 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -63,6 +63,8 @@ public:
|
|||||||
virtual bool GetStyle(long position, wxTextAttr& style);
|
virtual bool GetStyle(long position, wxTextAttr& style);
|
||||||
virtual void SetStyle(long start, long end, const wxTextAttr& style);
|
virtual void SetStyle(long start, long end, const wxTextAttr& style);
|
||||||
|
|
||||||
|
virtual bool CanFocus() const;
|
||||||
|
|
||||||
virtual bool HasOwnContextMenu() const { return true; }
|
virtual bool HasOwnContextMenu() const { return true; }
|
||||||
|
|
||||||
virtual void CheckSpelling(bool check);
|
virtual void CheckSpelling(bool check);
|
||||||
|
@@ -229,7 +229,6 @@ protected :
|
|||||||
return fieldEditor;
|
return fieldEditor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
- (void) setEnabled:(BOOL) flag
|
- (void) setEnabled:(BOOL) flag
|
||||||
{
|
{
|
||||||
[super setEnabled: flag];
|
[super setEnabled: flag];
|
||||||
@@ -322,6 +321,15 @@ wxNSTextViewControl::~wxNSTextViewControl()
|
|||||||
[m_textView setDelegate: nil];
|
[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
|
wxString wxNSTextViewControl::GetStringValue() const
|
||||||
{
|
{
|
||||||
if (m_textView)
|
if (m_textView)
|
||||||
|
@@ -1644,7 +1644,7 @@ bool wxWidgetCocoaImpl::HasFocus() const
|
|||||||
|
|
||||||
bool wxWidgetCocoaImpl::SetFocus()
|
bool wxWidgetCocoaImpl::SetFocus()
|
||||||
{
|
{
|
||||||
if ( [m_osxView canBecomeKeyView] == NO )
|
if ( !CanFocus() )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
[[m_osxView window] makeFirstResponder: m_osxView] ;
|
[[m_osxView window] makeFirstResponder: m_osxView] ;
|
||||||
|
Reference in New Issue
Block a user