Remove the support for the Win 3.1 Look.

This commit is contained in:
Dimitrie O. Paun 2004-04-01 04:57:12 +00:00 committed by Alexandre Julliard
parent b9f45e7a70
commit 126227a55a
18 changed files with 251 additions and 1395 deletions

View File

@ -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,41 +735,13 @@ 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)
{
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--;
}
}
else
{
UINT uState = DFCS_BUTTONPUSH | DFCS_ADJUSTRECT;
uState = DFCS_BUTTONPUSH | DFCS_ADJUSTRECT;
if (style & BS_FLAT)
uState |= DFCS_MONO;
@ -787,7 +759,6 @@ static void PB_Paint( HWND hwnd, HDC hDC, UINT action )
DrawFrameControl( hDC, &rc, DFC_BUTTON, uState );
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);
@ -886,34 +851,6 @@ static void CB_Paint( HWND hwnd, HDC hDC, UINT action )
rbox.bottom = rtext.bottom;
/* 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;
@ -945,14 +882,11 @@ static void CB_Paint( HWND hwnd, HDC hDC, UINT action )
rbox.top = rbox.bottom -= checkBoxHeight;
}
} else { /* Default */
if (delta > 0)
{
if (delta > 0) {
int ofs = (delta / 2);
rbox.bottom -= ofs + 1;
rbox.top = rbox.bottom - checkBoxHeight;
}
else if (delta < 0)
{
} else if (delta < 0) {
int ofs = (-delta / 2);
rbox.top -= ofs + 1;
rbox.bottom = rbox.top + checkBoxHeight;
@ -961,7 +895,6 @@ static void CB_Paint( HWND hwnd, HDC hDC, UINT action )
DrawFrameControl( hDC, &rbox, DFC_BUTTON, flags );
}
}
if (dtFlags == (UINT)-1L) /* Noting to draw */
return;
@ -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) );
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));
}
InflateRect(&rc, -7, 1);
dtFlags = BUTTON_CalcLabelRect(hwnd, hDC, &rc);

View File

@ -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,12 +571,9 @@ 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;
}
}
if (unicode)
lphc->hWndLBox = CreateWindowExW(lbeExStyle, clbName, NULL, lbeStyle,
@ -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;
hPrevBrush = SelectObject(hdc, GetSysColorBrush(COLOR_BTNFACE));
/*
* 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);
}
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 );

View File

@ -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 );
}
return TRUE;
}
@ -4564,7 +4552,6 @@ 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);

View File

@ -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;

View File

@ -888,10 +888,6 @@ 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;
}
else
@ -941,9 +937,6 @@ 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->xTab = 0;
@ -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;
}
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;
}
@ -1212,39 +1193,21 @@ 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 );
}
}
/* 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 );
}
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,29 +1418,8 @@ 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);
/* 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 );
}
if (lppop->nItems == 0)
{

View File

@ -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,7 +433,7 @@ 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,
static void SCROLL_DrawArrows( HDC hdc, SCROLLBAR_INFO *infoPtr,
RECT *rect, INT arrowSize, BOOL vertical,
BOOL top_pressed, BOOL bottom_pressed )
{
@ -462,92 +462,7 @@ 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,
static void SCROLL_DrawMovingThumb( HDC hdc, RECT *rect, BOOL vertical,
INT arrowSize, INT thumbSize )
{
INT pos = SCROLL_TrackingPos;
@ -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,13 +599,6 @@ 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
@ -710,7 +609,6 @@ static void SCROLL_DrawInterior( HWND hwnd, HDC hdc, INT nBar,
} 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,
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,
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,
PatBlt( hdc, r.left, r.top,
thumbPos - (arrowSize - SCROLL_ARROW_THUMB_OVERLAP),
r.bottom - r.top - offset*2,
top_selected ? 0x0f0000 : PATCOPY );
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 );
}
DrawEdge( hdc, &r, EDGE_RAISED, BF_RECT );
if (Save_SCROLL_MovingThumb &&

View File

@ -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)
{

View File

@ -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 */

View File

@ -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"

View File

@ -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 );

View File

@ -140,7 +140,6 @@ extern BOOL USER_IsExitingThread( DWORD tid );
typedef enum
{
WIN31_LOOK,
WIN95_LOOK,
WIN98_LOOK
} WINE_LOOK;

View File

@ -155,10 +155,6 @@ 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);
@ -167,26 +163,21 @@ HBRUSH DEFWND_ControlColor( HDC hDC, UINT ctlType )
* we better use 0x55aa bitmap brush to make scrollbar's background
* look different from the window background.
*/
if (bk == GetSysColor(COLOR_WINDOW)) {
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
SetBkColor( hDC, GetSysColor(COLOR_WINDOW) );
return GetSysColorBrush(COLOR_WINDOW);
}

View File

@ -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 );
}
/* 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);
}
/* restore */
DeleteMenu(menu,GetMenuItemCount(menu) - 1,MF_BYPOSITION);
/* minimize */

View File

@ -47,11 +47,10 @@ 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);
@ -60,7 +59,7 @@ static HFONT MSGBOX_OnInit(HWND hwnd, LPMSGBOXPARAMSW lpmb)
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 {

File diff suppressed because it is too large Load Diff

View File

@ -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);
}

View File

@ -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,8 +123,6 @@ 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];
@ -144,18 +139,6 @@ void SYSMETRICS_Init(void)
/* 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];
}
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];

View File

@ -720,12 +720,9 @@ 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 ) );
}
}
*(INT *)pvParam = border;
break;
@ -743,13 +740,10 @@ 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 ) );
}
}
}
else
ret = FALSE;
break;
@ -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,