Skip to content

Commit 3e81c38

Browse files
committed
fixed Alt-Up function
1 parent 7ca6a55 commit 3e81c38

File tree

1 file changed

+16
-22
lines changed

1 file changed

+16
-22
lines changed

src/MultiReplacePanel.cpp

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2443,6 +2443,21 @@ LRESULT CALLBACK MultiReplace::ListViewSubclassProc(HWND hwnd, UINT msg, WPARAM
24432443
break;
24442444
}
24452445

2446+
case WM_SYSKEYDOWN:
2447+
{
2448+
if ((GetKeyState(VK_MENU) & 0x8000) && wParam == VK_UP) {
2449+
int iItem = ListView_GetNextItem(hwnd, -1, LVNI_SELECTED);
2450+
if (iItem >= 0) { NMITEMACTIVATE nmia{}; nmia.iItem = iItem; pThis->handleCopyBack(&nmia); }
2451+
return 0;
2452+
}
2453+
// Optional fallback for Alt+E / Alt+D
2454+
if (GetKeyState(VK_MENU) & 0x8000) {
2455+
if (wParam == 'E') { pThis->setSelections(true, ListView_GetSelectedCount(hwnd) > 0); return 0; }
2456+
if (wParam == 'D') { pThis->setSelections(false, ListView_GetSelectedCount(hwnd) > 0); return 0; }
2457+
}
2458+
break;
2459+
}
2460+
24462461
case WM_TIMER: {
24472462
if (wParam == 1) { // Tooltip re-enable timer
24482463
KillTimer(hwnd, 1); // Kill the timer first to prevent it from firing again
@@ -3279,7 +3294,6 @@ INT_PTR CALLBACK MultiReplace::run_dlgProc(UINT message, WPARAM wParam, LPARAM l
32793294
(void)lstrcpynW(plvdi->item.pszText, d.replaceCount.c_str(), plvdi->item.cchTextMax);
32803295
}
32813296
else if (columnIndices[ColumnID::SELECTION] != -1 && subItem == columnIndices[ColumnID::SELECTION]) {
3282-
// If you draw this via text (icons), supply a short glyph; if via custom draw/images, you can leave it empty.
32833297
(void)lstrcpynW(plvdi->item.pszText, d.isEnabled ? L"\u25A0" : L"\u2610", plvdi->item.cchTextMax);
32843298
}
32853299
else if (columnIndices[ColumnID::FIND_TEXT] != -1 && subItem == columnIndices[ColumnID::FIND_TEXT]) {
@@ -3307,7 +3321,6 @@ INT_PTR CALLBACK MultiReplace::run_dlgProc(UINT message, WPARAM wParam, LPARAM l
33073321
(void)lstrcpynW(plvdi->item.pszText, d.comments.c_str(), plvdi->item.cchTextMax);
33083322
}
33093323
else if (columnIndices[ColumnID::DELETE_BUTTON] != -1 && subItem == columnIndices[ColumnID::DELETE_BUTTON]) {
3310-
// If delete is text-based (✖), supply it; else leave empty and draw an image.
33113324
(void)lstrcpynW(plvdi->item.pszText, L"\u2716", plvdi->item.cchTextMax);
33123325
}
33133326
else {
@@ -3385,26 +3398,7 @@ INT_PTR CALLBACK MultiReplace::run_dlgProc(UINT message, WPARAM wParam, LPARAM l
33853398
performItemAction(_contextMenuClickPoint, ItemAction::Add);
33863399
break;
33873400
}
3388-
}
3389-
else if (GetKeyState(VK_MENU) & 0x8000) { // If Alt is pressed
3390-
switch (pnkd->wVKey) {
3391-
case 'E': // Alt+E for Enable Line
3392-
setSelections(true, ListView_GetSelectedCount(_replaceListView) > 0);
3393-
break;
3394-
case 'D': // Alt+D for Disable Line
3395-
setSelections(false, ListView_GetSelectedCount(_replaceListView) > 0);
3396-
break;
3397-
case VK_UP: // Alt+ UP for Push Back
3398-
iItem = ListView_GetNextItem(_replaceListView, -1, LVNI_SELECTED);
3399-
if (iItem >= 0) {
3400-
NMITEMACTIVATE nmia;
3401-
ZeroMemory(&nmia, sizeof(nmia));
3402-
nmia.iItem = iItem;
3403-
handleCopyBack(&nmia);
3404-
}
3405-
break;
3406-
}
3407-
}
3401+
}
34083402
else {
34093403
switch (pnkd->wVKey) {
34103404
case VK_DELETE: // Delete key for deleting selected lines

0 commit comments

Comments
 (0)