mirror of
https://github.com/reactos/reactos.git
synced 2024-05-19 20:02:03 +00:00
[0.4.9][COMCTL32] status.c sizegrip-backports 2024-04-15
This ports back 3 commits: 0.4.15-dev-7861-ga771729e69
[COMCTL32] Fix Status Bar Updating (#6696) which fixes CORE-19497 'Regression, part of the statusbar with the sizegrip is not redrawn properly' which regressed on this branch by 0.4.9-release-221-g3def98d876
also port back: 0.4.13-dev-888-g76dfa2b284
[COMCTL32] Checking size grip bounds in x-axis only (#991) 0.4.13-dev-887-gb9ddad0bbb
[COMCTL32] Hide size grip when the parent window is maximized CORE-15240 (#991) To compensate binary increase, I stripped a few TRACE's and the debugstr_t() function in the older branches. comctl32.dll binary therefore has a tendency to shrink a tiny bit on most branches: comctl32.dll master RosBEWin2.2.2 GCC8.4.0dbg 2.001.408 (0.4.15-dev-7906-g1b85a5f) comctl32.dll 0.4.14rls RosBEWin2.2.1 GCC8.4.0dbg 1.998.336 -> 1.997.824 comctl32.dll 0.4.14rls RosBEWin2.1.6 GCC4.7.2dbg 1.807.872 -> 1.807.360 comctl32.dll 0.4.13rls RosBEWin2.1.6 GCC4.7.2dbg 1.804.800 -> 1.803.264 comctl32.dll 0.4.12rls RosBEWin2.1.6 GCC4.7.2dbg 1.817.600 -> 1.817.088 comctl32.dll 0.4.11rls RosBEWin2.1.6 GCC4.7.2dbg 1.809.920 -> 1.809.408 comctl32.dll 0.4.10rls RosBEWin2.1.6 GCC4.7.2dbg 1.806.848 -> 1.806.848 comctl32.dll 0.4. 9rls RosBEWin2.1.6 GCC4.7.2dbg 1.806.848 -> 1.806.848 comctl32.dll 0.4. 8rls RosBEWin2.1.6 GCC4.7.2dbg 1.633.792 -> 1.632.768 comctl32.dll 0.4. 7rls RosBEWin2.1.6 GCC4.7.2dbg 1.602.048 -> 1.602.048
This commit is contained in:
parent
b4c8f69545
commit
27df8ce0fd
|
@ -95,11 +95,6 @@ STATUSBAR_SetPartBounds (STATUS_INFO *infoPtr);
|
|||
static LRESULT
|
||||
STATUSBAR_NotifyFormat (STATUS_INFO *infoPtr, HWND from, INT cmd);
|
||||
|
||||
static inline LPCSTR debugstr_t(LPCWSTR text, BOOL isW)
|
||||
{
|
||||
return isW ? debugstr_w(text) : debugstr_a((LPCSTR)text);
|
||||
}
|
||||
|
||||
static UINT
|
||||
STATUSBAR_ComputeHeight(STATUS_INFO *infoPtr)
|
||||
{
|
||||
|
@ -291,7 +286,8 @@ STATUSBAR_Refresh (STATUS_INFO *infoPtr, HDC hdc)
|
|||
|
||||
SelectObject (hdc, hOldFont);
|
||||
|
||||
if (GetWindowLongW (infoPtr->Self, GWL_STYLE) & SBARS_SIZEGRIP)
|
||||
if ((GetWindowLongW (infoPtr->Self, GWL_STYLE) & SBARS_SIZEGRIP)
|
||||
&& !(GetWindowLongW (infoPtr->Notify, GWL_STYLE) & WS_MAXIMIZE))
|
||||
STATUSBAR_DrawSizeGrip (theme, hdc, &rect);
|
||||
|
||||
return 0;
|
||||
|
@ -705,11 +701,6 @@ STATUSBAR_SetTextT (STATUS_INFO *infoPtr, INT nPart, WORD style,
|
|||
BOOL changed = FALSE;
|
||||
INT oldStyle;
|
||||
|
||||
if (style & SBT_OWNERDRAW) {
|
||||
TRACE("part %d, text %p\n",nPart,text);
|
||||
}
|
||||
else TRACE("part %d, text %s\n", nPart, debugstr_t(text, isW));
|
||||
|
||||
/* MSDN says: "If the parameter is set to SB_SIMPLEID (255), the status
|
||||
* window is assumed to be a simple window */
|
||||
|
||||
|
@ -1004,7 +995,8 @@ STATUSBAR_WMGetText (const STATUS_INFO *infoPtr, INT size, LPWSTR buf)
|
|||
static BOOL
|
||||
STATUSBAR_WMNCHitTest (const STATUS_INFO *infoPtr, INT x, INT y)
|
||||
{
|
||||
if (GetWindowLongW (infoPtr->Self, GWL_STYLE) & SBARS_SIZEGRIP) {
|
||||
if ((GetWindowLongW (infoPtr->Self, GWL_STYLE) & SBARS_SIZEGRIP)
|
||||
&& !(GetWindowLongW (infoPtr->Notify, GWL_STYLE) & WS_MAXIMIZE)) {
|
||||
RECT rect;
|
||||
POINT pt;
|
||||
|
||||
|
@ -1014,10 +1006,7 @@ STATUSBAR_WMNCHitTest (const STATUS_INFO *infoPtr, INT x, INT y)
|
|||
pt.y = y;
|
||||
ScreenToClient (infoPtr->Self, &pt);
|
||||
|
||||
rect.left = rect.right - 13;
|
||||
rect.top += 2;
|
||||
|
||||
if (PtInRect (&rect, pt))
|
||||
if (pt.x >= rect.right - GetSystemMetrics(SM_CXVSCROLL))
|
||||
{
|
||||
if (GetWindowLongW( infoPtr->Self, GWL_EXSTYLE ) & WS_EX_LAYOUTRTL) return HTBOTTOMLEFT;
|
||||
else return HTBOTTOMRIGHT;
|
||||
|
@ -1033,7 +1022,6 @@ STATUSBAR_WMPaint (STATUS_INFO *infoPtr, HDC hdc)
|
|||
{
|
||||
PAINTSTRUCT ps;
|
||||
|
||||
TRACE("\n");
|
||||
if (hdc) return STATUSBAR_Refresh (infoPtr, hdc);
|
||||
hdc = BeginPaint (infoPtr->Self, &ps);
|
||||
STATUSBAR_Refresh (infoPtr, hdc);
|
||||
|
@ -1064,7 +1052,6 @@ STATUSBAR_WMSetText (const STATUS_INFO *infoPtr, LPCSTR text)
|
|||
STATUSWINDOWPART *part;
|
||||
int len;
|
||||
|
||||
TRACE("\n");
|
||||
if (infoPtr->numParts == 0)
|
||||
return FALSE;
|
||||
|
||||
|
@ -1092,7 +1079,6 @@ STATUSBAR_WMSize (STATUS_INFO *infoPtr, WORD flags)
|
|||
RECT parent_rect;
|
||||
|
||||
/* Need to resize width to match parent */
|
||||
TRACE("flags %04x\n", flags);
|
||||
|
||||
if (flags != SIZE_RESTORED && flags != SIZE_MAXIMIZED) {
|
||||
WARN("flags MUST be SIZE_RESTORED or SIZE_MAXIMIZED\n");
|
||||
|
@ -1110,6 +1096,10 @@ STATUSBAR_WMSize (STATUS_INFO *infoPtr, WORD flags)
|
|||
y = parent_rect.bottom - infoPtr->height;
|
||||
MoveWindow (infoPtr->Self, x, y, width, infoPtr->height, TRUE);
|
||||
STATUSBAR_SetPartBounds (infoPtr);
|
||||
#ifdef __REACTOS__
|
||||
parent_rect = infoPtr->parts[infoPtr->numParts - 1].bound;
|
||||
InvalidateRect(infoPtr->Self, &parent_rect, TRUE);
|
||||
#endif
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue