diff --git a/PowerEditor/installer/nativeLang/english.xml b/PowerEditor/installer/nativeLang/english.xml index 205c778f5..4ba4201d2 100644 --- a/PowerEditor/installer/nativeLang/english.xml +++ b/PowerEditor/installer/nativeLang/english.xml @@ -1230,6 +1230,9 @@ Continue?"/> + + + diff --git a/PowerEditor/installer/nativeLang/french.xml b/PowerEditor/installer/nativeLang/french.xml index 09c5854eb..341617889 100644 --- a/PowerEditor/installer/nativeLang/french.xml +++ b/PowerEditor/installer/nativeLang/french.xml @@ -1183,6 +1183,9 @@ Voulez-vous les poursuivez ?"/> + + + diff --git a/PowerEditor/installer/nativeLang/taiwaneseMandarin.xml b/PowerEditor/installer/nativeLang/taiwaneseMandarin.xml index ebcf89161..c394fd260 100644 --- a/PowerEditor/installer/nativeLang/taiwaneseMandarin.xml +++ b/PowerEditor/installer/nativeLang/taiwaneseMandarin.xml @@ -1174,6 +1174,9 @@ + + + diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index 628367a0e..58ff3d2dd 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -6469,7 +6469,7 @@ void Notepad_plus::launchFileBrowser(const vector & folders, con data.dlgID = IDM_VIEW_FILEBROWSER; NativeLangSpeaker *pNativeSpeaker = (NppParameters::getInstance()).getNativeLangSpeaker(); - generic_string title_temp = pNativeSpeaker->getAttrNameStr(FB_PANELTITLE, "FolderAsWorkspace", "PanelTitle"); + generic_string title_temp = pNativeSpeaker->getAttrNameStr(FB_PANELTITLE, FOLDERASWORKSPACE_NODE, "PanelTitle"); static TCHAR title[32]; if (title_temp.length() < 32) diff --git a/PowerEditor/src/WinControls/FileBrowser/fileBrowser.cpp b/PowerEditor/src/WinControls/FileBrowser/fileBrowser.cpp index a4131a4ff..3451d823a 100644 --- a/PowerEditor/src/WinControls/FileBrowser/fileBrowser.cpp +++ b/PowerEditor/src/WinControls/FileBrowser/fileBrowser.cpp @@ -57,6 +57,11 @@ #define FB_CMD_FOLDALL 2 #define FB_CMD_EXPANDALL 3 +#define FB_TIPEXPANDALLFOLDERS +#define FB_TIPEXPANDALLFOLDERS +#define FB_TIPCOLLAPSEALLFOLDERS +#define FB_TIPLOCATECURRENTFILE + FileBrowser::~FileBrowser() { for (const auto folder : _folderUpdaters) @@ -141,6 +146,12 @@ INT_PTR CALLBACK FileBrowser::run_dlgProc(UINT message, WPARAM wParam, LPARAM lP tbButtons[2].fsStyle = BTNS_BUTTON | BTNS_AUTOSIZE; tbButtons[2].iString = reinterpret_cast(TEXT("")); + // tips text for toolbar buttons + NativeLangSpeaker *pNativeSpeaker = nppParam.getNativeLangSpeaker(); + _expandAllFolders = pNativeSpeaker->getAttrNameStr(_expandAllFolders.c_str(), FOLDERASWORKSPACE_NODE, "ExpandAllFoldersTip"); + _collapseAllFolders = pNativeSpeaker->getAttrNameStr(_collapseAllFolders.c_str(), FOLDERASWORKSPACE_NODE, "CollapseAllFoldersTip"); + _locateCurrentFile = pNativeSpeaker->getAttrNameStr(_locateCurrentFile.c_str(), FOLDERASWORKSPACE_NODE, "LocateCurrentFileTip"); + ::SendMessage(_hToolbarMenu, TB_BUTTONSTRUCTSIZE, sizeof(TBBUTTON), 0); ::SendMessage(_hToolbarMenu, TB_SETBUTTONSIZE, 0, MAKELONG(nppParam._dpiManager.scaleX(20), nppParam._dpiManager.scaleY(20))); ::SendMessage(_hToolbarMenu, TB_SETPADDING, 0, MAKELONG(20, 0)); @@ -553,6 +564,24 @@ void FileBrowser::notified(LPNMHDR notification) { ::SendMessage(_hParent, WM_COMMAND, IDM_VIEW_FILEBROWSER, 0); } + else if (notification->code == TTN_GETDISPINFO) + { + LPTOOLTIPTEXT lpttt = (LPTOOLTIPTEXT)notification; + lpttt->hinst = NULL; + + if (notification->idFrom == FB_CMD_AIMFILE) + { + wcscpy_s(lpttt->szText, _locateCurrentFile.c_str()); + } + else if (notification->idFrom == FB_CMD_FOLDALL) + { + wcscpy_s(lpttt->szText, _collapseAllFolders.c_str()); + } + else if (notification->idFrom == FB_CMD_EXPANDALL) + { + wcscpy_s(lpttt->szText, _expandAllFolders.c_str()); + } + } else if ((notification->hwndFrom == _treeView.getHSelf())) { TCHAR textBuffer[MAX_PATH]; @@ -892,7 +921,7 @@ void FileBrowser::popupMenuCmd(int cmdID) case IDM_FILEBROWSER_ADDROOT: { NativeLangSpeaker *pNativeSpeaker = (NppParameters::getInstance()).getNativeLangSpeaker(); - generic_string openWorkspaceStr = pNativeSpeaker->getAttrNameStr(TEXT("Select a folder to add in Folder as Workspace panel"), "FolderAsWorkspace", "SelectFolderFromBrowserString"); + generic_string openWorkspaceStr = pNativeSpeaker->getAttrNameStr(TEXT("Select a folder to add in Folder as Workspace panel"), FOLDERASWORKSPACE_NODE, "SelectFolderFromBrowserString"); generic_string folderPath = folderBrowser(_hParent, openWorkspaceStr.c_str()); if (!folderPath.empty()) { diff --git a/PowerEditor/src/WinControls/FileBrowser/fileBrowser.h b/PowerEditor/src/WinControls/FileBrowser/fileBrowser.h index f6f88353e..c4f326021 100644 --- a/PowerEditor/src/WinControls/FileBrowser/fileBrowser.h +++ b/PowerEditor/src/WinControls/FileBrowser/fileBrowser.h @@ -44,6 +44,9 @@ #define FB_OPENINNPP TEXT("Open") #define FB_SHELLEXECUTE TEXT("Run by system") +#define FOLDERASWORKSPACE_NODE "FolderAsWorkspace" + + class TiXmlNode; class FileBrowser; class FolderInfo; @@ -120,6 +123,7 @@ struct SortingData4lParam { SortingData4lParam(generic_string rootPath, generic_string label, bool isFolder) : _rootPath(rootPath), _label(label), _isFolder(isFolder) {} }; +; class FileBrowser : public DockingDlgInterface { public: @@ -182,6 +186,10 @@ protected: std::vector sortingDataArray; + generic_string _expandAllFolders = TEXT("Expand all folders"); + generic_string _collapseAllFolders = TEXT("Collapse all folders"); + generic_string _locateCurrentFile = TEXT("Locate current file"); + void initPopupMenus(); void destroyMenus(); BOOL setImageList(int root_open_id, int root_close_id, int open_node_id, int closed_node_id, int leaf_id); diff --git a/PowerEditor/src/WinControls/FunctionList/functionListPanel.cpp b/PowerEditor/src/WinControls/FunctionList/functionListPanel.cpp index 1db9b0734..9ac26a871 100644 --- a/PowerEditor/src/WinControls/FunctionList/functionListPanel.cpp +++ b/PowerEditor/src/WinControls/FunctionList/functionListPanel.cpp @@ -41,6 +41,10 @@ using namespace std; #define INDEX_NODE 1 #define INDEX_LEAF 2 +#define FL_FUCTIONLISTROOTNODE "FunctionList" +#define FL_SORTLOCALNODENAME "SortTip" +#define FL_RELOADLOCALNODENAME "ReloadTip" + FunctionListPanel::~FunctionListPanel() { for (const auto s : posStrs) diff --git a/PowerEditor/src/WinControls/FunctionList/functionListPanel.h b/PowerEditor/src/WinControls/FunctionList/functionListPanel.h index fb1653285..0eee159b5 100644 --- a/PowerEditor/src/WinControls/FunctionList/functionListPanel.h +++ b/PowerEditor/src/WinControls/FunctionList/functionListPanel.h @@ -33,12 +33,6 @@ #include "TreeView.h" #define FL_PANELTITLE TEXT("Function List") -#define FL_SORTTIP TEXT("sort") -#define FL_RELOADTIP TEXT("Reload") - -#define FL_FUCTIONLISTROOTNODE "FunctionList" -#define FL_SORTLOCALNODENAME "SortTip" -#define FL_RELOADLOCALNODENAME "ReloadTip" class ScintillaEditView; @@ -83,8 +77,7 @@ struct TreeParams { class FunctionListPanel : public DockingDlgInterface { public: - FunctionListPanel(): DockingDlgInterface(IDD_FUNCLIST_PANEL), _ppEditView(NULL), _pTreeView(&_treeView), - _reloadTipStr(TEXT("Reload")), _sortTipStr(TEXT("Sort")) {}; + FunctionListPanel(): DockingDlgInterface(IDD_FUNCLIST_PANEL), _pTreeView(&_treeView) {}; ~FunctionListPanel(); void init(HINSTANCE hInst, HWND hPere, ScintillaEditView **ppEditView); @@ -119,10 +112,10 @@ protected: virtual INT_PTR CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam); private: - HWND _hToolbarMenu; - HWND _hSearchEdit; + HWND _hToolbarMenu = nullptr; + HWND _hSearchEdit = nullptr; - TreeView *_pTreeView; + TreeView *_pTreeView = nullptr; TreeView _treeView; TreeView _treeViewSearchResult; @@ -130,18 +123,19 @@ private: long _findEndLine = -1; HTREEITEM _findItem; - generic_string _sortTipStr; - generic_string _reloadTipStr; + generic_string _sortTipStr = TEXT("Reload"); + generic_string _reloadTipStr = TEXT("Sort"); std::vector _foundFuncInfos; std::vector posStrs; - ScintillaEditView **_ppEditView; + ScintillaEditView **_ppEditView = nullptr; FunctionParsersManager _funcParserMgr; std::vector< std::pair > _skipZones; std::vector _treeParams; HIMAGELIST _hTreeViewImaLst; + generic_string parseSubLevel(size_t begin, size_t end, std::vector< generic_string > dataToSearch, int & foundPos); size_t getBodyClosePos(size_t begin, const TCHAR *bodyOpenSymbol, const TCHAR *bodyCloseSymbol); void notified(LPNMHDR notification); diff --git a/PowerEditor/src/localization.cpp b/PowerEditor/src/localization.cpp index 39d061469..55facb2de 100644 --- a/PowerEditor/src/localization.cpp +++ b/PowerEditor/src/localization.cpp @@ -30,6 +30,7 @@ #include "ShortcutMapper.h" #include "EncodingMapper.h" #include "localization.h" +#include "fileBrowser.h" using namespace std; @@ -1254,7 +1255,7 @@ generic_string NativeLangSpeaker::getFileBrowserLangMenuStr(int cmdID, const TCH { if (!_nativeLangA) return defaultStr; - TiXmlNodeA *targetNode = _nativeLangA->FirstChild("FolderAsWorkspace"); + TiXmlNodeA *targetNode = _nativeLangA->FirstChild(FOLDERASWORKSPACE_NODE); if (!targetNode) return defaultStr; targetNode = targetNode->FirstChild("Menus");