mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 02:32:57 +00:00
[UXTHEME] nonclient.c: Formatting only
This commit is contained in:
parent
118869f69c
commit
fa29a61271
1 changed files with 85 additions and 86 deletions
|
@ -35,7 +35,8 @@ BOOL
|
||||||
IsScrollBarVisible(HWND hWnd, INT hBar)
|
IsScrollBarVisible(HWND hWnd, INT hBar)
|
||||||
{
|
{
|
||||||
SCROLLBARINFO sbi = {sizeof(SCROLLBARINFO)};
|
SCROLLBARINFO sbi = {sizeof(SCROLLBARINFO)};
|
||||||
if(!GetScrollBarInfo(hWnd, hBar, &sbi))
|
|
||||||
|
if (!GetScrollBarInfo(hWnd, hBar, &sbi))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
return !(sbi.rgstate[0] & STATE_SYSTEM_OFFSCREEN);
|
return !(sbi.rgstate[0] & STATE_SYSTEM_OFFSCREEN);
|
||||||
|
@ -115,10 +116,10 @@ HRESULT WINAPI ThemeDrawCaptionText(PDRAW_CONTEXT pcontext, RECT* pRect, int iPa
|
||||||
InternalGetWindowText(pcontext->hWnd, pszText, len);
|
InternalGetWindowText(pcontext->hWnd, pszText, len);
|
||||||
|
|
||||||
hr = GetThemeSysFont(pcontext->theme, TMT_CAPTIONFONT, &logfont);
|
hr = GetThemeSysFont(pcontext->theme, TMT_CAPTIONFONT, &logfont);
|
||||||
if(SUCCEEDED(hr))
|
if (SUCCEEDED(hr))
|
||||||
hFont = CreateFontIndirectW(&logfont);
|
hFont = CreateFontIndirectW(&logfont);
|
||||||
|
|
||||||
if(hFont)
|
if (hFont)
|
||||||
oldFont = SelectObject(pcontext->hDC, hFont);
|
oldFont = SelectObject(pcontext->hDC, hFont);
|
||||||
|
|
||||||
textColor = GetThemeSysColor(pcontext->theme, pcontext->Active ? COLOR_CAPTIONTEXT : COLOR_INACTIVECAPTIONTEXT);
|
textColor = GetThemeSysColor(pcontext->theme, pcontext->Active ? COLOR_CAPTIONTEXT : COLOR_INACTIVECAPTIONTEXT);
|
||||||
|
@ -168,7 +169,7 @@ ThemeInitDrawContext(PDRAW_CONTEXT pcontext,
|
||||||
pcontext->CaptionHeight = pcontext->wi.cyWindowBorders;
|
pcontext->CaptionHeight = pcontext->wi.cyWindowBorders;
|
||||||
pcontext->CaptionHeight += GetSystemMetrics(pcontext->wi.dwExStyle & WS_EX_TOOLWINDOW ? SM_CYSMCAPTION : SM_CYCAPTION );
|
pcontext->CaptionHeight += GetSystemMetrics(pcontext->wi.dwExStyle & WS_EX_TOOLWINDOW ? SM_CYSMCAPTION : SM_CYCAPTION );
|
||||||
|
|
||||||
if(hRgn <= (HRGN)1)
|
if (hRgn <= (HRGN)1)
|
||||||
{
|
{
|
||||||
hRgn = CreateRectRgnIndirect(&pcontext->wi.rcWindow);
|
hRgn = CreateRectRgnIndirect(&pcontext->wi.rcWindow);
|
||||||
}
|
}
|
||||||
|
@ -182,7 +183,7 @@ ThemeCleanupDrawContext(PDRAW_CONTEXT pcontext)
|
||||||
{
|
{
|
||||||
ReleaseDC(pcontext->hWnd ,pcontext->hDC);
|
ReleaseDC(pcontext->hWnd ,pcontext->hDC);
|
||||||
|
|
||||||
if(pcontext->hRgn != NULL)
|
if (pcontext->hRgn != NULL)
|
||||||
{
|
{
|
||||||
DeleteObject(pcontext->hRgn);
|
DeleteObject(pcontext->hRgn);
|
||||||
}
|
}
|
||||||
|
@ -221,7 +222,7 @@ static void ThemeCalculateCaptionButtonsPosEx(WINDOWINFO* wi, HWND hWnd, HTHEME
|
||||||
|
|
||||||
/* First of all check if we have something to do here */
|
/* First of all check if we have something to do here */
|
||||||
style = GetWindowLongW(hWnd, GWL_STYLE);
|
style = GetWindowLongW(hWnd, GWL_STYLE);
|
||||||
if((style & (WS_CAPTION | WS_SYSMENU)) != (WS_CAPTION | WS_SYSMENU))
|
if ((style & (WS_CAPTION | WS_SYSMENU)) != (WS_CAPTION | WS_SYSMENU))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Get theme data for this window */
|
/* Get theme data for this window */
|
||||||
|
@ -270,7 +271,8 @@ void ThemeCalculateCaptionButtonsPos(HWND hWnd, HTHEME htheme)
|
||||||
{
|
{
|
||||||
INT btnHeight;
|
INT btnHeight;
|
||||||
WINDOWINFO wi = {sizeof(wi)};
|
WINDOWINFO wi = {sizeof(wi)};
|
||||||
if(!GetWindowInfo(hWnd, &wi))
|
|
||||||
|
if (!GetWindowInfo(hWnd, &wi))
|
||||||
return;
|
return;
|
||||||
btnHeight = GetSystemMetrics(wi.dwExStyle & WS_EX_TOOLWINDOW ? SM_CYSMSIZE : SM_CYSIZE);
|
btnHeight = GetSystemMetrics(wi.dwExStyle & WS_EX_TOOLWINDOW ? SM_CYSMSIZE : SM_CYSIZE);
|
||||||
|
|
||||||
|
@ -566,10 +568,10 @@ static void ThemeDrawScrollBarsGrip(PDRAW_CONTEXT pcontext, RECT* prcCurrent)
|
||||||
static void
|
static void
|
||||||
ThemePaintWindow(PDRAW_CONTEXT pcontext, RECT* prcCurrent, BOOL bDoDoubleBuffering)
|
ThemePaintWindow(PDRAW_CONTEXT pcontext, RECT* prcCurrent, BOOL bDoDoubleBuffering)
|
||||||
{
|
{
|
||||||
if(!(pcontext->wi.dwStyle & WS_VISIBLE))
|
if (!(pcontext->wi.dwStyle & WS_VISIBLE))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if((pcontext->wi.dwStyle & WS_CAPTION)==WS_CAPTION)
|
if ((pcontext->wi.dwStyle & WS_CAPTION)==WS_CAPTION)
|
||||||
{
|
{
|
||||||
if (bDoDoubleBuffering)
|
if (bDoDoubleBuffering)
|
||||||
ThemeStartBufferedPaint(pcontext, prcCurrent->right, pcontext->CaptionHeight);
|
ThemeStartBufferedPaint(pcontext, prcCurrent->right, pcontext->CaptionHeight);
|
||||||
|
@ -583,24 +585,24 @@ ThemePaintWindow(PDRAW_CONTEXT pcontext, RECT* prcCurrent, BOOL bDoDoubleBufferi
|
||||||
DrawClassicFrame(pcontext, prcCurrent);
|
DrawClassicFrame(pcontext, prcCurrent);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(pcontext->wi.dwStyle & WS_MINIMIZE)
|
if (pcontext->wi.dwStyle & WS_MINIMIZE)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(HAS_MENU(pcontext->hWnd, pcontext->wi.dwStyle))
|
if (HAS_MENU(pcontext->hWnd, pcontext->wi.dwStyle))
|
||||||
ThemeDrawMenuBar(pcontext, prcCurrent);
|
ThemeDrawMenuBar(pcontext, prcCurrent);
|
||||||
|
|
||||||
if (pcontext->wi.dwExStyle & WS_EX_CLIENTEDGE)
|
if (pcontext->wi.dwExStyle & WS_EX_CLIENTEDGE)
|
||||||
DrawEdge(pcontext->hDC, prcCurrent, EDGE_SUNKEN, BF_RECT | BF_ADJUST);
|
DrawEdge(pcontext->hDC, prcCurrent, EDGE_SUNKEN, BF_RECT | BF_ADJUST);
|
||||||
|
|
||||||
if((pcontext->wi.dwStyle & WS_HSCROLL) && IsScrollBarVisible(pcontext->hWnd, OBJID_HSCROLL))
|
if ((pcontext->wi.dwStyle & WS_HSCROLL) && IsScrollBarVisible(pcontext->hWnd, OBJID_HSCROLL))
|
||||||
ThemeDrawScrollBar(pcontext, SB_HORZ , NULL);
|
ThemeDrawScrollBar(pcontext, SB_HORZ , NULL);
|
||||||
|
|
||||||
if((pcontext->wi.dwStyle & WS_VSCROLL) && IsScrollBarVisible(pcontext->hWnd, OBJID_VSCROLL))
|
if ((pcontext->wi.dwStyle & WS_VSCROLL) && IsScrollBarVisible(pcontext->hWnd, OBJID_VSCROLL))
|
||||||
ThemeDrawScrollBar(pcontext, SB_VERT, NULL);
|
ThemeDrawScrollBar(pcontext, SB_VERT, NULL);
|
||||||
|
|
||||||
if((pcontext->wi.dwStyle & (WS_HSCROLL|WS_VSCROLL)) == (WS_HSCROLL|WS_VSCROLL) &&
|
if ((pcontext->wi.dwStyle & (WS_HSCROLL|WS_VSCROLL)) == (WS_HSCROLL|WS_VSCROLL) &&
|
||||||
IsScrollBarVisible(pcontext->hWnd, OBJID_HSCROLL) &&
|
IsScrollBarVisible(pcontext->hWnd, OBJID_HSCROLL) &&
|
||||||
IsScrollBarVisible(pcontext->hWnd, OBJID_VSCROLL))
|
IsScrollBarVisible(pcontext->hWnd, OBJID_VSCROLL))
|
||||||
{
|
{
|
||||||
ThemeDrawScrollBarsGrip(pcontext, prcCurrent);
|
ThemeDrawScrollBarsGrip(pcontext, prcCurrent);
|
||||||
}
|
}
|
||||||
|
@ -637,7 +639,7 @@ ThemeHandleNcMouseMove(HWND hWnd, DWORD ht, POINT* pt)
|
||||||
|
|
||||||
/* First of all check if we have something to do here */
|
/* First of all check if we have something to do here */
|
||||||
style = GetWindowLongW(hWnd, GWL_STYLE);
|
style = GetWindowLongW(hWnd, GWL_STYLE);
|
||||||
if((style & (WS_CAPTION|WS_HSCROLL|WS_VSCROLL))==0)
|
if ((style & (WS_CAPTION|WS_HSCROLL|WS_VSCROLL))==0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/* Get theme data for this window */
|
/* Get theme data for this window */
|
||||||
|
@ -691,7 +693,7 @@ ThemeHandleNcMouseLeave(HWND hWnd)
|
||||||
|
|
||||||
/* First of all check if we have something to do here */
|
/* First of all check if we have something to do here */
|
||||||
style = GetWindowLongW(hWnd, GWL_STYLE);
|
style = GetWindowLongW(hWnd, GWL_STYLE);
|
||||||
if((style & (WS_CAPTION|WS_HSCROLL|WS_VSCROLL))==0)
|
if ((style & (WS_CAPTION|WS_HSCROLL|WS_VSCROLL))==0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/* Get theme data for this window */
|
/* Get theme data for this window */
|
||||||
|
@ -794,7 +796,6 @@ ThemeHandleButton(HWND hWnd, WPARAM wParam)
|
||||||
SendMessageW(hWnd, WM_SYSCOMMAND, SCMsg, 0);
|
SendMessageW(hWnd, WM_SYSCOMMAND, SCMsg, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static LRESULT
|
static LRESULT
|
||||||
DefWndNCHitTest(HWND hWnd, POINT Point)
|
DefWndNCHitTest(HWND hWnd, POINT Point)
|
||||||
{
|
{
|
||||||
|
@ -825,9 +826,9 @@ DefWndNCHitTest(HWND hWnd, POINT Point)
|
||||||
ThickFrame = (wi.dwStyle & WS_THICKFRAME);
|
ThickFrame = (wi.dwStyle & WS_THICKFRAME);
|
||||||
if (Point.y < WindowRect.top)
|
if (Point.y < WindowRect.top)
|
||||||
{
|
{
|
||||||
if(wi.dwStyle & WS_MINIMIZE)
|
if (wi.dwStyle & WS_MINIMIZE)
|
||||||
return HTCAPTION;
|
return HTCAPTION;
|
||||||
if(!ThickFrame)
|
if (!ThickFrame)
|
||||||
return HTBORDER;
|
return HTBORDER;
|
||||||
if (Point.x < (WindowRect.left + XSize))
|
if (Point.x < (WindowRect.left + XSize))
|
||||||
return HTTOPLEFT;
|
return HTTOPLEFT;
|
||||||
|
@ -837,9 +838,9 @@ DefWndNCHitTest(HWND hWnd, POINT Point)
|
||||||
}
|
}
|
||||||
if (Point.y >= WindowRect.bottom)
|
if (Point.y >= WindowRect.bottom)
|
||||||
{
|
{
|
||||||
if(wi.dwStyle & WS_MINIMIZE)
|
if (wi.dwStyle & WS_MINIMIZE)
|
||||||
return HTCAPTION;
|
return HTCAPTION;
|
||||||
if(!ThickFrame)
|
if (!ThickFrame)
|
||||||
return HTBORDER;
|
return HTBORDER;
|
||||||
if (Point.x < (WindowRect.left + XSize))
|
if (Point.x < (WindowRect.left + XSize))
|
||||||
return HTBOTTOMLEFT;
|
return HTBOTTOMLEFT;
|
||||||
|
@ -849,9 +850,9 @@ DefWndNCHitTest(HWND hWnd, POINT Point)
|
||||||
}
|
}
|
||||||
if (Point.x < WindowRect.left)
|
if (Point.x < WindowRect.left)
|
||||||
{
|
{
|
||||||
if(wi.dwStyle & WS_MINIMIZE)
|
if (wi.dwStyle & WS_MINIMIZE)
|
||||||
return HTCAPTION;
|
return HTCAPTION;
|
||||||
if(!ThickFrame)
|
if (!ThickFrame)
|
||||||
return HTBORDER;
|
return HTBORDER;
|
||||||
if (Point.y < (WindowRect.top + YSize))
|
if (Point.y < (WindowRect.top + YSize))
|
||||||
return HTTOPLEFT;
|
return HTTOPLEFT;
|
||||||
|
@ -861,9 +862,9 @@ DefWndNCHitTest(HWND hWnd, POINT Point)
|
||||||
}
|
}
|
||||||
if (Point.x >= WindowRect.right)
|
if (Point.x >= WindowRect.right)
|
||||||
{
|
{
|
||||||
if(wi.dwStyle & WS_MINIMIZE)
|
if (wi.dwStyle & WS_MINIMIZE)
|
||||||
return HTCAPTION;
|
return HTCAPTION;
|
||||||
if(!ThickFrame)
|
if (!ThickFrame)
|
||||||
return HTBORDER;
|
return HTBORDER;
|
||||||
if (Point.y < (WindowRect.top + YSize))
|
if (Point.y < (WindowRect.top + YSize))
|
||||||
return HTTOPRIGHT;
|
return HTTOPRIGHT;
|
||||||
|
@ -897,7 +898,7 @@ DefWndNCHitTest(HWND hWnd, POINT Point)
|
||||||
|
|
||||||
if (!(wi.dwExStyle & WS_EX_TOOLWINDOW))
|
if (!(wi.dwExStyle & WS_EX_TOOLWINDOW))
|
||||||
{
|
{
|
||||||
// if(!(wi.dwExStyle & WS_EX_DLGMODALFRAME))
|
// if (!(wi.dwExStyle & WS_EX_DLGMODALFRAME))
|
||||||
// FIXME: The real test should check whether there is
|
// FIXME: The real test should check whether there is
|
||||||
// an icon for the system window, and if so, do the
|
// an icon for the system window, and if so, do the
|
||||||
// rect.left increase.
|
// rect.left increase.
|
||||||
|
@ -924,7 +925,7 @@ DefWndNCHitTest(HWND hWnd, POINT Point)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!(wi.dwStyle & WS_MINIMIZE))
|
if (!(wi.dwStyle & WS_MINIMIZE))
|
||||||
{
|
{
|
||||||
HMENU menu;
|
HMENU menu;
|
||||||
|
|
||||||
|
@ -973,7 +974,7 @@ DefWndNCHitTest(HWND hWnd, POINT Point)
|
||||||
|
|
||||||
TempRect.top = TempRect2.top;
|
TempRect.top = TempRect2.top;
|
||||||
TempRect.bottom = TempRect2.bottom;
|
TempRect.bottom = TempRect2.bottom;
|
||||||
if(Parent)
|
if (Parent)
|
||||||
GetClientRect(Parent, &ParentRect);
|
GetClientRect(Parent, &ParentRect);
|
||||||
if (PtInRect(&TempRect, Point) && HASSIZEGRIP(wi.dwStyle, wi.dwExStyle,
|
if (PtInRect(&TempRect, Point) && HASSIZEGRIP(wi.dwStyle, wi.dwExStyle,
|
||||||
GetWindowLongW(Parent, GWL_STYLE), wi.rcWindow, ParentRect))
|
GetWindowLongW(Parent, GWL_STYLE), wi.rcWindow, ParentRect))
|
||||||
|
@ -1063,8 +1064,8 @@ ThemeWndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, WNDPROC DefWndPr
|
||||||
}
|
}
|
||||||
case WM_SYSCOMMAND:
|
case WM_SYSCOMMAND:
|
||||||
{
|
{
|
||||||
if((wParam & 0xfff0) == SC_VSCROLL ||
|
if ((wParam & 0xfff0) == SC_VSCROLL ||
|
||||||
(wParam & 0xfff0) == SC_HSCROLL)
|
(wParam & 0xfff0) == SC_HSCROLL)
|
||||||
{
|
{
|
||||||
POINT Pt;
|
POINT Pt;
|
||||||
Pt.x = (short)LOWORD(lParam);
|
Pt.x = (short)LOWORD(lParam);
|
||||||
|
@ -1132,7 +1133,6 @@ DrawWindowForNCPreview(
|
||||||
OffsetRect(&rcWindowNew, offsetX, offsetY);
|
OffsetRect(&rcWindowNew, offsetX, offsetY);
|
||||||
ThemeCalculateCaptionButtonsPosEx(&pcontext->wi, pcontext->hWnd, pcontext->theme, pcontext->CaptionHeight - pcontext->wi.cyWindowBorders);
|
ThemeCalculateCaptionButtonsPosEx(&pcontext->wi, pcontext->hWnd, pcontext->theme, pcontext->CaptionHeight - pcontext->wi.cyWindowBorders);
|
||||||
|
|
||||||
|
|
||||||
INT leftBorderInset = pcontext->wi.cxWindowBorders;
|
INT leftBorderInset = pcontext->wi.cxWindowBorders;
|
||||||
INT titleBarInset = pcontext->CaptionHeight; // + pcontext->wi.cyWindowBorders;
|
INT titleBarInset = pcontext->CaptionHeight; // + pcontext->wi.cyWindowBorders;
|
||||||
INT rightBorderInset = pcontext->wi.cxWindowBorders;
|
INT rightBorderInset = pcontext->wi.cxWindowBorders;
|
||||||
|
@ -1265,7 +1265,6 @@ HRESULT WINAPI DrawNCPreview(HDC hDC,
|
||||||
if (textFont)
|
if (textFont)
|
||||||
SelectFont(hDC, textFont);
|
SelectFont(hDC, textFont);
|
||||||
|
|
||||||
|
|
||||||
SetTextColor(hDC, GetThemeSysColor(context.theme, TMT_WINDOWTEXT));
|
SetTextColor(hDC, GetThemeSysColor(context.theme, TMT_WINDOWTEXT));
|
||||||
DrawThemeText(context.theme, hDC, WP_DIALOG, 0, L"Window Text", -1, DT_LEFT | DT_TOP | textDrawFlags, 0, &rcWindowClient);
|
DrawThemeText(context.theme, hDC, WP_DIALOG, 0, L"Window Text", -1, DT_LEFT | DT_TOP | textDrawFlags, 0, &rcWindowClient);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue