Skip to content

Commit eeb3052

Browse files
committed
[ENHANCE] Enhance Project Manager - add DELETE and ENTER shortcut.
- Notepad-plus svn trunk @ 821
1 parent 26495e5 commit eeb3052

File tree

9 files changed

+80
-64
lines changed

9 files changed

+80
-64
lines changed

PowerEditor/bin/change.log

Lines changed: 7 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,17 @@
1-
Notepad++ v5.9.3 new features and fixed bugs:
1+
Notepad++ v5.9.4 new features and fixed bugs:
22

3-
1. Update Scintilla to 2.27.
4-
2. Make Recent File List totally customizable.
5-
3. Add Vertical File Switcher feature.
6-
4. Add active folding area highlighting feature (only for box and circle mode).
7-
5. Detect the absence of Scintilla.
8-
6. Add 2 plugins messages NPPM_GETLANGUAGENAME & NPPM_GETLANGUAGEDESC.
9-
7. Fix "Replace all" feature hangs on the Regular Expression '$'.
10-
8. Fix wrong result returned by NPPM_GETLANGUAGENAME.
3+
1. Add 3 Project Panels for the management of projects
4+
2. Doc Switcher can be sorted now.
5+
3. Fix crash issue while printing for some printers.
6+
4. Fix ANSI version Clipboard history entries display bug.
7+
5. Fix wrong display of tab number setting dialog in Lang Menu/Tab settings of Preferences dialog.
118

129

13-
Notepad++ v5.9.2 fixed bugs:
14-
15-
1. Fix the Clipboard History crash issue while no data in Clipboard.
16-
2. Fix the local directory installation option ignored issue in Installer.
17-
3. Reduce the recent file history width to 32 characters.
18-
19-
20-
Notepad++ v5.9.1 new features:
21-
22-
1. Add Character Insertion Panel.
23-
2. Add Clipboard History feature.
24-
3. Add find characters in range feature.
25-
26-
27-
Notepad++ v5.9 new features and fixed bugs (from v5.8.7):
28-
29-
1. Update Scintilla from 2.21 to 2.25
30-
2. New feature: Non-greedy regular expression (Scintilla).
31-
3. Add Copy/Cut/Paste Binary Content feature.
32-
4. Add "paste HTML content" and "paste RTF content" commands.
33-
5. Fix the inverse of title and message for some MessageBox.
34-
6. Add "Remove Unmarked Lines" command.
35-
7. Add "Column Mode Tip" to notice users the usage of column mode in Notepad++.
36-
8. Make stream comment of php/javascript foldable.
37-
3810

3911
Included plugins (Unicode):
4012

4113
1. Spell Checker v1.3.3
42-
2. NppFTP 0.23
14+
2. NppFTP 0.24.1
4315
3. NppExport v0.2.8
4416
4. Plugin Manager 0.9.3.1
4517
5. Converter 3.0

PowerEditor/installer/nppSetup.nsi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
; Define the application name
1919
!define APPNAME "Notepad++"
2020

21-
!define APPVERSION "5.9.3"
21+
!define APPVERSION "5.9.4"
2222
!define APPNAMEANDVERSION "${APPNAME} v${APPVERSION}"
2323
!define VERSION_MAJOR 5
24-
!define VERSION_MINOR 93
24+
!define VERSION_MINOR 94
2525

2626
!define APPWEBSITE "http://notepad-plus-plus.org/"
2727

PowerEditor/src/NppCommands.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ void Notepad_plus::command(int id)
4545
case IDM_FILE_NEW:
4646
{
4747
fileNew();
48-
//launchProjectPanel();
4948
}
5049
break;
5150

PowerEditor/src/WinControls/ProjectPanel/ProjectPanel.cpp

Lines changed: 59 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,34 @@ generic_string ProjectPanel::getAbsoluteFilePath(const TCHAR * relativePath)
420420
return absolutePath;
421421
}
422422

