Status Bar update (2)
Dimitrie O. Paun
dpaun at rogers.com
Thu Apr 11 13:24:58 CDT 2002
ChangeLog:
Implement WM_NOTIFYFORMAT for the StatusBar control.
Index: dlls/comctl32/status.c
===================================================================
RCS file: /var/cvs/wine/dlls/comctl32/status.c,v
retrieving revision 1.40
diff -u -r1.40 status.c
--- dlls/comctl32/status.c 8 Apr 2002 22:44:20 -0000 1.40
+++ dlls/comctl32/status.c 11 Apr 2002 18:22:55 -0000
@@ -21,10 +21,9 @@
*
* FIXME:
* 1) Implement all CCS_* styles.
- * 2) Send WM_QUERYFORMAT
* 3) Use DrawEdge to draw the SizeGrip
* 4) Implement DrawStatusText and use it.
- *
+ * 5) Hide grip if window is maximized
*/
#include <string.h>
@@ -56,6 +55,7 @@
HFONT hDefaultFont;
COLORREF clrBk; /* background color */
BOOL bUnicode; /* unicode flag */
+ BOOL NtfUnicode; /* notify format */
STATUSWINDOWPART part0; /* simple window */
STATUSWINDOWPART* parts;
} STATUSWINDOWINFO;
@@ -803,7 +803,7 @@
NONCLIENTMETRICSW nclm;
DWORD dwStyle;
RECT rect;
- int width, len, textHeight = 0;
+ int i, width, len, textHeight = 0;
HDC hdc;
TRACE("\n");
@@ -818,7 +818,8 @@
infoPtr->clrBk = CLR_DEFAULT;
infoPtr->hFont = 0;
- /* FIXME: send unicode parent notification query (WM_QUERYFORMAT) here */
+ i = SendMessageW(GetParent (hwnd), WM_NOTIFYFORMAT, hwnd, NF_QUERY);
+ infoPtr->NtfUnicode = (i == NFR_UNICODE);
GetClientRect (hwnd, &rect);
InvalidateRect (hwnd, &rect, 0);
@@ -1067,6 +1068,17 @@
}
+static LRESULT
+STATUSBAR_NotifyFormat (STATUSWINDOWINFO *infoPtr, HWND from, INT cmd)
+{
+ if (cmd == NF_REQUERY) {
+ INT i = SendMessageW(from, WM_NOTIFYFORMAT, infoPtr->Self, NF_QUERY);
+ infoPtr->NtfUnicode = (i == NFR_UNICODE);
+ }
+ return infoPtr->NtfUnicode ? NFR_UNICODE : NFR_ANSI;
+}
+
+
static LRESULT
STATUSBAR_SendNotify (HWND hwnd, UINT code)
{
@@ -1193,6 +1205,9 @@
PostMessageW (GetParent (hwnd), msg, wParam, lParam);
return 0;
+ case WM_NOTIFYFORMAT:
+ return STATUSBAR_NotifyFormat(infoPtr, (HWND)wParam, (INT)lParam);
+
case WM_PAINT:
return STATUSBAR_WMPaint (infoPtr, (HDC)wParam);
@@ -1207,7 +1222,6 @@
case WM_SETTEXT:
return STATUSBAR_WMSetText (infoPtr, (LPCSTR)lParam);
-
case WM_SIZE:
if (STATUSBAR_WMSize (infoPtr, (WORD)wParam)) return 0;
--
Dimi.
More information about the wine-patches
mailing list