[NEW_FEATURE] Add sort button in function list.

git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@1133 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
Don Ho 2013-10-15 12:00:10 +00:00
parent 61a78b6628
commit d3afa41a9f
3 changed files with 23 additions and 8 deletions

View File

@ -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();

View File

@ -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

View File

@ -60,9 +60,9 @@ http://sourceforge.net/apps/mediawiki/notepad-plus/index.php?title=Context_Menu
<Item MenuEntryName="Edit" MenuItemName="UPPERCASE"/>
<Item MenuEntryName="Edit" MenuItemName="lowercase"/>
<Item id="0"/>
<Item MenuEntryName="Edit" MenuItemName="Toggle block comment"/>
<Item MenuEntryName="Edit" MenuItemName="Stream comment"/>
<Item MenuEntryName="Edit" MenuItemName="Stream uncomment"/>
<Item MenuEntryName="Edit" MenuItemName="Toggle Single Line Comment"/>
<Item MenuEntryName="Edit" MenuItemName="Block Comment"/>
<Item MenuEntryName="Edit" MenuItemName="Block Uncomment"/>
<Item id="0"/>
<Item MenuEntryName="View" MenuItemName="Hide lines"/>
</ScintillaContextMenu>