Fix Folder As Workspace double clicking issue

Fix input focus not in edit window after double click in Project or Folder As Workspace.

Fix #4656, fix #8361, close #8369
This commit is contained in:
Udo Hoffmann 2020-06-04 00:36:23 +02:00 committed by Don HO
parent 5e76ba238e
commit 58ded005bd
No known key found for this signature in database
GPG Key ID: 6C429F1D8D84F46E
3 changed files with 7 additions and 5 deletions

View File

@ -513,15 +513,15 @@ void FileBrowser::openSelectFile()
HTREEITEM selectedNode = _treeView.getSelection(); HTREEITEM selectedNode = _treeView.getSelection();
if (!selectedNode) return; if (!selectedNode) return;
generic_string fullPath = getNodePath(selectedNode); _selectedNodeFullPath = getNodePath(selectedNode);
// test the path - if it's a file, open it, otherwise just fold or unfold it // test the path - if it's a file, open it, otherwise just fold or unfold it
if (!::PathFileExists(fullPath.c_str())) if (!::PathFileExists(_selectedNodeFullPath.c_str()))
return; return;
if (::PathIsDirectory(fullPath.c_str())) if (::PathIsDirectory(_selectedNodeFullPath.c_str()))
return; return;
::SendMessage(_hParent, NPPM_DOOPEN, 0, reinterpret_cast<LPARAM>(fullPath.c_str())); ::PostMessage(_hParent, NPPM_DOOPEN, 0, reinterpret_cast<LPARAM>(_selectedNodeFullPath.c_str()));
} }

View File

@ -176,6 +176,8 @@ protected:
HMENU _hFileMenu = NULL; HMENU _hFileMenu = NULL;
std::vector<FolderUpdater *> _folderUpdaters; std::vector<FolderUpdater *> _folderUpdaters;
generic_string _selectedNodeFullPath; // this member is used only for PostMessage call
std::vector<SortingData4lParam*> sortingDataArray; std::vector<SortingData4lParam*> sortingDataArray;
void initPopupMenus(); void initPopupMenus();

View File

@ -579,7 +579,7 @@ void ProjectPanel::openSelectFile()
tvItem.mask = TVIF_IMAGE | TVIF_SELECTEDIMAGE; tvItem.mask = TVIF_IMAGE | TVIF_SELECTEDIMAGE;
if (::PathFileExists(fn->c_str())) if (::PathFileExists(fn->c_str()))
{ {
::SendMessage(_hParent, NPPM_DOOPEN, 0, reinterpret_cast<LPARAM>(fn->c_str())); ::PostMessage(_hParent, NPPM_DOOPEN, 0, reinterpret_cast<LPARAM>(fn->c_str()));
tvItem.iImage = INDEX_LEAF; tvItem.iImage = INDEX_LEAF;
tvItem.iSelectedImage = INDEX_LEAF; tvItem.iSelectedImage = INDEX_LEAF;
} }