[PowerRename] Split "status message" / "items count label" into two lines (#7696)

* Split status message

* Use spaces instead of tabs
This commit is contained in:
Mehmet Murat Akburak
2020-10-31 11:25:16 +03:00
committed by GitHub
parent 1777fca0e3
commit 7ff8b97006
5 changed files with 55 additions and 34 deletions

View File

@@ -63,7 +63,8 @@ RepositionMap g_repositionMap[] = {
{ IDC_EDIT_SEARCHFOR, Reposition_Width },
{ IDC_EDIT_REPLACEWITH, Reposition_Width },
{ IDC_LIST_PREVIEW, Reposition_Width | Reposition_Height },
{ IDC_STATUS_MESSAGE, Reposition_Y },
{ IDC_STATUS_MESSAGE_SELECTED, Reposition_Y },
{ IDC_STATUS_MESSAGE_RENAMING, Reposition_Y },
{ ID_RENAME, Reposition_X | Reposition_Y },
{ ID_ABOUT, Reposition_X | Reposition_Y },
{ IDCANCEL, Reposition_X | Reposition_Y }
@@ -679,7 +680,8 @@ void CPowerRenameUI::_InitDlgText()
UpdateDlgControl(m_hwnd, IDCANCEL, IDS_CANCEL_BUTTON);
UpdateDlgControl(m_hwnd, IDC_SEARCH_FOR, IDS_SEARCH_FOR);
UpdateDlgControl(m_hwnd, IDC_REPLACE_WITH, IDS_REPLACE_WITH);
UpdateDlgControl(m_hwnd, IDC_STATUS_MESSAGE, IDS_ITEMS_SELECTED);
UpdateDlgControl(m_hwnd, IDC_STATUS_MESSAGE_SELECTED, IDS_ITEMS_SELECTED);
UpdateDlgControl(m_hwnd, IDC_STATUS_MESSAGE_RENAMING, IDS_ITEMS_RENAMING);
UpdateDlgControl(m_hwnd, IDC_OPTIONSGROUP, IDS_OPTIONS);
UpdateDlgControl(m_hwnd, IDC_PREVIEWGROUP, IDS_PREVIEW);
UpdateDlgControl(m_hwnd, IDC_SEARCHREPLACEGROUP, IDS_RENAME_CRITERIA);
@@ -868,8 +870,11 @@ void CPowerRenameUI::_MoveControl(_In_ DWORD id, _In_ DWORD repositionFlags)
width = mainWindowWidth - static_cast<int>(m_itemsPositioning.listPreviewWidthDiff * scale);
height = mainWindowHeight - static_cast<int>(m_itemsPositioning.listPreviewHeightDiff * scale);
break;
case IDC_STATUS_MESSAGE:
y = mainWindowHeight - static_cast<int>(m_itemsPositioning.statusMessageYDiff * scale);
case IDC_STATUS_MESSAGE_SELECTED:
y = mainWindowHeight - static_cast<int>(m_itemsPositioning.statusMessageSelectedYDiff * scale);
break;
case IDC_STATUS_MESSAGE_RENAMING:
y = mainWindowHeight - static_cast<int>(m_itemsPositioning.statusMessageRenamingYDiff * scale);
break;
case ID_RENAME:
x = mainWindowWidth - static_cast<int>(m_itemsPositioning.renameButtonXDiff * scale);
@@ -1000,12 +1005,17 @@ void CPowerRenameUI::_UpdateCounts()
m_renamingCount = renamingCount;
// Update selected and rename count label
wchar_t countsLabelFormat[100] = { 0 };
LoadString(g_hInst, IDS_COUNTSLABELFMT, countsLabelFormat, ARRAYSIZE(countsLabelFormat));
wchar_t countsLabelFormatSelected[100] = { 0 };
wchar_t countsLabelFormatRenaming[100] = { 0 };
LoadString(g_hInst, IDS_COUNTSLABELSELECTEDFMT, countsLabelFormatSelected, ARRAYSIZE(countsLabelFormatSelected));
LoadString(g_hInst, IDS_COUNTSLABELRENAMINGFMT, countsLabelFormatRenaming, ARRAYSIZE(countsLabelFormatRenaming));
wchar_t countsLabel[100] = { 0 };
StringCchPrintf(countsLabel, ARRAYSIZE(countsLabel), countsLabelFormat, selectedCount, renamingCount);
SetDlgItemText(m_hwnd, IDC_STATUS_MESSAGE, countsLabel);
wchar_t countsLabelSelected[100] = { 0 };
wchar_t countsLabelRenaming[100] = { 0 };
StringCchPrintf(countsLabelSelected, ARRAYSIZE(countsLabelSelected), countsLabelFormatSelected, selectedCount);
StringCchPrintf(countsLabelRenaming, ARRAYSIZE(countsLabelRenaming), countsLabelFormatRenaming, renamingCount);
SetDlgItemText(m_hwnd, IDC_STATUS_MESSAGE_SELECTED, countsLabelSelected);
SetDlgItemText(m_hwnd, IDC_STATUS_MESSAGE_RENAMING, countsLabelRenaming);
// Update Rename button state
EnableWindow(GetDlgItem(m_hwnd, ID_RENAME), (renamingCount > 0));
@@ -1039,8 +1049,11 @@ void CPowerRenameUI::_CollectItemPosition(_In_ DWORD id)
m_itemsPositioning.listPreviewWidthDiff = m_initialWidth - itemWidth;
m_itemsPositioning.listPreviewHeightDiff = m_initialHeight - itemHeight;
break;
case IDC_STATUS_MESSAGE:
m_itemsPositioning.statusMessageYDiff = m_initialHeight - rcWindow.top;
case IDC_STATUS_MESSAGE_SELECTED:
m_itemsPositioning.statusMessageSelectedYDiff = m_initialHeight - rcWindow.top;
break;
case IDC_STATUS_MESSAGE_RENAMING:
m_itemsPositioning.statusMessageRenamingYDiff = m_initialHeight - rcWindow.top;
break;
case ID_RENAME:
m_itemsPositioning.renameButtonXDiff = m_initialWidth - rcWindow.left;

View File

@@ -83,7 +83,8 @@ private:
int searchReplaceWidthDiff;
int listPreviewWidthDiff;
int listPreviewHeightDiff;
int statusMessageYDiff;
int statusMessageSelectedYDiff;
int statusMessageRenamingYDiff;
int renameButtonXDiff;
int renameButtonYDiff;
int helpButtonXDiff;

View File

@@ -133,8 +133,11 @@ Please select from the options above to show items.</value>
<data name="Entireitemname" xml:space="preserve">
<value>Item Name and Extension</value>
</data>
<data name="Countslabelfmt" xml:space="preserve">
<value>Items Selected: %u | Renaming: %u</value>
<data name="Countslabelselectedfmt" xml:space="preserve">
<value>Items Selected: %u</value>
</data>
<data name="Countslabelrenamingfmt" xml:space="preserve">
<value>Items Renaming: %u</value>
</data>
<data name="Use_Regex" xml:space="preserve">
<value>Use Regular Expressions</value>
@@ -188,7 +191,10 @@ Please select from the options above to show items.</value>
<value>Replace with:</value>
</data>
<data name="Items_Selected" xml:space="preserve">
<value>Items Selected: 0 | Renaming: 0</value>
<value>Items Selected: 0</value>
</data>
<data name="Items_Renaming" xml:space="preserve">
<value>Items Renaming: 0</value>
</data>
<data name="Options" xml:space="preserve">
<value>Options</value>

View File

@@ -10,24 +10,25 @@
#define IDC_EDIT_REPLACEWITH 3003
#define IDC_LIST_PREVIEW 3004
#define IDC_CHECK_USEREGEX 3005
#define IDC_STATUS_MESSAGE 3006
#define IDC_CHECK_EXCLUDESUBFOLDERS 3007
#define IDC_CHECK_ENUMITEMS 3008
#define IDC_CHECK_EXCLUDEFILES 3009
#define IDC_CHECK_CASESENSITIVE 3010
#define IDC_CHECK_MATCHALLOCCURENCES 3011
#define IDC_CHECK_EXCLUDEFOLDERS 3012
#define IDC_CHECK_NAMEONLY 3013
#define IDC_CHECK_EXTENSIONONLY 3014
#define IDC_PREVIEWGROUP 3015
#define IDC_OPTIONSGROUP 3016
#define IDC_SEARCHREPLACEGROUP 3017
#define IDC_TRANSFORM_UPPERCASE 3018
#define IDC_TRANSFORM_LOWERCASE 3019
#define IDC_TRANSFORM_TITLECASE 3020
#define IDC_SEARCH_FOR 3021
#define IDC_REPLACE_WITH 3022
#define IDC_STATUS_MESSAGE_SELECTED 3006
#define IDC_STATUS_MESSAGE_RENAMING 3007
#define IDC_CHECK_EXCLUDESUBFOLDERS 3008
#define IDC_CHECK_ENUMITEMS 3009
#define IDC_CHECK_EXCLUDEFILES 3010
#define IDC_CHECK_CASESENSITIVE 3011
#define IDC_CHECK_MATCHALLOCCURENCES 3012
#define IDC_CHECK_EXCLUDEFOLDERS 3013
#define IDC_CHECK_NAMEONLY 3014
#define IDC_CHECK_EXTENSIONONLY 3015
#define IDC_PREVIEWGROUP 3016
#define IDC_OPTIONSGROUP 3017
#define IDC_SEARCHREPLACEGROUP 3018
#define IDC_TRANSFORM_UPPERCASE 3019
#define IDC_TRANSFORM_LOWERCASE 3020
#define IDC_TRANSFORM_TITLECASE 3021
#define IDC_SEARCH_FOR 3022
#define IDC_REPLACE_WITH 3023
#define IDC_STATIC -1
#define IDR_MAINFRAME 3023
#define IDD_MAIN 3024
#define IDR_MAINFRAME 3024
#define IDD_MAIN 3025
#define IDI_RENAME 2001