diff --git a/PowerEditor/src/WinControls/FunctionList/functionListPanel.cpp b/PowerEditor/src/WinControls/FunctionList/functionListPanel.cpp
index 94f33f52e..b5e463e05 100644
--- a/PowerEditor/src/WinControls/FunctionList/functionListPanel.cpp
+++ b/PowerEditor/src/WinControls/FunctionList/functionListPanel.cpp
@@ -411,6 +411,7 @@ void FunctionListPanel::searchFuncAndSwitchView()
{
_treeViewSearchResult.display(false);
_treeView.display(true);
+ _pTreeView = &_treeView;
}
else
{
@@ -424,6 +425,7 @@ void FunctionListPanel::searchFuncAndSwitchView()
_treeViewSearchResult.display(true);
_treeViewSearchResult.expand(_treeViewSearchResult.getRoot());
_treeView.display(false);
+ _pTreeView = &_treeViewSearchResult;
// invalidate the editor rect
::InvalidateRect(_hSearchEdit, NULL, TRUE);
@@ -484,7 +486,7 @@ BOOL CALLBACK FunctionListPanel::run_dlgProc(UINT message, WPARAM wParam, LPARAM
//::GetWindowLongPtr(_hToolbarMenu, GWL_WNDPROC);
oldFunclstToolbarProc = (WNDPROC)::SetWindowLongPtr(_hToolbarMenu, GWLP_WNDPROC, (LONG_PTR)funclstToolbarProc);
- TBBUTTON tbButtons[2];
+ TBBUTTON tbButtons[3];
tbButtons[0].idCommand = 0;
tbButtons[0].iBitmap = editWidth + 10;
@@ -492,11 +494,17 @@ BOOL CALLBACK FunctionListPanel::run_dlgProc(UINT message, WPARAM wParam, LPARAM
tbButtons[0].fsStyle = BTNS_SEP;
tbButtons[0].iString = 0;
- tbButtons[1].idCommand = IDC_RELOADBUTTON_FUNCLIST;
+ tbButtons[1].idCommand = IDC_SORTBUTTON_FUNCLIST;
tbButtons[1].iBitmap = I_IMAGENONE;
tbButtons[1].fsState = TBSTATE_ENABLED;
tbButtons[1].fsStyle = BTNS_BUTTON | BTNS_AUTOSIZE;
- tbButtons[1].iString = (INT_PTR)TEXT("Reload");
+ tbButtons[1].iString = (INT_PTR)TEXT("Sort");
+
+ tbButtons[2].idCommand = IDC_RELOADBUTTON_FUNCLIST;
+ tbButtons[2].iBitmap = I_IMAGENONE;
+ tbButtons[2].fsState = TBSTATE_ENABLED;
+ tbButtons[2].fsStyle = BTNS_BUTTON | BTNS_AUTOSIZE;
+ tbButtons[2].iString = (INT_PTR)TEXT("Reload");
SendMessage(_hToolbarMenu, TB_BUTTONSTRUCTSIZE, (WPARAM)sizeof(TBBUTTON), 0);
SendMessage(_hToolbarMenu, TB_ADDBUTTONS, (WPARAM)sizeof(tbButtons) / sizeof(TBBUTTON), (LPARAM)&tbButtons);
@@ -542,6 +550,12 @@ BOOL CALLBACK FunctionListPanel::run_dlgProc(UINT message, WPARAM wParam, LPARAM
switch (LOWORD(wParam))
{
+ case IDC_SORTBUTTON_FUNCLIST:
+ {
+ ::SendMessage(_pTreeView->getHSelf(), TVM_SORTCHILDREN, TRUE, (LPARAM)_pTreeView->getRoot());
+ }
+ return TRUE;
+
case IDC_RELOADBUTTON_FUNCLIST:
{
reload();
diff --git a/PowerEditor/src/WinControls/FunctionList/functionListPanel_rc.h b/PowerEditor/src/WinControls/FunctionList/functionListPanel_rc.h
index 5e1eae58b..a32106da3 100644
--- a/PowerEditor/src/WinControls/FunctionList/functionListPanel_rc.h
+++ b/PowerEditor/src/WinControls/FunctionList/functionListPanel_rc.h
@@ -32,8 +32,9 @@
#define IDD_FUNCLIST_PANEL 3400
#define IDC_LIST_FUNCLIST (IDD_FUNCLIST_PANEL + 1)
#define IDC_LIST_FUNCLIST_AUX (IDD_FUNCLIST_PANEL + 2)
-#define IDC_RELOADBUTTON_FUNCLIST (IDD_FUNCLIST_PANEL + 3)
-#define IDC_SEARCHFIELD_FUNCLIST (IDD_FUNCLIST_PANEL + 4)
+#define IDC_SEARCHFIELD_FUNCLIST (IDD_FUNCLIST_PANEL + 3)
+#define IDC_RELOADBUTTON_FUNCLIST (IDD_FUNCLIST_PANEL + 4)
+#define IDC_SORTBUTTON_FUNCLIST (IDD_FUNCLIST_PANEL + 5)
#endif //IDD_FUNCLISTPANEL_RC_H
diff --git a/PowerEditor/src/contextMenu.xml b/PowerEditor/src/contextMenu.xml
index 58f8341a8..2063a3f15 100644
--- a/PowerEditor/src/contextMenu.xml
+++ b/PowerEditor/src/contextMenu.xml
@@ -60,9 +60,9 @@ http://sourceforge.net/apps/mediawiki/notepad-plus/index.php?title=Context_Menu
-
-
-
+
+
+