diff --git a/controls/button.c b/controls/button.c index f778ce466df..d3b1b860df7 100644 --- a/controls/button.c +++ b/controls/button.c @@ -715,7 +715,7 @@ static void BUTTON_DrawLabel(HWND hwnd, HDC hdc, UINT dtFlags, RECT *rc) static void PB_Paint( HWND hwnd, HDC hDC, UINT action ) { RECT rc, focus_rect, r; - UINT dtFlags; + UINT dtFlags, uState; HRGN hRgn; HPEN hOldPen; HBRUSH hOldBrush; @@ -735,59 +735,30 @@ static void PB_Paint( HWND hwnd, HDC hDC, UINT action ) hOldBrush =(HBRUSH)SelectObject(hDC,GetSysColorBrush(COLOR_BTNFACE)); oldBkMode = SetBkMode(hDC, TRANSPARENT); - if ( TWEAK_WineLook == WIN31_LOOK) - { - COLORREF clr_wnd = GetSysColor(COLOR_WINDOW); - Rectangle(hDC, rc.left, rc.top, rc.right, rc.bottom); - - SetPixel( hDC, rc.left, rc.top, clr_wnd); - SetPixel( hDC, rc.left, rc.bottom-1, clr_wnd); - SetPixel( hDC, rc.right-1, rc.top, clr_wnd); - SetPixel( hDC, rc.right-1, rc.bottom-1, clr_wnd); - InflateRect( &rc, -1, -1 ); - } - if (get_button_type(style) == BS_DEFPUSHBUTTON) { Rectangle(hDC, rc.left, rc.top, rc.right, rc.bottom); InflateRect( &rc, -1, -1 ); } - if (TWEAK_WineLook == WIN31_LOOK) + uState = DFCS_BUTTONPUSH | DFCS_ADJUSTRECT; + + if (style & BS_FLAT) + uState |= DFCS_MONO; + else if (pushedState) { - if (pushedState) - { - /* draw button shadow: */ - SelectObject(hDC, GetSysColorBrush(COLOR_BTNSHADOW)); - PatBlt(hDC, rc.left, rc.top, 1, rc.bottom-rc.top, PATCOPY ); - PatBlt(hDC, rc.left, rc.top, rc.right-rc.left, 1, PATCOPY ); - } else { - rc.right++, rc.bottom++; - DrawEdge( hDC, &rc, EDGE_RAISED, BF_RECT ); - rc.right--, rc.bottom--; - } + if (get_button_type(style) == BS_DEFPUSHBUTTON ) + uState |= DFCS_FLAT; + else + uState |= DFCS_PUSHED; } - else - { - UINT uState = DFCS_BUTTONPUSH | DFCS_ADJUSTRECT; - if (style & BS_FLAT) - uState |= DFCS_MONO; - else if (pushedState) - { - if (get_button_type(style) == BS_DEFPUSHBUTTON ) - uState |= DFCS_FLAT; - else - uState |= DFCS_PUSHED; - } + if (state & (BUTTON_CHECKED | BUTTON_3STATE)) + uState |= DFCS_CHECKED; - if (state & (BUTTON_CHECKED | BUTTON_3STATE)) - uState |= DFCS_CHECKED; + DrawFrameControl( hDC, &rc, DFC_BUTTON, uState ); - DrawFrameControl( hDC, &rc, DFC_BUTTON, uState ); - - focus_rect = rc; - } + focus_rect = rc; /* draw button label */ r = rc; @@ -799,12 +770,6 @@ static void PB_Paint( HWND hwnd, HDC hDC, UINT action ) if (pushedState) OffsetRect(&r, 1, 1); - if(TWEAK_WineLook == WIN31_LOOK) - { - focus_rect = r; - InflateRect(&focus_rect, 2, 0); - } - hRgn = CreateRectRgn(rc.left, rc.top, rc.right, rc.bottom); SelectClipRgn(hDC, hRgn); @@ -887,80 +852,48 @@ static void CB_Paint( HWND hwnd, HDC hDC, UINT action ) /* Draw the check-box bitmap */ if (action == ODA_DRAWENTIRE || action == ODA_SELECT) { - if( TWEAK_WineLook == WIN31_LOOK ) - { - HDC hMemDC = CreateCompatibleDC( hDC ); - int x = 0, y = 0; - delta = (rbox.bottom - rbox.top - checkBoxHeight) / 2; - - /* Check in case the client area is smaller than the checkbox bitmap */ - if (delta < 0) delta = 0; - - if (state & BUTTON_HIGHLIGHTED) x += 2 * checkBoxWidth; - if (state & (BUTTON_CHECKED | BUTTON_3STATE)) x += checkBoxWidth; - if ((get_button_type(style) == BS_RADIOBUTTON) || - (get_button_type(style) == BS_AUTORADIOBUTTON)) y += checkBoxHeight; - else if (state & BUTTON_3STATE) y += 2 * checkBoxHeight; - - /* The bitmap for the radio button is not aligned with the - * left of the window, it is 1 pixel off. */ - if ((get_button_type(style) == BS_RADIOBUTTON) || - (get_button_type(style) == BS_AUTORADIOBUTTON)) - rbox.left += 1; - - SelectObject( hMemDC, hbitmapCheckBoxes ); - BitBlt( hDC, rbox.left, rbox.top + delta, checkBoxWidth, - checkBoxHeight, hMemDC, x, y, SRCCOPY ); - DeleteDC( hMemDC ); - } - else - { - UINT flags; + UINT flags; - if ((get_button_type(style) == BS_RADIOBUTTON) || - (get_button_type(style) == BS_AUTORADIOBUTTON)) flags = DFCS_BUTTONRADIO; - else if (state & BUTTON_3STATE) flags = DFCS_BUTTON3STATE; - else flags = DFCS_BUTTONCHECK; + if ((get_button_type(style) == BS_RADIOBUTTON) || + (get_button_type(style) == BS_AUTORADIOBUTTON)) flags = DFCS_BUTTONRADIO; + else if (state & BUTTON_3STATE) flags = DFCS_BUTTON3STATE; + else flags = DFCS_BUTTONCHECK; - if (state & (BUTTON_CHECKED | BUTTON_3STATE)) flags |= DFCS_CHECKED; - if (state & BUTTON_HIGHLIGHTED) flags |= DFCS_PUSHED; + if (state & (BUTTON_CHECKED | BUTTON_3STATE)) flags |= DFCS_CHECKED; + if (state & BUTTON_HIGHLIGHTED) flags |= DFCS_PUSHED; - if (style & WS_DISABLED) flags |= DFCS_INACTIVE; + if (style & WS_DISABLED) flags |= DFCS_INACTIVE; - /* rbox must have the correct height */ - delta = rbox.bottom - rbox.top - checkBoxHeight; - - if (style & BS_TOP) { - if (delta > 0) { + /* rbox must have the correct height */ + delta = rbox.bottom - rbox.top - checkBoxHeight; + + if (style & BS_TOP) { + if (delta > 0) { rbox.bottom = rbox.top + checkBoxHeight; - } else { + } else { rbox.top -= -delta/2 + 1; rbox.bottom += rbox.top + checkBoxHeight; - } - } else if (style & BS_BOTTOM) { - if (delta > 0) { + } + } else if (style & BS_BOTTOM) { + if (delta > 0) { rbox.top = rbox.bottom - checkBoxHeight; - } else { + } else { rbox.bottom += -delta/2 + 1; rbox.top = rbox.bottom -= checkBoxHeight; - } - } else { /* Default */ - if (delta > 0) - { - int ofs = (delta / 2); - rbox.bottom -= ofs + 1; - rbox.top = rbox.bottom - checkBoxHeight; - } - else if (delta < 0) - { - int ofs = (-delta / 2); - rbox.top -= ofs + 1; - rbox.bottom = rbox.top + checkBoxHeight; - } } + } else { /* Default */ + if (delta > 0) { + int ofs = (delta / 2); + rbox.bottom -= ofs + 1; + rbox.top = rbox.bottom - checkBoxHeight; + } else if (delta < 0) { + int ofs = (-delta / 2); + rbox.top -= ofs + 1; + rbox.bottom = rbox.top + checkBoxHeight; + } + } - DrawFrameControl( hDC, &rbox, DFC_BUTTON, flags ); - } + DrawFrameControl( hDC, &rbox, DFC_BUTTON, flags ); } if (dtFlags == (UINT)-1L) /* Noting to draw */ @@ -1018,6 +951,7 @@ static void GB_Paint( HWND hwnd, HDC hDC, UINT action ) HBRUSH hbr; HFONT hFont; UINT dtFlags; + TEXTMETRICW tm; LONG style = GetWindowLongA( hwnd, GWL_STYLE ); if (action != ODA_DRAWENTIRE) return; @@ -1030,23 +964,11 @@ static void GB_Paint( HWND hwnd, HDC hDC, UINT action ) (WPARAM)hDC, (LPARAM)hwnd); GetClientRect( hwnd, &rc); - if (TWEAK_WineLook == WIN31_LOOK) { - HPEN hPrevPen = SelectObject( hDC, - SYSCOLOR_GetPen(COLOR_WINDOWFRAME)); - HBRUSH hPrevBrush = SelectObject( hDC, - GetStockObject(NULL_BRUSH) ); + rcFrame = rc; - Rectangle( hDC, rc.left, rc.top + 2, rc.right - 1, rc.bottom - 1 ); - SelectObject( hDC, hPrevBrush ); - SelectObject( hDC, hPrevPen ); - } else { - TEXTMETRICW tm; - rcFrame = rc; - - GetTextMetricsW (hDC, &tm); - rcFrame.top += (tm.tmHeight / 2) - 1; - DrawEdge (hDC, &rcFrame, EDGE_ETCHED, BF_RECT | ((style & BS_FLAT) ? BF_FLAT : 0)); - } + GetTextMetricsW (hDC, &tm); + rcFrame.top += (tm.tmHeight / 2) - 1; + DrawEdge (hDC, &rcFrame, EDGE_ETCHED, BF_RECT | ((style & BS_FLAT) ? BF_FLAT : 0)); InflateRect(&rc, -7, 1); dtFlags = BUTTON_CalcLabelRect(hwnd, hDC, &rc); diff --git a/controls/combo.c b/controls/combo.c index 75c7ef89184..32ecdcd5114 100644 --- a/controls/combo.c +++ b/controls/combo.c @@ -69,10 +69,10 @@ static UINT CBitHeight, CBitWidth; */ #define COMBO_YBORDERGAP 5 -#define COMBO_XBORDERSIZE() ( (TWEAK_WineLook == WIN31_LOOK) ? 0 : 2 ) -#define COMBO_YBORDERSIZE() ( (TWEAK_WineLook == WIN31_LOOK) ? 0 : 2 ) -#define COMBO_EDITBUTTONSPACE() ( (TWEAK_WineLook == WIN31_LOOK) ? 8 : 0 ) -#define EDIT_CONTROL_PADDING() ( (TWEAK_WineLook == WIN31_LOOK) ? 0 : 1 ) +#define COMBO_XBORDERSIZE() 2 +#define COMBO_YBORDERSIZE() 2 +#define COMBO_EDITBUTTONSPACE() 0 +#define EDIT_CONTROL_PADDING() 1 static LRESULT WINAPI ComboWndProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam ); static LRESULT WINAPI ComboWndProcW( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam ); @@ -571,11 +571,8 @@ static LRESULT COMBO_Create( HWND hwnd, LPHEADCOMBO lphc, HWND hwndParent, LONG * In win 95 look n feel, the listbox in the simple combobox has * the WS_EXCLIENTEDGE style instead of the WS_BORDER style. */ - if (TWEAK_WineLook > WIN31_LOOK) - { - lbeStyle &= ~WS_BORDER; - lbeExStyle |= WS_EX_CLIENTEDGE; - } + lbeStyle &= ~WS_BORDER; + lbeExStyle |= WS_EX_CLIENTEDGE; } if (unicode) @@ -600,13 +597,6 @@ static LRESULT COMBO_Create( HWND hwnd, LPHEADCOMBO lphc, HWND hwndParent, LONG BOOL bEdit = TRUE; lbeStyle = WS_CHILD | WS_VISIBLE | ES_NOHIDESEL | ES_LEFT | ES_COMBO; - /* - * In Win95 look, the border fo the edit control is - * provided by the combobox - */ - if (TWEAK_WineLook == WIN31_LOOK) - lbeStyle |= WS_BORDER; - if( lphc->wState & CBF_EDIT ) { if( lphc->dwStyle & CBS_OEMCONVERT ) @@ -671,84 +661,21 @@ static LRESULT COMBO_Create( HWND hwnd, LPHEADCOMBO lphc, HWND hwndParent, LONG * * Paint combo button (normal, pressed, and disabled states). */ -static void CBPaintButton( - LPHEADCOMBO lphc, - HDC hdc, - RECT rectButton) +static void CBPaintButton( LPHEADCOMBO lphc, HDC hdc, RECT rectButton) { + UINT buttonState = DFCS_SCROLLCOMBOBOX; + if( lphc->wState & CBF_NOREDRAW ) return; - if (TWEAK_WineLook == WIN31_LOOK) - { - UINT x, y; - BOOL bBool; - HDC hMemDC; - HBRUSH hPrevBrush; - COLORREF oldTextColor, oldBkColor; + if (lphc->wState & CBF_BUTTONDOWN) + buttonState |= DFCS_PUSHED; - hPrevBrush = SelectObject(hdc, GetSysColorBrush(COLOR_BTNFACE)); + if (CB_DISABLED(lphc)) + buttonState |= DFCS_INACTIVE; - /* - * Draw the button background - */ - PatBlt( hdc, - rectButton.left, - rectButton.top, - rectButton.right-rectButton.left, - rectButton.bottom-rectButton.top, - PATCOPY ); - - if( (bBool = lphc->wState & CBF_BUTTONDOWN) ) - { - DrawEdge( hdc, &rectButton, EDGE_SUNKEN, BF_RECT ); - } - else - { - DrawEdge( hdc, &rectButton, EDGE_RAISED, BF_RECT ); - } - - /* - * Remove the edge of the button from the rectangle - * and calculate the position of the bitmap. - */ - InflateRect( &rectButton, -2, -2); - - x = (rectButton.left + rectButton.right - CBitWidth) >> 1; - y = (rectButton.top + rectButton.bottom - CBitHeight) >> 1; - - - hMemDC = CreateCompatibleDC( hdc ); - SelectObject( hMemDC, hComboBmp ); - oldTextColor = SetTextColor( hdc, GetSysColor(COLOR_BTNFACE) ); - oldBkColor = SetBkColor( hdc, CB_DISABLED(lphc) ? RGB(128,128,128) : - RGB(0,0,0) ); - BitBlt( hdc, x, y, CBitWidth, CBitHeight, hMemDC, 0, 0, SRCCOPY ); - SetBkColor( hdc, oldBkColor ); - SetTextColor( hdc, oldTextColor ); - DeleteDC( hMemDC ); - SelectObject( hdc, hPrevBrush ); - } - else - { - UINT buttonState = DFCS_SCROLLCOMBOBOX; - - if (lphc->wState & CBF_BUTTONDOWN) - { - buttonState |= DFCS_PUSHED; - } - - if (CB_DISABLED(lphc)) - { - buttonState |= DFCS_INACTIVE; - } - - DrawFrameControl(hdc, - &rectButton, - DFC_SCROLL, - buttonState); - } + DrawFrameControl(hdc, &rectButton, DFC_SCROLL, buttonState); } /*********************************************************************** @@ -1020,10 +947,7 @@ static LRESULT COMBO_Paint(LPHEADCOMBO lphc, HDC hParamDC) /* * In non 3.1 look, there is a sunken border on the combobox */ - if (TWEAK_WineLook != WIN31_LOOK) - { - CBPaintBorder(lphc->self, lphc, hDC); - } + CBPaintBorder(lphc->self, lphc, hDC); if( !IsRectEmpty(&lphc->buttonRect) ) { @@ -1041,23 +965,7 @@ static LRESULT COMBO_Paint(LPHEADCOMBO lphc, HDC hParamDC) } if( !(lphc->wState & CBF_EDIT) ) - { - /* - * The text area has a border only in Win 3.1 look. - */ - if (TWEAK_WineLook == WIN31_LOOK) - { - HPEN hPrevPen = SelectObject( hDC, SYSCOLOR_GetPen(COLOR_WINDOWFRAME) ); - - Rectangle( hDC, - lphc->textRect.left, lphc->textRect.top, - lphc->textRect.right - 1, lphc->textRect.bottom - 1); - - SelectObject( hDC, hPrevPen ); - } - CBPaintText( lphc, hDC, lphc->textRect); - } if( hPrevBrush ) SelectObject( hDC, hPrevBrush ); diff --git a/controls/edit.c b/controls/edit.c index f32cea54b42..36a19aeee51 100644 --- a/controls/edit.c +++ b/controls/edit.c @@ -2148,8 +2148,6 @@ static void EDIT_SetRectNP(EDITSTATE *es, LPRECT rc) CopyRect(&es->format_rect, rc); if (es->style & WS_BORDER) { INT bw = GetSystemMetrics(SM_CXBORDER) + 1; - if(TWEAK_WineLook == WIN31_LOOK) - bw += 2; es->format_rect.left += bw; es->format_rect.top += bw; es->format_rect.right -= bw; @@ -4376,8 +4374,7 @@ static LRESULT EDIT_WM_NCCreate(HWND hwnd, LPCREATESTRUCTW lpcs, BOOL unicode) es->style |= ES_AUTOVSCROLL; } else { es->buffer_limit = BUFLIMIT_SINGLE; - if (WIN31_LOOK == TWEAK_WineLook || - WIN95_LOOK == TWEAK_WineLook) { + if ( WIN95_LOOK == TWEAK_WineLook) { es->style &= ~ES_CENTER; es->style &= ~ES_RIGHT; } else { @@ -4418,16 +4415,7 @@ static LRESULT EDIT_WM_NCCreate(HWND hwnd, LPCREATESTRUCTW lpcs, BOOL unicode) * controls created directly with style 0x50800000, exStyle 0 ( * which should have a single pixel border) */ - if (TWEAK_WineLook != WIN31_LOOK) - { - es->style &= ~WS_BORDER; - } - else - { - if ((es->style & WS_BORDER) && !(es->style & WS_DLGFRAME)) - SetWindowLongW( hwnd, GWL_STYLE, - GetWindowLongW( hwnd, GWL_STYLE ) & ~WS_BORDER ); - } + es->style &= ~WS_BORDER; return TRUE; } @@ -4564,9 +4552,8 @@ static void EDIT_WM_SetFont(EDITSTATE *es, HFONT font, BOOL redraw) if (font) SelectObject(dc, old_font); ReleaseDC(es->hwndSelf, dc); - if (font && (TWEAK_WineLook > WIN31_LOOK)) - EDIT_EM_SetMargins(es, EC_LEFTMARGIN | EC_RIGHTMARGIN, - EC_USEFONTINFO, EC_USEFONTINFO); + EDIT_EM_SetMargins(es, EC_LEFTMARGIN | EC_RIGHTMARGIN, + EC_USEFONTINFO, EC_USEFONTINFO); /* Force the recalculation of the format rect for each font change */ GetClientRect(es->hwndSelf, &r); diff --git a/controls/listbox.c b/controls/listbox.c index a4e70f9b143..2043b22311a 100644 --- a/controls/listbox.c +++ b/controls/listbox.c @@ -3102,8 +3102,7 @@ static LRESULT WINAPI ComboLBWndProc_common( HWND hwnd, UINT msg, switch( msg ) { case WM_MOUSEMOVE: - if ( (TWEAK_WineLook > WIN31_LOOK) && - (CB_GETTYPE(lphc) != CBS_SIMPLE) ) + if ( (CB_GETTYPE(lphc) != CBS_SIMPLE) ) { POINT mousePos; BOOL captured; @@ -3138,11 +3137,9 @@ static LRESULT WINAPI ComboLBWndProc_common( HWND hwnd, UINT msg, return 0; } - /* else we are in Win3.1 look, go with the default behavior. */ break; case WM_LBUTTONUP: - if (TWEAK_WineLook > WIN31_LOOK) { POINT mousePos; RECT clientRect; diff --git a/controls/menu.c b/controls/menu.c index a4201549f00..f46fe8d87e5 100644 --- a/controls/menu.c +++ b/controls/menu.c @@ -888,11 +888,7 @@ static void MENU_CalcItemSize( HDC hdc, MENUITEM *lpitem, HWND hwndOwner, /* under at least win95 you seem to be given a standard height for the menu and the height value is ignored */ - - if (TWEAK_WineLook == WIN31_LOOK) - lpitem->rect.bottom += GetSystemMetrics(SM_CYMENU); - else - lpitem->rect.bottom += GetSystemMetrics(SM_CYMENU)-1; + lpitem->rect.bottom += GetSystemMetrics(SM_CYMENU)-1; } else lpitem->rect.bottom += mis.itemHeight; @@ -941,10 +937,7 @@ static void MENU_CalcItemSize( HDC hdc, MENUITEM *lpitem, HWND hwndOwner, GetTextExtentPoint32W(hdc, lpitem->text, strlenW(lpitem->text), &size); lpitem->rect.right += size.cx; - if (TWEAK_WineLook == WIN31_LOOK) - lpitem->rect.bottom += max( size.cy, GetSystemMetrics(SM_CYMENU) ); - else - lpitem->rect.bottom += max(size.cy, GetSystemMetrics(SM_CYMENU)-1); + lpitem->rect.bottom += max(size.cy, GetSystemMetrics(SM_CYMENU)-1); lpitem->xTab = 0; if (menuBar) @@ -989,13 +982,13 @@ static void MENU_PopupMenuCalcSize( LPPOPUPMENU lppop, HWND hwndOwner ) SelectObject( hdc, hMenuFont); start = 0; - maxX = (TWEAK_WineLook == WIN31_LOOK) ? GetSystemMetrics(SM_CXBORDER) : 2+1 ; + maxX = 2 + 1; while (start < lppop->nItems) { lpitem = &lppop->items[start]; orgX = maxX; - orgY = (TWEAK_WineLook == WIN31_LOOK) ? GetSystemMetrics(SM_CYBORDER) : 2; + orgY = 2; maxTab = maxTabWidth = 0; @@ -1032,11 +1025,8 @@ static void MENU_PopupMenuCalcSize( LPPOPUPMENU lppop, HWND hwndOwner ) lppop->Width = maxX; /* space for 3d border */ - if(TWEAK_WineLook > WIN31_LOOK) - { - lppop->Height += 2; - lppop->Width += 2; - } + lppop->Height += 2; + lppop->Width += 2; ReleaseDC( 0, hdc ); } @@ -1130,17 +1120,8 @@ static void MENU_DrawMenuItem( HWND hwnd, HMENU hmenu, HWND hwndOwner, HDC hdc, if (lpitem->fType & MF_SYSMENU) { - if( !IsIconic(hwnd) ) { - if (TWEAK_WineLook > WIN31_LOOK) - NC_DrawSysButton95( hwnd, hdc, - lpitem->fState & - (MF_HILITE | MF_MOUSESELECT) ); - else - NC_DrawSysButton( hwnd, hdc, - lpitem->fState & - (MF_HILITE | MF_MOUSESELECT) ); - } - + if( !IsIconic(hwnd) ) + NC_DrawSysButton( hwnd, hdc, lpitem->fState & (MF_HILITE | MF_MOUSESELECT) ); return; } @@ -1213,38 +1194,20 @@ static void MENU_DrawMenuItem( HWND hwnd, HMENU hmenu, HWND hwndOwner, HDC hdc, /* vertical separator */ if (!menuBar && (lpitem->fType & MF_MENUBARBREAK)) { - if (TWEAK_WineLook > WIN31_LOOK) - { - RECT rc = rect; - rc.top = 3; - rc.bottom = height - 3; - DrawEdge (hdc, &rc, EDGE_ETCHED, BF_LEFT); - } - else - { - SelectObject( hdc, SYSCOLOR_GetPen(COLOR_WINDOWFRAME) ); - MoveToEx( hdc, rect.left, 0, NULL ); - LineTo( hdc, rect.left, height ); - } + RECT rc = rect; + rc.top = 3; + rc.bottom = height - 3; + DrawEdge (hdc, &rc, EDGE_ETCHED, BF_LEFT); } /* horizontal separator */ if (lpitem->fType & MF_SEPARATOR) { - if (TWEAK_WineLook > WIN31_LOOK) - { - RECT rc = rect; - rc.left++; - rc.right--; - rc.top += SEPARATOR_HEIGHT / 2; - DrawEdge (hdc, &rc, EDGE_ETCHED, BF_TOP); - } - else - { - SelectObject( hdc, SYSCOLOR_GetPen(COLOR_WINDOWFRAME) ); - MoveToEx( hdc, rect.left, rect.top + SEPARATOR_HEIGHT/2, NULL ); - LineTo( hdc, rect.right, rect.top + SEPARATOR_HEIGHT/2 ); - } + RECT rc = rect; + rc.left++; + rc.right--; + rc.top += SEPARATOR_HEIGHT / 2; + DrawEdge (hdc, &rc, EDGE_ETCHED, BF_TOP); return; } } @@ -1384,7 +1347,7 @@ static void MENU_DrawMenuItem( HWND hwnd, HMENU hmenu, HWND hwndOwner, HDC hdc, if ((lpitem->text[i] == '\t') || (lpitem->text[i] == '\b')) break; - if( (TWEAK_WineLook != WIN31_LOOK) && (lpitem->fState & MF_GRAYED)) + if(lpitem->fState & MF_GRAYED) { if (!(lpitem->fState & MF_HILITE) ) { @@ -1411,7 +1374,7 @@ static void MENU_DrawMenuItem( HWND hwnd, HMENU hmenu, HWND hwndOwner, HDC hdc, uFormat = DT_RIGHT | DT_VCENTER | DT_SINGLELINE; } - if( (TWEAK_WineLook != WIN31_LOOK) && (lpitem->fState & MF_GRAYED)) + if(lpitem->fState & MF_GRAYED) { if (!(lpitem->fState & MF_HILITE) ) { @@ -1445,12 +1408,6 @@ static void MENU_DrawPopupMenu( HWND hwnd, HDC hdc, HMENU hmenu ) GetClientRect( hwnd, &rect ); - if(TWEAK_WineLook == WIN31_LOOK) - { - rect.bottom -= POPUP_YSHADE * GetSystemMetrics(SM_CYBORDER); - rect.right -= POPUP_XSHADE * GetSystemMetrics(SM_CXBORDER); - } - if((hPrevBrush = SelectObject( hdc, GetSysColorBrush(COLOR_MENU) )) && (SelectObject( hdc, hMenuFont))) { @@ -1461,30 +1418,9 @@ static void MENU_DrawPopupMenu( HWND hwnd, HDC hdc, HMENU hmenu ) hPrevPen = SelectObject( hdc, GetStockObject( NULL_PEN ) ); if( hPrevPen ) { - INT ropPrev, i; POPUPMENU *menu; - /* draw 3-d shade */ - if(TWEAK_WineLook == WIN31_LOOK) { - SelectObject( hdc, hShadeBrush ); - SetBkMode( hdc, TRANSPARENT ); - ropPrev = SetROP2( hdc, R2_MASKPEN ); - - i = rect.right; /* why SetBrushOrg() doesn't? */ - PatBlt( hdc, i & 0xfffffffe, - rect.top + POPUP_YSHADE*GetSystemMetrics(SM_CYBORDER), - i%2 + POPUP_XSHADE*GetSystemMetrics(SM_CXBORDER), - rect.bottom - rect.top, 0x00a000c9 ); - i = rect.bottom; - PatBlt( hdc, rect.left + POPUP_XSHADE*GetSystemMetrics(SM_CXBORDER), - i & 0xfffffffe,rect.right - rect.left, - i%2 + POPUP_YSHADE*GetSystemMetrics(SM_CYBORDER), 0x00a000c9 ); - SelectObject( hdc, hPrevPen ); - SelectObject( hdc, hPrevBrush ); - SetROP2( hdc, ropPrev ); - } - else - DrawEdge (hdc, &rect, EDGE_RAISED, BF_RECT); + DrawEdge (hdc, &rect, EDGE_RAISED, BF_RECT); /* draw menu items */ @@ -1592,12 +1528,6 @@ static BOOL MENU_ShowPopup( HWND hwndOwner, HMENU hmenu, UINT id, } if( y < 0 ) y = 0; - if( TWEAK_WineLook == WIN31_LOOK ) - { - width += POPUP_XSHADE * GetSystemMetrics(SM_CXBORDER); /* add space for shading */ - height += POPUP_YSHADE * GetSystemMetrics(SM_CYBORDER); - } - /* NOTE: In Windows, top menu popup is not owned. */ menu->hWnd = CreateWindowExW( 0, POPUPMENU_CLASS_ATOMW, NULL, WS_POPUP, x, y, width, height, @@ -2244,10 +2174,6 @@ static BOOL MENU_ButtonDown( MTRACKER* pmt, HMENU hPtMenu, UINT wFlags ) if(!(item->fState & MF_MOUSESELECT )) { pmt->hCurrentMenu = MENU_ShowSubPopup( pmt->hOwnerWnd, hPtMenu, FALSE, wFlags ); - - /* In win31, a newly popped menu always remains opened for the next buttonup */ - if(TWEAK_WineLook == WIN31_LOOK) - ptmenu->bTimeToHide = FALSE; } return TRUE; @@ -2778,9 +2704,9 @@ static BOOL MENU_TrackMenu( HMENU hmenu, UINT wFlags, INT x, INT y, /* In win95 winelook, the selected menu item must be changed every time the mouse moves. In Win31 winelook, the mouse button has to be held down */ - if ( hmenu && ((TWEAK_WineLook > WIN31_LOOK) || + if ( hmenu && ( (msg.wParam & MK_LBUTTON) || - ((wFlags & TPM_RIGHTBUTTON) && (msg.wParam & MK_RBUTTON)))) ) + ((wFlags & TPM_RIGHTBUTTON) && (msg.wParam & MK_RBUTTON))) ) fEndMenu |= !MENU_MouseMove( &mt, hmenu, wFlags ); @@ -3875,18 +3801,9 @@ DWORD WINAPI DrawMenuBarTemp(HWND hwnd, HDC hDC, LPRECT lprect, HMENU hMenu, HFO FillRect(hDC, lprect, GetSysColorBrush(COLOR_MENU) ); - if (TWEAK_WineLook == WIN31_LOOK) - { - SelectObject( hDC, SYSCOLOR_GetPen(COLOR_WINDOWFRAME) ); - MoveToEx( hDC, lprect->left, lprect->bottom, NULL ); - LineTo( hDC, lprect->right, lprect->bottom ); - } - else - { - SelectObject( hDC, SYSCOLOR_GetPen(COLOR_3DFACE)); - MoveToEx( hDC, lprect->left, lprect->bottom, NULL ); - LineTo( hDC, lprect->right, lprect->bottom ); - } + SelectObject( hDC, SYSCOLOR_GetPen(COLOR_3DFACE)); + MoveToEx( hDC, lprect->left, lprect->bottom, NULL ); + LineTo( hDC, lprect->right, lprect->bottom ); if (lppop->nItems == 0) { diff --git a/controls/scroll.c b/controls/scroll.c index c0dbedf5db2..9400759b144 100644 --- a/controls/scroll.c +++ b/controls/scroll.c @@ -73,7 +73,7 @@ static HBITMAP hRgArrowI; #define SCROLL_MIN_THUMB 6 /* Overlap between arrows and thumb */ -#define SCROLL_ARROW_THUMB_OVERLAP ((TWEAK_WineLook == WIN31_LOOK) ? 1 : 0) +#define SCROLL_ARROW_THUMB_OVERLAP 0 /* Delay (in ms) before first repetition when holding the button down */ #define SCROLL_FIRST_DELAY 200 @@ -433,9 +433,9 @@ static enum SCROLL_HITTEST SCROLL_HitTest( HWND hwnd, INT nBar, * * Draw the scroll bar arrows. */ -static void SCROLL_DrawArrows_9x( HDC hdc, SCROLLBAR_INFO *infoPtr, - RECT *rect, INT arrowSize, BOOL vertical, - BOOL top_pressed, BOOL bottom_pressed ) +static void SCROLL_DrawArrows( HDC hdc, SCROLLBAR_INFO *infoPtr, + RECT *rect, INT arrowSize, BOOL vertical, + BOOL top_pressed, BOOL bottom_pressed ) { RECT r; @@ -462,93 +462,8 @@ static void SCROLL_DrawArrows_9x( HDC hdc, SCROLLBAR_INFO *infoPtr, | (infoPtr->flags&ESB_DISABLE_RTDN ? DFCS_INACTIVE : 0) ); } -static void SCROLL_DrawArrows_31( HDC hdc, SCROLLBAR_INFO *infoPtr, - RECT *rect, INT arrowSize, BOOL vertical, - BOOL top_pressed, BOOL bottom_pressed ) -{ - HDC hdcMem = CreateCompatibleDC( hdc ); - HBITMAP hbmpPrev = SelectObject( hdcMem, vertical ? - TOP_ARROW(infoPtr->flags, top_pressed) - : LEFT_ARROW(infoPtr->flags, top_pressed)); - - SetStretchBltMode( hdc, STRETCH_DELETESCANS ); - StretchBlt( hdc, rect->left, rect->top, - vertical ? rect->right-rect->left : arrowSize, - vertical ? arrowSize : rect->bottom-rect->top, - hdcMem, 0, 0, - GetSystemMetrics(SM_CXVSCROLL),GetSystemMetrics(SM_CYHSCROLL), - SRCCOPY ); - - SelectObject( hdcMem, vertical ? - BOTTOM_ARROW( infoPtr->flags, bottom_pressed ) - : RIGHT_ARROW( infoPtr->flags, bottom_pressed ) ); - if (vertical) - StretchBlt( hdc, rect->left, rect->bottom - arrowSize, - rect->right - rect->left, arrowSize, - hdcMem, 0, 0, - GetSystemMetrics(SM_CXVSCROLL),GetSystemMetrics(SM_CYHSCROLL), - SRCCOPY ); - else - StretchBlt( hdc, rect->right - arrowSize, rect->top, - arrowSize, rect->bottom - rect->top, - hdcMem, 0, 0, - GetSystemMetrics(SM_CXVSCROLL), GetSystemMetrics(SM_CYHSCROLL), - SRCCOPY ); - SelectObject( hdcMem, hbmpPrev ); - DeleteDC( hdcMem ); -} - -static void SCROLL_DrawArrows( HDC hdc, SCROLLBAR_INFO *infoPtr, - RECT *rect, INT arrowSize, BOOL vertical, - BOOL top_pressed, BOOL bottom_pressed ) -{ - if( TWEAK_WineLook == WIN31_LOOK ) - SCROLL_DrawArrows_31( hdc, infoPtr, rect, arrowSize, - vertical, top_pressed,bottom_pressed ); - else - SCROLL_DrawArrows_9x( hdc, infoPtr, rect, arrowSize, - vertical, top_pressed,bottom_pressed ); -} - - -/*********************************************************************** - * SCROLL_DrawMovingThumb - * - * Draw the moving thumb rectangle. - */ -static void SCROLL_DrawMovingThumb_31( HDC hdc, RECT *rect, BOOL vertical, - INT arrowSize, INT thumbSize ) -{ - RECT r = *rect; - if (vertical) - { - r.top += SCROLL_TrackingPos; - if (r.top < rect->top + arrowSize - SCROLL_ARROW_THUMB_OVERLAP) - r.top = rect->top + arrowSize - SCROLL_ARROW_THUMB_OVERLAP; - if (r.top + thumbSize > - rect->bottom - (arrowSize - SCROLL_ARROW_THUMB_OVERLAP)) - r.top = rect->bottom - (arrowSize - SCROLL_ARROW_THUMB_OVERLAP) - - thumbSize; - r.bottom = r.top + thumbSize; - } - else - { - r.left += SCROLL_TrackingPos; - if (r.left < rect->left + arrowSize - SCROLL_ARROW_THUMB_OVERLAP) - r.left = rect->left + arrowSize - SCROLL_ARROW_THUMB_OVERLAP; - if (r.left + thumbSize > - rect->right - (arrowSize - SCROLL_ARROW_THUMB_OVERLAP)) - r.left = rect->right - (arrowSize - SCROLL_ARROW_THUMB_OVERLAP) - - thumbSize; - r.right = r.left + thumbSize; - } - - DrawFocusRect( hdc, &r ); - SCROLL_MovingThumb = !SCROLL_MovingThumb; -} - -static void SCROLL_DrawMovingThumb_9x( HDC hdc, RECT *rect, BOOL vertical, - INT arrowSize, INT thumbSize ) +static void SCROLL_DrawMovingThumb( HDC hdc, RECT *rect, BOOL vertical, + INT arrowSize, INT thumbSize ) { INT pos = SCROLL_TrackingPos; INT max_size; @@ -572,15 +487,6 @@ static void SCROLL_DrawMovingThumb_9x( HDC hdc, RECT *rect, BOOL vertical, SCROLL_MovingThumb = !SCROLL_MovingThumb; } -static void SCROLL_DrawMovingThumb( HDC hdc, RECT *rect, BOOL vertical, - INT arrowSize, INT thumbSize ) -{ - if( TWEAK_WineLook == WIN31_LOOK ) - SCROLL_DrawMovingThumb_31( hdc, rect, vertical, arrowSize, thumbSize ); - else - SCROLL_DrawMovingThumb_9x( hdc, rect, vertical, arrowSize, thumbSize ); -} - /*********************************************************************** * SCROLL_DrawInterior * @@ -693,23 +599,15 @@ static void SCROLL_DrawInterior( HWND hwnd, HDC hdc, INT nBar, /* Select the correct brush and pen */ - if (TWEAK_WineLook == WIN31_LOOK && (flags & ESB_DISABLE_BOTH) == ESB_DISABLE_BOTH) - { - /* This ought to be the color of the parent window */ - hBrush = GetSysColorBrush(COLOR_WINDOW); - } - else - { - /* Only scrollbar controls send WM_CTLCOLORSCROLLBAR. - * The window-owned scrollbars need to call DEFWND_ControlColor - * to correctly setup default scrollbar colors - */ - if (nBar == SB_CTL) { - hBrush = (HBRUSH)SendMessageA( GetParent(hwnd), WM_CTLCOLORSCROLLBAR, - (WPARAM)hdc,(LPARAM)hwnd); - } else { - hBrush = DEFWND_ControlColor( hdc, CTLCOLOR_SCROLLBAR ); - } + /* Only scrollbar controls send WM_CTLCOLORSCROLLBAR. + * The window-owned scrollbars need to call DEFWND_ControlColor + * to correctly setup default scrollbar colors + */ + if (nBar == SB_CTL) { + hBrush = (HBRUSH)SendMessageA( GetParent(hwnd), WM_CTLCOLORSCROLLBAR, + (WPARAM)hdc,(LPARAM)hwnd); + } else { + hBrush = DEFWND_ControlColor( hdc, CTLCOLOR_SCROLLBAR ); } hSavePen = SelectObject( hdc, SYSCOLOR_GetPen(COLOR_WINDOWFRAME) ); hSaveBrush = SelectObject( hdc, hBrush ); @@ -730,19 +628,11 @@ static void SCROLL_DrawInterior( HWND hwnd, HDC hdc, INT nBar, /* Draw the scroll bar frame */ - /* Only draw outline if Win 3.1. Mar 24, 1999 - Ronald B. Cemer */ - if (TWEAK_WineLook == WIN31_LOOK) - Rectangle( hdc, r.left, r.top, r.right, r.bottom ); - /* Draw the scroll rectangles and thumb */ if (!thumbPos) /* No thumb to draw */ { - INT offset = (TWEAK_WineLook > WIN31_LOOK) ? 0 : 1; - - PatBlt( hdc, r.left+offset, r.top+offset, - r.right - r.left - 2*offset, r.bottom - r.top - 2*offset, - PATCOPY ); + PatBlt( hdc, r.left, r.top, r.right - r.left, r.bottom - r.top, PATCOPY ); /* cleanup and return */ SelectObject( hdc, hSavePen ); @@ -752,47 +642,30 @@ static void SCROLL_DrawInterior( HWND hwnd, HDC hdc, INT nBar, if (vertical) { - INT offset = (TWEAK_WineLook == WIN31_LOOK) ? 1 : 0; - - PatBlt( hdc, r.left + offset, r.top + offset, - r.right - r.left - offset*2, - thumbPos - (arrowSize - SCROLL_ARROW_THUMB_OVERLAP) - offset, - top_selected ? 0x0f0000 : PATCOPY ); + PatBlt( hdc, r.left, r.top, r.right - r.left, + thumbPos - (arrowSize - SCROLL_ARROW_THUMB_OVERLAP), + top_selected ? 0x0f0000 : PATCOPY ); r.top += thumbPos - (arrowSize - SCROLL_ARROW_THUMB_OVERLAP); - PatBlt( hdc, r.left + offset, r.top + thumbSize, - r.right - r.left - offset*2, - r.bottom - r.top - thumbSize - offset, - bottom_selected ? 0x0f0000 : PATCOPY ); + PatBlt( hdc, r.left, r.top + thumbSize, r.right - r.left, + r.bottom - r.top - thumbSize, + bottom_selected ? 0x0f0000 : PATCOPY ); r.bottom = r.top + thumbSize; } else /* horizontal */ { - INT offset = (TWEAK_WineLook == WIN31_LOOK) ? 1 : 0; - - PatBlt( hdc, r.left + offset, r.top + offset, - thumbPos - (arrowSize - SCROLL_ARROW_THUMB_OVERLAP), - r.bottom - r.top - offset*2, - top_selected ? 0x0f0000 : PATCOPY ); + PatBlt( hdc, r.left, r.top, + thumbPos - (arrowSize - SCROLL_ARROW_THUMB_OVERLAP), + r.bottom - r.top, top_selected ? 0x0f0000 : PATCOPY ); r.left += thumbPos - (arrowSize - SCROLL_ARROW_THUMB_OVERLAP); - PatBlt( hdc, r.left + thumbSize, r.top + offset, - r.right - r.left - thumbSize - offset, - r.bottom - r.top - offset*2, - bottom_selected ? 0x0f0000 : PATCOPY ); + PatBlt( hdc, r.left + thumbSize, r.top, r.right - r.left - thumbSize, + r.bottom - r.top, bottom_selected ? 0x0f0000 : PATCOPY ); r.right = r.left + thumbSize; } /* Draw the thumb */ SelectObject( hdc, GetSysColorBrush(COLOR_BTNFACE) ); - if (TWEAK_WineLook == WIN31_LOOK) - { - Rectangle( hdc, r.left, r.top, r.right, r.bottom ); - r.top++, r.left++; - } - else - { - Rectangle( hdc, r.left+1, r.top+1, r.right-1, r.bottom-1 ); - } + Rectangle( hdc, r.left+1, r.top+1, r.right-1, r.bottom-1 ); DrawEdge( hdc, &r, EDGE_RAISED, BF_RECT ); if (Save_SCROLL_MovingThumb && diff --git a/controls/static.c b/controls/static.c index 5b58659b9af..70eba740637 100644 --- a/controls/static.c +++ b/controls/static.c @@ -274,7 +274,7 @@ static LRESULT StaticWndProc_common( HWND hwnd, UINT uMsg, WPARAM wParam, break; case WM_NCCREATE: - if ((TWEAK_WineLook > WIN31_LOOK) && (full_style & SS_SUNKEN)) + if (full_style & SS_SUNKEN) SetWindowLongA( hwnd, GWL_EXSTYLE, GetWindowLongA( hwnd, GWL_EXSTYLE ) | WS_EX_STATICEDGE ); @@ -585,9 +585,6 @@ static void STATIC_PaintEtchedfn( HWND hwnd, HDC hdc, DWORD style ) { RECT rc; - if (TWEAK_WineLook == WIN31_LOOK) - return; - GetClientRect( hwnd, &rc ); switch (style & SS_TYPEMASK) { diff --git a/dlls/user/user_main.c b/dlls/user/user_main.c index ee52fcf14e0..8c4cf1b2977 100644 --- a/dlls/user/user_main.c +++ b/dlls/user/user_main.c @@ -39,7 +39,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(graphics); USER_DRIVER USER_Driver; -WINE_LOOK TWEAK_WineLook = WIN31_LOOK; +WINE_LOOK TWEAK_WineLook = WIN95_LOOK; WORD USER_HeapSel = 0; /* USER heap selector */ HMODULE user32_module = 0; @@ -155,7 +155,7 @@ static void palette_init(void) */ static void tweak_init(void) { - static const char *OS = "Win3.1"; + static const char *OS = "Win95"; char buffer[80]; HKEY hkey; DWORD type, count = sizeof(buffer); @@ -163,7 +163,7 @@ static void tweak_init(void) if (RegOpenKeyA( HKEY_LOCAL_MACHINE, "Software\\Wine\\Wine\\Config\\Tweak.Layout", &hkey )) return; if (RegQueryValueExA( hkey, "WineLook", 0, &type, buffer, &count )) - strcpy( buffer, "Win31" ); /* default value */ + strcpy( buffer, "Win95" ); /* default value */ RegCloseKey( hkey ); /* WIN31_LOOK is default */ diff --git a/documentation/samples/config b/documentation/samples/config index 4c79407c9b3..23bab623f17 100644 --- a/documentation/samples/config +++ b/documentation/samples/config @@ -197,7 +197,7 @@ WINE REGISTRY Version 2 "SaveOnlyUpdatedKeys" = "Y" [Tweak.Layout] -;; supported styles are 'Win31'(default), 'Win95', 'Win98' +;; supported styles are 'Win95'(default), 'Win98' ;; this has *nothing* to do with the windows version Wine returns: ;; set the "Windows" value in the [Version] section if you want that. "WineLook" = "Win95" diff --git a/include/nonclient.h b/include/nonclient.h index b984a42513a..21ded3ea626 100644 --- a/include/nonclient.h +++ b/include/nonclient.h @@ -31,8 +31,7 @@ extern LONG NC_HandleNCLButtonDown( HWND hwnd, WPARAM wParam, LPARAM lParam ); extern LONG NC_HandleNCLButtonDblClk( HWND hwnd, WPARAM wParam, LPARAM lParam); extern LONG NC_HandleSysCommand( HWND hwnd, WPARAM wParam, LPARAM lParam ); extern LONG NC_HandleSetCursor( HWND hwnd, WPARAM wParam, LPARAM lParam ); -extern void NC_DrawSysButton( HWND hwnd, HDC hdc, BOOL down ); -extern BOOL NC_DrawSysButton95( HWND hwnd, HDC hdc, BOOL down ); +extern BOOL NC_DrawSysButton( HWND hwnd, HDC hdc, BOOL down ); extern void NC_GetSysPopupPos( HWND hwnd, RECT* rect ); extern void NC_GetInsideRect( HWND hwnd, RECT *rect ); diff --git a/include/user.h b/include/user.h index 28229ab8e31..04266d3ad19 100644 --- a/include/user.h +++ b/include/user.h @@ -140,7 +140,6 @@ extern BOOL USER_IsExitingThread( DWORD tid ); typedef enum { - WIN31_LOOK, WIN95_LOOK, WIN98_LOOK } WINE_LOOK; diff --git a/windows/defwnd.c b/windows/defwnd.c index dbd000895a8..ac4882ea532 100644 --- a/windows/defwnd.c +++ b/windows/defwnd.c @@ -155,38 +155,29 @@ HBRUSH DEFWND_ControlColor( HDC hDC, UINT ctlType ) if( ctlType == CTLCOLOR_SCROLLBAR) { HBRUSH hb = GetSysColorBrush(COLOR_SCROLLBAR); - if (TWEAK_WineLook == WIN31_LOOK) { - SetTextColor( hDC, RGB(0, 0, 0) ); - SetBkColor( hDC, RGB(255, 255, 255) ); - } else { - COLORREF bk = GetSysColor(COLOR_3DHILIGHT); - SetTextColor( hDC, GetSysColor(COLOR_3DFACE)); - SetBkColor( hDC, bk); + COLORREF bk = GetSysColor(COLOR_3DHILIGHT); + SetTextColor( hDC, GetSysColor(COLOR_3DFACE)); + SetBkColor( hDC, bk); + + /* if COLOR_WINDOW happens to be the same as COLOR_3DHILIGHT + * we better use 0x55aa bitmap brush to make scrollbar's background + * look different from the window background. + */ + if (bk == GetSysColor(COLOR_WINDOW)) + return CACHE_GetPattern55AABrush(); - /* if COLOR_WINDOW happens to be the same as COLOR_3DHILIGHT - * we better use 0x55aa bitmap brush to make scrollbar's background - * look different from the window background. - */ - if (bk == GetSysColor(COLOR_WINDOW)) { - return CACHE_GetPattern55AABrush(); - } - } UnrealizeObject( hb ); return hb; } SetTextColor( hDC, GetSysColor(COLOR_WINDOWTEXT)); - if (TWEAK_WineLook > WIN31_LOOK) { - if ((ctlType == CTLCOLOR_EDIT) || (ctlType == CTLCOLOR_LISTBOX)) - SetBkColor( hDC, GetSysColor(COLOR_WINDOW) ); - else { - SetBkColor( hDC, GetSysColor(COLOR_3DFACE) ); - return GetSysColorBrush(COLOR_3DFACE); - } - } - else + if ((ctlType == CTLCOLOR_EDIT) || (ctlType == CTLCOLOR_LISTBOX)) SetBkColor( hDC, GetSysColor(COLOR_WINDOW) ); + else { + SetBkColor( hDC, GetSysColor(COLOR_3DFACE) ); + return GetSysColorBrush(COLOR_3DFACE); + } return GetSysColorBrush(COLOR_WINDOW); } diff --git a/windows/mdi.c b/windows/mdi.c index 68450aa2033..76e5dd63ba3 100644 --- a/windows/mdi.c +++ b/windows/mdi.c @@ -808,6 +808,7 @@ static BOOL MDI_AugmentFrameMenu( HWND frame, HWND hChild ) HBITMAP hSysMenuBitmap = 0; INT nItems; UINT iId; + HICON hIcon; TRACE("frame %p,child %p\n",frame,hChild); @@ -828,18 +829,11 @@ static BOOL MDI_AugmentFrameMenu( HWND frame, HWND hChild ) AppendMenuA(menu,MF_HELP | MF_BITMAP, SC_RESTORE, (LPSTR)(DWORD)HBMMENU_MBAR_RESTORE ); - /* The close button is only present in Win 95 look */ - if(TWEAK_WineLook > WIN31_LOOK) - { - AppendMenuA(menu,MF_HELP | MF_BITMAP, - SC_CLOSE, (LPSTR)(DWORD)HBMMENU_MBAR_CLOSE ); - } + AppendMenuA(menu,MF_HELP | MF_BITMAP, + SC_CLOSE, (LPSTR)(DWORD)HBMMENU_MBAR_CLOSE ); - /* In Win 95 look, the system menu is replaced by the child icon */ - - if(TWEAK_WineLook > WIN31_LOOK) - { - HICON hIcon = (HICON)GetClassLongW(hChild, GCL_HICONSM); + /* The system menu is replaced by the child icon */ + hIcon = (HICON)GetClassLongW(hChild, GCL_HICONSM); if (!hIcon) hIcon = (HICON)GetClassLongW(hChild, GCL_HICON); if (!hIcon) @@ -869,9 +863,6 @@ static BOOL MDI_AugmentFrameMenu( HWND frame, HWND hChild ) hSysMenuBitmap = hBitmap; } } - } - else - hSysMenuBitmap = hBmpClose; if( !InsertMenuA(menu,0,MF_BYPOSITION | MF_BITMAP | MF_POPUP, (UINT_PTR)hSysPopup, (LPSTR)hSysMenuBitmap)) @@ -930,11 +921,8 @@ static BOOL MDI_RestoreFrameMenu( HWND frame, HWND hChild ) DeleteObject(HBITMAP_32(LOWORD(menuInfo.dwTypeData))); } - if(TWEAK_WineLook > WIN31_LOOK) - { - /* close */ - DeleteMenu(menu,GetMenuItemCount(menu) - 1,MF_BYPOSITION); - } + /* close */ + DeleteMenu(menu,GetMenuItemCount(menu) - 1,MF_BYPOSITION); /* restore */ DeleteMenu(menu,GetMenuItemCount(menu) - 1,MF_BYPOSITION); /* minimize */ diff --git a/windows/msgbox.c b/windows/msgbox.c index b40b91677f1..21ddff67aa3 100644 --- a/windows/msgbox.c +++ b/windows/msgbox.c @@ -47,20 +47,19 @@ static HFONT MSGBOX_OnInit(HWND hwnd, LPMSGBOXPARAMSW lpmb) int i, buttons; int bspace, bw, bh, theight, tleft, wwidth, wheight, bpos; int borheight, borwidth, iheight, ileft, iwidth, twidth, tiheight; + NONCLIENTMETRICSW nclm; LPCWSTR lpszText; WCHAR buf[256]; - if (TWEAK_WineLook >= WIN95_LOOK) { - NONCLIENTMETRICSW nclm; - nclm.cbSize = sizeof(nclm); - SystemParametersInfoW (SPI_GETNONCLIENTMETRICS, 0, &nclm, 0); - hFont = CreateFontIndirectW (&nclm.lfMessageFont); - /* set button font */ - for (i=1; i < 8; i++) - SendDlgItemMessageW (hwnd, i, WM_SETFONT, (WPARAM)hFont, 0); - /* set text font */ - SendDlgItemMessageW (hwnd, MSGBOX_IDTEXT, WM_SETFONT, (WPARAM)hFont, 0); - } + nclm.cbSize = sizeof(nclm); + SystemParametersInfoW (SPI_GETNONCLIENTMETRICS, 0, &nclm, 0); + hFont = CreateFontIndirectW (&nclm.lfMessageFont); + /* set button font */ + for (i=1; i < 8; i++) + SendDlgItemMessageW (hwnd, i, WM_SETFONT, (WPARAM)hFont, 0); + /* set text font */ + SendDlgItemMessageW (hwnd, MSGBOX_IDTEXT, WM_SETFONT, (WPARAM)hFont, 0); + if (HIWORD(lpmb->lpszCaption)) { SetWindowTextW(hwnd, lpmb->lpszCaption); } else { diff --git a/windows/nonclient.c b/windows/nonclient.c index 185b05e744f..5fe7f372ef9 100644 --- a/windows/nonclient.c +++ b/windows/nonclient.c @@ -42,8 +42,6 @@ WINE_DECLARE_DEBUG_CHANNEL(shell); BOOL NC_DrawGrayButton(HDC hdc, int x, int y); -static HBITMAP hbitmapClose; - static const BYTE lpGrayMask[] = { 0xAA, 0xA0, 0x55, 0x50, 0xAA, 0xA0, @@ -86,47 +84,8 @@ static const BYTE lpGrayMask[] = { 0xAA, 0xA0, #define HAS_MENU(w) (!((w)->dwStyle & WS_CHILD) && ((w)->wIDmenu != 0)) -/*********************************************************************** - * NC_AdjustRect - * - * Compute the size of the window rectangle from the size of the - * client rectangle. - */ -static void NC_AdjustRect( LPRECT rect, DWORD style, BOOL menu, DWORD exStyle ) -{ - if (TWEAK_WineLook > WIN31_LOOK) - ERR("Called in Win95 mode. Aiee! Please report this.\n" ); - - if(style & WS_ICONIC) return; - - if (HAS_THICKFRAME( style, exStyle )) - InflateRect( rect, GetSystemMetrics(SM_CXFRAME), GetSystemMetrics(SM_CYFRAME) ); - else if (HAS_DLGFRAME( style, exStyle )) - InflateRect( rect, GetSystemMetrics(SM_CXDLGFRAME), GetSystemMetrics(SM_CYDLGFRAME) ); - else if (HAS_THINFRAME( style )) - InflateRect( rect, GetSystemMetrics(SM_CXBORDER), GetSystemMetrics(SM_CYBORDER)); - - if ((style & WS_CAPTION) == WS_CAPTION) - rect->top -= GetSystemMetrics(SM_CYCAPTION) - GetSystemMetrics(SM_CYBORDER); - - if (menu) rect->top -= GetSystemMetrics(SM_CYMENU) + GetSystemMetrics(SM_CYBORDER); - - if (style & WS_VSCROLL) { - rect->right += GetSystemMetrics(SM_CXVSCROLL) - 1; - if(!HAS_ANYFRAME( style, exStyle )) - rect->right++; - } - - if (style & WS_HSCROLL) { - rect->bottom += GetSystemMetrics(SM_CYHSCROLL) - 1; - if(!HAS_ANYFRAME( style, exStyle )) - rect->bottom++; - } -} - - /****************************************************************************** - * NC_AdjustRectOuter95 + * NC_AdjustRectOuter * * Computes the size of the "outside" parts of the window based on the * parameters of the client area. @@ -142,21 +101,10 @@ static void NC_AdjustRect( LPRECT rect, DWORD style, BOOL menu, DWORD exStyle ) * menu bar. It does not include "inner" parts of the frame like client * edge, static edge or scroll bars. * - * Revision history - * 05-Jul-1997 Dave Cuthbert (dacut@ece.cmu.edu) - * Original (NC_AdjustRect95) cut & paste from NC_AdjustRect - * - * 20-Jun-1998 Eric Kohl (ekohl@abo.rhein-zeitung.de) - * Split NC_AdjustRect95 into NC_AdjustRectOuter95 and - * NC_AdjustRectInner95 and added handling of Win95 styles. - * - * 28-Jul-1999 Ove Kåven (ovek@arcticnet.no) - * Streamlined window style checks. - * *****************************************************************************/ static void -NC_AdjustRectOuter95 (LPRECT rect, DWORD style, BOOL menu, DWORD exStyle) +NC_AdjustRectOuter (LPRECT rect, DWORD style, BOOL menu, DWORD exStyle) { int adjust; if(style & WS_ICONIC) return; @@ -193,7 +141,7 @@ NC_AdjustRectOuter95 (LPRECT rect, DWORD style, BOOL menu, DWORD exStyle) /****************************************************************************** - * NC_AdjustRectInner95 + * NC_AdjustRectInner * * Computes the size of the "inside" part of the window based on the * parameters of the client area. @@ -208,18 +156,10 @@ NC_AdjustRectOuter95 (LPRECT rect, DWORD style, BOOL menu, DWORD exStyle) * window frame. It includes the client edge, the static edge and the * scroll bars. * - * Revision history - * 05-Jul-1997 Dave Cuthbert (dacut@ece.cmu.edu) - * Original (NC_AdjustRect95) cut & paste from NC_AdjustRect - * - * 20-Jun-1998 Eric Kohl (ekohl@abo.rhein-zeitung.de) - * Split NC_AdjustRect95 into NC_AdjustRectOuter95 and - * NC_AdjustRectInner95 and added handling of Win95 styles. - * *****************************************************************************/ static void -NC_AdjustRectInner95 (LPRECT rect, DWORD style, DWORD exStyle) +NC_AdjustRectInner (LPRECT rect, DWORD style, DWORD exStyle) { if(style & WS_ICONIC) return; @@ -445,13 +385,9 @@ BOOL WINAPI AdjustWindowRectEx( LPRECT rect, DWORD style, BOOL menu, DWORD exSty rect->left, rect->top, rect->right, rect->bottom, style, menu, exStyle ); - if (TWEAK_WineLook == WIN31_LOOK) - NC_AdjustRect( rect, style, menu, exStyle ); - else - { - NC_AdjustRectOuter95( rect, style, menu, exStyle ); - NC_AdjustRectInner95( rect, style, exStyle ); - } + NC_AdjustRectOuter( rect, style, menu, exStyle ); + NC_AdjustRectInner( rect, style, exStyle ); + return TRUE; } @@ -474,10 +410,7 @@ LONG NC_HandleNCCalcSize( HWND hwnd, RECT *winRect ) if (!IsIconic(hwnd)) { - if (TWEAK_WineLook == WIN31_LOOK) - NC_AdjustRect( &tmpRect, style, FALSE, exStyle ); - else - NC_AdjustRectOuter95( &tmpRect, style, FALSE, exStyle ); + NC_AdjustRectOuter( &tmpRect, style, FALSE, exStyle ); winRect->left -= tmpRect.left; winRect->top -= tmpRect.top; @@ -495,14 +428,12 @@ LONG NC_HandleNCCalcSize( HWND hwnd, RECT *winRect ) -tmpRect.left, -tmpRect.top ) + 1; } - if (TWEAK_WineLook > WIN31_LOOK) { - SetRect(&tmpRect, 0, 0, 0, 0); - NC_AdjustRectInner95 (&tmpRect, style, exStyle); - winRect->left -= tmpRect.left; - winRect->top -= tmpRect.top; - winRect->right -= tmpRect.right; - winRect->bottom -= tmpRect.bottom; - } + SetRect(&tmpRect, 0, 0, 0, 0); + NC_AdjustRectInner (&tmpRect, style, exStyle); + winRect->left -= tmpRect.left; + winRect->top -= tmpRect.top; + winRect->right -= tmpRect.right; + winRect->bottom -= tmpRect.bottom; if (winRect->top > winRect->bottom) winRect->bottom = winRect->top; @@ -539,9 +470,6 @@ void NC_GetInsideRect( HWND hwnd, RECT *rect ) else if (HAS_DLGFRAME( wndPtr->dwStyle, wndPtr->dwExStyle )) { InflateRect( rect, -GetSystemMetrics(SM_CXDLGFRAME), -GetSystemMetrics(SM_CYDLGFRAME)); - /* FIXME: this isn't in NC_AdjustRect? why not? */ - if ((TWEAK_WineLook == WIN31_LOOK) && (wndPtr->dwExStyle & WS_EX_DLGMODALFRAME)) - InflateRect( rect, -1, 0 ); } else if (HAS_THINFRAME( wndPtr->dwStyle )) { @@ -550,16 +478,13 @@ void NC_GetInsideRect( HWND hwnd, RECT *rect ) /* We have additional border information if the window * is a child (but not an MDI child) */ - if (TWEAK_WineLook != WIN31_LOOK) + if ( (wndPtr->dwStyle & WS_CHILD) && + ( (wndPtr->dwExStyle & WS_EX_MDICHILD) == 0 ) ) { - if ( (wndPtr->dwStyle & WS_CHILD) && - ( (wndPtr->dwExStyle & WS_EX_MDICHILD) == 0 ) ) - { - if (wndPtr->dwExStyle & WS_EX_CLIENTEDGE) - InflateRect (rect, -GetSystemMetrics(SM_CXEDGE), -GetSystemMetrics(SM_CYEDGE)); - if (wndPtr->dwExStyle & WS_EX_STATICEDGE) - InflateRect (rect, -GetSystemMetrics(SM_CXBORDER), -GetSystemMetrics(SM_CYBORDER)); - } + if (wndPtr->dwExStyle & WS_EX_CLIENTEDGE) + InflateRect (rect, -GetSystemMetrics(SM_CXEDGE), -GetSystemMetrics(SM_CYEDGE)); + if (wndPtr->dwExStyle & WS_EX_STATICEDGE) + InflateRect (rect, -GetSystemMetrics(SM_CXBORDER), -GetSystemMetrics(SM_CYBORDER)); } END: @@ -572,145 +497,11 @@ END: * NC_DoNCHitTest * * Handle a WM_NCHITTEST message. Called from NC_HandleNCHitTest(). - */ - -static LONG NC_DoNCHitTest (WND *wndPtr, POINT pt ) -{ - RECT rect; - - TRACE("hwnd=%p pt=%ld,%ld\n", wndPtr->hwndSelf, pt.x, pt.y ); - - GetWindowRect(wndPtr->hwndSelf, &rect ); - if (!PtInRect( &rect, pt )) return HTNOWHERE; - - if (wndPtr->dwStyle & WS_MINIMIZE) return HTCAPTION; - - /* Check borders */ - if (HAS_THICKFRAME( wndPtr->dwStyle, wndPtr->dwExStyle )) - { - InflateRect( &rect, -GetSystemMetrics(SM_CXFRAME), -GetSystemMetrics(SM_CYFRAME) ); - if (!PtInRect( &rect, pt )) - { - /* Check top sizing border */ - if (pt.y < rect.top) - { - if (pt.x < rect.left+GetSystemMetrics(SM_CXSIZE)) return HTTOPLEFT; - if (pt.x >= rect.right-GetSystemMetrics(SM_CXSIZE)) return HTTOPRIGHT; - return HTTOP; - } - /* Check bottom sizing border */ - if (pt.y >= rect.bottom) - { - if (pt.x < rect.left+GetSystemMetrics(SM_CXSIZE)) return HTBOTTOMLEFT; - if (pt.x >= rect.right-GetSystemMetrics(SM_CXSIZE)) return HTBOTTOMRIGHT; - return HTBOTTOM; - } - /* Check left sizing border */ - if (pt.x < rect.left) - { - if (pt.y < rect.top+GetSystemMetrics(SM_CYSIZE)) return HTTOPLEFT; - if (pt.y >= rect.bottom-GetSystemMetrics(SM_CYSIZE)) return HTBOTTOMLEFT; - return HTLEFT; - } - /* Check right sizing border */ - if (pt.x >= rect.right) - { - if (pt.y < rect.top+GetSystemMetrics(SM_CYSIZE)) return HTTOPRIGHT; - if (pt.y >= rect.bottom-GetSystemMetrics(SM_CYSIZE)) return HTBOTTOMRIGHT; - return HTRIGHT; - } - } - } - else /* No thick frame */ - { - if (HAS_DLGFRAME( wndPtr->dwStyle, wndPtr->dwExStyle )) - InflateRect(&rect, -GetSystemMetrics(SM_CXDLGFRAME), -GetSystemMetrics(SM_CYDLGFRAME)); - else if (HAS_THINFRAME( wndPtr->dwStyle )) - InflateRect(&rect, -GetSystemMetrics(SM_CXBORDER), -GetSystemMetrics(SM_CYBORDER)); - if (!PtInRect( &rect, pt )) return HTBORDER; - } - - /* Check caption */ - - if ((wndPtr->dwStyle & WS_CAPTION) == WS_CAPTION) - { - rect.top += GetSystemMetrics(SM_CYCAPTION) - GetSystemMetrics(SM_CYBORDER); - if (!PtInRect( &rect, pt )) - { - /* Check system menu */ - if ((wndPtr->dwStyle & WS_SYSMENU) && !(wndPtr->dwExStyle & WS_EX_TOOLWINDOW)) - rect.left += GetSystemMetrics(SM_CXSIZE); - if (pt.x <= rect.left) return HTSYSMENU; - - /* Check maximize box */ - if (wndPtr->dwStyle & WS_MAXIMIZEBOX) - rect.right -= GetSystemMetrics(SM_CXSIZE) + 1; - - if (pt.x >= rect.right) return HTMAXBUTTON; - /* Check minimize box */ - if (wndPtr->dwStyle & WS_MINIMIZEBOX) - rect.right -= GetSystemMetrics(SM_CXSIZE) + 1; - if (pt.x >= rect.right) return HTMINBUTTON; - return HTCAPTION; - } - } - - /* Check client area */ - - ScreenToClient( wndPtr->hwndSelf, &pt ); - GetClientRect( wndPtr->hwndSelf, &rect ); - if (PtInRect( &rect, pt )) return HTCLIENT; - - /* Check vertical scroll bar */ - - if (wndPtr->dwStyle & WS_VSCROLL) - { - if((wndPtr->dwExStyle & WS_EX_LEFTSCROLLBAR) != 0) - rect.left -= GetSystemMetrics(SM_CXVSCROLL); - else - rect.right += GetSystemMetrics(SM_CXVSCROLL); - if (PtInRect( &rect, pt )) return HTVSCROLL; - } - - /* Check horizontal scroll bar */ - - if (wndPtr->dwStyle & WS_HSCROLL) - { - rect.bottom += GetSystemMetrics(SM_CYHSCROLL); - if (PtInRect( &rect, pt )) - { - /* Check size box */ - if ((wndPtr->dwStyle & WS_VSCROLL) && - ((((wndPtr->dwExStyle & WS_EX_LEFTSCROLLBAR) != 0) && (pt.x <= rect.left + GetSystemMetrics(SM_CXVSCROLL))) || - (((wndPtr->dwExStyle & WS_EX_LEFTSCROLLBAR) == 0) && (pt.x >= rect.right - GetSystemMetrics(SM_CXVSCROLL))))) - return HTSIZE; - return HTHSCROLL; - } - } - - /* Check menu bar */ - - if (HAS_MENU(wndPtr)) - { - if ((pt.y < 0) && (pt.x >= 0) && (pt.x < rect.right)) - return HTMENU; - } - - /* Has to return HTNOWHERE if nothing was found - Could happen when a window has a customized non client area */ - return HTNOWHERE; -} - - -/*********************************************************************** - * NC_DoNCHitTest95 - * - * Handle a WM_NCHITTEST message. Called from NC_HandleNCHitTest(). * * FIXME: Just a modified copy of the Win 3.1 version. */ -static LONG NC_DoNCHitTest95 (WND *wndPtr, POINT pt ) +static LONG NC_DoNCHitTest (WND *wndPtr, POINT pt ) { RECT rect; @@ -865,93 +656,20 @@ LONG NC_HandleNCHitTest (HWND hwnd , POINT pt) if (!wndPtr) return HTERROR; - if (TWEAK_WineLook == WIN31_LOOK) - retvalue = NC_DoNCHitTest (wndPtr, pt); - else - retvalue = NC_DoNCHitTest95 (wndPtr, pt); + retvalue = NC_DoNCHitTest (wndPtr, pt); WIN_ReleaseWndPtr(wndPtr); return retvalue; } -/*********************************************************************** - * NC_DrawSysButton - */ -void NC_DrawSysButton( HWND hwnd, HDC hdc, BOOL down ) -{ - RECT rect; - HDC hdcMem; - HBITMAP hbitmap; - - NC_GetInsideRect( hwnd, &rect ); - hdcMem = CreateCompatibleDC( hdc ); - hbitmap = SelectObject( hdcMem, hbitmapClose ); - BitBlt(hdc, rect.left, rect.top, GetSystemMetrics(SM_CXSIZE), GetSystemMetrics(SM_CYSIZE), - hdcMem, (GetWindowLongA(hwnd,GWL_STYLE) & WS_CHILD) ? GetSystemMetrics(SM_CXSIZE) : 0, 0, - down ? NOTSRCCOPY : SRCCOPY ); - SelectObject( hdcMem, hbitmap ); - DeleteDC( hdcMem ); -} - - -/*********************************************************************** - * NC_DrawMaxButton - */ -static void NC_DrawMaxButton( HWND hwnd, HDC hdc, BOOL down ) -{ - RECT rect; - UINT flags = IsZoomed(hwnd) ? DFCS_CAPTIONRESTORE : DFCS_CAPTIONMAX; - - NC_GetInsideRect( hwnd, &rect ); - rect.left = rect.right - GetSystemMetrics(SM_CXSIZE) + 1; - rect.bottom = rect.top + GetSystemMetrics(SM_CYSIZE) - 1; - rect.top += 1; - rect.right -= 1; - if (down) flags |= DFCS_PUSHED; - DrawFrameControl( hdc, &rect, DFC_CAPTION, flags ); -} - - -/*********************************************************************** - * NC_DrawMinButton - */ -static void NC_DrawMinButton( HWND hwnd, HDC hdc, BOOL down ) -{ - RECT rect; - UINT flags = DFCS_CAPTIONMIN; - DWORD style = GetWindowLongA( hwnd, GWL_STYLE ); - - NC_GetInsideRect( hwnd, &rect ); - if (style & (WS_MAXIMIZEBOX|WS_MINIMIZEBOX)) - rect.right -= GetSystemMetrics(SM_CXSIZE) - 2; - rect.left = rect.right - GetSystemMetrics(SM_CXSIZE) + 1; - rect.bottom = rect.top + GetSystemMetrics(SM_CYSIZE) - 1; - rect.top += 1; - rect.right -= 1; - if (down) flags |= DFCS_PUSHED; - DrawFrameControl( hdc, &rect, DFC_CAPTION, flags ); -} - - /****************************************************************************** * - * void NC_DrawSysButton95( - * HWND hwnd, - * HDC hdc, - * BOOL down ) + * NC_DrawSysButton * - * Draws the Win95 system icon. - * - * Revision history - * 05-Jul-1997 Dave Cuthbert (dacut@ece.cmu.edu) - * Original implementation from NC_DrawSysButton source. - * 11-Jun-1998 Eric Kohl (ekohl@abo.rhein-zeitung.de) - * Fixed most bugs. + * Draws the system icon. * *****************************************************************************/ - -BOOL -NC_DrawSysButton95 (HWND hwnd, HDC hdc, BOOL down) +BOOL NC_DrawSysButton (HWND hwnd, HDC hdc, BOOL down) { HICON hIcon = NC_IconForWindow( hwnd ); @@ -969,23 +687,15 @@ NC_DrawSysButton95 (HWND hwnd, HDC hdc, BOOL down) /****************************************************************************** * - * void NC_DrawCloseButton95( - * HWND hwnd, - * HDC hdc, - * BOOL down, - * BOOL bGrayed ) + * NC_DrawCloseButton * - * Draws the Win95 close button. + * Draws the close button. * * If bGrayed is true, then draw a disabled Close button * - * Revision history - * 11-Jun-1998 Eric Kohl (ekohl@abo.rhein-zeitung.de) - * Original implementation from NC_DrawSysButton95 source. - * *****************************************************************************/ -static void NC_DrawCloseButton95 (HWND hwnd, HDC hdc, BOOL down, BOOL bGrayed) +static void NC_DrawCloseButton (HWND hwnd, HDC hdc, BOOL down, BOOL bGrayed) { RECT rect; @@ -1017,12 +727,12 @@ static void NC_DrawCloseButton95 (HWND hwnd, HDC hdc, BOOL down, BOOL bGrayed) } /****************************************************************************** - * NC_DrawMaxButton95 + * NC_DrawMaxButton * - * Draws the maximize button for Win95 style windows. + * Draws the maximize button for windows. * If bGrayed is true, then draw a disabled Maximize button */ -static void NC_DrawMaxButton95(HWND hwnd,HDC hdc,BOOL down, BOOL bGrayed) +static void NC_DrawMaxButton(HWND hwnd,HDC hdc,BOOL down, BOOL bGrayed) { RECT rect; UINT flags = IsZoomed(hwnd) ? DFCS_CAPTIONRESTORE : DFCS_CAPTIONMAX; @@ -1040,12 +750,12 @@ static void NC_DrawMaxButton95(HWND hwnd,HDC hdc,BOOL down, BOOL bGrayed) } /****************************************************************************** - * NC_DrawMinButton95 + * NC_DrawMinButton * - * Draws the minimize button for Win95 style windows. + * Draws the minimize button for windows. * If bGrayed is true, then draw a disabled Minimize button */ -static void NC_DrawMinButton95(HWND hwnd,HDC hdc,BOOL down, BOOL bGrayed) +static void NC_DrawMinButton(HWND hwnd,HDC hdc,BOOL down, BOOL bGrayed) { RECT rect; UINT flags = DFCS_CAPTIONMIN; @@ -1065,99 +775,15 @@ static void NC_DrawMinButton95(HWND hwnd,HDC hdc,BOOL down, BOOL bGrayed) DrawFrameControl( hdc, &rect, DFC_CAPTION, flags ); } -/*********************************************************************** - * NC_DrawFrame - * - * Draw a window frame inside the given rectangle, and update the rectangle. - * The correct pen for the frame must be selected in the DC. - */ -static void NC_DrawFrame( HDC hdc, RECT *rect, BOOL dlgFrame, - BOOL active ) -{ - INT width, height; - - if (TWEAK_WineLook != WIN31_LOOK) - ERR("Called in Win95 mode. Aiee! Please report this.\n" ); - - if (dlgFrame) - { - width = GetSystemMetrics(SM_CXDLGFRAME) - 1; - height = GetSystemMetrics(SM_CYDLGFRAME) - 1; - SelectObject( hdc, GetSysColorBrush(active ? COLOR_ACTIVECAPTION : - COLOR_INACTIVECAPTION) ); - } - else - { - width = GetSystemMetrics(SM_CXFRAME) - 2; - height = GetSystemMetrics(SM_CYFRAME) - 2; - SelectObject( hdc, GetSysColorBrush(active ? COLOR_ACTIVEBORDER : - COLOR_INACTIVEBORDER) ); - } - - /* Draw frame */ - PatBlt( hdc, rect->left, rect->top, - rect->right - rect->left, height, PATCOPY ); - PatBlt( hdc, rect->left, rect->top, - width, rect->bottom - rect->top, PATCOPY ); - PatBlt( hdc, rect->left, rect->bottom - 1, - rect->right - rect->left, -height, PATCOPY ); - PatBlt( hdc, rect->right - 1, rect->top, - -width, rect->bottom - rect->top, PATCOPY ); - - if (dlgFrame) - { - InflateRect( rect, -width, -height ); - } - else - { - INT decYOff = GetSystemMetrics(SM_CXFRAME) + GetSystemMetrics(SM_CXSIZE) - 1; - INT decXOff = GetSystemMetrics(SM_CYFRAME) + GetSystemMetrics(SM_CYSIZE) - 1; - - /* Draw inner rectangle */ - - SelectObject( hdc, GetStockObject(NULL_BRUSH) ); - Rectangle( hdc, rect->left + width, rect->top + height, - rect->right - width , rect->bottom - height ); - - /* Draw the decorations */ - - MoveToEx( hdc, rect->left, rect->top + decYOff, NULL ); - LineTo( hdc, rect->left + width, rect->top + decYOff ); - MoveToEx( hdc, rect->right - 1, rect->top + decYOff, NULL ); - LineTo( hdc, rect->right - width - 1, rect->top + decYOff ); - MoveToEx( hdc, rect->left, rect->bottom - decYOff, NULL ); - LineTo( hdc, rect->left + width, rect->bottom - decYOff ); - MoveToEx( hdc, rect->right - 1, rect->bottom - decYOff, NULL ); - LineTo( hdc, rect->right - width - 1, rect->bottom - decYOff ); - - MoveToEx( hdc, rect->left + decXOff, rect->top, NULL ); - LineTo( hdc, rect->left + decXOff, rect->top + height); - MoveToEx( hdc, rect->left + decXOff, rect->bottom - 1, NULL ); - LineTo( hdc, rect->left + decXOff, rect->bottom - height - 1 ); - MoveToEx( hdc, rect->right - decXOff, rect->top, NULL ); - LineTo( hdc, rect->right - decXOff, rect->top + height ); - MoveToEx( hdc, rect->right - decXOff, rect->bottom - 1, NULL ); - LineTo( hdc, rect->right - decXOff, rect->bottom - height - 1 ); - - InflateRect( rect, -width - 1, -height - 1 ); - } -} - - /****************************************************************************** * - * void NC_DrawFrame95( - * HDC hdc, - * RECT *rect, - * BOOL active, - * DWORD style, - * DWORD exStyle ) + * NC_DrawFrame * * Draw a window frame inside the given rectangle, and update the rectangle. * * Bugs * Many. First, just what IS a frame in Win95? Note that the 3D look - * on the outer edge is handled by NC_DoNCPaint95. As is the inner + * on the outer edge is handled by NC_DoNCPaint. As is the inner * edge. The inner rectangle just inside the frame is handled by the * Caption code. * @@ -1166,22 +792,9 @@ static void NC_DrawFrame( HDC hdc, RECT *rect, BOOL dlgFrame, * them lately, but just to get this code right). Even so, it doesn't * appear to be so. It's being worked on... * - * Revision history - * 06-Jul-1997 Dave Cuthbert (dacut@ece.cmu.edu) - * Original implementation (based on NC_DrawFrame) - * 02-Jun-1998 Eric Kohl (ekohl@abo.rhein-zeitung.de) - * Some minor fixes. - * 29-Jun-1999 Ove Kåven (ovek@arcticnet.no) - * Fixed a fix or something. - * *****************************************************************************/ -static void NC_DrawFrame95( - HDC hdc, - RECT *rect, - BOOL active, - DWORD style, - DWORD exStyle) +static void NC_DrawFrame( HDC hdc, RECT *rect, BOOL active, DWORD style, DWORD exStyle) { INT width, height; @@ -1239,97 +852,17 @@ static void NC_DrawFrame95( } -/*********************************************************************** - * NC_DrawCaption - * - * Draw the window caption. - * The correct pen for the window frame must be selected in the DC. - */ -static void NC_DrawCaption( HDC hdc, RECT *rect, HWND hwnd, - DWORD style, BOOL active ) -{ - RECT r = *rect; - char buffer[256]; - - if (!hbitmapClose) - { - if (!(hbitmapClose = LoadBitmapA( 0, MAKEINTRESOURCEA(OBM_OLD_CLOSE) ))) return; - } - - if (GetWindowLongA( hwnd, GWL_EXSTYLE) & WS_EX_DLGMODALFRAME) - { - HBRUSH hbrushOld = SelectObject(hdc, GetSysColorBrush(COLOR_WINDOW) ); - PatBlt( hdc, r.left, r.top, 1, r.bottom-r.top+1,PATCOPY ); - PatBlt( hdc, r.right-1, r.top, 1, r.bottom-r.top+1, PATCOPY ); - PatBlt( hdc, r.left, r.top-1, r.right-r.left, 1, PATCOPY ); - r.left++; - r.right--; - SelectObject( hdc, hbrushOld ); - } - MoveToEx( hdc, r.left, r.bottom, NULL ); - LineTo( hdc, r.right, r.bottom ); - - if (style & WS_SYSMENU) - { - NC_DrawSysButton( hwnd, hdc, FALSE ); - r.left += GetSystemMetrics(SM_CXSIZE) + 1; - MoveToEx( hdc, r.left - 1, r.top, NULL ); - LineTo( hdc, r.left - 1, r.bottom ); - } - FillRect( hdc, &r, GetSysColorBrush(active ? COLOR_ACTIVECAPTION : COLOR_INACTIVECAPTION) ); - if (style & WS_MAXIMIZEBOX) - { - NC_DrawMaxButton( hwnd, hdc, FALSE ); - r.right -= GetSystemMetrics(SM_CXSIZE) + 1; - } - if (style & WS_MINIMIZEBOX) - { - NC_DrawMinButton( hwnd, hdc, FALSE ); - r.right -= GetSystemMetrics(SM_CXSIZE) + 1; - } - - if (GetWindowTextA( hwnd, buffer, sizeof(buffer) )) - { - if (active) SetTextColor( hdc, GetSysColor( COLOR_CAPTIONTEXT ) ); - else SetTextColor( hdc, GetSysColor( COLOR_INACTIVECAPTIONTEXT ) ); - SetBkMode( hdc, TRANSPARENT ); - DrawTextA( hdc, buffer, -1, &r, - DT_SINGLELINE | DT_CENTER | DT_VCENTER | DT_NOPREFIX ); - } -} - - /****************************************************************************** * - * NC_DrawCaption95( - * HDC hdc, - * RECT *rect, - * HWND hwnd, - * DWORD style, - * BOOL active ) + * NC_DrawCaption * - * Draw the window caption for Win95 style windows. + * Draw the window caption for windows. * The correct pen for the window frame must be selected in the DC. * - * Bugs - * Hey, a function that finally works! Well, almost. - * It's being worked on. - * - * Revision history - * 05-Jul-1997 Dave Cuthbert (dacut@ece.cmu.edu) - * Original implementation. - * 02-Jun-1998 Eric Kohl (ekohl@abo.rhein-zeitung.de) - * Some minor fixes. - * *****************************************************************************/ -static void NC_DrawCaption95( - HDC hdc, - RECT *rect, - HWND hwnd, - DWORD style, - DWORD exStyle, - BOOL active ) +static void NC_DrawCaption( HDC hdc, RECT *rect, HWND hwnd, DWORD style, + DWORD exStyle, BOOL active ) { RECT r = *rect; char buffer[256]; @@ -1349,7 +882,7 @@ static void NC_DrawCaption95( COLOR_INACTIVECAPTION) ); if ((style & WS_SYSMENU) && !(exStyle & WS_EX_TOOLWINDOW)) { - if (NC_DrawSysButton95 (hwnd, hdc, FALSE)) + if (NC_DrawSysButton (hwnd, hdc, FALSE)) r.left += GetSystemMetrics(SM_CYCAPTION) - 1; } @@ -1362,8 +895,8 @@ static void NC_DrawCaption95( state = GetMenuState(hSysMenu, SC_CLOSE, MF_BYCOMMAND); /* Draw a grayed close button if disabled and a normal one if SC_CLOSE is not there */ - NC_DrawCloseButton95 (hwnd, hdc, FALSE, - ((((state & MF_DISABLED) || (state & MF_GRAYED))) && (state != 0xFFFFFFFF))); + NC_DrawCloseButton (hwnd, hdc, FALSE, + ((((state & MF_DISABLED) || (state & MF_GRAYED))) && (state != 0xFFFFFFFF))); r.right -= GetSystemMetrics(SM_CYCAPTION) - 1; if ((style & WS_MAXIMIZEBOX) || (style & WS_MINIMIZEBOX)) @@ -1371,10 +904,10 @@ static void NC_DrawCaption95( /* In win95 the two buttons are always there */ /* But if the menu item is not in the menu they're disabled*/ - NC_DrawMaxButton95( hwnd, hdc, FALSE, (!(style & WS_MAXIMIZEBOX))); + NC_DrawMaxButton( hwnd, hdc, FALSE, (!(style & WS_MAXIMIZEBOX))); r.right -= GetSystemMetrics(SM_CXSIZE) + 1; - NC_DrawMinButton95( hwnd, hdc, FALSE, (!(style & WS_MINIMIZEBOX))); + NC_DrawMinButton( hwnd, hdc, FALSE, (!(style & WS_MINIMIZEBOX))); r.right -= GetSystemMetrics(SM_CXSIZE) + 1; } } @@ -1400,141 +933,20 @@ static void NC_DrawCaption95( } - -/*********************************************************************** - * NC_DoNCPaint - * - * Paint the non-client area. clip is currently unused. - */ -static void NC_DoNCPaint( HWND hwnd, HRGN clip, BOOL suppress_menupaint ) -{ - HDC hdc; - RECT rect; - BOOL active; - WND *wndPtr; - DWORD dwStyle, dwExStyle; - WORD flags; - RECT rectClient, rectWindow; - int has_menu; - - if (!(wndPtr = WIN_GetPtr( hwnd )) || wndPtr == WND_OTHER_PROCESS) return; - has_menu = HAS_MENU(wndPtr); - dwStyle = wndPtr->dwStyle; - dwExStyle = wndPtr->dwExStyle; - flags = wndPtr->flags; - rectClient = wndPtr->rectClient; - rectWindow = wndPtr->rectWindow; - WIN_ReleasePtr( wndPtr ); - - if ( dwStyle & WS_MINIMIZE || - !WIN_IsWindowDrawable( hwnd, 0 )) return; /* Nothing to do */ - - active = flags & WIN_NCACTIVATED; - - TRACE("%p %d\n", hwnd, active ); - - if (!(hdc = GetDCEx( hwnd, (clip > (HRGN)1) ? clip : 0, DCX_USESTYLE | DCX_WINDOW | - ((clip > (HRGN)1) ? (DCX_INTERSECTRGN | DCX_KEEPCLIPRGN): 0) ))) return; - - if (ExcludeVisRect16( HDC_16(hdc), rectClient.left-rectWindow.left, - rectClient.top-rectWindow.top, - rectClient.right-rectWindow.left, - rectClient.bottom-rectWindow.top ) - == NULLREGION) - { - ReleaseDC( hwnd, hdc ); - return; - } - - rect.top = rect.left = 0; - rect.right = rectWindow.right - rectWindow.left; - rect.bottom = rectWindow.bottom - rectWindow.top; - - SelectObject( hdc, SYSCOLOR_GetPen(COLOR_WINDOWFRAME) ); - - if (HAS_ANYFRAME( dwStyle, dwExStyle )) - { - SelectObject( hdc, GetStockObject(NULL_BRUSH) ); - Rectangle( hdc, 0, 0, rect.right, rect.bottom ); - InflateRect( &rect, -1, -1 ); - } - - if (HAS_THICKFRAME( dwStyle, dwExStyle )) - NC_DrawFrame(hdc, &rect, FALSE, active ); - else if (HAS_DLGFRAME( dwStyle, dwExStyle )) - NC_DrawFrame( hdc, &rect, TRUE, active ); - - if ((dwStyle & WS_CAPTION) == WS_CAPTION) - { - RECT r = rect; - r.bottom = rect.top + GetSystemMetrics(SM_CYSIZE); - rect.top += GetSystemMetrics(SM_CYSIZE) + GetSystemMetrics(SM_CYBORDER); - NC_DrawCaption( hdc, &r, hwnd, dwStyle, active ); - } - - if (has_menu) - { - RECT r = rect; - r.bottom = rect.top + GetSystemMetrics(SM_CYMENU); /* default height */ - rect.top += MENU_DrawMenuBar( hdc, &r, hwnd, suppress_menupaint ); - } - - /* Draw the scroll-bars */ - - if (dwStyle & WS_VSCROLL) - SCROLL_DrawScrollBar( hwnd, hdc, SB_VERT, TRUE, TRUE ); - if (dwStyle & WS_HSCROLL) - SCROLL_DrawScrollBar( hwnd, hdc, SB_HORZ, TRUE, TRUE ); - - /* Draw the "size-box" */ - - if ((dwStyle & WS_VSCROLL) && (dwStyle & WS_HSCROLL)) - { - RECT r = rect; - if((dwExStyle & WS_EX_LEFTSCROLLBAR) != 0) - r.right = r.left + GetSystemMetrics(SM_CXVSCROLL) + 1; - else - r.left = r.right - GetSystemMetrics(SM_CXVSCROLL) + 1; - r.top = r.bottom - GetSystemMetrics(SM_CYHSCROLL) + 1; - if(wndPtr->dwStyle & WS_BORDER) { - r.left++; - r.top++; - } - FillRect( hdc, &r, GetSysColorBrush(COLOR_SCROLLBAR) ); - } - - ReleaseDC( hwnd, hdc ); -} - - /****************************************************************************** * - * void NC_DoNCPaint95( - * HWND hwnd, - * HRGN clip, - * BOOL suppress_menupaint ) + * NC_DoNCPaint * - * Paint the non-client area for Win95 windows. The clip region is + * Paint the non-client area for windows. The clip region is * currently ignored. * * Bugs * grep -E -A10 -B5 \(95\)\|\(Bugs\)\|\(FIXME\) windows/nonclient.c \ * misc/tweak.c controls/menu.c # :-) * - * Revision history - * 03-Jul-1997 Dave Cuthbert (dacut@ece.cmu.edu) - * Original implementation - * 10-Jun-1998 Eric Kohl (ekohl@abo.rhein-zeitung.de) - * Fixed some bugs. - * 29-Jun-1999 Ove Kåven (ovek@arcticnet.no) - * Streamlined window style checks. - * *****************************************************************************/ -static void NC_DoNCPaint95( - HWND hwnd, - HRGN clip, - BOOL suppress_menupaint ) +static void NC_DoNCPaint( HWND hwnd, HRGN clip, BOOL suppress_menupaint ) { HDC hdc; RECT rfuzz, rect, rectClip; @@ -1603,7 +1015,7 @@ static void NC_DoNCPaint95( DrawEdge (hdc, &rect, EDGE_RAISED, BF_RECT | BF_ADJUST); } - NC_DrawFrame95(hdc, &rect, active, dwStyle, dwExStyle ); + NC_DrawFrame(hdc, &rect, active, dwStyle, dwExStyle ); if ((dwStyle & WS_CAPTION) == WS_CAPTION) { @@ -1617,8 +1029,7 @@ static void NC_DoNCPaint95( rect.top += GetSystemMetrics(SM_CYCAPTION); } if( !clip || IntersectRect( &rfuzz, &r, &rectClip ) ) - NC_DrawCaption95 (hdc, &r, hwnd, dwStyle, - dwExStyle, active); + NC_DrawCaption(hdc, &r, hwnd, dwStyle, dwExStyle, active); } if (has_menu) @@ -1676,10 +1087,8 @@ LONG NC_HandleNCPaint( HWND hwnd , HRGN clip) { if( dwStyle & WS_MINIMIZE ) WINPOS_RedrawIconTitle( hwnd ); - else if (TWEAK_WineLook == WIN31_LOOK) - NC_DoNCPaint( hwnd, clip, FALSE ); else - NC_DoNCPaint95( hwnd, clip, FALSE ); + NC_DoNCPaint( hwnd, clip, FALSE ); } return 0; } @@ -1705,11 +1114,10 @@ LONG NC_HandleNCActivate( HWND hwnd, WPARAM wParam ) else wndPtr->flags &= ~WIN_NCACTIVATED; WIN_ReleaseWndPtr(wndPtr); - if (IsIconic(hwnd)) WINPOS_RedrawIconTitle( hwnd ); - else if (TWEAK_WineLook == WIN31_LOOK) - NC_DoNCPaint( hwnd, (HRGN)1, FALSE ); + if (IsIconic(hwnd)) + WINPOS_RedrawIconTitle( hwnd ); else - NC_DoNCPaint95( hwnd, (HRGN)1, FALSE ); + NC_DoNCPaint( hwnd, (HRGN)1, FALSE ); } return TRUE; } @@ -1781,20 +1189,14 @@ void NC_GetSysPopupPos( HWND hwnd, RECT* rect ) OffsetRect( rect, wndPtr->rectWindow.left, wndPtr->rectWindow.top); if (wndPtr->dwStyle & WS_CHILD) ClientToScreen( GetParent(hwnd), (POINT *)rect ); - if (TWEAK_WineLook == WIN31_LOOK) { - rect->right = rect->left + GetSystemMetrics(SM_CXSIZE); - rect->bottom = rect->top + GetSystemMetrics(SM_CYSIZE); - } - else { - rect->right = rect->left + GetSystemMetrics(SM_CYCAPTION) - 1; - rect->bottom = rect->top + GetSystemMetrics(SM_CYCAPTION) - 1; - } + rect->right = rect->left + GetSystemMetrics(SM_CYCAPTION) - 1; + rect->bottom = rect->top + GetSystemMetrics(SM_CYCAPTION) - 1; WIN_ReleaseWndPtr( wndPtr ); } } /*********************************************************************** - * NC_TrackMinMaxBox95 + * NC_TrackMinMaxBox * * Track a mouse button press on the minimize or maximize box. * @@ -1803,7 +1205,7 @@ void NC_GetSysPopupPos( HWND hwnd, RECT* rect ) * event. * */ -static void NC_TrackMinMaxBox95( HWND hwnd, WORD wParam ) +static void NC_TrackMinMaxBox( HWND hwnd, WORD wParam ) { MSG msg; HDC hdc = GetWindowDC( hwnd ); @@ -1823,7 +1225,7 @@ static void NC_TrackMinMaxBox95( HWND hwnd, WORD wParam ) /* Check if the sysmenu item for minimize is there */ state = GetMenuState(hSysMenu, SC_MINIMIZE, MF_BYCOMMAND); - paintButton = &NC_DrawMinButton95; + paintButton = &NC_DrawMinButton; } else { @@ -1834,7 +1236,7 @@ static void NC_TrackMinMaxBox95( HWND hwnd, WORD wParam ) /* Check if the sysmenu item for maximize is there */ state = GetMenuState(hSysMenu, SC_MAXIMIZE, MF_BYCOMMAND); - paintButton = &NC_DrawMaxButton95; + paintButton = &NC_DrawMaxButton; } SetCapture( hwnd ); @@ -1878,67 +1280,11 @@ static void NC_TrackMinMaxBox95( HWND hwnd, WORD wParam ) } /*********************************************************************** - * NC_TrackMinMaxBox - * - * Track a mouse button press on the minimize or maximize box. - */ -static void NC_TrackMinMaxBox( HWND hwnd, WORD wParam ) -{ - MSG msg; - HDC hdc = GetWindowDC( hwnd ); - BOOL pressed = TRUE; - void (*paintButton)(HWND, HDC, BOOL); - - SetCapture( hwnd ); - - if (wParam == HTMINBUTTON) - paintButton = &NC_DrawMinButton; - else - paintButton = &NC_DrawMaxButton; - - (*paintButton)( hwnd, hdc, TRUE); - - while(1) - { - BOOL oldstate = pressed; - - if (!GetMessageW( &msg, 0, WM_MOUSEFIRST, WM_MOUSELAST )) break; - if (CallMsgFilterW( &msg, MSGF_MAX )) continue; - - if(msg.message == WM_LBUTTONUP) - break; - - if(msg.message != WM_MOUSEMOVE) - continue; - - pressed = (NC_HandleNCHitTest( hwnd, msg.pt ) == wParam); - if (pressed != oldstate) - (*paintButton)( hwnd, hdc, pressed); - } - - if(pressed) - (*paintButton)( hwnd, hdc, FALSE); - - ReleaseCapture(); - ReleaseDC( hwnd, hdc ); - - if (!pressed) return; - - if (wParam == HTMINBUTTON) - SendMessageA( hwnd, WM_SYSCOMMAND, SC_MINIMIZE, MAKELONG(msg.pt.x,msg.pt.y) ); - else - SendMessageA( hwnd, WM_SYSCOMMAND, - IsZoomed(hwnd) ? SC_RESTORE:SC_MAXIMIZE, MAKELONG(msg.pt.x,msg.pt.y) ); -} - - -/*********************************************************************** - * NC_TrackCloseButton95 + * NC_TrackCloseButton * * Track a mouse button press on the Win95 close button. */ -static void -NC_TrackCloseButton95 (HWND hwnd, WORD wParam) +static void NC_TrackCloseButton (HWND hwnd, WORD wParam) { MSG msg; HDC hdc; @@ -1959,7 +1305,7 @@ NC_TrackCloseButton95 (HWND hwnd, WORD wParam) SetCapture( hwnd ); - NC_DrawCloseButton95 (hwnd, hdc, TRUE, FALSE); + NC_DrawCloseButton (hwnd, hdc, TRUE, FALSE); while(1) { @@ -1976,11 +1322,11 @@ NC_TrackCloseButton95 (HWND hwnd, WORD wParam) pressed = (NC_HandleNCHitTest( hwnd, msg.pt ) == wParam); if (pressed != oldstate) - NC_DrawCloseButton95 (hwnd, hdc, pressed, FALSE); + NC_DrawCloseButton (hwnd, hdc, pressed, FALSE); } if(pressed) - NC_DrawCloseButton95 (hwnd, hdc, FALSE, FALSE); + NC_DrawCloseButton (hwnd, hdc, FALSE, FALSE); ReleaseCapture(); ReleaseDC( hwnd, hdc ); @@ -2039,10 +1385,7 @@ LONG NC_HandleNCLButtonDown( HWND hwnd, WPARAM wParam, LPARAM lParam ) if( !(style & WS_MINIMIZE) ) { HDC hDC = GetWindowDC(hwnd); - if (TWEAK_WineLook == WIN31_LOOK) - NC_DrawSysButton( hwnd, hDC, TRUE ); - else - NC_DrawSysButton95( hwnd, hDC, TRUE ); + NC_DrawSysButton( hwnd, hDC, TRUE ); ReleaseDC( hwnd, hDC ); } SendMessageW( hwnd, WM_SYSCOMMAND, SC_MOUSEMENU + HTSYSMENU, lParam ); @@ -2063,15 +1406,11 @@ LONG NC_HandleNCLButtonDown( HWND hwnd, WPARAM wParam, LPARAM lParam ) case HTMINBUTTON: case HTMAXBUTTON: - if (TWEAK_WineLook == WIN31_LOOK) - NC_TrackMinMaxBox( hwnd, wParam ); - else - NC_TrackMinMaxBox95( hwnd, wParam ); + NC_TrackMinMaxBox( hwnd, wParam ); break; case HTCLOSE: - if (TWEAK_WineLook >= WIN95_LOOK) - NC_TrackCloseButton95 (hwnd, wParam); + NC_TrackCloseButton (hwnd, wParam); break; case HTLEFT: diff --git a/windows/syscolor.c b/windows/syscolor.c index 6b5c35c7c84..a742de09a59 100644 --- a/windows/syscolor.c +++ b/windows/syscolor.c @@ -40,39 +40,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(syscolor); static const char * const DefSysColors[] = -{ - "Scrollbar", "224 224 224", /* COLOR_SCROLLBAR */ - "Background", "192 192 192", /* COLOR_BACKGROUND */ - "ActiveTitle", "0 64 128", /* COLOR_ACTIVECAPTION */ - "InactiveTitle", "255 255 255", /* COLOR_INACTIVECAPTION */ - "Menu", "255 255 255", /* COLOR_MENU */ - "Window", "255 255 255", /* COLOR_WINDOW */ - "WindowFrame", "0 0 0", /* COLOR_WINDOWFRAME */ - "MenuText", "0 0 0", /* COLOR_MENUTEXT */ - "WindowText", "0 0 0", /* COLOR_WINDOWTEXT */ - "TitleText", "255 255 255", /* COLOR_CAPTIONTEXT */ - "ActiveBorder", "128 128 128", /* COLOR_ACTIVEBORDER */ - "InactiveBorder", "255 255 255", /* COLOR_INACTIVEBORDER */ - "AppWorkspace", "255 255 232", /* COLOR_APPWORKSPACE */ - "Hilight", "224 224 224", /* COLOR_HIGHLIGHT */ - "HilightText", "0 0 0", /* COLOR_HIGHLIGHTTEXT */ - "ButtonFace", "192 192 192", /* COLOR_BTNFACE */ - "ButtonShadow", "128 128 128", /* COLOR_BTNSHADOW */ - "GrayText", "192 192 192", /* COLOR_GRAYTEXT */ - "ButtonText", "0 0 0", /* COLOR_BTNTEXT */ - "InactiveTitleText", "0 0 0", /* COLOR_INACTIVECAPTIONTEXT */ - "ButtonHilight", "255 255 255", /* COLOR_BTNHIGHLIGHT */ - "3DDarkShadow", "32 32 32", /* COLOR_3DDKSHADOW */ - "3DLight", "192 192 192", /* COLOR_3DLIGHT */ - "InfoText", "0 0 0", /* COLOR_INFOTEXT */ - "InfoBackground", "255 255 192", /* COLOR_INFOBK */ - "AlternateButtonFace", "184 180 184", /* COLOR_ALTERNATEBTNFACE */ - "HotTrackingColor", "0 0 255", /* COLOR_HOTLIGHT */ - "GradientActiveTitle", "16 132 208", /* COLOR_GRADIENTACTIVECAPTION */ - "GradientInactiveTitle", "181 181 181" /* COLOR_GRADIENTINACTIVECAPTION */ -}; - -static const char * const DefSysColors95[] = { "Scrollbar", "192 192 192", /* COLOR_SCROLLBAR */ "Background", "0 128 128", /* COLOR_BACKGROUND */ @@ -174,13 +141,10 @@ static void SYSCOLOR_SetColor( int index, COLORREF color ) void SYSCOLOR_Init(void) { int i, r, g, b; - const char * const *p; char buffer[100]; BOOL bOk = FALSE, bNoReg = FALSE; HKEY hKey; - p = (TWEAK_WineLook == WIN31_LOOK) ? DefSysColors : DefSysColors95; - /* first, try to read the values from the registry */ if (RegCreateKeyExA(HKEY_CURRENT_USER, "Control Panel\\Colors", 0, 0, 0, KEY_ALL_ACCESS, 0, &hKey, 0)) bNoReg = TRUE; @@ -191,21 +155,21 @@ void SYSCOLOR_Init(void) if (!bNoReg) { DWORD dwDataSize = sizeof(buffer); - if (!(RegQueryValueExA(hKey,(LPSTR)p[i*2], 0, 0, buffer, &dwDataSize))) + if (!(RegQueryValueExA(hKey,(LPSTR)DefSysColors[i*2], 0, 0, buffer, &dwDataSize))) if (sscanf( buffer, "%d %d %d", &r, &g, &b ) == 3) bOk = TRUE; } /* second try, win.ini */ if (!bOk) - { GetProfileStringA( "colors", p[i*2], p[i*2+1], buffer, 100 ); + { GetProfileStringA( "colors", DefSysColors[i*2], DefSysColors[i*2+1], buffer, 100 ); if (sscanf( buffer, " %d %d %d", &r, &g, &b ) == 3) bOk = TRUE; } /* last chance, take the default */ if (!bOk) - { int iNumColors = sscanf( p[i*2+1], " %d %d %d", &r, &g, &b ); + { int iNumColors = sscanf( DefSysColors[i*2+1], " %d %d %d", &r, &g, &b ); assert (iNumColors==3); } diff --git a/windows/sysmetrics.c b/windows/sysmetrics.c index 2527dfc78f9..80d2c07f72c 100644 --- a/windows/sysmetrics.c +++ b/windows/sysmetrics.c @@ -109,9 +109,6 @@ static int SYSMETRICS_GetRegistryMetric ( * SM_CYFULLSCREEN x-1 x * SM_CXFRAME Fixed July 6, 2001 - Bill Medland * - * (collides with TWEAK_WineLook sometimes, - * so changing anything might be difficult) - * * Starting at Win95 there are now a large number or Registry entries in the * [WindowMetrics] section that are probably relevant here. */ @@ -126,36 +123,22 @@ void SYSMETRICS_Init(void) if (RegOpenKeyExA (HKEY_CURRENT_USER, "Control Panel\\desktop\\WindowMetrics", 0, KEY_QUERY_VALUE, &hkey) != ERROR_SUCCESS) hkey = 0; - if (TWEAK_WineLook > WIN31_LOOK) - { - sysMetrics[SM_CXVSCROLL] = SYSMETRICS_GetRegistryMetric( hkey, "ScrollWidth", 16 ); - sysMetrics[SM_CYHSCROLL] = sysMetrics[SM_CXVSCROLL]; + sysMetrics[SM_CXVSCROLL] = SYSMETRICS_GetRegistryMetric( hkey, "ScrollWidth", 16 ); + sysMetrics[SM_CYHSCROLL] = sysMetrics[SM_CXVSCROLL]; - /* The Win 2000 resource kit SAYS that this is governed by the ScrollHeight - * but on my computer that controls the CYV/CXH values. */ - sysMetrics[SM_CYCAPTION] = SYSMETRICS_GetRegistryMetric(hkey, "CaptionHeight", 18) - + 1; /* for the separator? */ + /* The Win 2000 resource kit SAYS that this is governed by the ScrollHeight + * but on my computer that controls the CYV/CXH values. */ + sysMetrics[SM_CYCAPTION] = SYSMETRICS_GetRegistryMetric(hkey, "CaptionHeight", 18) + + 1; /* for the separator? */ - sysMetrics[SM_CYMENU] = SYSMETRICS_GetRegistryMetric (hkey, "MenuHeight", 18) + 1; + sysMetrics[SM_CYMENU] = SYSMETRICS_GetRegistryMetric (hkey, "MenuHeight", 18) + 1; - sysMetrics[SM_CXDLGFRAME] = 3; - sysMetrics[SM_CYDLGFRAME] = sysMetrics[SM_CXDLGFRAME]; + sysMetrics[SM_CXDLGFRAME] = 3; + sysMetrics[SM_CYDLGFRAME] = sysMetrics[SM_CXDLGFRAME]; - /* force setting of SM_CXFRAME/SM_CYFRAME */ - SystemParametersInfoA( SPI_GETBORDER, 0, &dummy, 0 ); - } - else - { - sysMetrics[SM_CXVSCROLL] = 17; - sysMetrics[SM_CYHSCROLL] = sysMetrics[SM_CXVSCROLL]; - sysMetrics[SM_CYCAPTION] = 20; - sysMetrics[SM_CYMENU] = 18; - sysMetrics[SM_CXDLGFRAME] = 4; - sysMetrics[SM_CYDLGFRAME] = sysMetrics[SM_CXDLGFRAME]; - sysMetrics[SM_CXFRAME] = GetProfileIntA("Windows", "BorderWidth", 4) + 1; - sysMetrics[SM_CYFRAME] = sysMetrics[SM_CXFRAME]; - } + /* force setting of SM_CXFRAME/SM_CYFRAME */ + SystemParametersInfoA( SPI_GETBORDER, 0, &dummy, 0 ); sysMetrics[SM_CXCURSOR] = 32; sysMetrics[SM_CYCURSOR] = 32; @@ -180,8 +163,8 @@ void SYSMETRICS_Init(void) sysMetrics[SM_RESERVED4] = 0; /* FIXME: The following two are calculated, but how? */ - sysMetrics[SM_CXMIN] = (TWEAK_WineLook > WIN31_LOOK) ? 112 : 100; - sysMetrics[SM_CYMIN] = (TWEAK_WineLook > WIN31_LOOK) ? 27 : 28; + sysMetrics[SM_CXMIN] = 112; + sysMetrics[SM_CYMIN] = 27; sysMetrics[SM_CXSIZE] = sysMetrics[SM_CYCAPTION] - 1; sysMetrics[SM_CYSIZE] = sysMetrics[SM_CXSIZE]; diff --git a/windows/sysparams.c b/windows/sysparams.c index e77de8c6f1c..bd672613fd1 100644 --- a/windows/sysparams.c +++ b/windows/sysparams.c @@ -720,11 +720,8 @@ BOOL WINAPI SystemParametersInfoW( UINT uiAction, UINT uiParam, border = SYSPARAMS_Twips2Pixels( atoiW(buf) ); spi_loaded[spi_idx] = TRUE; - if (TWEAK_WineLook > WIN31_LOOK) - { - SYSMETRICS_Set( SM_CXFRAME, border + GetSystemMetrics( SM_CXDLGFRAME ) ); - SYSMETRICS_Set( SM_CYFRAME, border + GetSystemMetrics( SM_CXDLGFRAME ) ); - } + SYSMETRICS_Set( SM_CXFRAME, border + GetSystemMetrics( SM_CXDLGFRAME ) ); + SYSMETRICS_Set( SM_CYFRAME, border + GetSystemMetrics( SM_CXDLGFRAME ) ); } *(INT *)pvParam = border; break; @@ -743,11 +740,8 @@ BOOL WINAPI SystemParametersInfoW( UINT uiAction, UINT uiParam, { border = uiParam; spi_loaded[spi_idx] = TRUE; - if (TWEAK_WineLook > WIN31_LOOK) - { - SYSMETRICS_Set( SM_CXFRAME, uiParam + GetSystemMetrics( SM_CXDLGFRAME ) ); - SYSMETRICS_Set( SM_CYFRAME, uiParam + GetSystemMetrics( SM_CXDLGFRAME ) ); - } + SYSMETRICS_Set( SM_CXFRAME, uiParam + GetSystemMetrics( SM_CXDLGFRAME ) ); + SYSMETRICS_Set( SM_CYFRAME, uiParam + GetSystemMetrics( SM_CXDLGFRAME ) ); } } else @@ -1309,11 +1303,10 @@ BOOL WINAPI SystemParametersInfoW( UINT uiAction, UINT uiParam, /* menu font metrics */ SystemParametersInfoW( SPI_GETICONTITLELOGFONT, 0, (LPVOID)&(lpnm->lfMenuFont), 0 ); - GetProfileStringW( Desktop, MenuFont, - (TWEAK_WineLook > WIN31_LOOK) ? lpnm->lfCaptionFont.lfFaceName : System, + GetProfileStringW( Desktop, MenuFont, lpnm->lfCaptionFont.lfFaceName, lpnm->lfMenuFont.lfFaceName, LF_FACESIZE ); lpnm->lfMenuFont.lfHeight = -GetProfileIntW( Desktop, MenuFontSize, 11 ); - lpnm->lfMenuFont.lfWeight = (TWEAK_WineLook > WIN31_LOOK) ? FW_NORMAL : FW_BOLD; + lpnm->lfMenuFont.lfWeight = FW_NORMAL; /* status bar font metrics */ SystemParametersInfoW( SPI_GETICONTITLELOGFONT, 0,