PATCH: status bar (again)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

The problem I fixed in the statusbar was broken by the patch collection it 
was applied together.

So I fixed it again and added some hopefully helpful comments on the
places where simple parts are addressed.

Ciao, Marcus

License: LGPL
Changelog:
	Fixed StatusBar SetText again, added some comments.


Index: status.c
===================================================================
RCS file: /home/wine/wine/dlls/comctl32/status.c,v
retrieving revision 1.42
diff -u -r1.42 status.c
--- status.c	23 Apr 2002 19:26:55 -0000	1.42
+++ status.c	28 Apr 2002 08:02:55 -0000
@@ -327,6 +327,7 @@
 STATUSBAR_GetIcon (STATUSWINDOWINFO *infoPtr, INT nPart)
 {
     TRACE("%d\n", nPart);
+    /* MSDN says: "simple parts are indexed with -1" */
     if ((nPart < -1) || (nPart >= infoPtr->numParts))
 	return 0;
 
@@ -371,6 +372,8 @@
     LRESULT result;
 
     TRACE("part %d\n", nPart);
+
+    /* MSDN says: "simple parts use index of 0", so this check is ok. */
     if (nPart < 0 || nPart >= infoPtr->numParts) return 0;
 
     if (infoPtr->simple)
@@ -505,6 +508,7 @@
 
     TRACE("setting part %d\n", nPart);
 
+    /* FIXME: MSDN says "if nPart is -1, the status bar is assumed simple" */
     if (nPart == -1) {
 	if (infoPtr->part0.hIcon == hIcon) /* same as - no redraw */
 	    return TRUE;
@@ -625,12 +629,17 @@
     BOOL changed = FALSE;
 
     TRACE("part %d, text %s\n", nPart, debugstr_t(text, isW));
-    if (nPart < 0 || nPart >= infoPtr->numParts) return FALSE;
 
-    if (nPart == 0x00ff)
+    /* MSDN says: "If the parameter is set to SB_SIMPLEID (255), the status
+     * window is assumed to be a simple window */
+
+    if (nPart == 0x00ff) {
 	part = &infoPtr->part0;
-    else if (!infoPtr->simple && infoPtr->parts)
-	part = &infoPtr->parts[nPart];
+    } else {
+	if (infoPtr->parts && (nPart < 0 || nPart >= infoPtr->numParts)) {
+	    part = &infoPtr->parts[nPart];
+	}
+    }
     if (!part) return FALSE;
 
     if (part->style != style)



[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux