Ticket #1: torhu2.diff
| File torhu2.diff, 207.6 kB (added by torhu, 1 year ago) |
|---|
-
a/dwt/widgets/Canvas.d
old new 125 125 return caret; 126 126 } 127 127 128 void releaseChildren (bool destroy) {128 override void releaseChildren (bool destroy) { 129 129 if (caret !is null) { 130 130 caret.release (false); 131 131 caret = null; … … 288 288 } 289 289 } 290 290 291 public void setFont (Font font) {291 override public void setFont (Font font) { 292 292 checkWidget (); 293 293 if (caret !is null) caret.setFont (font); 294 294 super.setFont (font); … … 307 307 return super.windowProc (hwnd, msg, wParam, lParam); 308 308 } 309 309 310 LRESULT WM_IME_COMPOSITION (int wParam, int lParam) {310 override LRESULT WM_IME_COMPOSITION (int wParam, int lParam) { 311 311 LRESULT result = super.WM_IME_COMPOSITION (wParam, lParam); 312 312 /* 313 313 * Bug in Windows. On Korean Windows XP, the IME window … … 340 340 return result; 341 341 } 342 342 343 LRESULT WM_INPUTLANGCHANGE (int wParam, int lParam) {343 override LRESULT WM_INPUTLANGCHANGE (int wParam, int lParam) { 344 344 LRESULT result = super.WM_INPUTLANGCHANGE (wParam, lParam); 345 345 if (caret !is null && caret.isFocusCaret ()) { 346 346 caret.setIMEFont (); … … 349 349 return result; 350 350 } 351 351 352 LRESULT WM_KILLFOCUS (int wParam, int lParam) {352 override LRESULT WM_KILLFOCUS (int wParam, int lParam) { 353 353 LRESULT result = super.WM_KILLFOCUS (wParam, lParam); 354 354 if (caret !is null) caret.killFocus (); 355 355 return result; 356 356 } 357 357 358 LRESULT WM_SETFOCUS (int wParam, int lParam) {358 override LRESULT WM_SETFOCUS (int wParam, int lParam) { 359 359 LRESULT result = super.WM_SETFOCUS (wParam, lParam); 360 360 if (caret !is null) caret.setFocus (); 361 361 return result; 362 362 } 363 363 364 LRESULT WM_SIZE (int wParam, int lParam) {364 override LRESULT WM_SIZE (int wParam, int lParam) { 365 365 LRESULT result = super.WM_SIZE (wParam, lParam); 366 366 if (caret !is null && caret.isFocusCaret ()) caret.resizeIME (); 367 367 return result; 368 368 } 369 369 370 LRESULT WM_WINDOWPOSCHANGED (int wParam, int lParam) {370 override LRESULT WM_WINDOWPOSCHANGED (int wParam, int lParam) { 371 371 LRESULT result = super.WM_WINDOWPOSCHANGED (wParam, lParam); 372 372 if (result !is LRESULT.NULL) return result; 373 373 /* … … 382 382 return result; 383 383 } 384 384 385 LRESULT WM_WINDOWPOSCHANGING (int wParam, int lParam) {385 override LRESULT WM_WINDOWPOSCHANGING (int wParam, int lParam) { 386 386 LRESULT result = super.WM_WINDOWPOSCHANGING (wParam, lParam); 387 387 if (result !is LRESULT.NULL) return result; 388 388 /* -
a/dwt/widgets/Caret.d
old new 290 290 OS.ImmReleaseContext (hwnd, hIMC); 291 291 } 292 292 293 void releaseParent () {293 override void releaseParent () { 294 294 super.releaseParent (); 295 295 if (this is parent.getCaret ()) parent.setCaret (null); 296 296 } 297 297 298 void releaseWidget () {298 override void releaseWidget () { 299 299 super.releaseWidget (); 300 300 parent = null; 301 301 image = null; -
a/dwt/widgets/Combo.d
old new 70 70 71 71 public class Combo : Composite { 72 72 73 alias Composite.computeSize computeSize; 74 alias Composite.dragDetect dragDetect; 73 75 alias Composite.sendKeyEvent sendKeyEvent; 76 alias Composite.setBackgroundImage setBackgroundImage; 77 alias Composite.setBounds setBounds; 78 alias Composite.setToolTipText setToolTipText; 74 79 75 80 alias extern(Windows) int function( HWND, uint, uint, int ) TWindowProc; 76 81 private static Combo pThis; … … 336 341 return OS.CallNextHookEx (cbtHook, nCode, wParam, lParam); 337 342 } 338 343 339 bool checkHandle (HWND hwnd) {344 override bool checkHandle (HWND hwnd) { 340 345 return hwnd is handle || hwnd is OS.GetDlgItem (handle, CBID_EDIT) || hwnd is OS.GetDlgItem (handle, CBID_LIST); 341 346 } 342 347 343 protected void checkSubclass () {348 override protected void checkSubclass () { 344 349 if (!isValidSubclass ()) error (DWT.ERROR_INVALID_SUBCLASS); 345 350 } 346 351 … … 394 399 OS.SendMessage (handle, OS.CB_SETEDITSEL, 0, -1); 395 400 } 396 401 397 public Point computeSize (int wHint, int hHint, bool changed) {402 override public Point computeSize (int wHint, int hHint, bool changed) { 398 403 checkWidget (); 399 404 int width = 0, height = 0; 400 405 if (wHint is DWT.DEFAULT) { … … 491 496 OS.SendMessage (handle, OS.WM_COPY, 0, 0); 492 497 } 493 498 494 void createHandle () {499 override void createHandle () { 495 500 /* 496 501 * Feature in Windows. When the selection changes in a combo box, 497 502 * Windows draws the selection, even when the combo box does not … … 562 567 OS.SendMessage (handle, OS.WM_CUT, 0, 0); 563 568 } 564 569 565 int defaultBackground () {570 override int defaultBackground () { 566 571 return OS.GetSysColor (OS.COLOR_WINDOW); 567 572 } 568 573 569 void deregister () {574 override void deregister () { 570 575 super.deregister (); 571 576 auto hwndText = OS.GetDlgItem (handle, CBID_EDIT); 572 577 if (hwndText !is null) display.removeControl (hwndText); … … 616 621 // widget could be disposed at this point 617 622 } 618 623 619 bool dragDetect (HWND hwnd, int x, int y, bool filter, bool [] detect, bool [] consume) {624 override bool dragDetect (HWND hwnd, int x, int y, bool filter, bool [] detect, bool [] consume) { 620 625 if (filter && (style & DWT.READ_ONLY) is 0) { 621 626 auto hwndText = OS.GetDlgItem (handle, CBID_EDIT); 622 627 if (hwndText !is null) { … … 754 759 return true; 755 760 } 756 761 757 char[] getNameText () {762 override char[] getNameText () { 758 763 return getText (); 759 764 } 760 765 … … 912 917 return visibleCount; 913 918 } 914 919 915 bool hasFocus () {920 override bool hasFocus () { 916 921 auto hwndFocus = OS.GetFocus (); 917 922 if (hwndFocus is handle) return true; 918 923 if (hwndFocus is null) return false; … … 1027 1032 OS.SendMessage (handle, OS.WM_PASTE, 0, 0); 1028 1033 } 1029 1034 1030 void register () {1035 override void register () { 1031 1036 super.register (); 1032 1037 auto hwndText = OS.GetDlgItem (handle, CBID_EDIT); 1033 1038 if (hwndText !is null) display.addControl (hwndText, this); … … 1286 1291 eventTable.unhook (DWT.Verify, listener); 1287 1292 } 1288 1293 1289 bool sendKeyEvent (int type, int msg, int wParam, int lParam, Event event) {1294 override bool sendKeyEvent (int type, int msg, int wParam, int lParam, Event event) { 1290 1295 if (!super.sendKeyEvent (type, msg, wParam, lParam, event)) { 1291 1296 return false; 1292 1297 } … … 1396 1401 } 1397 1402 } 1398 1403 1399 void setBackgroundImage (HBITMAP hBitmap) {1404 override void setBackgroundImage (HBITMAP hBitmap) { 1400 1405 super.setBackgroundImage (hBitmap); 1401 1406 auto hwndText = OS.GetDlgItem (handle, CBID_EDIT); 1402 1407 if (hwndText !is null) OS.InvalidateRect (hwndText, null, true); … … 1404 1409 if (hwndList !is null) OS.InvalidateRect (hwndList, null, true); 1405 1410 } 1406 1411 1407 void setBackgroundPixel (int pixel) {1412 override void setBackgroundPixel (int pixel) { 1408 1413 super.setBackgroundPixel (pixel); 1409 1414 auto hwndText = OS.GetDlgItem (handle, CBID_EDIT); 1410 1415 if (hwndText !is null) OS.InvalidateRect (hwndText, null, true); … … 1412 1417 if (hwndList !is null) OS.InvalidateRect (hwndList, null, true); 1413 1418 } 1414 1419 1415 void setBounds (int x, int y, int width, int height, int flags) {1420 override void setBounds (int x, int y, int width, int height, int flags) { 1416 1421 /* 1417 1422 * Feature in Windows. If the combo box has the CBS_DROPDOWN 1418 1423 * or CBS_DROPDOWNLIST style, Windows uses the height that the … … 1459 1464 } 1460 1465 } 1461 1466 1462 public void setFont (Font font) {1467 override public void setFont (Font font) { 1463 1468 checkWidget (); 1464 1469 super.setFont (font); 1465 1470 if ((style & DWT.H_SCROLL) !is 0) setScrollWidth (); 1466 1471 } 1467 1472 1468 void setForegroundPixel (int pixel) {1473 override void setForegroundPixel (int pixel) { 1469 1474 super.setForegroundPixel (pixel); 1470 1475 auto hwndText = OS.GetDlgItem (handle, CBID_EDIT); 1471 1476 if (hwndText !is null) OS.InvalidateRect (hwndText, null, true); … … 1834 1839 OS.SendMessage (handle, OS.CB_LIMITTEXT, limit, 0); 1835 1840 } 1836 1841 1837 void setToolTipText (Shell shell, char[] string) {1842 override void setToolTipText (Shell shell, char[] string) { 1838 1843 auto hwndText = OS.GetDlgItem (handle, CBID_EDIT); 1839 1844 auto hwndList = OS.GetDlgItem (handle, CBID_LIST); 1840 1845 if (hwndText !is null) shell.setToolTipText (hwndText, string); … … 1872 1877 } 1873 1878 } 1874 1879 1875 void subclass () {1880 override void subclass () { 1876 1881 super.subclass (); 1877 1882 auto newProc = display.windowProc; 1878 1883 auto hwndText = OS.GetDlgItem (handle, CBID_EDIT); … … 1885 1890 } 1886 1891 } 1887 1892 1888 bool translateTraversal (MSG* msg) {1893 override bool translateTraversal (MSG* msg) { 1889 1894 /* 1890 1895 * When the combo box is dropped down, allow return 1891 1896 * to select an item in the list and escape to close … … 1903 1908 return super.translateTraversal (msg); 1904 1909 } 1905 1910 1906 bool traverseEscape () {1911 override bool traverseEscape () { 1907 1912 if ((style & DWT.DROP_DOWN) !is 0) { 1908 1913 if (OS.SendMessage (handle, OS.CB_GETDROPPEDSTATE, 0, 0) !is 0) { 1909 1914 OS.SendMessage (handle, OS.CB_SHOWDROPDOWN, 0, 0); … … 1913 1918 return super.traverseEscape (); 1914 1919 } 1915 1920 1916 bool traverseReturn () {1921 override bool traverseReturn () { 1917 1922 if ((style & DWT.DROP_DOWN) !is 0) { 1918 1923 if (OS.SendMessage (handle, OS.CB_GETDROPPEDSTATE, 0, 0) !is 0) { 1919 1924 OS.SendMessage (handle, OS.CB_SHOWDROPDOWN, 0, 0); … … 1923 1928 return super.traverseReturn (); 1924 1929 } 1925 1930 1926 void unsubclass () {1931 override void unsubclass () { 1927 1932 super.unsubclass (); 1928 1933 auto hwndText = OS.GetDlgItem (handle, CBID_EDIT); 1929 1934 if (hwndText !is null && EditProc !is null) { … … 1978 1983 return mbcsPos; 1979 1984 } 1980 1985 1981 int widgetExtStyle () {1986 override int widgetExtStyle () { 1982 1987 return super.widgetExtStyle () & ~OS.WS_EX_NOINHERITLAYOUT; 1983 1988 } 1984 1989 1985 int widgetStyle () {1990 override int widgetStyle () { 1986 1991 int bits = super.widgetStyle () | OS.CBS_AUTOHSCROLL | OS.CBS_NOINTEGRALHEIGHT | OS.WS_HSCROLL |OS.WS_VSCROLL; 1987 1992 if ((style & DWT.SIMPLE) !is 0) return bits | OS.CBS_SIMPLE; 1988 1993 if ((style & DWT.READ_ONLY) !is 0) return bits | OS.CBS_DROPDOWNLIST; 1989 1994 return bits | OS.CBS_DROPDOWN; 1990 1995 } 1991 1996 1992 char[] windowClass () {1997 override char[] windowClass () { 1993 1998 return TCHARzToStr( ComboClass ); 1994 1999 } 1995 2000 1996 int windowProc () {2001 override int windowProc () { 1997 2002 return cast(int) ComboProc; 1998 2003 } 1999 2004 … … 2084 2089 return super.windowProc (hwnd, msg, wParam, lParam); 2085 2090 } 2086 2091 2087 LRESULT WM_CTLCOLOR (int wParam, int lParam) {2092 override LRESULT WM_CTLCOLOR (int wParam, int lParam) { 2088 2093 return wmColorChild (wParam, lParam); 2089 2094 } 2090 2095 2091 LRESULT WM_GETDLGCODE (int wParam, int lParam) {2096 override LRESULT WM_GETDLGCODE (int wParam, int lParam) { 2092 2097 int code = callWindowProc (handle, OS.WM_GETDLGCODE, wParam, lParam); 2093 2098 return cast( LRESULT )(code | OS.DLGC_WANTARROWS); 2094 2099 } 2095 2100 2096 LRESULT WM_KILLFOCUS (int wParam, int lParam) {2101 override LRESULT WM_KILLFOCUS (int wParam, int lParam) { 2097 2102 /* 2098 2103 * Bug in Windows. When a combo box that is read only 2099 2104 * is disposed in CBN_KILLFOCUS, Windows segment faults. … … 2113 2118 return LRESULT.NULL; 2114 2119 } 2115 2120 2116 LRESULT WM_LBUTTONDOWN (int wParam, int lParam) {2121 override LRESULT WM_LBUTTONDOWN (int wParam, int lParam) { 2117 2122 /* 2118 2123 * Feature in Windows. When an editable combo box is dropped 2119 2124 * down and the text in the entry field partially matches an … … 2136 2141 return result; 2137 2142 } 2138 2143 2139 LRESULT WM_SETFOCUS (int wParam, int lParam) {2144 override LRESULT WM_SETFOCUS (int wParam, int lParam) { 2140 2145 /* 2141 2146 * Return NULL - Focus notification is 2142 2147 * done by WM_COMMAND with CBN_SETFOCUS. … … 2144 2149 return LRESULT.NULL; 2145 2150 } 2146 2151 2147 LRESULT WM_SIZE (int wParam, int lParam) {2152 override LRESULT WM_SIZE (int wParam, int lParam) { 2148 2153 /* 2149 2154 * Bug in Windows. If the combo box has the CBS_SIMPLE style, 2150 2155 * the list portion of the combo box is not redrawn when the … … 2218 2223 return result; 2219 2224 } 2220 2225 2221 LRESULT wmChar (HWND hwnd, int wParam, int lParam) {2226 override LRESULT wmChar (HWND hwnd, int wParam, int lParam) { 2222 2227 if (ignoreCharacter) return LRESULT.NULL; 2223 2228 LRESULT result = super.wmChar (hwnd, wParam, lParam); 2224 2229 if (result !is LRESULT.NULL) return result; … … 2324 2329 return LRESULT.NULL; 2325 2330 } 2326 2331 2327 LRESULT wmCommandChild (int wParam, int lParam) {2332 override LRESULT wmCommandChild (int wParam, int lParam) { 2328 2333 int code = wParam >> 16; 2329 2334 switch (code) { 2330 2335 case OS.CBN_EDITCHANGE: … … 2389 2394 return super.wmCommandChild (wParam, lParam); 2390 2395 } 2391 2396 2392 LRESULT wmIMEChar (HWND hwnd, int wParam, int lParam) {2397 override LRESULT wmIMEChar (HWND hwnd, int wParam, int lParam) { 2393 2398 2394 2399 /* Process a DBCS character */ 2395 2400 Display display = this.display; … … 2423 2428 return cast( LRESULT )(result); 2424 2429 } 2425 2430 2426 LRESULT wmKeyDown (HWND hwnd, int wParam, int lParam) {2431 override LRESULT wmKeyDown (HWND hwnd, int wParam, int lParam) { 2427 2432 if (ignoreCharacter) return LRESULT.NULL; 2428 2433 LRESULT result = super.wmKeyDown (hwnd, wParam, lParam); 2429 2434 if (result !is LRESULT.NULL) return result; … … 2438 2443 return result; 2439 2444 } 2440 2445 2441 LRESULT wmSysKeyDown (HWND hwnd, int wParam, int lParam) {2446 override LRESULT wmSysKeyDown (HWND hwnd, int wParam, int lParam) { 2442 2447 /* 2443 2448 * Feature in Windows. When an editable combo box is dropped 2444 2449 * down using Alt+Down and the text in the entry field partially -
a/dwt/widgets/Composite.d
old new 66 66 */ 67 67 68 68 public class Composite : Scrollable { 69 70 alias Scrollable.computeSize computeSize; 71 alias Scrollable.translateMnemonic translateMnemonic; 72 69 73 Layout layout_; 70 74 HFONT font; 71 75 WINDOWPOS* [] lpwp; … … 201 205 } 202 206 } 203 207 204 void checkBuffered () {208 override void checkBuffered () { 205 209 if (OS.IsWinCE || (state & CANVAS) is 0) { 206 210 super.checkBuffered (); 207 211 } 208 212 } 209 213 210 protected void checkSubclass () {214 override protected void checkSubclass () { 211 215 /* Do nothing - Subclassing is allowed */ 212 216 } 213 217 214 Control [] computeTabList () {218 override Control [] computeTabList () { 215 219 Control result [] = super.computeTabList (); 216 220 if (result.length is 0) return result; 217 221 Control [] list = tabList !is null ? _getTabList () : _getChildren (); … … 228 232 return result; 229 233 } 230 234 231 public Point computeSize (int wHint, int hHint, bool changed) {235 override public Point computeSize (int wHint, int hHint, bool changed) { 232 236 checkWidget (); 233 237 Point size; 234 238 if (layout_ !is null) { … … 250 254 return new Point (trim.width, trim.height); 251 255 } 252 256 253 void createHandle () {257 override void createHandle () { 254 258 super.createHandle (); 255 259 state |= CANVAS; 256 260 if ((style & (DWT.H_SCROLL | DWT.V_SCROLL)) is 0) { … … 262 266 return layoutCount > 0 ? this : parent.findDeferredControl (); 263 267 } 264 268 265 Menu [] findMenus (Control control) {269 override Menu [] findMenus (Control control) { 266 270 if (control is this) return new Menu [0]; 267 271 Menu result [] = super.findMenus (control); 268 272 Control [] children = _getChildren (); … … 279 283 return result; 280 284 } 281 285 282 void fixChildren (Shell newShell, Shell oldShell, Decorations newDecorations, Decorations oldDecorations, Menu [] menus) {286 override void fixChildren (Shell newShell, Shell oldShell, Decorations newDecorations, Decorations oldDecorations, Menu [] menus) { 283 287 super.fixChildren (newShell, oldShell, newDecorations, oldDecorations, menus); 284 288 Control [] children = _getChildren (); 285 289 for (int i=0; i<children.length; i++) { … … 640 644 } 641 645 } 642 646 643 void markLayout (bool changed, bool all) {647 override void markLayout (bool changed, bool all) { 644 648 if (layout_ !is null) { 645 649 state |= LAYOUT_NEEDED; 646 650 if (changed) state |= LAYOUT_CHANGED; … … 664 668 return new Point (width, height); 665 669 } 666 670 667 bool redrawChildren () {671 override bool redrawChildren () { 668 672 if (!super.redrawChildren ()) return false; 669 673 Control [] children = _getChildren (); 670 674 for (int i=0; i<children.length; i++) { … … 673 677 return true; 674 678 } 675 679 676 void releaseChildren (bool destroy) {680 override void releaseChildren (bool destroy) { 677 681 Control [] children = _getChildren (); 678 682 for (int i=0; i<children.length; i++) { 679 683 Control child = children [i]; … … 684 688 super.releaseChildren (destroy); 685 689 } 686 690 687 void releaseWidget () {691 override void releaseWidget () { 688 692 super.releaseWidget (); 689 693 if ((state & CANVAS) !is 0 && (style & DWT.EMBEDDED) !is 0) { 690 694 auto hwndChild = OS.GetWindow (handle, OS.GW_CHILD); … … 807 811 } 808 812 } 809 813 810 bool setFixedFocus () {814 override bool setFixedFocus () { 811 815 checkWidget (); 812 816 Control [] children = _getChildren (); 813 817 for (int i=0; i<children.length; i++) { … … 821 825 return super.setFixedFocus (); 822 826 } 823 827 824 public bool setFocus () {828 override public bool setFocus () { 825 829 checkWidget (); 826 830 Control [] children = _getChildren (); 827 831 for (int i=0; i<children.length; i++) { … … 926 930 } 927 931 } 928 932 929 bool setTabGroupFocus () {933 override bool setTabGroupFocus () { 930 934 if (isTabItem ()) return setTabItemFocus (); 931 935 bool takeFocus = (style & DWT.NO_FOCUS) is 0; 932 936 if ((state & CANVAS) !is 0) { … … 963 967 return control !is null ? control.toolTipText_ : null; 964 968 } 965 969 966 bool translateMnemonic (Event event, Control control) {970 override bool translateMnemonic (Event event, Control control) { 967 971 if (super.translateMnemonic (event, control)) return true; 968 972 if (control !is null) { 969 973 Control [] children = _getChildren (); … … 975 979 return false; 976 980 } 977 981 978 bool translateTraversal (MSG* msg) {982 override bool translateTraversal (MSG* msg) { 979 983 if ((state & CANVAS) !is 0 ) { 980 984 if ((style & DWT.EMBEDDED) !is 0) return false; 981 985 switch (msg.wParam) { … … 992 996 return super.translateTraversal (msg); 993 997 } 994 998 995 void updateBackgroundColor () {999 override void updateBackgroundColor () { 996 1000 super.updateBackgroundColor (); 997 1001 Control [] children = _getChildren (); 998 1002 for (int i=0; i<children.length; i++) { … … 1002 1006 } 1003 1007 } 1004 1008 1005 void updateBackgroundImage () {1009 override void updateBackgroundImage () { 1006 1010 super.updateBackgroundImage (); 1007 1011 Control [] children = _getChildren (); 1008 1012 for (int i=0; i<children.length; i++) { … … 1012 1016 } 1013 1017 } 1014 1018 1015 void updateBackgroundMode () {1019 override void updateBackgroundMode () { 1016 1020 super.updateBackgroundMode (); 1017 1021 Control [] children = _getChildren (); 1018 1022 for (int i = 0; i < children.length; i++) { … … 1020 1024 } 1021 1025 } 1022 1026 1023 void updateFont (Font oldFont, Font newFont) {1027 override void updateFont (Font oldFont, Font newFont) { 1024 1028 super.updateFont (oldFont, newFont); 1025 1029 Control [] children = _getChildren (); 1026 1030 for (int i=0; i<children.length; i++) { … … 1031 1035 } 1032 1036 } 1033 1037 1034 void updateLayout (bool resize, bool all) {1038 override void updateLayout (bool resize, bool all) { 1035 1039 Composite parent = findDeferredControl (); 1036 1040 if (parent !is null) { 1037 1041 parent.state |= LAYOUT_CHILD; … … 1053 1057 } 1054 1058 } 1055 1059 1056 int widgetStyle () {1060 override int widgetStyle () { 1057 1061 /* Force clipping of children by setting WS_CLIPCHILDREN */ 1058 1062 return super.widgetStyle () | OS.WS_CLIPCHILDREN; 1059 1063 } 1060 1064 1061 LRESULT WM_ERASEBKGND (int wParam, int lParam) {1065 override LRESULT WM_ERASEBKGND (int wParam, int lParam) { 1062 1066 LRESULT result = super.WM_ERASEBKGND (wParam, lParam); 1063 1067 if (result !is LRESULT.NULL) return result; 1064 1068 if ((state & CANVAS) !is 0) { … … 1068 1072 return result; 1069 1073 } 1070 1074 1071 LRESULT WM_GETDLGCODE (int wParam, int lParam) {1075 override LRESULT WM_GETDLGCODE (int wParam, int lParam) { 1072 1076 LRESULT result = super.WM_GETDLGCODE (wParam, lParam); 1073 1077 if (result !is LRESULT.NULL) return result; 1074 1078 if ((state & CANVAS) !is 0) { … … 1083 1087 return result; 1084 1088 } 1085 1089 1086 LRESULT WM_GETFONT (int wParam, int lParam) {1090 override LRESULT WM_GETFONT (int wParam, int lParam) { 1087 1091 LRESULT result = super.WM_GETFONT (wParam, lParam); 1088 1092 if (result !is LRESULT.NULL) return result; 1089 1093 int code = callWindowProc (handle, OS.WM_GETFONT, wParam, lParam); … … 1092 1096 return cast( LRESULT )(font); 1093 1097 } 1094 1098 1095 LRESULT WM_LBUTTONDOWN (int wParam, int lParam) {1099 override LRESULT WM_LBUTTONDOWN (int wParam, int lParam) { 1096 1100 LRESULT result = super.WM_LBUTTONDOWN (wParam, lParam); 1097 1101 if (result is LRESULT.ZERO) return result; 1098 1102 … … 1105 1109 return result; 1106 1110 } 1107 1111 1108 LRESULT WM_NCPAINT (int wParam, int lParam) {1112 override LRESULT WM_NCPAINT (int wParam, int lParam) { 1109 1113 LRESULT result = super.WM_NCPAINT (wParam, lParam); 1110 1114 if (result !is LRESULT.NULL) return result; 1111 1115 if ((state & CANVAS) !is 0) { … … 1114 1118 return result; 1115 1119 } 1116 1120 1117 LRESULT WM_PARENTNOTIFY (int wParam, int lParam) {1121 override LRESULT WM_PARENTNOTIFY (int wParam, int lParam) { 1118 1122 if ((state & CANVAS) !is 0 && (style & DWT.EMBEDDED) !is 0) { 1119 1123 if ((wParam & 0xFFFF) is OS.WM_CREATE) { 1120 1124 RECT rect; … … 1125 1129 return super.WM_PARENTNOTIFY (wParam, lParam); 1126 1130 } 1127 1131 1128 LRESULT WM_PAINT (int wParam, int lParam) {1132 override LRESULT WM_PAINT (int wParam, int lParam) { 1129 1133 if ((state & CANVAS) is 0 || (state & FOREIGN_HANDLE) !is 0) { 1130 1134 return super.WM_PAINT (wParam, lParam); 1131 1135 } … … 1328 1332 return LRESULT.ZERO; 1329 1333 } 1330 1334 1331 LRESULT WM_PRINTCLIENT (int wParam, int lParam) {1335 override LRESULT WM_PRINTCLIENT (int wParam, int lParam) { 1332 1336 LRESULT result = super.WM_PRINTCLIENT (wParam, lParam); 1333 1337 if (result !is LRESULT.NULL) return result; 1334 1338 if ((state & CANVAS) !is 0) { … … 1364 1368 return result; 1365 1369 } 1366 1370 1367 LRESULT WM_SETFONT (int wParam, int lParam) {1371 override LRESULT WM_SETFONT (int wParam, int lParam) { 1368 1372 if (lParam !is 0) OS.InvalidateRect (handle, null, true); 1369 1373 font = cast(HFONT)wParam; 1370 1374 return super.WM_SETFONT (wParam, lParam); 1371 1375 } 1372 1376 1373 LRESULT WM_SIZE (int wParam, int lParam) {1377 override LRESULT WM_SIZE (int wParam, int lParam) { 1374 1378 1375 1379 /* Begin deferred window positioning */ 1376 1380 setResizeChildren (false); … … 1414 1418 return result; 1415 1419 } 1416 1420 1417 LRESULT WM_SYSCOLORCHANGE (int wParam, int lParam) {1421 override LRESULT WM_SYSCOLORCHANGE (int wParam, int lParam) { 1418 1422 LRESULT result = super.WM_SYSCOLORCHANGE (wParam, lParam); 1419 1423 if (result !is LRESULT.NULL) return result; 1420 1424 auto hwndChild = OS.GetWindow (handle, OS.GW_CHILD); … … 1425 1429 return result; 1426 1430 } 1427 1431 1428 LRESULT WM_SYSCOMMAND (int wParam, int lParam) {1432 override LRESULT WM_SYSCOMMAND (int wParam, int lParam) { 1429 1433 LRESULT result = super.WM_SYSCOMMAND (wParam, lParam); 1430 1434 if (result !is LRESULT.NULL) return result; 1431 1435 … … 1463 1467 return result; 1464 1468 } 1465 1469 1466 LRESULT WM_UPDATEUISTATE (int wParam, int lParam) {1470 override LRESULT WM_UPDATEUISTATE (int wParam, int lParam) { 1467 1471 LRESULT result = super.WM_UPDATEUISTATE (wParam, lParam); 1468 1472 if (result !is LRESULT.NULL) return result; 1469 1473 if ((state & CANVAS) !is 0) OS.InvalidateRect (handle, null, false); … … 1495 1499 return LRESULT.NULL; 1496 1500 } 1497 1501 1498 LRESULT wmNotify (NMHDR* hdr, int wParam, int lParam) {1502 override LRESULT wmNotify (NMHDR* hdr, int wParam, int lParam) { 1499 1503 if (!OS.IsWinCE) { 1500 1504 switch (hdr.code) { 1501 1505 /* -
a/dwt/widgets/Control.d
old new 685 685 display.removeControl (handle); 686 686 } 687 687 688 void destroyWidget () {688 override void destroyWidget () { 689 689 auto hwnd = topHandle (); 690 690 releaseHandle (); 691 691 if (hwnd !is null) { … … 1317 1317 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> 1318 1318 * </ul> 1319 1319 */ 1320 public Menu getMenu () {1320 override public Menu getMenu () { 1321 1321 checkWidget (); 1322 1322 return menu; 1323 1323 } … … 1744 1744 return getVisible () && parent.isVisible (); 1745 1745 } 1746 1746 1747 void mapEvent (HWND hwnd, Event event) {1747 override void mapEvent (HWND hwnd, Event event) { 1748 1748 if (hwnd !is handle) { 1749 1749 POINT point; 1750 1750 point.x = event.x; … … 1882 1882 return Accessible.internal_new_Accessible (this); 1883 1883 } 1884 1884 1885 GC new_GC (GCData data) {1885 override GC new_GC (GCData data) { 1886 1886 return GC.win32_new (this, data); 1887 1887 } 1888 1888 … … 2032 2032 display.addControl (handle, this); 2033 2033 } 2034 2034 2035 void releaseHandle () {2035 override void releaseHandle () { 2036 2036 super.releaseHandle (); 2037 2037 handle = null; 2038 2038 parent = null; 2039 2039 } 2040 2040 2041 void releaseParent () {2041 override void releaseParent () { 2042 2042 parent.removeControl (this); 2043 2043 } 2044 2044 2045 void releaseWidget () {2045 override void releaseWidget () { 2046 2046 super.releaseWidget (); 2047 2047 if (OS.IsDBLocale) { 2048 2048 OS.ImmAssociateContext (handle, null); … … 2374 2374 if (handle !is topHandle_) OS.ShowWindow (handle, visible ? OS.SW_SHOW : OS.SW_HIDE); 2375 2375 } 2376 2376 2377 bool sendFocusEvent (int type) {2377 override bool sendFocusEvent (int type) { 2378 2378 Shell shell = getShell (); 2379 2379 2380 2380 /* -
a/dwt/widgets/CoolBar.d
old new 53 53 */ 54 54 55 55 public class CoolBar : Composite { 56 57 alias Composite.computeSize computeSize; 58 alias Composite.windowProc windowProc; 56 59 57 60 CoolItem [] items; 58 61 CoolItem [] originalItems; … … 124 127 } 125 128 } 126 129 127 LRESULT callWindowProc (HWND hwnd, int msg, int wParam, int lParam) {130 override LRESULT callWindowProc (HWND hwnd, int msg, int wParam, int lParam) { 128 131 if (handle is null) return LRESULT.NULL; 129 132 return cast(LRESULT) OS.CallWindowProc (ReBarProc, hwnd, msg, wParam, lParam); 130 133 } … … 141 144 return style & ~(DWT.H_SCROLL | DWT.V_SCROLL); 142 145 } 143 146 144 protected void checkSubclass () {147 override protected void checkSubclass () { 145 148 if (!isValidSubclass ()) error (DWT.ERROR_INVALID_SUBCLASS); 146 149 } 147 150 148 public Point computeSize (int wHint, int hHint, bool changed) {151 override public Point computeSize (int wHint, int hHint, bool changed) { 149 152 checkWidget (); 150 153 int width = 0, height = 0; 151 154 int border = getBorderWidth (); … … 214 217 return new Point (width, height); 215 218 } 216 219 217 void createHandle () {220 override void createHandle () { 218 221 super.createHandle (); 219 222 state &= ~(CANVAS | THEME_BACKGROUND); 220 223 … … 302 305 originalItems = newOriginals; 303 306 } 304 307 305 void createWidget () {308 override void createWidget () { 306 309 super.createWidget (); 307 310 items = new CoolItem [4]; 308 311 originalItems = new CoolItem [0]; … … 374 377 originalItems = newOriginals; 375 378 } 376 379 377 void drawThemeBackground (HDC hDC, HWND hwnd, RECT* rect) {380 override void drawThemeBackground (HDC hDC, HWND hwnd, RECT* rect) { 378 381 if (OS.COMCTL32_MAJOR >= 6 && OS.IsAppThemed ()) { 379 382 if (background is -1 && (style & DWT.FLAT) !is 0) { 380 383 Control control = findBackgroundControl (); … … 393 396 OS.SetWindowOrgEx (hDC, lpPoint.x, lpPoint.y, null); 394 397 } 395 398 396 Control findThemeControl () {399 override Control findThemeControl () { 397 400 if ((style & DWT.FLAT) !is 0) return this; 398 401 return background is -1 && backgroundImage is null ? this : super.findThemeControl (); 399 402 } … … 710 713 OS.SendMessage (handle, OS.RB_SETBANDINFO, index, &rbBand); 711 714 } 712 715 713 void releaseChildren (bool destroy) {716 override void releaseChildren (bool destroy) { 714 717 if (items !is null) { 715 718 for (int i=0; i<items.length; i++) { 716 719 CoolItem item = items [i]; … … 723 726 super.releaseChildren (destroy); 724 727 } 725 728 726 void removeControl (Control control) {729 override void removeControl (Control control) { 727 730 super.removeControl (control); 728 731 for (int i=0; i<items.length; i++) { 729 732 CoolItem item = items [i]; … … 733 736 } 734 737 } 735 738 736 void setBackgroundPixel (int pixel) {739 override void setBackgroundPixel (int pixel) { 737 740 if (pixel is -1) pixel = defaultBackground (); 738 741 OS.SendMessage (handle, OS.RB_SETBKCOLOR, 0, pixel); 739 742 setItemColors (OS.SendMessage (handle, OS.RB_GETTEXTCOLOR, 0, 0), pixel); … … 752 755 } 753 756 } 754 757 755 void setForegroundPixel (int pixel) {758 override void setForegroundPixel (int pixel) { 756 759 if (pixel is -1) pixel = defaultForeground (); 757 760 OS.SendMessage (handle, OS.RB_SETTEXTCOLOR, 0, pixel); 758 761 setItemColors (pixel, OS.SendMessage (handle, OS.RB_GETBKCOLOR, 0, 0)); … … 977 980 setRedraw (true); 978 981 } 979 982 980 int widgetStyle () {983 override int widgetStyle () { 981 984 int bits = super.widgetStyle () | OS.CCS_NODIVIDER | OS.CCS_NORESIZE; 982 985 bits |= OS.RBS_VARHEIGHT | OS.RBS_DBLCLKTOGGLE; 983 986 if ((style & DWT.FLAT) is 0) bits |= OS.RBS_BANDBORDERS; 984 987 return bits; 985 988 } 986 989 987 char[] windowClass () {990 override char[] windowClass () { 988 991 return TCHARzToStr( ReBarClass ); 989 992 } 990 993 991 int windowProc () {994 override int windowProc () { 992 995 return cast(int) ReBarProc; 993 996 } 994 997 995 LRESULT WM_COMMAND (int wParam, int lParam) {998 override LRESULT WM_COMMAND (int wParam, int lParam) { 996 999 /* 997 1000 * Feature in Windows. When the coolbar window 998 1001 * proc processes WM_COMMAND, it forwards this … … 1016 1019 return LRESULT.ZERO; 1017 1020 } 1018 1021 1019 LRESULT WM_ERASEBKGND (int wParam, int lParam) {1022 override LRESULT WM_ERASEBKGND (int wParam, int lParam) { 1020 1023 LRESULT result = super.WM_ERASEBKGND (wParam, lParam); 1021 1024 /* 1022 1025 * Feature in Windows. For some reason, Windows … … 1038 1041 return result; 1039 1042 } 1040 1043 1041 LRESULT WM_NOTIFY (int wParam, int lParam) {1044 override LRESULT WM_NOTIFY (int wParam, int lParam) { 1042 1045 /* 1043 1046 * Feature in Windows. When the cool bar window 1044 1047 * proc processes WM_NOTIFY, it forwards this … … 1062 1065 return LRESULT.ZERO; 1063 1066 } 1064 1067 1065 LRESULT WM_SETREDRAW (int wParam, int lParam) {1068 override LRESULT WM_SETREDRAW (int wParam, int lParam) { 1066 1069 LRESULT result = super.WM_SETREDRAW (wParam, lParam); 1067 1070 if (result !is LRESULT.NULL) return result; 1068 1071 /* … … 1094 1097 return cast( LRESULT )(code); 1095 1098 } 1096 1099 1097 LRESULT WM_SIZE (int wParam, int lParam) {1100 override LRESULT WM_SIZE (int wParam, int lParam) { 1098 1101 if (ignoreResize) { 1099 1102 int code = callWindowProc (handle, OS.WM_SIZE, wParam, lParam); 1100 1103 if (code is 0) return LRESULT.ZERO; … … 1109 1112 return super.WM_SIZE (wParam, lParam); 1110 1113 } 1111 1114 1112 LRESULT wmNotifyChild (NMHDR* hdr, int wParam, int lParam) {1115 override LRESULT wmNotifyChild (NMHDR* hdr, int wParam, int lParam) { 1113 1116 switch (hdr.code) { 1114 1117 case OS.RBN_BEGINDRAG: { 1115 1118 int pos = OS.GetMessagePos (); -
a/dwt/widgets/CoolItem.d
old new 161 161 addListener (DWT.DefaultSelection,typedListener); 162 162 } 163 163 164 protected void checkSubclass () {164 override protected void checkSubclass () { 165 165 if (!isValidSubclass ()) error (DWT.ERROR_INVALID_SUBCLASS); 166 166 } 167 167 … … 207 207 return new Point (width, height); 208 208 } 209 209 210 void destroyWidget () {210 override void destroyWidget () { 211 211 parent.destroyItem (this); 212 212 releaseHandle (); 213 213 } … … 305 305 return parent; 306 306 } 307 307 308 void releaseHandle () {308 override void releaseHandle () { 309 309 super.releaseHandle (); 310 310 parent = null; 311 311 id = -1; -
a/dwt/widgets/DateTime.d
old new 59 59 */ 60 60 61 61 public class DateTime extends Composite { 62 63 alias Composite.computeSize computeSize; 64 alias Composite.windowProc windowProc; 65 62 66 static final int DateTimeProc; 63 67 static final TCHAR DateTimeClass = new TCHAR (0, OS.DATETIMEPICK_CLASS, true); 64 68 static final int CalendarProc; … … 165 169 addListener (DWT.DefaultSelection, typedListener); 166 170 } 167 171 168 int callWindowProc (int hwnd, int msg, int wParam, int lParam) {172 override int callWindowProc (int hwnd, int msg, int wParam, int lParam) { 169 173 if (handle is 0) return 0; 170 174 return OS.CallWindowProc (windowProc (), hwnd, msg, wParam, lParam); 171 175 } … … 183 187 return checkBits (style, DWT.MEDIUM, DWT.SHORT, DWT.LONG, 0, 0, 0); 184 188 } 185 189 186 protected void checkSubclass () {190 override protected void checkSubclass () { 187 191 if (!isValidSubclass ()) error (DWT.ERROR_INVALID_SUBCLASS); 188 192 } 189 193 190 public Point computeSize (int wHint, int hHint, bool changed) {194 override public Point computeSize (int wHint, int hHint, bool changed) { 191 195 checkWidget (); 192 196 int width = 0, height = 0; 193 197 if (wHint is DWT.DEFAULT || hHint is DWT.DEFAULT) { … … 340 344 return new Point (width, height); 341 345 } 342 346 343 void createHandle () {347 override void createHandle () { 344 348 super.createHandle (); 345 349 state &= ~(CANVAS | THEME_BACKGROUND); 346 350 } 347 351 348 int defaultBackground () {352 override int defaultBackground () { 349 353 return OS.GetSysColor (OS.COLOR_WINDOW); 350 354 } 351 355 … … 552 556 return systime.wMonth - 1; 553 557 } 554 558 555 String getNameText () {559 override String getNameText () { 556 560 return "DateTime"; 557 561 } 558 562 … … 761 765 OS.SendMessage (handle, msg, 0, systime); 762 766 } 763 767 764 int widgetStyle () {768 override int widgetStyle () { 765 769 int bits = super.widgetStyle () | OS.WS_TABSTOP; 766 770 if ((style & DWT.CALENDAR) !is 0) return bits | OS.MCS_NOTODAY; 767 771 /* … … 775 779 return bits; 776 780 } 777 781
