Creating accessible software applications with PowerBuilder

PowerBuilder supports the following two technologies of Windows accessibility and automation -- Microsoft Active Accessibility (MSAA) and Microsoft UI Automation.

MSAA is a legacy technology introduced in Windows 95; it supports the PowerBuilder standard controls well; but it imposes major limitations on the PowerBuilder custom controls such as DataWindows. Starting from PowerBuilder 2019 R3, PowerBuilder supports a newer and more capable technology which overcomes the limitations of MSAA; this new technology called Microsoft UI Automation offers a richer set of properties and extended interfaces to manipulate not only standard controls but also custom controls (such as PowerBuilder DataWindows and child controls in DataWindows).

The support for Microsoft Active Accessibility (MSAA) and Microsoft UI Automation is disabled by default. You can enable/disable the support using the Accessibility option in the PB.INI file:

  • Accessibility=0: Disable both MSAA and Microsoft UI Automation

  • Accessibility=1: Enable both

  • Accessibility=2: Enable Microsoft UI Automation only

  • Accessibility=3: Enable MSAA only

For example,

[Application]
ACCESSIBILITY=0

It is recommended that you enable (value is 1) or disable (value is 0) both technologies; if you set the value to 2 or 3 (enable only one of them), some testing tools may not work well with only UIA or MSAA, and may cause the application to malfunction or crash.

Microsoft UI Automation

With the Microsoft UI Automation technology, the UI elements of the PowerBuilder control can be accessible to the screen reader (such as Windows Narrator), the accessibility tool (such as Accessibility Insights, Inspect), and the automated testing tool (such as QTP) in Windows 11/10 and Windows Server 2022/2019.

The Microsoft UI Automation technology allows you not only to access and test the PowerBuilder standard controls (see Table 1), but also the PowerBuilder DataWindow controls (see Table 2 and 3).

Table 1: PowerBuilder controls/objects supported by Microsoft UI Automation

Animation

CheckBox

CommandButton

DataWindow

DatePicker

DropDownListBox

DropDownPictureListBox

EditMask

GroupBox

HProgressBar

HScrollBar

HTrackBar

ListBox

ListView

MonthCalendar

MultiLineEdit

Picture

PictureButton

PictureHyperText

PictureListBox

RadioButton

SingleLineEdit

StaticText

StaticHyperText

Tab

TreeView

UserObject

VProgressBar

VScrollBar

VTrackBar


The following PowerBuilder controls/objects are unsupported by Microsoft UI Automation:

  • Graph

  • InkEdit

  • InkPicture

  • Line

  • OLE

  • Oval

  • Rectangle

  • RibbonBar

  • RoundRectangle

  • RichTextEdit

  • WebBrowser

Table 2: DataWindow presentation styles supported by Microsoft UI Automation

CrossTab

FreeForm

Grid

Group

Label

N-Up

Tabular

TreeView


DataWindow controls of the following presentation styles are unsupported:

  • Graph

  • OLE 2.0

  • Composite

  • RichText

Table 3: Controls in DataWindow supported by Microsoft UI Automation

Button

Column (and the following edit styles are supported: CheckBox, DropDownListBox, DropDownDataWindow, Edit box, EditMask, and RadioButtons)

Computed Field

GroupBox

Text


The following controls in DataWindow are unsupported by Microsoft UI Automation:

  • Graph

  • InkPicture

  • Line

  • OLE Object

  • Oval

  • Rectangle

  • RoundRectangle

  • Picture

  • Report

  • TableBlob

Examples

To enable support for PowerBuilder controls/objects through Microsoft UI Automation, you will need to set the AccessibleName and AccessibleDescription properties in the controls' Property tab page. Note that AccessibleRole property is unsupported by Microsoft UI Automation.

The following statements set the AccessibleName and AccessibleDescription properties for a command button in a Window:

cb_1.accessiblename = "Delete"
cb_1.accessibledescription = "Deletes selected text"

The following statement sets the AccessibleName property of a button in a DataWindow object:

dw_1.Object.b_1.accessiblename = "Update"

Deployment

When you deploy an accessible application, you must deploy the pbacc.dll and PBAccessibility.dll files.

For more information

For more information, refer to the PowerBuilder VPATs report, and also the Microsoft general accessibility website at http://www.microsoft.com/enable. Also helpful is the WebAim website at http://www.webaim.org.

Microsoft Active Accessibility (MSAA)

PowerBuilder provides the infrastructure and properties needed to build accessibility features into your Windows and Web applications. Its features allow applications to conform generally to Microsoft Active Accessibility (MSAA) Version 2. MSAA is a Windows standard that defines the way accessibility aids obtain information about user interface elements and the way programs expose information to the aids.

