Mercurial > projects > dwt-mac
diff dwt/accessibility/Accessible.d @ 60:62202ce0039f
Updated and fixed many modules to 3.514
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Mon, 22 Dec 2008 15:10:19 +0100 |
parents | 83b0ad9d9238 |
children | c74ba20de292 |
line wrap: on
line diff
--- a/dwt/accessibility/Accessible.d Tue Dec 09 21:52:21 2008 +0100 +++ b/dwt/accessibility/Accessible.d Mon Dec 22 15:10:19 2008 +0100 @@ -36,10 +36,15 @@ import dwt.widgets.Monitor; import dwt.widgets.Shell; +import tango.core.Thread; import tango.util.container.HashMap; +import dwt.accessibility.ACC; +import dwt.accessibility.AccessibleControlEvent; +import dwt.accessibility.AccessibleEvent; import dwt.accessibility.AccessibleListener; import dwt.accessibility.AccessibleControlListener; +import dwt.accessibility.AccessibleTextEvent; import dwt.accessibility.AccessibleTextListener; import dwt.accessibility.SWTAccessibleDelegate; import dwt.dwthelper.array; @@ -231,7 +236,7 @@ event.childID = childID; event.detail = -1; for (int i = 0; i < accessibleControlListeners.size(); i++) { - AccessibleControlListener listener = accessibleControlListeners.elementAt(i); + AccessibleControlListener listener = elementAt(accessibleControlListeners, i); listener.getRole(event); } @@ -361,7 +366,7 @@ if (event.detail !is -1) { String osRole = roleToOs(event.detail); - if (osRole.indexOf(':') is -1) + if (dwt.dwthelper.utils.indexOf(osRole, ':') is -1) returnValue.removeObject(OS.NSAccessibilitySubroleAttribute); } @@ -453,7 +458,7 @@ public cocoa.id internal_accessibilityHitTest(NSPoint point, int childID) { AccessibleControlEvent event = new AccessibleControlEvent(this); event.x = cast(int) point.x; - Monitor primaryMonitor = Display.getCurrent().getPrimaryMonitor(); + dwt.widgets.Monitor.Monitor primaryMonitor = Display.getCurrent().getPrimaryMonitor(); event.y = cast(int) (primaryMonitor.getBounds().height - point.y); // Set an impossible value to determine if anything responded to the event. @@ -586,7 +591,7 @@ } if (event.detail !is -1) { String appRole = roleToOs (event.detail); - int index = appRole.indexOf(':'); + int index = dwt.dwthelper.utils.indexOf(appRole, ':'); if (index !is -1) appRole = appRole.substring(0, index); returnValue = NSString.stringWith(appRole); } @@ -605,7 +610,7 @@ } if (event.detail !is -1) { String appRole = roleToOs (event.detail); - int index = appRole.indexOf(':'); + int index = dwt.dwthelper.utils.indexOf(appRole, ':'); if (index !is -1) { appRole = appRole.substring(index + 1); returnValue = NSString.stringWith(appRole); @@ -626,7 +631,7 @@ if (event.detail !is -1) { String appRole = roleToOs (event.detail); String appSubrole = null; - int index = appRole.indexOf(':'); + int index = dwt.dwthelper.utils.indexOf(appRole, ':'); if (index !is -1) { appSubrole = appRole.substring(index + 1); appRole = appRole.substring(0, index); @@ -671,7 +676,7 @@ } cocoa.id getValueAttribute (int childID) { - id returnValue = null; + cocoa.id returnValue = null; AccessibleControlEvent event = new AccessibleControlEvent(this); event.childID = childID; event.detail = -1; @@ -717,7 +722,7 @@ if (role is ACC.ROLE_TABITEM) { returnValue = NSNumber.numberWithBool(ace.childID is childID); } else { - returnValue = new id(OS.NSAccessibilityUnignoredAncestor(childIDToOs(ace.childID).id)); + returnValue = new cocoa.id(OS.NSAccessibilityUnignoredAncestor(childIDToOs(ace.childID).id)); } } else { returnValue = NSNumber.numberWithBool(false); @@ -798,7 +803,7 @@ if (childID is ACC.CHILDID_SELF) return null; else - return new id(OS.NSAccessibilityUnignoredAncestor(control.view.id)); + return new cocoa.id(OS.NSAccessibilityUnignoredAncestor(control.view.id)); } cocoa.id getChildrenAttribute (int childID) { @@ -824,7 +829,7 @@ for (int i = 0; i < appChildren.length; i++) { Object child = appChildren[i]; if (cast(Integer) child) { - id accChild = childIDToOs((cast(Integer)child).intValue()); + cocoa.id accChild = childIDToOs((cast(Integer)child).intValue()); childArray.addObject(accChild); } else { childArray.addObject((cast(Accessible)child).control.view); @@ -918,7 +923,7 @@ listener.getLocation(event); } - Monitor primaryMonitor = Display.getCurrent().getPrimaryMonitor(); + dwt.widgets.Monitor.Monitor primaryMonitor = Display.getCurrent().getPrimaryMonitor(); NSPoint osPositionAttribute = NSPoint (); if (event.width !is -1) { @@ -1036,7 +1041,7 @@ // The parameter is an NSNumber with the line number. NSNumber lineNumberObj = new NSNumber(parameter.id); int lineNumber = lineNumberObj.intValue(); - System.Out.println("Line number = " ~ lineNumber); + System.Out.println("Line number = " ~ Integer.toString(lineNumber)); AccessibleControlEvent event = new AccessibleControlEvent(this); event.childID = childID; event.result = null; @@ -1389,11 +1394,11 @@ } /* Check cache for childID, if found, return corresponding osChildID. */ - SWTAccessibleDelegate childRef = children.get(childID); + SWTAccessibleDelegate childRef = children[childID]; if (childRef is null) { childRef = new SWTAccessibleDelegate(this, childID); - children.put(childID, childRef); + children.add(childID, childRef); } return childRef; @@ -1496,7 +1501,7 @@ /* isValidThread was copied from Widget, and rewritten to work in this package */ bool isValidThread () { - return control.getDisplay ().getThread () is Thread.currentThread (); + return control.getDisplay ().getThread () is Thread.getThis (); } }