The document discusses accessibility in web development and software applications. It covers topics like web accessibility guidelines, providing alternatives for images, maximizing readability in structures, accessibility in Visual Studio .NET, C#, XHTML tables and frames, and accessibility tools. Code examples are provided to demonstrate making applications more accessible for people with disabilities.
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Chapter 24 - Guide to Improving Website and Application Accessibility
1. Chapter 24 – Accessibility Outline 24.1 Introduction 24.2 Regulations and Resources 24.3 Web Accessibility Initiative 24.4 Providing Alternatives for Images 24.5 Maximizing Readability by Focusing on Structure 24.6 Accessibility in Visual Studio .NET 24.6.1 Enlarging Toolbar Icons 24.6.2 Enlarging the Text 24.6.3 Modifying the Toolbox 24.6.4 Modifying the Keyboard 24.6.5 Rearranging Windows 24.7 Accessibility in C# 24.8 Accessibility in XHTML Tables
2. Chapter 24 – Accessibility Outline 24.9 Accessibility in XHTML Frames 24.10 Accessibility in XML 24.11 Using Voice Synthesis and Recognition with VoiceXML™ 24.12 CallXML™ 24.13 JAWS® for Windows 24.14 Other Accessibility Tools 24.15 Accessibility in Microsoft® Windows® 2000 24.15.1 Tools for People with Visual Impairments 24.15.2 Tools for People with Hearing Impairments 24.15.3 Tools for Users Who Have Difficulty Using the Keyboard 24.15.4 Microsoft Narrator 24.15.5 Microsoft On-Screen Keyboard 24.15.6 Accessibility Features in Microsoft Internet Explorer 5.5 24.16 Internet and World Wide Web Resources
22. TextToSpeech.cs 1 // Fig. 24.13: TextToSpeech.cs 2 // Providing audio for people with visual impairments. 3 4 using System; 5 using System.Drawing; 6 using System.Collections; 7 using System.ComponentModel; 8 using System.Windows.Forms; 9 using System.Data; 10 11 // helps users navigate a form with aid of audio cues 12 public class TextToSpeech : System.Windows.Forms.Form 13 { 14 private System.Windows.Forms.Label nameLabel; 15 private System.Windows.Forms.Label phoneLabel; 16 17 private System.Windows.Forms.TextBox nameTextBox; 18 private System.Windows.Forms.TextBox phoneTextBox; 19 private System.Windows.Forms.TextBox passwordTextBox; 20 21 private System.Windows.Forms.Button submitButton; 22 23 private System.Windows.Forms.Label passwordLabel; 24 25 private AxHTTSLib.AxTextToSpeech speaker; 26 27 private System.ComponentModel.Container components = null ; 28 29 // default constructor 30 public TextToSpeech() 31 { 32 InitializeComponent(); 33 Text-to-speech control
23. TextToSpeech.cs 34 // set Form to be visible to accessibility applications 35 this .IsAccessible = true ; 36 37 // let all controls be visible to accessibility applications 38 foreach ( Control current in this .Controls ) 39 current.IsAccessible = true ; 40 } 41 42 private void InitializeComponent() 43 { 44 this .nameLabel.AccessibleDescription = "User Name" ; 45 this .nameLabel.AccessibleName = "User Name" ; 46 this .nameLabel.TabIndex = 5 ; 47 this .nameLabel.MouseHover += 48 new System.EventHandler( this .controls_MouseHover ); 49 50 this .phoneLabel.AccessibleDescription = 51 "Phone Number Label" ; 52 this .phoneLabel.AccessibleName = "Phone Number Label" ; 53 this .phoneLabel.TabIndex = 6 ; 54 this .phoneLabel.MouseHover += 55 new System.EventHandler( this .controls_MouseHover ); 56 57 this .nameTextBox.AccessibleDescription = 58 "Enter User Name" ; 59 this .nameTextBox.AccessibleName = "User Name TextBox" ; 60 this .nameTextBox.TabIndex = 1 ; 61 this .nameTextBox.MouseHover += 62 new System.EventHandler( this .controls_MouseHover ); 63 TabIndex property of the control Set AccessibleDiscription properties of all the controls Set AccessibleName properties of all the controls Not visible in the Properties window during design time Loop through each control and update IsAccessible property to true
24. TextToSpeech.cs 64 this .phoneTextBox.AccessibleDescription = 65 "Enter Phone Number" ; 66 this .phoneTextBox.AccessibleName = "Phone Number TextBox" ; 67 this .phoneTextBox.TabIndex = 2 ; 68 this .phoneTextBox.MouseHover += 69 new System.EventHandler( this .controls_MouseHover ); 70 71 this .passwordTextBox.AccessibleDescription = 72 "Enter Password" ; 73 this .passwordTextBox.AccessibleName = "Password TextBox" ; 74 this .passwordTextBox.TabIndex = 3 ; 75 this .passwordTextBox.MouseHover += 76 new System.EventHandler( this .controls_MouseHover ); 77 78 this .submitButton.AccessibleDescription = 79 "Submit the Information" ; 80 this .submitButton.AccessibleName = "Submit Information" ; 81 this .submitButton.TabIndex = 4 ; 82 this .submitButton.Text = "&Submit" ; 83 this .submitButton.Click += 84 new System.EventHandler( this .submitButton_Click ); 85 this .submitButton.MouseHover += 86 new System.EventHandler( this .controls_MouseHover ); 87 88 this .passwordLabel.AccessibleDescription = 89 "Password Label" ; 90 this .passwordLabel.AccessibleName = "Password Label" ; 91 this .passwordLabel.TabIndex = 7 ; 92 this .passwordLabel.MouseHover += 93 new System.EventHandler( this .controls_MouseHover ); 94 &Submit allows special keyboard access
25. TextToSpeech.cs 95 this .speaker.AccessibleDescription = 96 "Give Information about Form" ; 97 this .speaker.AccessibleName = "Speaker" ; 98 this .speaker.TabIndex = 8 ; 99 this .speaker.TabStop = false ; 100 101 this .AccessibleDescription = "Registration Form" ; 102 this .AccessibleName = "Registration Form" ; 103 } 104 105 [STAThread] 106 static void Main() 107 { 108 Application.Run( new TextToSpeech() ); 109 } 110 111 // tell user over which control the mouse is 112 private void controls_MouseHover( 113 object sender, System.EventArgs e ) 114 { 115 // if mouse is over a Label, tell user to enter information 116 if ( sender.GetType() == nameLabel.GetType() ) 117 { 118 Label temporary = ( Label) sender; 119 speaker.Speak( "Please enter your " + temporary.Text + 120 " in the textbox to the right" ); 121 } 122 This method to determine type of control Casts sender to a Label and assign to Label temporary A reference to control that triggered the event Provide string to be converted to speech Determine which type matches the label Method GetType returns instance of class Type
26. TextToSpeech.cs 123 // if mouse is over a TextBox, tell user what 124 // information was entered 125 else if ( sender.GetType() == nameTextBox.GetType() ) 126 { 127 TextBox temporary = ( TextBox ) sender; 128 speaker.Speak( "You have entered " + 129 ( temporary.Text == "" ? "nothing" : 130 temporary.Text ) + " in the " + temporary.Name ); 131 } 132 133 // otherwise, user is over Button, so tell user to click 134 // it to submit the information 135 else 136 speaker.Speak( 137 "Click on this button to submit your information" ); 138 139 } // end method controls_MouseHover 140 141 // thank user for information submission 142 private void submitButton_Click( 143 object sender, System.EventArgs e ) 144 { 145 speaker.Speak( 146 "Thank you, your information has been submitted." ); 147 148 Application.Exit(); 149 } 150 151 } // end class TextToSpeech When the type is neither a Label nor a TexBox Notify the user
31. withheaders.html 1 <?xml version = "1.0" ?> 2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 3 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" > 4 5 <!-- Fig. 24.15: withheaders.html --> 6 <!-- Table with headers --> 7 8 <html xmlns = "http://www.w3.org/1999/xhtml" > 9 <head> 10 <title> XHTML Table With Headers </title> 11 12 <style type = "text/css" > 13 body { background-color: #ccffaa ; 14 text-align: center } 15 </style> 16 </head> 17 18 <body> 19 20 <!-- This table uses the id and headers attributes to --> 21 <!-- ensure readability by text-based browsers. It also --> 22 <!-- uses a summary attribute, used by screen readers to --> 23 <!-- describe the table. --> 24 25 <table width = "50%" border = "1" 26 summary = "This table uses th elements and id and 27 headers attributes to make the table readable 28 by screen readers" > 29 30 <caption><strong> Price of Fruit </strong></caption> 31 32 <tr> 33 <th id = "fruit" > Fruit </th> 34 <th id = "price" > Price </th> 35 </tr> Provide summary content for screen reader
37. main.vxml 1 <?xml version = "1.0" ?> 2 <vxml version = "1.0" > 3 4 <!-- Fig. 24.16: main.vxml --> 5 <!-- Voice page --> 6 7 <link next = "#home" > 8 <grammar> home </grammar> 9 </link> 10 11 <link next = "#end" > 12 <grammar> exit </grammar> 13 </link> 14 15 <var name = "currentOption" expr = "'home'" /> 16 17 <form> 18 <block> 19 <emp> Welcome </emp> to the voice page of Deitel and 20 Associates. To exit any time say exit. 21 To go to the home page any time say home. 22 </block> 23 24 <subdialog src = "#home" /> 25 </form> 26 27 <menu id = "home" > 28 <prompt count = "1" timeout = "10s" > 29 You have just entered the Deitel home page. 30 Please make a selection by speaking one of the 31 following options: 32 <break msecs = "1000" /> 33 <enumerate/> 34 </prompt> 35 form element presents information to the user and get data menu element provides the list options and transfer control Create active link to homepage Specifies URL the browser is directed to Element grammar marks the text user must speak to select the link Link to id end when user speak exit block can only exit within form element Signal text should be spoken with emphasis Instruct user to make selection Maintain record of the number of times that a prompt is spoken
38. main.vxml 36 <prompt count = "2" > 37 Please say one of the following. 38 <break msecs = "1000" /> 39 <enumerate/> 40 </prompt> 41 42 <choice next = "#about" > About us </choice> 43 <choice next = "#directions" > Driving directions </choice> 44 <choice next = "publications.vxml" > Publications </choice> 45 </menu> 46 47 <form id = "about" > 48 <block> 49 About Deitel and Associates, Inc. 50 Deitel and Associates, Inc. is an internationally 51 recognized corporate training and publishing 52 organization, specializing in programming languages, 53 Internet and World Wide Web technology and object 54 technology education. Deitel and Associates, Inc. is a 55 member of the World Wide Web Consortium. The company 56 provides courses on Java, C++, Visual Basic, C, Internet 57 and World Wide Web programming and Object Technology. 58 <assign name = "currentOption" expr = "'about'" /> 59 <goto next = "#repeat" /> 60 </block> 61 </form> 62 Prompt remind user to make a selection
39. main.vxml 63 <form id = "directions" > 64 <block> 65 Directions to Deitel and Associates, Inc. 66 We are located on Route 20 in Sudbury, 67 Massachusetts, equidistant from route 68 <sayas class = "digits"> 128 </sayas> and route 69 <sayas class = "digits"> 495 </sayas>. 70 <assign name = "currentOption" expr = "'directions'" /> 71 <goto next = "#repeat" /> 72 </block> 73 </form> 74 75 <form id = "repeat" > 76 <field name = "confirm" type = "boolean" > 77 <prompt> 78 To repeat say yes. To go back to home, say no. 79 </prompt> 80 81 <filled> 82 <if cond = "confirm == true" > 83 <goto expr = "'#' + currentOption" /> 84 <else/> 85 <goto next = "#home" /> 86 </if> 87 </filled> 88 89 </field> 90 </form> 91 92 <form id = "end" > 93 <block> 94 Thank you for visiting Deitel and Associates voice page. 95 Have a nice day. 96 <exit/> 97 </block> 98 </form>
40. main.vxml 99 100 </vxml> 101 <?xml version = "1.0" ?> 101 <?xml version = "1.0" ?> 102 <vxml version = "1.0" > 103 104 <!-- Fig. 24.17: publications.vxml --> 105 <!-- Voice page for various publications --> 106 107 <link next = "main.vxml#home" > 108 <grammar> home </grammar> 109 </link> 110 111 <link next = "main.vxml#end" > 112 <grammar> exit </grammar> 113 </link> 114 115 <link next = "#publication" > 116 <grammar> menu </grammar> 117 </link> 118 119 <var name = "currentOption" expr = "'home'" /> 120 121 <menu id = "publication" > 122 123 <prompt count = "1" timeout = "12s" > 124 Following are some of our publications. For more 125 information visit our web page at www.deitel.com. 126 To repeat the following menu, say menu at any time. 127 Please select by saying one of the following books: 128 <break msecs = "1000" /> 129 <enumerate/> 130 </prompt> 131 Provide links to the menu element which prompt user to select publication Define link elements that provide links to main.vxml
41. main.vxml 132 <prompt count = "2" > 133 Please select from the following books. 134 <break msecs = "1000" /> 135 <enumerate/> 136 </prompt> 137 138 <choice next = "#java" > Java. </choice> 139 <choice next = "#c" > C. </choice> 140 <choice next = "#cplus" > C plus plus. </choice> 141 </menu> 142 143 <form id = "java" > 144 <block> 145 Java How to program, third edition. 146 The complete, authoritative introduction to Java. 147 Java is revolutionizing software development with 148 multimedia-intensive, platform-independent, 149 object-oriented code for conventional, Internet, 150 Intranet and Extranet-based applets and applications. 151 This Third Edition of the world's most widely used 152 university-level Java textbook carefully explains 153 Java's extraordinary capabilities. 154 <assign name = "currentOption" expr = "'java'" /> 155 <goto next = "#repeat" /> 156 </block> 157 </form> 158 Describe the book according to topic
42. main.vxml 159 <form id = "c" > 160 <block> 161 C How to Program, third edition. 162 This is the long-awaited, thorough revision to the 163 world's best-selling introductory C book! The book's 164 powerful "teach by example" approach is based on 165 more than 10,000 lines of live code, thoroughly 166 explained and illustrated with screen captures showing 167 detailed output.World-renowned corporate trainers and 168 best-selling authors Harvey and Paul Deitel offer the 169 most comprehensive, practical introduction to C ever 170 published with hundreds of hands-on exercises, more 171 than 250 complete programs written and documented for 172 easy learning, and exceptional insight into good 173 programming practices, maximizing performance, avoiding 174 errors, debugging, and testing. New features include 175 thorough introductions to C++, Java, and object-oriented 176 programming that build directly on the C skills taught 177 in this book; coverage of graphical user interface 178 development and C library functions; and many new, 179 substantial hands-on projects.For anyone who wants to 180 learn C, improve their existing C skills, and understand 181 how C serves as the foundation for C++, Java, and 182 object-oriented development. 183 <assign name = "currentOption" expr = "'c'" /> 184 <goto next = "#repeat" /> 185 </block> 186 </form> 187
43. main.vxml 188 <form id = "cplus" > 189 <block> 190 The C++ how to program, second edition. 191 With nearly 250,000 sold, Harvey and Paul Deitel's C++ 192 How to Program is the world's best-selling introduction 193 to C++ programming. Now, this classic has been thoroughly 194 updated! The new, full-color Third Edition has been 195 completely revised to reflect the ANSI C++ standard, add 196 powerful new coverage of object analysis and design with 197 UML, and give beginning C++ developers even better live 198 code examples and real-world projects. The Deitels' C++ 199 How to Program is the most comprehensive, practical 200 introduction to C++ ever published with hundreds of 201 hands-on exercises, roughly 250 complete programs written 202 and documented for easy learning, and exceptional insight 203 into good programming practices, maximizing performance, 204 avoiding errors, debugging, and testing. This new Third 205 Edition covers every key concept and technique ANSI C++ 206 developers need to master: control structures, functions, 207 arrays, pointers and strings, classes and data 208 abstraction, operator overloading, inheritance, virtual 209 functions, polymorphism, I/O, templates, exception 210 handling, file processing, data structures, and more. It 211 also includes a detailed introduction to Standard 212 Template Library containers, container adapters, 213 algorithms, and iterators. 214 <assign name = "currentOption" expr = "'cplus'" /> 215 <goto next = "#repeat" /> 216 </block> 217 </form> 218
44. main.vxml 219 <form id = "repeat" > 220 <field name = "confirm" type = "boolean" > 221 222 <prompt> 223 To repeat say yes. Say no, to go back to home. 224 </prompt> 225 226 <filled> 227 <if cond = "confirm == true" > 228 <goto expr = "'#' + currentOption" /> 229 <else/> 230 <goto next = "#publication" /> 231 </if> 232 </filled> 233 </field> 234 </form> 235 </vxml> Prompt the user if they want to repeat
45. main.vxml Program Output Computer speaks: Welcome to the voice page of Deitel and Associates. To exit any time say exit. To go to the home page any time say home. User speaks: Home Computer speaks: You have just entered the Deitel home page. Please make a selection by speaking one of the following options: About us, Driving directions, Publications. User speaks: Driving directions Computer speaks: Directions to Deitel and Associates, Inc. We are located on Route 20 in Sudbury, Massachusetts, equidistant from route 128 and route 495. To repeat say yes. To go back to home, say no.
46. 24.11 Using Voice Synthesizers and Recognition with VoiceXML ™
47.
48. hello.xml Program Output 1 <?xml version = "1.0" encoding = "UTF-8" ?> 2 3 <!-- Fig. 24.19: hello.xml --> 4 <!-- The classic Hello World example --> 5 6 <callxml> 7 <text> Hello World. </text> 8 </callxml> Declare that content is a CallXML document Text to be spoken Logging feature of the Voxeo Account Manager
49. isbn.xml 1 <?xml version = "1.0" encoding = "UTF-8" ?> 2 3 <!-- Fig. 24.20: isbn.xml --> 4 <!-- Reads the ISBN value of three Deitel books --> 5 6 <callxml> 7 <block> 8 <text> 9 Welcome. To obtain the ISBN of the Internet and World 10 Wide Web How to Program: Second Edition, please enter 1. 11 To obtain the ISBN of the XML How to Program, 12 please enter 2. To obtain the ISBN of the Java How 13 to Program: Fourth Edition, please enter 3. To exit the 14 application, please enter 4. 15 </text> 16 17 <!-- Obtains the numeric value entered by the user and --> 18 <!-- stores it in the variable ISBN. The user has 60 --> 19 <!-- seconds to enter one numeric value --> 20 <getDigits var = "ISBN" 21 maxDigits = "1" 22 termDigits = "1234" 23 maxTime = "60s" /> 24 25 <!-- Requests that the user enter a valid numeric --> 26 <!-- value after the elapsed time of 60 seconds --> 27 <onMaxSilence> 28 <text> 29 Please enter either 1, 2, 3 or 4. 30 </text> 31 Encapsulates other CallXML getDigits element obtain user’s touch-tone response Indicate maximum number of digits the application accept Contain list of characters that terminate user input Maximum amount of time allowed Invoked when attribute maxTime or maxSilence expires Ask user to enter a value
50. isbn.xml 32 <getDigits var = "ISBN" 33 termDigits = "1234" 34 maxDigits = "1" 35 maxTime = "60s" /> 36 37 </onMaxSilence> 38 39 <onTermDigit value = "1" > 40 <text> 41 The ISBN for the Internet book is 0130308978. 42 Thank you for calling our CallXML application. 43 Good-bye. 44 </text> 45 </onTermDigit> 46 47 <onTermDigit value = "2" > 48 <text> 49 The ISBN for the XML book is 0130284173. 50 Thank you for calling our CallXML application. 51 Good-bye. 52 </text> 53 </onTermDigit> 54 55 <onTermDigit value = "3" > 56 <text> 57 The ISBN for the Java book is 0130341517. 58 Thank you for calling our CallXML application. 59 Good-bye. 60 </text> 61 </onTermDigit> 62 Event handler notify application of appropriate action to perform
51. isbn.xml Program Output 63 <onTermDigit value = "4" > 64 <text> 65 Thank you for calling our CallXML application. 66 Good-bye. 67 </text> 68 </onTermDigit> 69 </block> 70 71 <!-- Event handler that terminates the call --> 72 <onHangup /> 73 </callxml> Terminate the telephone call when the user hangs up Display the “conversation” between application and user