PowerBuilder standard controls support all required Microsoft Active Accessibility properties as listed in the following table:

Microsoft Active Accessibility property

PowerBuilder property support

Name

objectname.AccessibleName

Some controls support the Name setting through the Text or Title property. For all controls, Name is customizable through the AccessibleName property.

Role

objectname.AccessibleRole

Customizable through the AccessibleRole property.

State

Default Active Accessibility support

Location

Default Active Accessibility support

Parent

Default Active Accessibility support

ChildCount

Default Active Accessibility support

Keyboard Shortcut

Default Active Accessibility support for "&" access key of the Text property

Also, PowerBuilder Accelerator property setting if applicable to the control.

DefaultAction

Default Active Accessibility support

(For example, a selected check box has a default action of uncheck.)

Value

Default Active Accessibility support

(For example, a selected check box has the value checked.)

Children

Default Active Accessibility support

(For example, items in a list box.)

Focus

Default Active Accessibility support

Selection

Default Active Accessibility support

Description

objectname.AccessibleDescription

Customizable through the AccessibleDescription property.

Help

Not supported

HelpTopic

Not supported


Visual controls

For PowerBuilder visual controls that inherit from DragObject, you can manipulate the IAccessible Name, Role, and Description properties of each control by using PowerBuilder dot notation or the Other page in the Properties view of the painters. You can also manipulate the IAccessible property KeyboardShortcut using PowerBuilder properties wherever the ampersand in text property and accelerator property are supported. Other IAccessible properties are set automatically using Active Accessibility default support. (For example, location is automatically updated with absolute screen coordinates for Windows controls at runtime.)

The following table lists PowerBuilder visual controls that inherit from DragObject and their default accessible roles:

PowerBuilder visual controls

AccessibleRole enumerated value

Animation

animationrole!

CheckBox

checkbuttonrole!

CommandButton

pushbuttonrole!

DataWindow

clientrole!

DropDownListBox

comboboxrole!

DropDownPictureListBox

comboboxrole!

EditMask

textrole!

Graph

diagramrole!

GroupBox

groupingrole!

HProgressBar, VProgressBar

progressbarrole!

HScrollBar, VScrollBar

scrollbarrole!

HTrackBar, VTrackBar

sliderrole!

ListBox

listrole!

ListView

listrole!

MonthCalendar

clientrole!

MultiLineEdit

textrole!

Picture

graphicrole!

PictureButton

pushbuttonrole!

PictureHyperLink

linkrole!

PictureListBox

listrole!

RadioButton

radiobuttonrole!

RichTextEdit

clientrole!

SingleLineEdit

textrole!

StaticHyperLink

linkrole!

StaticText

statictextrole!

Tab control

clientrole!

Tab page

clientrole!

TreeView

outlinerole!


The OLEControl control is set to pushbuttonrole! by default. You need to set this role depending on content.

DataWindow control

PowerBuilder implements the MSAA standard for the DataWindow custom control and its children.

The AccessibleName and AccessibleDescription properties take string values. The AccessibleRole property takes the value of the AccessibleRole enumerated variable.

There are some limitations regarding accessibility support in the DataWindow:

  • For the navigation function accNavigate, spatial navigation (navigation by keyboard based on screen location) is not supported. Logical navigation, where keyboard navigation follows a logical tab sequence, is supported only for columns in the detail band. Columns that have a tab value set to 0 so that users cannot update them cannot be accessed from the keyboard.

  • The Composite, Label, N-Up, OLE 2.0, and RichText DataWindow styles are not supported.

  • Support for OLE objects, OLE database columns, and nested reports in DataWindows is limited.

PowerBuilder cannot provide accessibility for control content. This must be provided by the control vendor.

Examples

The following statements set the IAccessible properties for a command button in a Window:

cb_1.accessiblename = "Delete"
cb_1.accessibledescription = "Deletes selected text"
cb_1.accessiblerole = pushbuttonrole!

The following statement sets the AccessibleName property of a button in a DataWindow object:

dw_1.Object.b_1.accessiblename = "Update"

The following statements set the AccessibleRole property for a button in a DataWindow object to 43 (the number associated with PushButtonRole!) and return the property to a string variable:

string ls_data
dw_1.Object.b_1.AccessibleRole = 43
ls_data = dw_1.Describe("b_1.AccessibleRole")

Deployment

When you deploy an accessible application, you must deploy the pbacc.dll file.

For more information

For more information, refer to the PowerBuilder VPATs report, and also the Microsoft general accessibility website at http://www.microsoft.com/enable. Also helpful is the WebAim website at http://www.webaim.org.