Mercurial > projects > dwt-win
comparison dwt/widgets/ToolItem.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 | ecb80b2a89e1 |
comparison
equal
deleted
inserted
replaced
212:ab60f3309436 | 213:36f5cb12e1a2 |
---|---|
191 * a mouse press and release. This will ensure | 191 * a mouse press and release. This will ensure |
192 * that radio and pull down items are handled | 192 * that radio and pull down items are handled |
193 * properly. | 193 * properly. |
194 */ | 194 */ |
195 int y = rect.top + (rect.bottom - rect.top) / 2; | 195 int y = rect.top + (rect.bottom - rect.top) / 2; |
196 int lParam = ((dropDown ? rect.right - 1 : rect.left) & 0xFFFF) | ((y << 16) & 0xFFFF0000); | 196 int /*long*/ lParam = OS.MAKELPARAM (dropDown ? rect.right - 1 : rect.left, y); |
197 parent.ignoreMouse = true; | 197 parent.ignoreMouse = true; |
198 OS.SendMessage (hwnd, OS.WM_LBUTTONDOWN, 0, lParam); | 198 OS.SendMessage (hwnd, OS.WM_LBUTTONDOWN, 0, lParam); |
199 OS.SendMessage (hwnd, OS.WM_LBUTTONUP, 0, lParam); | 199 OS.SendMessage (hwnd, OS.WM_LBUTTONUP, 0, lParam); |
200 parent.ignoreMouse = false; | 200 parent.ignoreMouse = false; |
201 | 201 |
285 checkWidget(); | 285 checkWidget(); |
286 if ((style & DWT.SEPARATOR) !is 0) { | 286 if ((style & DWT.SEPARATOR) !is 0) { |
287 return (state & DISABLED) is 0; | 287 return (state & DISABLED) is 0; |
288 } | 288 } |
289 auto hwnd = parent.handle; | 289 auto hwnd = parent.handle; |
290 int fsState = OS.SendMessage (hwnd, OS.TB_GETSTATE, id, 0); | 290 int /*long*/ fsState = OS.SendMessage (hwnd, OS.TB_GETSTATE, id, 0); |
291 return (fsState & OS.TBSTATE_ENABLED) !is 0; | 291 return (fsState & OS.TBSTATE_ENABLED) !is 0; |
292 } | 292 } |
293 | 293 |
294 /** | 294 /** |
295 * Returns the receiver's hot image if it has one, or null | 295 * Returns the receiver's hot image if it has one, or null |
344 */ | 344 */ |
345 public bool getSelection () { | 345 public bool getSelection () { |
346 checkWidget(); | 346 checkWidget(); |
347 if ((style & (DWT.CHECK | DWT.RADIO)) is 0) return false; | 347 if ((style & (DWT.CHECK | DWT.RADIO)) is 0) return false; |
348 auto hwnd = parent.handle; | 348 auto hwnd = parent.handle; |
349 int fsState = OS.SendMessage (hwnd, OS.TB_GETSTATE, id, 0); | 349 int /*long*/ fsState = OS.SendMessage (hwnd, OS.TB_GETSTATE, id, 0); |
350 return (fsState & OS.TBSTATE_CHECKED) !is 0; | 350 return (fsState & OS.TBSTATE_CHECKED) !is 0; |
351 } | 351 } |
352 | 352 |
353 /** | 353 /** |
354 * Returns the receiver's tool tip text, or null if it has not been set. | 354 * Returns the receiver's tool tip text, or null if it has not been set. |
799 * when text has already been set on one item and then a new | 799 * when text has already been set on one item and then a new |
800 * item is created. The fix is to use WM_SETFONT to force | 800 * item is created. The fix is to use WM_SETFONT to force |
801 * the tool bar to redraw and layout. | 801 * the tool bar to redraw and layout. |
802 */ | 802 */ |
803 parent.setDropDownItems (false); | 803 parent.setDropDownItems (false); |
804 int hFont = OS.SendMessage (hwnd, OS.WM_GETFONT, 0, 0); | 804 int /*long*/ hFont = OS.SendMessage (hwnd, OS.WM_GETFONT, 0, 0); |
805 OS.SendMessage (hwnd, OS.WM_SETFONT, hFont, 0); | 805 OS.SendMessage (hwnd, OS.WM_SETFONT, hFont, 0); |
806 parent.setDropDownItems (true); | 806 parent.setDropDownItems (true); |
807 parent.layoutItems (); | 807 parent.layoutItems (); |
808 } | 808 } |
809 | 809 |
955 if ((style & DWT.RADIO) !is 0) return OS.BTNS_CHECK; | 955 if ((style & DWT.RADIO) !is 0) return OS.BTNS_CHECK; |
956 if ((style & DWT.SEPARATOR) !is 0) return OS.BTNS_SEP; | 956 if ((style & DWT.SEPARATOR) !is 0) return OS.BTNS_SEP; |
957 return OS.BTNS_BUTTON; | 957 return OS.BTNS_BUTTON; |
958 } | 958 } |
959 | 959 |
960 LRESULT wmCommandChild (int wParam, int lParam) { | 960 LRESULT wmCommandChild (int /*long*/ wParam, int /*long*/ lParam) { |
961 if ((style & DWT.RADIO) !is 0) { | 961 if ((style & DWT.RADIO) !is 0) { |
962 if ((parent.getStyle () & DWT.NO_RADIO_GROUP) is 0) { | 962 if ((parent.getStyle () & DWT.NO_RADIO_GROUP) is 0) { |
963 selectRadio (); | 963 selectRadio (); |
964 } | 964 } |
965 } | 965 } |