[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wine-patches
Subject:    proposed PATCH: static / etched
From:       Marcus Meissner <marcus () jet ! franken ! de>
Date:       1999-10-30 16:42:51
[Download RAW message or body]

Hi folks,

First, I am usually not the Windows GUI knowledgeable guy, so I might be 
wrong, use incorrect terms etc. Sorry in advance.

Anyway.

There are several gameinstallers, whose starting layout is like this:
            +------+
            |Bitmap|
	    |splash|        <- Static , style 0x12 (SS_ETCHEDFRAME)
	    +------+
	    |button|        <- Button
	    +------+
	    |button|        <- Button
	    +------+
	    |button|        <- Button
	    +------+

The bug is, that the splashbitmap is shown very briefly but grayed out
only milliseconds later.

I've tracked it down to the Static control, type SS_ETCHED* filling its
complete area with the default brush.

The splashbitmap itself is apparently drawn by the programs dialogwindow
procedure after calling the subclassed WINE dialogwindowprocedure.

Now, the MSDN lib says for SS_ETCHED controls "draws the edge ... using
DrawEdge" ... It does _not_ mention filling it.

So I just removed the FillRect() from the STATIC_PaintEtchedfn, which
seems to help. (I also did replace the other two cases by DrawEdge()).

GUI guys... Is this correct? How does Windows does this?

Ciao, Marcus

Changelog:
	do not clear the drawing area for etched static controls
	replaced our own drawing stuff in etched static controls by DrawEdge

--- wine-cvs/controls/static.c	Mon Sep 20 21:27:07 1999
+++ controls/static.c	Sat Oct 30 18:22:33 1999
@@ -474,41 +474,19 @@
 static void STATIC_PaintEtchedfn( WND *wndPtr, HDC hdc )
 {
     RECT rc;
-    HBRUSH hbrush;
-    HPEN hpen;
 
     if (TWEAK_WineLook == WIN31_LOOK)
 	return;
 
     GetClientRect( wndPtr->hwndSelf, &rc );
-    hbrush = SendMessageA( GetParent(wndPtr->hwndSelf), WM_CTLCOLORSTATIC,
-                             hdc, wndPtr->hwndSelf );
-    FillRect( hdc, &rc, hbrush );
-
     switch (wndPtr->dwStyle & SS_TYPEMASK)
     {
 	case SS_ETCHEDHORZ:
-	    hpen = SelectObject (hdc, GetSysColorPen (COLOR_3DSHADOW));
-	    MoveToEx (hdc, rc.left, rc.bottom / 2 - 1, NULL);
-	    LineTo (hdc, rc.right - 1, rc.bottom / 2 - 1);
-	    SelectObject (hdc, GetSysColorPen (COLOR_3DHIGHLIGHT));
-	    MoveToEx (hdc, rc.left, rc.bottom / 2, NULL);
-	    LineTo (hdc, rc.right, rc.bottom / 2);
-	    LineTo (hdc, rc.right, rc.bottom / 2 - 1);
-	    SelectObject (hdc, hpen);
+	    DrawEdge(hdc,&rc,EDGE_ETCHED,BF_TOP|BF_BOTTOM);
 	    break;
-
 	case SS_ETCHEDVERT:
-	    hpen = SelectObject (hdc, GetSysColorPen (COLOR_3DSHADOW));
-	    MoveToEx (hdc, rc.right / 2 - 1, rc.top, NULL);
-	    LineTo (hdc, rc.right / 2 - 1, rc.bottom - 1);
-	    SelectObject (hdc, GetSysColorPen (COLOR_3DHIGHLIGHT));
-	    MoveToEx (hdc, rc.right / 2, rc.top, NULL);
-	    LineTo (hdc, rc.right / 2, rc.bottom);
-	    LineTo (hdc, rc.right / 2 -1 , rc.bottom);
-	    SelectObject (hdc, hpen); 
+	    DrawEdge(hdc,&rc,EDGE_ETCHED,BF_LEFT|BF_RIGHT);
 	    break;
-
 	case SS_ETCHEDFRAME:
 	    DrawEdge (hdc, &rc, EDGE_ETCHED, BF_RECT);
 	    break;


=========================================================================

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic