[Laszlo-checkins] r13147 - in openlaszlo/trunk: WEB-INF/lps/lfc/kernel/swf WEB-INF/lps/lfc/views lps/components/lz
max@openlaszlo.org
max at openlaszlo.org
Tue Mar 3 18:41:46 PST 2009
Author: max
Date: 2009-03-03 18:41:42 -0800 (Tue, 03 Mar 2009)
New Revision: 13147
Modified:
openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/LzSprite.as
openlaszlo/trunk/WEB-INF/lps/lfc/views/LaszloCanvas.lzs
openlaszlo/trunk/lps/components/lz/radio.lzx
Log:
Change 20090302-maxcarlson-P by maxcarlson at Bank.lan on 2009-03-02 23:39:29 PST
in /Users/maxcarlson/openlaszlo/trunk-clean
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Add accessibility support to radiobuttons
Bugs Fixed: LPP-7594 - IBM Jaws Accessibility support needed for Radioboxes and trees and Issues (partial)
Technical Reviewer: promanik
QA Reviewer: aalappat at laszlosystems.com
Details: LzSprite - fix braino in __gotFocus()
LaszloCanvas - Make sure canvas.accessible is false for runtimes that don't support accessibility.
radio - Add accessibility support, conditionalize on canvas.accessible.
Tests: See radiotext.lzx test from LPP-7594 with JAWS or accevent.exe from http://www.microsoft.com/downloads/details.aspx?familyid=3755582A-A707-460A-BF21-1373316E13F0&displaylang=en. LPP-7593 runs as before.
Modified: openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/LzSprite.as
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/LzSprite.as 2009-03-04 02:06:02 UTC (rev 13146)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/LzSprite.as 2009-03-04 02:41:42 UTC (rev 13147)
@@ -1618,7 +1618,7 @@
var v = this.myView || this._parent.myView;
if (!(lz.Focus.getFocus() === v)) {
//var tabdown = lz.Keys.isKeyDown('tab');
- lz.Focus.setFocus(this.myView);
+ lz.Focus.setFocus(v);
}
}
Modified: openlaszlo/trunk/WEB-INF/lps/lfc/views/LaszloCanvas.lzs
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/views/LaszloCanvas.lzs 2009-03-04 02:06:02 UTC (rev 13146)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/views/LaszloCanvas.lzs 2009-03-04 02:41:42 UTC (rev 13147)
@@ -211,8 +211,9 @@
this.sprite.setAAActive(true);
this.sprite.setAASilent(false);
}
- } else if (args.accessible && $debug) {
- Debug.warn("This runtime doesn't support accessibility.");
+ } else if (args.accessible) {
+ if ($debug) Debug.warn("This runtime doesn't support accessibility.");
+ args.accessible = this.accessible = false;
}
if ((typeof(args.history) == "undefined") || args.history == null) {
Modified: openlaszlo/trunk/lps/components/lz/radio.lzx
===================================================================
--- openlaszlo/trunk/lps/components/lz/radio.lzx 2009-03-04 02:06:02 UTC (rev 13146)
+++ openlaszlo/trunk/lps/components/lz/radio.lzx 2009-03-04 02:41:42 UTC (rev 13147)
@@ -123,7 +123,82 @@
to be radiogroup. -->
<class name="radiobutton" extends="baselistitem" focusable="false"
clickable="true">
+ <!--- @keywords private -->
+ <method name="init">
+ <![CDATA[
+ super.init();
+ if (canvas.accessible) {
+ this.accessible.setAttribute('applied', true);
+ var mc = this.getMCRef();
+ mc._accImpl = {};
+ mc._accImpl.stub = false;
+ mc._accImpl.master = this;
+
+ mc._accImpl.get_accRole = function() {
+ // ROLE_SYSTEM_RADIOBUTTON
+ return 0x2d;
+ }
+
+ mc._accImpl.get_accName = function() {
+ return this.master.text;
+ }
+
+ mc._accImpl.get_accState = function() {
+ if (this.master.selected) {
+ // STATE_SYSTEM_CHECKED && STATE_SYSTEM_FOCUSED && STATE_SYSTEM_FOCUSABLE
+ return 0x00100014
+ } else {
+ // STATE_SYSTEM_FOCUSABLE && STATE_SYSTEM_FOCUSED
+ return 0x00100004
+ }
+ }
+
+ mc._accImpl.get_accDefaultAction = function(childId) {
+ //Debug.info('get_accDefaultAction', childId);
+ if (this.master.selected){
+ return "UnCheck";
+ }else{
+ return "Check";
+ }
+ }
+
+ mc._accImpl.accDoDefaultAction = function(childId) {
+ //this.master.onclick.sendEvent();
+ //Debug.write('accDoDefaultAction', this.master);
+ this.master.parent.select(this.master);
+ }
+ }
+ ]]>
+ </method>
+
+ <state name="accessible">
+ <!--- @keywords private -->
+ <attribute name="EVENT_OBJECT_FOCUS" type="number" value="0x8005"/>
+ <!--- @keywords private -->
+ <attribute name="EVENT_OBJECT_NAMECHANGE" type="number" value="0x800c"/>
+ <!--- @keywords private -->
+ <attribute name="EVENT_OBJECT_SELECTION" type="number" value="0x8006"/>
+ <!--- @keywords private -->
+ <attribute name="EVENT_OBJECT_STATECHANGE" type="number" value="0x800a"/>
+ <!--- @keywords private -->
+ <handler name="onselected" args="s">
+ this.sendAAEvent(0, EVENT_OBJECT_FOCUS);
+ this.sendAAEvent( 0, EVENT_OBJECT_STATECHANGE,true );
+ </handler>
+ <!--- @keywords private -->
+ <handler name="ontext" args="l">
+ this.sendAAEvent( 0, EVENT_OBJECT_NAMECHANGE);
+ </handler>
+ <!--- @keywords private -->
+ <method name="updateFocus">
+ this.sendAAEvent(0, EVENT_OBJECT_SELECTION);
+ this.sendAAEvent(0, EVENT_OBJECT_FOCUS);
+ Selection.setFocus(parent.getMCRef());
+ </method>
+ </state>
+
+
<!--- the y position of the text label. default: centered -->
<attribute name="text_y"
value="${this.rb.height/2 - this._title.height/2}" type="number"/>
@@ -165,6 +240,7 @@
<method name="setHilite" args="dohilite">
_title.setAttribute('fgcolor',
dohilite ? style.texthilitecolor : style.textcolor);
+ if (canvas.accessible) this.updateFocus();
</method>
<!-- FIXME: [hqm 2006-09] LPP-2244 This used to be y="$once{classroot.text_y}"
More information about the Laszlo-checkins
mailing list