mirror of
https://github.com/reactos/reactos.git
synced 2025-08-07 04:43:01 +00:00
don't draw menu bar and scrollbars when minimized
svn path=/trunk/; revision=7274
This commit is contained in:
parent
cda2695c4c
commit
7ec1d6fece
1 changed files with 54 additions and 49 deletions
|
@ -394,59 +394,64 @@ DefWndNCPaint(HWND hWnd, HRGN hRgn)
|
||||||
UserDrawCaptionButton(&TempRect, Style, ExStyle, hDC, FALSE, DFCS_CAPTIONMAX);
|
UserDrawCaptionButton(&TempRect, Style, ExStyle, hDC, FALSE, DFCS_CAPTIONMAX);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(!(Style & WS_MINIMIZE))
|
||||||
/* Line under caption */
|
|
||||||
PreviousPen = SelectObject(hDC, GetSysColorPen(
|
|
||||||
((ExStyle & (WS_EX_STATICEDGE | WS_EX_CLIENTEDGE |
|
|
||||||
WS_EX_DLGMODALFRAME)) == WS_EX_STATICEDGE) ?
|
|
||||||
COLOR_WINDOWFRAME : COLOR_3DFACE));
|
|
||||||
MoveToEx(hDC, TempRect.left, TempRect.bottom, NULL);
|
|
||||||
LineTo(hDC, TempRect.right, TempRect.bottom);
|
|
||||||
SelectObject(hDC, PreviousPen);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Draw menu bar */
|
|
||||||
if (UserHasMenu(hWnd, Style))
|
|
||||||
{
|
|
||||||
TempRect = CurrentRect;
|
|
||||||
TempRect.bottom = TempRect.top + GetSystemMetrics(SM_CYMENU);
|
|
||||||
CurrentRect.top += MenuDrawMenuBar(hDC, &TempRect, hWnd, FALSE);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ExStyle & WS_EX_CLIENTEDGE)
|
|
||||||
{
|
|
||||||
DrawEdge(hDC, &CurrentRect, EDGE_SUNKEN, BF_RECT | BF_ADJUST);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Draw the scrollbars */
|
|
||||||
if ((Style & WS_VSCROLL) && (Style & WS_HSCROLL) &&
|
|
||||||
(CurrentRect.bottom - CurrentRect.top) > GetSystemMetrics(SM_CYHSCROLL))
|
|
||||||
{
|
|
||||||
TempRect = CurrentRect;
|
|
||||||
if (ExStyle & WS_EX_LEFTSCROLLBAR)
|
|
||||||
TempRect.right = TempRect.left + GetSystemMetrics(SM_CXVSCROLL);
|
|
||||||
else
|
|
||||||
TempRect.left = TempRect.right - GetSystemMetrics(SM_CXVSCROLL);
|
|
||||||
TempRect.top = TempRect.bottom - GetSystemMetrics(SM_CYHSCROLL);
|
|
||||||
FillRect(hDC, &TempRect, GetSysColorBrush(COLOR_SCROLLBAR));
|
|
||||||
/* FIXME: Correct drawing of size-box with WS_EX_LEFTSCROLLBAR */
|
|
||||||
if (!(Style & WS_CHILD) || (ExStyle & WS_EX_MDICHILD))
|
|
||||||
{
|
{
|
||||||
TempRect.top--;
|
/* Line under caption */
|
||||||
TempRect.bottom++;
|
PreviousPen = SelectObject(hDC, GetSysColorPen(
|
||||||
TempRect.left--;
|
((ExStyle & (WS_EX_STATICEDGE | WS_EX_CLIENTEDGE |
|
||||||
TempRect.right++;
|
WS_EX_DLGMODALFRAME)) == WS_EX_STATICEDGE) ?
|
||||||
DrawFrameControl(hDC, &TempRect, DFC_SCROLL, DFCS_SCROLLSIZEGRIP);
|
COLOR_WINDOWFRAME : COLOR_3DFACE));
|
||||||
|
MoveToEx(hDC, TempRect.left, TempRect.bottom, NULL);
|
||||||
|
LineTo(hDC, TempRect.right, TempRect.bottom);
|
||||||
|
SelectObject(hDC, PreviousPen);
|
||||||
}
|
}
|
||||||
IntDrawScrollBar(hWnd, hDC, SB_VERT);
|
|
||||||
IntDrawScrollBar(hWnd, hDC, SB_HORZ);
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
if(!(Style & WS_MINIMIZE))
|
||||||
{
|
{
|
||||||
if (Style & WS_VSCROLL)
|
/* Draw menu bar */
|
||||||
IntDrawScrollBar(hWnd, hDC, SB_VERT);
|
if (UserHasMenu(hWnd, Style))
|
||||||
else if (Style & WS_HSCROLL)
|
{
|
||||||
IntDrawScrollBar(hWnd, hDC, SB_HORZ);
|
TempRect = CurrentRect;
|
||||||
|
TempRect.bottom = TempRect.top + GetSystemMetrics(SM_CYMENU);
|
||||||
|
CurrentRect.top += MenuDrawMenuBar(hDC, &TempRect, hWnd, FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ExStyle & WS_EX_CLIENTEDGE)
|
||||||
|
{
|
||||||
|
DrawEdge(hDC, &CurrentRect, EDGE_SUNKEN, BF_RECT | BF_ADJUST);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Draw the scrollbars */
|
||||||
|
if ((Style & WS_VSCROLL) && (Style & WS_HSCROLL) &&
|
||||||
|
(CurrentRect.bottom - CurrentRect.top) > GetSystemMetrics(SM_CYHSCROLL))
|
||||||
|
{
|
||||||
|
TempRect = CurrentRect;
|
||||||
|
if (ExStyle & WS_EX_LEFTSCROLLBAR)
|
||||||
|
TempRect.right = TempRect.left + GetSystemMetrics(SM_CXVSCROLL);
|
||||||
|
else
|
||||||
|
TempRect.left = TempRect.right - GetSystemMetrics(SM_CXVSCROLL);
|
||||||
|
TempRect.top = TempRect.bottom - GetSystemMetrics(SM_CYHSCROLL);
|
||||||
|
FillRect(hDC, &TempRect, GetSysColorBrush(COLOR_SCROLLBAR));
|
||||||
|
/* FIXME: Correct drawing of size-box with WS_EX_LEFTSCROLLBAR */
|
||||||
|
if (!(Style & WS_CHILD) || (ExStyle & WS_EX_MDICHILD))
|
||||||
|
{
|
||||||
|
TempRect.top--;
|
||||||
|
TempRect.bottom++;
|
||||||
|
TempRect.left--;
|
||||||
|
TempRect.right++;
|
||||||
|
DrawFrameControl(hDC, &TempRect, DFC_SCROLL, DFCS_SCROLLSIZEGRIP);
|
||||||
|
}
|
||||||
|
IntDrawScrollBar(hWnd, hDC, SB_VERT);
|
||||||
|
IntDrawScrollBar(hWnd, hDC, SB_HORZ);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (Style & WS_VSCROLL)
|
||||||
|
IntDrawScrollBar(hWnd, hDC, SB_VERT);
|
||||||
|
else if (Style & WS_HSCROLL)
|
||||||
|
IntDrawScrollBar(hWnd, hDC, SB_HORZ);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ReleaseDC(hWnd, hDC);
|
ReleaseDC(hWnd, hDC);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue