From 703a49b32304e9ab09931493db9e1ca972e896f3 Mon Sep 17 00:00:00 2001 From: Don HO Date: Wed, 18 Dec 2019 22:12:36 +0100 Subject: [PATCH] Add the Expand All capacity into Folder as Workspace --- PowerEditor/src/Notepad_plus.rc | 1 + .../src/WinControls/FileBrowser/fileBrowser.cpp | 16 +++++++++++++++- PowerEditor/src/icons/fb_expand_all.bmp | Bin 0 -> 1080 bytes PowerEditor/src/resource.h | 1 + 4 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 PowerEditor/src/icons/fb_expand_all.bmp diff --git a/PowerEditor/src/Notepad_plus.rc b/PowerEditor/src/Notepad_plus.rc index c55ff54d..0dbe7a9b 100644 --- a/PowerEditor/src/Notepad_plus.rc +++ b/PowerEditor/src/Notepad_plus.rc @@ -208,6 +208,7 @@ IDI_FB_ROOTCLOSE BITMAP "icons/fb_root_close.bmp" IDI_FB_SELECTCURRENTFILE BITMAP "icons/fb_select_current_file.bmp" IDI_FB_FOLDALL BITMAP "icons/fb_fold_all.bmp" +IDI_FB_EXPANDALL BITMAP "icons/fb_expand_all.bmp" IDI_FUNCLIST_ROOT BITMAP "icons/project_file.bmp" IDI_FUNCLIST_NODE BITMAP "icons/funcList_node.bmp" diff --git a/PowerEditor/src/WinControls/FileBrowser/fileBrowser.cpp b/PowerEditor/src/WinControls/FileBrowser/fileBrowser.cpp index 76f47ebd..e309c266 100644 --- a/PowerEditor/src/WinControls/FileBrowser/fileBrowser.cpp +++ b/PowerEditor/src/WinControls/FileBrowser/fileBrowser.cpp @@ -55,6 +55,7 @@ #define FB_RNFILE (WM_USER + 1026) #define FB_CMD_AIMFILE 1 #define FB_CMD_FOLDALL 2 +#define FB_CMD_EXPANDALL 3 FileBrowser::~FileBrowser() { @@ -110,13 +111,15 @@ INT_PTR CALLBACK FileBrowser::run_dlgProc(UINT message, WPARAM wParam, LPARAM lP NppParameters& nppParam = NppParameters::getInstance(); int style = WS_CHILD | WS_VISIBLE | CCS_ADJUSTABLE | TBSTYLE_AUTOSIZE | TBSTYLE_FLAT | TBSTYLE_LIST | TBSTYLE_TRANSPARENT | BTNS_AUTOSIZE | BTNS_SEP | TBSTYLE_TOOLTIPS; _hToolbarMenu = CreateWindowEx(WS_EX_LAYOUTRTL, TOOLBARCLASSNAME, NULL, style, 0, 0, 0, 0, _hSelf, nullptr, _hInst, NULL); - TBBUTTON tbButtons[2]; + TBBUTTON tbButtons[3]; // Add the bmap image into toolbar's imagelist TBADDBITMAP addbmp = { _hInst, 0 }; addbmp.nID = IDI_FB_SELECTCURRENTFILE; ::SendMessage(_hToolbarMenu, TB_ADDBITMAP, 1, reinterpret_cast(&addbmp)); addbmp.nID = IDI_FB_FOLDALL; ::SendMessage(_hToolbarMenu, TB_ADDBITMAP, 1, reinterpret_cast(&addbmp)); + addbmp.nID = IDI_FB_EXPANDALL; + ::SendMessage(_hToolbarMenu, TB_ADDBITMAP, 1, reinterpret_cast(&addbmp)); tbButtons[0].idCommand = FB_CMD_AIMFILE; tbButtons[0].iBitmap = 0; tbButtons[0].fsState = TBSTATE_ENABLED; @@ -127,6 +130,11 @@ INT_PTR CALLBACK FileBrowser::run_dlgProc(UINT message, WPARAM wParam, LPARAM lP tbButtons[1].fsState = TBSTATE_ENABLED; tbButtons[1].fsStyle = BTNS_BUTTON | BTNS_AUTOSIZE; tbButtons[1].iString = reinterpret_cast(TEXT("")); + tbButtons[2].idCommand = FB_CMD_EXPANDALL; + tbButtons[2].iBitmap = 2; + tbButtons[2].fsState = TBSTATE_ENABLED; + tbButtons[2].fsStyle = BTNS_BUTTON | BTNS_AUTOSIZE; + tbButtons[2].iString = reinterpret_cast(TEXT("")); ::SendMessage(_hToolbarMenu, TB_BUTTONSTRUCTSIZE, sizeof(TBBUTTON), 0); ::SendMessage(_hToolbarMenu, TB_SETBUTTONSIZE, 0, MAKELONG(nppParam._dpiManager.scaleX(20), nppParam._dpiManager.scaleY(20))); @@ -214,6 +222,12 @@ INT_PTR CALLBACK FileBrowser::run_dlgProc(UINT message, WPARAM wParam, LPARAM lP break; } + case FB_CMD_EXPANDALL: + { + _treeView.expandAll(); + break; + } + default: popupMenuCmd(LOWORD(wParam)); } diff --git a/PowerEditor/src/icons/fb_expand_all.bmp b/PowerEditor/src/icons/fb_expand_all.bmp new file mode 100644 index 0000000000000000000000000000000000000000..4b24b7bbe706871b0f8cc838343b7c7708f6fc07 GIT binary patch literal 1080 zcmchRu?m1N3`C>2xrkrj=w1+KcmMx$YODszk*i99zki h|JVPTFYj+Nau3c=8OVD(%kWsHVFu$$x@D9YkptdLT?GID literal 0 HcmV?d00001 diff --git a/PowerEditor/src/resource.h b/PowerEditor/src/resource.h index d2d8f939..21f9579d 100644 --- a/PowerEditor/src/resource.h +++ b/PowerEditor/src/resource.h @@ -146,6 +146,7 @@ #define IDI_FB_ROOTCLOSE 609 #define IDI_FB_SELECTCURRENTFILE 610 #define IDI_FB_FOLDALL 611 +#define IDI_FB_EXPANDALL 612 #define IDI_FUNCLIST_ROOT 620 #define IDI_FUNCLIST_NODE 621