mirror of
https://github.com/reactos/reactos.git
synced 2025-07-04 17:51:24 +00:00
[SYSSETUP] Adjust Status Window if Asian (#4280)
The Asian logo and bar positions are different from English or Latin positions, due to Asian font. Add positional adjustment to IDD_STATUSWINDOW_DLG if Asian.
This commit is contained in:
parent
4411668e6b
commit
ef4f0d07b1
1 changed files with 65 additions and 0 deletions
|
@ -565,6 +565,70 @@ cleanup:
|
||||||
return bRet;
|
return bRet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static VOID
|
||||||
|
AdjustStatusMessageWindow(HWND hwndDlg, PDLG_DATA pDlgData)
|
||||||
|
{
|
||||||
|
INT xOld, yOld, cxOld, cyOld;
|
||||||
|
INT xNew, yNew, cxNew, cyNew;
|
||||||
|
INT cxLabel, cyLabel, dyLabel;
|
||||||
|
RECT rc, rcBar, rcLabel, rcWnd;
|
||||||
|
BITMAP bmLogo, bmBar;
|
||||||
|
DWORD style, exstyle;
|
||||||
|
HWND hwndLogo = GetDlgItem(hwndDlg, IDC_ROSLOGO);
|
||||||
|
HWND hwndBar = GetDlgItem(hwndDlg, IDC_BAR);
|
||||||
|
HWND hwndLabel = GetDlgItem(hwndDlg, IDC_STATUSLABEL);
|
||||||
|
|
||||||
|
/* This adjustment is for CJK only */
|
||||||
|
switch (PRIMARYLANGID(GetUserDefaultLangID()))
|
||||||
|
{
|
||||||
|
case LANG_CHINESE:
|
||||||
|
case LANG_JAPANESE:
|
||||||
|
case LANG_KOREAN:
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!GetObjectW(pDlgData->hLogoBitmap, sizeof(BITMAP), &bmLogo) ||
|
||||||
|
!GetObjectW(pDlgData->hBarBitmap, sizeof(BITMAP), &bmBar))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
GetWindowRect(hwndBar, &rcBar);
|
||||||
|
MapWindowPoints(NULL, hwndDlg, (LPPOINT)&rcBar, 2);
|
||||||
|
dyLabel = bmLogo.bmHeight - rcBar.top;
|
||||||
|
|
||||||
|
GetWindowRect(hwndLabel, &rcLabel);
|
||||||
|
MapWindowPoints(NULL, hwndDlg, (LPPOINT)&rcLabel, 2);
|
||||||
|
cxLabel = rcLabel.right - rcLabel.left;
|
||||||
|
cyLabel = rcLabel.bottom - rcLabel.top;
|
||||||
|
|
||||||
|
MoveWindow(hwndLogo, 0, 0, bmLogo.bmWidth, bmLogo.bmHeight, TRUE);
|
||||||
|
MoveWindow(hwndBar, 0, bmLogo.bmHeight, bmLogo.bmWidth, bmBar.bmHeight, TRUE);
|
||||||
|
MoveWindow(hwndLabel, rcLabel.left, rcLabel.top + dyLabel, cxLabel, cyLabel, TRUE);
|
||||||
|
|
||||||
|
GetWindowRect(hwndDlg, &rcWnd);
|
||||||
|
xOld = rcWnd.left;
|
||||||
|
yOld = rcWnd.top;
|
||||||
|
cxOld = rcWnd.right - rcWnd.left;
|
||||||
|
cyOld = rcWnd.bottom - rcWnd.top;
|
||||||
|
|
||||||
|
GetClientRect(hwndDlg, &rc);
|
||||||
|
SetRect(&rc, 0, 0, bmLogo.bmWidth, rc.bottom - rc.top); /* new client size */
|
||||||
|
|
||||||
|
style = (DWORD)GetWindowLongPtrW(hwndDlg, GWL_STYLE);
|
||||||
|
exstyle = (DWORD)GetWindowLongPtrW(hwndDlg, GWL_EXSTYLE);
|
||||||
|
AdjustWindowRectEx(&rc, style, FALSE, exstyle);
|
||||||
|
|
||||||
|
cxNew = rc.right - rc.left;
|
||||||
|
cyNew = (rc.bottom - rc.top) + dyLabel;
|
||||||
|
xNew = xOld - (cxNew - cxOld) / 2;
|
||||||
|
yNew = yOld - (cyNew - cyOld) / 2;
|
||||||
|
MoveWindow(hwndDlg, xNew, yNew, cxNew, cyNew, TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
static INT_PTR CALLBACK
|
static INT_PTR CALLBACK
|
||||||
StatusMessageWindowProc(
|
StatusMessageWindowProc(
|
||||||
IN HWND hwndDlg,
|
IN HWND hwndDlg,
|
||||||
|
@ -622,6 +686,7 @@ StatusMessageWindowProc(
|
||||||
return FALSE;
|
return FALSE;
|
||||||
SetDlgItemTextW(hwndDlg, IDC_STATUSLABEL, szMsg);
|
SetDlgItemTextW(hwndDlg, IDC_STATUSLABEL, szMsg);
|
||||||
|
|
||||||
|
AdjustStatusMessageWindow(hwndDlg, pDlgData);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue