Add right-click context menu to bookmark margin

Close #8319, close #8320
pull/8355/head
Scott Sumner 2020-05-26 20:38:31 -04:00 committed by Don HO
parent 24252c02e1
commit 7cf43795ac
No known key found for this signature in database
GPG Key ID: 6C429F1D8D84F46E
1 changed files with 25 additions and 0 deletions

View File

@ -603,6 +603,31 @@ BOOL Notepad_plus::notify(SCNotification *notification)
break;
}
case SCN_MARGINRIGHTCLICK:
{
if (notification->nmhdr.hwndFrom == _mainEditView.getHSelf())
switchEditViewTo(MAIN_VIEW);
else if (notification->nmhdr.hwndFrom == _subEditView.getHSelf())
switchEditViewTo(SUB_VIEW);
if ((notification->margin == ScintillaEditView::_SC_MARGE_SYBOLE) && !notification->modifiers)
{
POINT p;
::GetCursorPos(&p);
MenuPosition& menuPos = getMenuPosition("search-bookmark");
HMENU hSearchMenu = ::GetSubMenu(_mainMenuHandle, menuPos._x);
if (hSearchMenu)
{
HMENU hBookmarkMenu = ::GetSubMenu(hSearchMenu, menuPos._y);
if (hBookmarkMenu)
{
TrackPopupMenu(hBookmarkMenu, 0, p.x, p.y, 0, _pPublicInterface->getHSelf(), NULL);
}
}
}
break;
}
case SCN_FOLDINGSTATECHANGED :
{
if ((notification->nmhdr.hwndFrom == _mainEditView.getHSelf()) || (notification->nmhdr.hwndFrom == _subEditView.getHSelf()))