diff --git a/PowerEditor/src/WinControls/FunctionList/functionListPanel.cpp b/PowerEditor/src/WinControls/FunctionList/functionListPanel.cpp index f5fa4c389..6e11458f0 100644 --- a/PowerEditor/src/WinControls/FunctionList/functionListPanel.cpp +++ b/PowerEditor/src/WinControls/FunctionList/functionListPanel.cpp @@ -396,6 +396,22 @@ BOOL CALLBACK FunctionListPanel::run_dlgProc(UINT message, WPARAM wParam, LPARAM { case WM_INITDIALOG : { + // Create toolbar menu + int style = WS_CHILD | WS_VISIBLE | CCS_ADJUSTABLE | TBSTYLE_AUTOSIZE | TBSTYLE_FLAT | TBSTYLE_LIST; + _hToolbarMenu = CreateWindowEx(0,TOOLBARCLASSNAME,NULL, style, + 0,0,0,0,_hSelf,(HMENU)0, _hInst, NULL); + TBBUTTON tbButtons[1]; + tbButtons[0].idCommand = IDC_RELOADBUTTON_FUNCLIST; + tbButtons[0].iBitmap = I_IMAGENONE; + tbButtons[0].fsState = TBSTATE_ENABLED; + tbButtons[0].fsStyle = BTNS_BUTTON | BTNS_AUTOSIZE; + tbButtons[0].iString = (INT_PTR)TEXT("Reload"); + + SendMessage(_hToolbarMenu, TB_BUTTONSTRUCTSIZE, (WPARAM)sizeof(TBBUTTON), 0); + SendMessage(_hToolbarMenu, TB_ADDBUTTONS, (WPARAM)sizeof(tbButtons) / sizeof(TBBUTTON), (LPARAM)&tbButtons); + SendMessage(_hToolbarMenu, TB_AUTOSIZE, 0, 0); + ShowWindow(_hToolbarMenu, SW_SHOW); + _treeView.init(_hInst, _hSelf, IDC_LIST_FUNCLIST); setImageList(IDI_FUNCLIST_ROOT, IDI_FUNCLIST_NODE, IDI_FUNCLIST_LEAF); _treeView.display(); @@ -403,6 +419,8 @@ BOOL CALLBACK FunctionListPanel::run_dlgProc(UINT message, WPARAM wParam, LPARAM } case WM_DESTROY: + _treeView.destroy(); + ::DestroyWindow(_hToolbarMenu); break; case WM_COMMAND : @@ -423,8 +441,14 @@ BOOL CALLBACK FunctionListPanel::run_dlgProc(UINT message, WPARAM wParam, LPARAM (*_ppEditView)->execute(SCI_GOTOPOS, pos); } } - return TRUE; } + return TRUE; + + case IDC_RELOADBUTTON_FUNCLIST: + { + reload(); + } + return TRUE; } } break; @@ -439,24 +463,16 @@ BOOL CALLBACK FunctionListPanel::run_dlgProc(UINT message, WPARAM wParam, LPARAM { int width = LOWORD(lParam); int height = HIWORD(lParam); - //::MoveWindow(::GetDlgItem(_hSelf, IDC_LIST_FUNCLIST), 0, 0, width, height, TRUE); + RECT toolbarMenuRect; + ::GetClientRect(_hToolbarMenu, &toolbarMenuRect); + + ::MoveWindow(_hToolbarMenu, 0, 0, width, toolbarMenuRect.bottom, TRUE); + HWND hwnd = _treeView.getHSelf(); if (hwnd) - ::MoveWindow(hwnd, 0, 0, width, height, TRUE); + ::MoveWindow(hwnd, 0, toolbarMenuRect.bottom + 2, width, height - toolbarMenuRect.bottom - 2, TRUE); break; } -/* - case WM_VKEYTOITEM: - { - if (LOWORD(wParam) == VK_RETURN) - { - int i = ::SendDlgItemMessage(_hSelf, IDC_LIST_CLIPBOARD, LB_GETCURSEL, 0, 0); - printInt(i); - return TRUE; - }//return TRUE; - break; - } -*/ default : return DockingDlgInterface::run_dlgProc(message, wParam, lParam); diff --git a/PowerEditor/src/WinControls/FunctionList/functionListPanel.h b/PowerEditor/src/WinControls/FunctionList/functionListPanel.h index 0092d4ab0..f30a9b6c6 100644 --- a/PowerEditor/src/WinControls/FunctionList/functionListPanel.h +++ b/PowerEditor/src/WinControls/FunctionList/functionListPanel.h @@ -96,6 +96,7 @@ protected: virtual BOOL CALLBACK FunctionListPanel::run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam); private: + HWND _hToolbarMenu; TreeView _treeView; ScintillaEditView **_ppEditView; FunctionParsersManager _funcParserMgr; diff --git a/PowerEditor/src/WinControls/FunctionList/functionListPanel.rc b/PowerEditor/src/WinControls/FunctionList/functionListPanel.rc index 30f2c94d2..5a19871c8 100644 --- a/PowerEditor/src/WinControls/FunctionList/functionListPanel.rc +++ b/PowerEditor/src/WinControls/FunctionList/functionListPanel.rc @@ -35,5 +35,6 @@ EXSTYLE WS_EX_TOOLWINDOW | WS_EX_WINDOWEDGE CAPTION "Function List" FONT 8, "MS Sans Serif", 0, 0, 0x0 BEGIN + //PUSHBUTTON "Reload",IDC_RELOADBUTTON_FUNCLIST, 3,3,38,14 //LISTBOX IDC_LIST_FUNCLIST,50,44,78,120,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP END diff --git a/PowerEditor/src/WinControls/FunctionList/functionListPanel_rc.h b/PowerEditor/src/WinControls/FunctionList/functionListPanel_rc.h index dbaa5fb3a..7a02cacfc 100644 --- a/PowerEditor/src/WinControls/FunctionList/functionListPanel_rc.h +++ b/PowerEditor/src/WinControls/FunctionList/functionListPanel_rc.h @@ -30,7 +30,9 @@ #define IDD_FUNCLISTPANEL_RC_H #define IDD_FUNCLIST_PANEL 3400 -#define IDC_LIST_FUNCLIST (IDD_FUNCLIST_PANEL + 1) +#define IDC_LIST_FUNCLIST (IDD_FUNCLIST_PANEL + 1) +#define IDC_RELOADBUTTON_FUNCLIST (IDD_FUNCLIST_PANEL + 2) +#define IDC_SEARCHFIELD_FUNCLIST (IDD_FUNCLIST_PANEL + 3) #endif //IDD_FUNCLISTPANEL_RC_H