Mercurial > projects > dwt-win
diff dwt/widgets/ToolBar.d @ 213:36f5cb12e1a2
Update to SWT 3.4M7
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sat, 17 May 2008 17:34:28 +0200 |
parents | ab60f3309436 |
children | fd9c62a2998e |
line wrap: on
line diff
--- a/dwt/widgets/ToolBar.d Mon May 05 00:12:38 2008 +0200 +++ b/dwt/widgets/ToolBar.d Sat May 17 17:34:28 2008 +0200 @@ -317,7 +317,7 @@ * bar currently sets this value to 300 so it is not * necessary to set TTM_SETMAXTIPWIDTH. */ -// int hwndToolTip = OS.SendMessage (handle, OS.TB_GETTOOLTIPS, 0, 0); +// int /*long*/ hwndToolTip = OS.SendMessage (handle, OS.TB_GETTOOLTIPS, 0, 0); // OS.SendMessage (hwndToolTip, OS.TTM_SETMAXTIPWIDTH, 0, 0x7FFF); /* @@ -676,8 +676,8 @@ TBBUTTONINFO info; info.cbSize = TBBUTTONINFO.sizeof; info.dwMask = OS.TBIF_SIZE; - int size = OS.SendMessage (handle, OS.TB_GETBUTTONSIZE, 0, 0); - info.cx = cast(short) (size & 0xFFFF); + int /*long*/ size = OS.SendMessage (handle, OS.TB_GETBUTTONSIZE, 0, 0); + info.cx = cast(short) OS.LOWORD (size); int index = 0; while (index < items.length) { ToolItem item = items [index]; @@ -685,8 +685,8 @@ index++; } if (index < items.length) { - int padding = OS.SendMessage (handle, OS.TB_GETPADDING, 0, 0); - info.cx += (padding & 0xFFFF) * 2; + int /*long*/ padding = OS.SendMessage (handle, OS.TB_GETPADDING, 0, 0); + info.cx += OS.LOWORD (padding) * 2; } for (int i=0; i<items.length; i++) { ToolItem item = items [i]; @@ -974,7 +974,7 @@ * choosing two instead of one as the row increment fixes both cases. */ count += 2; - OS.SendMessage (handle, OS.TB_SETROWS, (1 << 16) | count, 0); + OS.SendMessage (handle, OS.TB_SETROWS, OS.MAKEWPARAM (count, 1), 0); int flags = OS.SWP_NOACTIVATE | OS.SWP_NOMOVE | OS.SWP_NOZORDER; SetWindowPos (handle, null, 0, 0, rect.right - rect.left, rect.bottom - rect.top, flags); ignoreResize = false; @@ -1009,6 +1009,18 @@ int index = hdr.hdr.idFrom; auto hwndToolTip = cast(HWND) OS.SendMessage (handle, OS.TB_GETTOOLTIPS, 0, 0); if (hwndToolTip is hdr.hdr.hwndFrom) { + /* + * Bug in Windows. For some reason the reading order + * in NMTTDISPINFO is sometimes set incorrectly. The + * reading order seems to change every time the mouse + * enters the control from the top edge. The fix is + * to explicitly set TTF_RTLREADING. + */ + if ((style & DWT.RIGHT_TO_LEFT) !is 0) { + hdr.uFlags |= OS.TTF_RTLREADING; + } else { + hdr.uFlags &= ~OS.TTF_RTLREADING; + } if (toolTipText_ !is null) return ""; //$NON-NLS-1$ if (0 <= index && index < items.length) { ToolItem item = items [index]; @@ -1240,7 +1252,7 @@ override LRESULT WM_SIZE (int wParam, int lParam) { if (ignoreResize) { - int code = callWindowProc (handle, OS.WM_SIZE, wParam, lParam); + int /*long*/ code = callWindowProc (handle, OS.WM_SIZE, wParam, lParam); if (code is 0) return LRESULT.ZERO; return new LRESULT (code); } @@ -1323,7 +1335,7 @@ } override LRESULT wmCommandChild (int wParam, int lParam) { - ToolItem child = items [wParam & 0xFFFF]; + ToolItem child = items [OS.LOWORD (wParam)]; if (child is null) return null; return child.wmCommandChild (wParam, lParam); }