Changeset 30
- Timestamp:
- 07/03/04 04:20:31 (4 years ago)
- Files:
-
- branches/0.1/src/dwt/accessibility/accessible.d (modified) (5 diffs)
- branches/0.1/src/dwt/widgets/control.d (modified) (14 diffs)
- branches/0.1/src/dwt/widgets/shell.d (modified) (8 diffs)
- branches/0.1/src/makefile (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/0.1/src/dwt/accessibility/accessible.d
r17 r30 54 54 public class Accessible { 55 55 56 /+ 56 57 57 int refCount = 0, enumIndex = 0; 58 58 COMObject objIAccessible, objIEnumVARIANT; … … 132 132 return new Accessible(control); 133 133 } 134 134 /+ TODO: delegates? 135 135 /** 136 136 * Adds the listener to the collection of listeners who will … … 216 216 textListeners.addElement (listener); 217 217 } 218 218 +/ 219 219 220 /** 220 221 * Gets the control for this Accessible object. … … 261 262 } 262 263 264 /+ TODO: delegates? 263 265 /** 264 266 * Removes the listener from the collection of listeners who will … … 337 339 textListeners.remove (listener); 338 340 } 341 +/ 339 342 340 343 /** branches/0.1/src/dwt/widgets/control.d
r28 r30 475 475 } 476 476 477 /+ TODO: new Control [] [this] +/ 477 478 Control [] computeTabList () { 478 479 if (isTabGroup ()) { 479 480 if (getVisible () && getEnabled ()) { 480 return new Control [] [this]; 481 // return new Control [] {this}; 482 Control[] ret; 483 ret[0] = this; 484 return ret; 481 485 } 482 486 } 483 487 return new Control [0]; 484 488 } 489 485 490 486 491 void createHandle () { 487 492 int hwndParent = widgetParent (); 493 CREATESTRUCT wcs = widgetCreateStruct (); 488 494 handle = OS.CreateWindowEx ( 489 495 widgetExtStyle (), 490 496 windowClass (), 491 null,497 cast(TCHAR)null, 492 498 widgetStyle (), 493 499 OS.CW_USEDEFAULT, 0, OS.CW_USEDEFAULT, 0, … … 495 501 0, 496 502 OS.GetModuleHandle (null), 497 widgetCreateStruct ());503 &wcs); 498 504 if (handle == 0) error (DWT.ERROR_NO_HANDLES); 499 505 int bits = OS.GetWindowLong (handle, OS.GWL_STYLE); … … 544 550 545 551 void drawBackground (int hDC) { 546 RECT rect = new RECT ();547 OS.GetClientRect (handle, rect);552 RECT rect; 553 OS.GetClientRect (handle, &rect); 548 554 drawBackground (hDC, rect); 549 555 } … … 557 563 int pixel = getBackgroundPixel (); 558 564 int hBrush = findBrush (pixel); 559 OS.FillRect (hDC, rect, hBrush);565 OS.FillRect (hDC, &rect, hBrush); 560 566 } 561 567 … … 569 575 } 570 576 577 /+ TODO: new Menu[] [menu] +/ 571 578 Menu [] findMenus (Control control) { 572 if (menu != null && this != control) return new Menu[] [menu]; 579 if (menu != null && this != control) { 580 // return new Menu[] [menu]; 581 Menu[] ret; 582 ret[0] = menu; 583 } 573 584 return new Menu [0]; 574 585 } 575 586 576 char findMnemonic (String string) {587 wchar findMnemonic (String string) { 577 588 int index = 0; 578 int length = string.length ();589 int length = string.length; 579 590 do { 580 while (index < length && string .charAt (index)!= '&') index++;591 while (index < length && string[index] != '&') index++; 581 592 if (++index >= length) return '\0'; 582 if (string .charAt (index) != '&') return string.charAt (index);593 if (string[index] != '&') return string[index]; // TODO: if string[index] is a wchar, does comparing it to '&' really work? is '&' a wchar, too? 583 594 index++; 584 595 } while (index < length); … … 644 655 for (int i=0; i<lpwp.length; i++) { 645 656 WINDOWPOS wp = lpwp [i]; 646 if ( wp != null && wp.hwnd == handle) {657 if (cast(void*)wp != null && wp.hwnd == handle) { 647 658 /* 648 659 * This code is intentionally commented. All widgets that … … 656 667 // } 657 668 OS.SetWindowPos (wp.hwnd, 0, wp.x, wp.y, wp.cx, wp.cy, wp.flags); 658 lpwp [i] = null;669 // lpwp [i] = null; TODO: set struct to null? Use isActive in the WINDOWPOS like other structs before? 659 670 return; 660 671 } … … 739 750 checkWidget (); 740 751 forceResize (); 741 RECT rect = new RECT ();742 OS.GetWindowRect (handle, rect);752 RECT rect; 753 OS.GetWindowRect (handle, &rect); 743 754 int hwndParent = parent == null ? 0 : parent.handle; 744 OS.MapWindowPoints (0, hwndParent, rect, 2);755 OS.MapWindowPoints (0, hwndParent, &rect, 2); 745 756 int width = rect.right - rect.left; 746 757 int height = rect.bottom - rect.top; … … 751 762 if (OS.IsUnicode) return OS.CP_ACP; 752 763 int hFont = OS.SendMessage (handle, OS.WM_GETFONT, 0, 0); 753 LOGFONT logFont = OS.IsUnicode ? cast(LOGFONT) new LOGFONTW () : new LOGFONTA ();754 OS.GetObject (hFont, LOGFONT.sizeof,logFont);764 LOGFONT logFont; // = OS.IsUnicode ? cast(LOGFONT) new LOGFONTW () : new LOGFONTA (); 765 OS.GetObject (hFont, cast(int)LOGFONT.sizeof, &logFont); 755 766 int cs = logFont.lfCharSet & 0xFF; 756 767 int [] lpCs = new int [8]; … … 847 858 checkWidget (); 848 859 forceResize (); 849 RECT rect = new RECT ();850 OS.GetWindowRect (handle, rect);860 RECT rect; 861 OS.GetWindowRect (handle, &rect); 851 862 int hwndParent = parent == null ? 0 : parent.handle; 852 OS.MapWindowPoints (0, hwndParent, rect, 2);863 OS.MapWindowPoints (0, hwndParent, &rect, 2); 853 864 return new Point (rect.left, rect.top); 854 865 } … … 887 898 } 888 899 int hmonitor = OS.MonitorFromWindow (handle, OS.MONITOR_DEFAULTTONEAREST); 889 MONITORINFO lpmi = new MONITORINFO ();900 MONITORINFO lpmi; 890 901 lpmi.cbSize = MONITORINFO.sizeof; 891 OS.GetMonitorInfo (hmonitor, lpmi);902 OS.GetMonitorInfo (hmonitor, &lpmi); 892 903 Monitor monitor = new Monitor (); 893 904 monitor.handle = hmonitor; … … 973 984 checkWidget (); 974 985 forceResize (); 975 RECT rect = new RECT ();976 OS.GetWindowRect (handle, rect);986 RECT rect; 987 OS.GetWindowRect (handle, &rect); 977 988 int width = rect.right - rect.left; 978 989 int height = rect.bottom - rect.top; … … 1021 1032 1022 1033 bit hasCursor () { 1023 RECT rect = new RECT ();1024 if (!OS.GetClientRect (handle, rect)) return false;1025 if (OS.MapWindowPoints (handle, 0, rect, 2) == 0) return false;1026 POINT pt = new POINT ();1027 return (OS.GetCursorPos ( pt) && OS.PtInRect (rect,pt));1034 RECT rect; 1035 if (!OS.GetClientRect (handle, &rect)) return false; 1036 if (OS.MapWindowPoints (handle, 0, &rect, 2) == 0) return false; // TODO: did we send this to MapWindowPoints(int,int,POINT*,int) ?? instead of RECT* 1037 POINT pt; 1038 return (OS.GetCursorPos (&pt) && OS.PtInRect (&rect, &pt)); 1028 1039 } 1029 1040 … … 1179 1190 } 1180 1191 1181 b itisFocusAncestor () {1192 bool isFocusAncestor () { 1182 1193 Control control = display.getFocusControl (); 1183 1194 while (control != null && control != this) { 1184 1195 control = control.parent; 1185 1196 } 1186 return c ontrol == this;1197 return cast(bool)(control == this); 1187 1198 } 1188 1199 branches/0.1/src/dwt/widgets/shell.d
r28 r30 127 127 128 128 Menu activeMenu; 129 int hIMC, hwndMDIClient, toolTipHandle, lpstrTip;129 int hIMC, _hwndMDIClient, toolTipHandle, lpstrTip; 130 130 int [] brushes; 131 131 bit showWithParent; … … 369 369 */ 370 370 371 /+ 371 372 372 373 373 public static Shell win32_new (Display display, int handle) { … … 385 385 } 386 386 387 /+ TODO: delegates 387 388 /** 388 389 * Adds the listener to the collection of listeners who will … … 415 416 } 416 417 418 +/ 419 417 420 int callWindowProc (int msg, int wParam, int lParam) { 418 421 if (parent != null) { … … 426 429 } 427 430 if (handle == 0) return 0; 428 if ( hwndMDIClient != 0) {429 return OS.DefFrameProc (handle, hwndMDIClient, msg, wParam, lParam);431 if (_hwndMDIClient != 0) { 432 return OS.DefFrameProc (handle, _hwndMDIClient, msg, wParam, lParam); 430 433 } 431 434 return OS.DefWindowProc (handle, msg, wParam, lParam); … … 718 721 719 722 int hwndMDIClient () { 720 if ( hwndMDIClient == 0) {723 if (_hwndMDIClient == 0) { 721 724 int widgetStyle = OS.MDIS_ALLCHILDSTYLES | OS.WS_CHILD | OS.WS_CLIPCHILDREN | OS.WS_CLIPSIBLINGS; 722 hwndMDIClient = OS.CreateWindowEx (725 _hwndMDIClient = OS.CreateWindowEx ( 723 726 0, 724 727 new TCHAR (0, "MDICLIENT", true), … … 730 733 OS.GetModuleHandle (null), 731 734 new CREATESTRUCT ()); 732 // OS.ShowWindow ( hwndMDIClient, OS.SW_SHOW);733 } 734 return hwndMDIClient;735 } 736 737 +/ 735 // OS.ShowWindow (_hwndMDIClient, OS.SW_SHOW); 736 } 737 return _hwndMDIClient; 738 } 739 740 738 741 739 742 /** … … 796 799 void releaseHandle () { 797 800 super.releaseHandle (); 798 hwndMDIClient = 0;801 _hwndMDIClient = 0; 799 802 } 800 803 branches/0.1/src/makefile
r28 r30 13 13 dwt/dwt.d 14 14 15 dwt.accessibility = \ 16 dwt/accessibility/accessible.d 17 15 18 dwt.graphics = \ 16 19 dwt/graphics/IDrawable.d \ … … 91 94 dwtSRC = \ 92 95 $(dwt.dwt) \ 96 $(dwt.accessibility) \ 93 97 $(dwt.graphics) \ 94 98 $(dwt.internal) \
