FIX: [STUDIO-1940] hide edit ctrl on scroll in ObjectList
Change-Id: I9936ecff241d468f14e3dda0c12e4458cad8c237
This commit is contained in:
parent
bd29ac769c
commit
db65fd6e83
|
@ -265,7 +265,8 @@ ObjectList::ObjectList(wxWindow* parent) :
|
|||
this->CallAfter([this]() { ensure_current_item_visible(); });
|
||||
#endif
|
||||
e.Skip();
|
||||
}));
|
||||
}));
|
||||
|
||||
}
|
||||
|
||||
ObjectList::~ObjectList()
|
||||
|
@ -4925,6 +4926,9 @@ void ObjectList::OnEditingStarted(wxDataViewEvent &event)
|
|||
if (col == colName) // TODO: for colName editing, disable shortcuts
|
||||
SetAcceleratorTable(wxNullAcceleratorTable);
|
||||
}
|
||||
#ifdef __WXOSX__
|
||||
SetCustomRendererPtr(dynamic_cast<wxDataViewCustomRenderer*>(renderer));
|
||||
#endif
|
||||
#endif //__WXMSW__
|
||||
}
|
||||
|
||||
|
|
|
@ -208,7 +208,7 @@ void openFolderForFile(wxString const & file)
|
|||
|
||||
@end
|
||||
|
||||
/* edit column for wxTableView */
|
||||
/* edit column for wxCocoaOutlineView */
|
||||
|
||||
#include <wx/dataview.h>
|
||||
#include <wx/osx/cocoa/dataview.h>
|
||||
|
@ -216,8 +216,20 @@ void openFolderForFile(wxString const & file)
|
|||
|
||||
@implementation wxCocoaOutlineView (Edit)
|
||||
|
||||
bool addObserver = false;
|
||||
|
||||
- (BOOL)outlineView: (NSOutlineView*) view shouldEditTableColumn:(nullable NSTableColumn *)tableColumn item:(nonnull id)item
|
||||
{
|
||||
NSClipView * clipView = [[self enclosingScrollView] contentView];
|
||||
if (!addObserver) {
|
||||
addObserver = true;
|
||||
clipView.postsBoundsChangedNotifications = YES;
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||
selector:@selector(synchronizedViewContentBoundsDidChange:)
|
||||
name:NSViewBoundsDidChangeNotification
|
||||
object:clipView];
|
||||
}
|
||||
|
||||
wxDataViewColumn* const col((wxDataViewColumn *)[tableColumn getColumnPointer]);
|
||||
wxDataViewItem item2([static_cast<wxPointerObject *>(item) pointer]);
|
||||
|
||||
|
@ -227,9 +239,18 @@ void openFolderForFile(wxString const & file)
|
|||
dvc->GetEventHandler()->ProcessEvent( event );
|
||||
if( !event.IsAllowed() )
|
||||
return NO;
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (void)synchronizedViewContentBoundsDidChange:(NSNotification *)notification
|
||||
{
|
||||
wxDataViewCtrl* const dvc = implementation->GetDataViewCtrl();
|
||||
wxDataViewCustomRenderer * r = dvc->GetCustomRendererPtr();
|
||||
if (r)
|
||||
r->FinishEditing();
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
/* Font for wxTextCtrl */
|
||||
|
|
Loading…
Reference in New Issue