Merge pull request #2860 from RaiKoHoff/Dev_NewFeatures

grepWinNP3: "Stay On Top" titlebar context-menu
This commit is contained in:
Pairi Daiza 2020-09-20 00:43:07 +02:00 committed by GitHub
commit 5b6c2489a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 39 additions and 2 deletions

View File

@ -418,6 +418,9 @@ BEGIN
IDS_EXPORTMATCHLINECONTENT "include match line text"
IDS_UPDATEAVAILABLE "grepWinNP3 %s is available"
IDS_CAPTURESEARCH "Capture search"
IDS_CLONE "Start new grepWinNP3 window"
IDS_NEWINSTANCE_TT "Start new grepWinNP3 window"
IDS_STAY_ON_TOP "Stay On Top"
END
#endif // Neutral resources

View File

@ -177,6 +177,8 @@ CSearchDlg::CSearchDlg(HWND hParent)
, m_pBookmarksDlg(nullptr)
, m_showContent(false)
, m_showContentSet(false)
, m_stayOnTop(false)
, m_OpacityNoFocus(100)
, m_themeCallbackId(0)
{
}
@ -330,6 +332,8 @@ LRESULT CSearchDlg::DlgFunc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPara
int menuItemsCount = GetMenuItemCount(hSysMenu);
if (menuItemsCount > 2)
{
InsertMenu(hSysMenu, menuItemsCount - 2, MF_STRING | MF_BYPOSITION, ID_STAY_ON_TOP, TranslatedString(hResource, IDS_STAY_ON_TOP).c_str());
InsertMenu(hSysMenu, menuItemsCount - 2, MF_SEPARATOR | MF_BYPOSITION, NULL, NULL);
InsertMenu(hSysMenu, menuItemsCount - 2, MF_STRING | MF_BYPOSITION, ID_ABOUTBOX, TranslatedString(hResource, IDS_ABOUT).c_str());
InsertMenu(hSysMenu, menuItemsCount - 2, MF_STRING | MF_BYPOSITION, ID_CLONE, TranslatedString(hResource, IDS_CLONE).c_str());
InsertMenu(hSysMenu, menuItemsCount - 2, MF_SEPARATOR | MF_BYPOSITION, NULL, NULL);
@ -339,6 +343,8 @@ LRESULT CSearchDlg::DlgFunc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPara
AppendMenu(hSysMenu, MF_SEPARATOR, NULL, NULL);
AppendMenu(hSysMenu, MF_STRING, ID_CLONE, TranslatedString(hResource, IDS_CLONE).c_str());
AppendMenu(hSysMenu, MF_STRING, ID_ABOUTBOX, TranslatedString(hResource, IDS_ABOUT).c_str());
AppendMenu(hSysMenu, MF_SEPARATOR, NULL, NULL);
AppendMenu(hSysMenu, MF_STRING, ID_STAY_ON_TOP, TranslatedString(hResource, IDS_STAY_ON_TOP).c_str());
}
}
@ -801,6 +807,13 @@ LRESULT CSearchDlg::DlgFunc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPara
CloneWindow();
}
break;
case ID_STAY_ON_TOP:
{
m_stayOnTop = !m_stayOnTop; // toggle
SetWindowPos(*this, m_stayOnTop ? HWND_TOPMOST : HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
CheckMenuItem(GetSystemMenu(*this, FALSE), ID_STAY_ON_TOP, m_stayOnTop ? MF_BYCOMMAND | MF_CHECKED : MF_BYCOMMAND | MF_UNCHECKED);
}
break;
}
}
break;

View File

@ -42,6 +42,8 @@
#define ID_ABOUTBOX 0x0010
#define ID_CLONE 0x0011
#define ID_STAY_ON_TOP 0x0022
#define ALPHA_OPAQUE (255)
enum ExecuteAction
@ -205,6 +207,7 @@ private:
bool m_bConfirmationOnReplace;
bool m_showContent;
bool m_showContentSet;
bool m_stayOnTop;
BYTE m_OpacityNoFocus;
std::vector<CSearchInfo> m_items;

View File

@ -185,6 +185,7 @@
#define IDC_MAXNUMWORKER 3003
#define IDC_TEXT_NUMOFWORKER 3004
#define IDC_ENTRYCONTEXTMENU 3005
#define IDS_STAY_ON_TOP 3006
#define ID_REMOVEBOOKMARK 32771

View File

@ -574,6 +574,10 @@ msgstr "Scanning der Datei '%s'"
msgid "search string is empty"
msgstr "Suchstring ist leer"
#. Resource IDs: (170, 171)
msgid "Start new grepWinNP3 window"
msgstr "Starte neues grepWinNP3 Fenster"
#. Resource IDs: (114)
msgid "the path(s) which is searched recursively.\nSeparate paths with the '|' symbol.\nExample: c:\\temp|d:\\logs"
msgstr "Der Pfad bzw. die Pfade, der bzw. die rekursiv gesucht wird bzw. werden.\nSeparieren Sie Pfade mit dem '|' Symbol.\nBeispiel: c:\\temp|d:\\logs"
@ -598,3 +602,7 @@ msgstr "Max # an gleichz. Worker"
msgid "This adds a new entry to the context menu named 'Open with Editor'"
msgstr "Dies fügt dem Kontextmenü einen neuen Eintrag hinzu, benannt 'Mit Editor öffnen'."
#. Resource IDs: (3006)
msgid "Stay On Top"
msgstr "Immer als oberstes Fenster"

View File

@ -574,6 +574,10 @@ msgstr ""
msgid "search string is empty"
msgstr ""
#. Resource IDs: (170, 171)
msgid "Start new grepWinNP3 window"
msgstr ""
#. Resource IDs: (114)
msgid "the path(s) which is searched recursively.\nSeparate paths with the '|' symbol.\nExample: c:\\temp|d:\\logs"
msgstr ""
@ -598,3 +602,7 @@ msgstr ""
msgid "This adds a new entry to the context menu named 'Open with Editor'"
msgstr ""
#. Resource IDs: (3006)
msgid "Stay On Top"
msgstr ""

View File

@ -1049,9 +1049,9 @@ LRESULT MsgCreate(HWND hwnd,WPARAM wParam,LPARAM lParam)
// DirList
InitListView(hwndDirList);
ListView_InsertColumn(hwndDirList, 0, &lvc);
DirList_Init(hwndDirList, NULL);
ListView_SetExtendedListViewStyle(hwndDirList,LVS_EX_DOUBLEBUFFER|LVS_EX_LABELTIP);
DirList_Init(hwndDirList,NULL);
ListView_InsertColumn(hwndDirList, 0, &lvc);
if (Settings.bTrackSelect)
ListView_SetExtendedListViewStyleEx(hwndDirList,
LVS_EX_TRACKSELECT|LVS_EX_ONECLICKACTIVATE,
@ -1060,6 +1060,7 @@ LRESULT MsgCreate(HWND hwnd,WPARAM wParam,LPARAM lParam)
ListView_SetExtendedListViewStyleEx(hwndDirList,
LVS_EX_FULLROWSELECT,
LVS_EX_FULLROWSELECT);
SetExplorerTheme(hwndDirList);
}
ListView_SetHoverTime(hwndDirList,10);