423+
void ProjectPanel::openSelectFile()
424+
{
425+
TVITEM tvItem;
426+
tvItem.mask = TVIF_PARAM;
427+
tvItem.hItem = _treeView.getSelection();
428+
::SendMessage(_treeView.getHSelf(), TVM_GETITEM, 0,(LPARAM)&tvItem);
429+
430+
NodeType nType = getNodeType(tvItem.hItem);
431+
generic_string *fn = (generic_string *)tvItem.lParam;
432+
if (nType == nodeType_file && fn)
433+
{
434+
tvItem.mask = TVIF_IMAGE | TVIF_SELECTEDIMAGE;
435+
if (::PathFileExists(fn->c_str()))
436+
{
437+
::SendMessage(_hParent, NPPM_DOOPEN, 0, (LPARAM)(fn->c_str()));
438+
tvItem.iImage = INDEX_LEAF;
439+
tvItem.iSelectedImage = INDEX_LEAF;
440+
}
441+
else
442+
{
443+
tvItem.iImage = INDEX_LEAF_INVALID;
444+
tvItem.iSelectedImage = INDEX_LEAF_INVALID;
445+
}
446+
TreeView_SetItem(_treeView.getHSelf(), &tvItem);
447+
}
448+
}
449+
450+
423451
void ProjectPanel::notified(LPNMHDR notification)
424452
{
425453
if((notification->hwndFrom == _treeView.getHSelf()))
@@ -434,25 +462,7 @@ void ProjectPanel::notified(LPNMHDR notification)
434462
{
435463
case NM_DBLCLK:
436464
{
437-
tvItem.hItem = _treeView.getSelection();
438-
::SendMessage(_treeView.getHSelf(), TVM_GETITEM, 0,(LPARAM)&tvItem);
439-
generic_string *fn = (generic_string *)tvItem.lParam;
440-
if (fn)
441-
{
442-
tvItem.mask = TVIF_IMAGE | TVIF_SELECTEDIMAGE;
443-
if (::PathFileExists(fn->c_str()))
444-
{
445-
::SendMessage(_hParent, NPPM_DOOPEN, 0, (LPARAM)(fn->c_str()));
446-
tvItem.iImage = INDEX_LEAF;
447-
tvItem.iSelectedImage = INDEX_LEAF;
448-
}
449-
else
450-
{
451-
tvItem.iImage = INDEX_LEAF_INVALID;
452-
tvItem.iSelectedImage = INDEX_LEAF_INVALID;
453-
}
454-
TreeView_SetItem(_treeView.getHSelf(), &tvItem);
455-
}
465+
openSelectFile();
456466
}
457467
break;
458468

@@ -521,6 +531,36 @@ void ProjectPanel::notified(LPNMHDR notification)
521531
}
522532
break;
523533

534+
case TVN_KEYDOWN:
535+
{
536+
//tvItem.hItem = _treeView.getSelection();
537+
//::SendMessage(_treeView.getHSelf(), TVM_GETITEM, 0,(LPARAM)&tvItem);
538+
LPNMTVKEYDOWN ptvkd = (LPNMTVKEYDOWN)notification;
539+
if (ptvkd->wVKey == VK_DELETE)
540+
{
541+
HTREEITEM hItem = _treeView.getSelection();
542+
NodeType nType = getNodeType(hItem);
543+
if (nType == nodeType_project || nType == nodeType_folder)
544+
popupMenuCmd(IDM_PROJECT_DELETEFOLDER);
545+
else if (nType == nodeType_file)
546+
popupMenuCmd(IDM_PROJECT_DELETEFILE);
547+
}
548+
else if (ptvkd->wVKey == VK_RETURN)
549+
{
550+
HTREEITEM hItem = _treeView.getSelection();
551+
NodeType nType = getNodeType(hItem);
552+
if (nType == nodeType_file)
553+
openSelectFile();
554+
else
555+
_treeView.toggleExpandCollapse(hItem);
556+
}
557+
558+
else if (ptvkd->wVKey == VK_F2)
559+
popupMenuCmd(IDM_PROJECT_RENAME);
560+
561+
}
562+
break;
563+
524564
case TVN_ITEMEXPANDED:
525565
{
526566
LPNMTREEVIEW nmtv = (LPNMTREEVIEW)notification;

PowerEditor/src/WinControls/ProjectPanel/ProjectPanel.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ class ProjectPanel : public DockingDlgInterface {
9191
void notified(LPNMHDR notification);
9292
void showContextMenu(int x, int y);
9393
generic_string getAbsoluteFilePath(const TCHAR * relativePath);
94+
void openSelectFile();
9495
};
9596

9697
class FileRelocalizerDlg : public StaticDialog

PowerEditor/src/WinControls/ProjectPanel/TreeView.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,3 +118,4 @@ void TreeView::setItemImage(HTREEITEM hTreeItem, int iImage, int iSelectedImage)
118118
tvItem.iSelectedImage = iSelectedImage;
119119
TreeView_SetItem(_hSelf, &tvItem);
120120
}
121+

PowerEditor/src/WinControls/ProjectPanel/TreeView.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,12 @@ class TreeView : public Window
4444
HTREEITEM getNextSibling(HTREEITEM hItem) const {
4545
return TreeView_GetNextSibling(_hSelf, hItem);
4646
};
47-
void expand(HTREEITEM hItem) const {
48-
TreeView_Expand(_hSelf, hItem, TVE_EXPAND);
49-
};
47+
void expand(HTREEITEM hItem) const {
48+
TreeView_Expand(_hSelf, hItem, TVE_EXPAND);
49+
};
50+
void toggleExpandCollapse(HTREEITEM hItem) const {
51+
TreeView_Expand(_hSelf, hItem, TVE_TOGGLE);
52+
};
5053
void setItemImage(HTREEITEM hTreeItem, int iImage, int iSelectedImage);
5154

5255
protected:

0 commit comments

Comments
 (0)