@@ -578,9 +578,8 @@ void MultiReplace::updateListViewFrame()
578
578
MoveWindow (lv, ci.x , ci.y , ci.cx , ci.cy , TRUE );
579
579
}
580
580
581
- void MultiReplace::repaintPanelContents (HWND hGrp, const wchar_t * title)
581
+ void MultiReplace::repaintPanelContents (HWND hGrp, const std::wstring& title)
582
582
{
583
- // The control IDs within the panel.
584
583
static const std::vector<int > repInFilesIds = {
585
584
IDC_REPLACE_IN_FILES_GROUP,
586
585
IDC_FILTER_STATIC, IDC_FILTER_EDIT, IDC_FILTER_HELP,
@@ -589,26 +588,25 @@ void MultiReplace::repaintPanelContents(HWND hGrp, const wchar_t* title)
589
588
IDC_CANCEL_REPLACE_BUTTON
590
589
};
591
590
592
- // Update the title
593
- SetDlgItemText (_hSelf, IDC_REPLACE_IN_FILES_GROUP, title);
591
+ // WICHTIG: Jetzt immer eine stabile Kopie verwenden
592
+ SetDlgItemText (_hSelf, IDC_REPLACE_IN_FILES_GROUP, title. c_str () );
594
593
595
- // Get the panel's rectangle in the parent dialog's coordinates
596
594
RECT rcGrp;
597
595
GetWindowRect (hGrp, &rcGrp);
598
596
MapWindowPoints (HWND_DESKTOP, _hSelf, reinterpret_cast <LPPOINT>(&rcGrp), 2 );
599
597
600
- // 1. Erase the parent's background behind the panel to prevent artifacts
601
- RedrawWindow (_hSelf, &rcGrp, NULL , RDW_INVALIDATE | RDW_ERASE | RDW_UPDATENOW | RDW_NOCHILDREN);
598
+ RedrawWindow (_hSelf, &rcGrp, NULL ,
599
+ RDW_INVALIDATE | RDW_ERASE | RDW_UPDATENOW | RDW_NOCHILDREN);
602
600
603
- // 2. Redraw the group box's frame and title without erasing its background (no flicker)
604
- RedrawWindow (hGrp, NULL , NULL , RDW_INVALIDATE | RDW_UPDATENOW | RDW_NOERASE | RDW_NOCHILDREN | RDW_FRAME);
601
+ RedrawWindow (hGrp, NULL , NULL ,
602
+ RDW_INVALIDATE | RDW_UPDATENOW | RDW_NOERASE | RDW_NOCHILDREN | RDW_FRAME);
605
603
606
- // 3. Redraw all visible child controls inside the panel
607
604
for (int id : repInFilesIds) {
608
605
if (id == IDC_REPLACE_IN_FILES_GROUP) continue ;
609
606
HWND hChild = GetDlgItem (_hSelf, id);
610
607
if (IsWindow (hChild) && IsWindowVisible (hChild)) {
611
- RedrawWindow (hChild, NULL , NULL , RDW_INVALIDATE | RDW_UPDATENOW | RDW_NOERASE);
608
+ RedrawWindow (hChild, NULL , NULL ,
609
+ RDW_INVALIDATE | RDW_UPDATENOW | RDW_NOERASE);
612
610
}
613
611
}
614
612
}
@@ -632,18 +630,18 @@ void MultiReplace::updateReplaceInFilesVisibility()
632
630
const bool show = (isReplaceInFiles || isFindAllInFiles) && !twoButtonsMode;
633
631
634
632
// Determine title for the group box
635
- const wchar_t * titlePtr = nullptr ;
636
633
std::wstring titleKey;
634
+ std::wstring titleText;
637
635
if (isReplaceInFiles && isFindAllInFiles) {
638
- titlePtr = LM.getLPW (L" panel_find_replace_in_files" );
636
+ titleText = LM.get (L" panel_find_replace_in_files" );
639
637
titleKey = L" panel_find_replace_in_files" ;
640
638
}
641
639
else if (isFindAllInFiles) {
642
- titlePtr = LM.getLPW (L" panel_find_in_files" );
640
+ titleText = LM.get (L" panel_find_in_files" );
643
641
titleKey = L" panel_find_in_files" ;
644
642
}
645
643
else {
646
- titlePtr = LM.getLPW (L" panel_replace_in_files" );
644
+ titleText = LM.get (L" panel_replace_in_files" );
647
645
titleKey = L" panel_replace_in_files" ;
648
646
}
649
647
@@ -681,7 +679,7 @@ void MultiReplace::updateReplaceInFilesVisibility()
681
679
682
680
if (show) {
683
681
// handles the complete repaint logic for showing the panel.
684
- repaintPanelContents (hGrp, titlePtr );
682
+ repaintPanelContents (hGrp, titleText );
685
683
}
686
684
else {
687
685
// HIDE: This logic is specific to cleaning up and must remain.
@@ -729,7 +727,7 @@ void MultiReplace::updateReplaceInFilesVisibility()
729
727
{
730
728
// *** ERSETZT ***
731
729
// The helper function also handles the repaint logic for a simple title change.
732
- repaintPanelContents (hGrp, titlePtr );
730
+ repaintPanelContents (hGrp, titleText );
733
731
lastTitleKey = titleKey;
734
732
}
735
733
}
0 commit comments