User Interface Toolkit Enhancements
The following enhancements have been made to the IDL's graphical user interface toolkit in the IDL 6.1 release:
Tabbing in Widget Applications
New support for tabbing among widgets enables widget navigation using the Tab key. This allows users to quickly move between user interface elements of your widget application. Base, button, combobox, droplist, list, slider, tab, table, text, and tree widgets support the new TAB_MODE keyword. Set this keyword to a value indicating one of the following levels of tabbing support:
|
Value
|
Description
|
|
0
|
Disable navigation onto or off of the widget. This is the default unless the TAB_MODE has been set on a parent base. Child widgets automatically inherit the tab mode of the parent base.
|
|
1
|
Enable navigation onto and off of the widget.
|
|
2
|
Navigate only onto the widget.
|
|
3
|
Navigate only off of the widget.
|
In widget applications run on the UNIX platform, the Motif library controls what widgets are brought into and released from focus using tabbing. The TAB_MODE keyword value is always zero, and any attempt to change it is ignored when running a widget application on the UNIX platform.
See the following items for details:
IDL GUIBuilder and Tab Mode
The IDL GUIBuilder also features a new Tab Mode attribute that defines to what degree tabbing can be used to navigate the widget hierarchy in a widget application. By default, this value is set to None for a top level base, and to Inherit for subsequent bases and widgets. Like the TAB_MODE keyword, the Tab Mode attribute applies to base, button, combobox, droplist, list, slider, tab, table, text, and tree widgets.
Allowable values are:
|
Value
|
Description
|
|
Inherit
|
Upon creation, the subsequent base inherits the tabbing support of the parent base. This is the default for child widgets.
|
|
None
|
Disallow tabbing into or out of the base. This is the default for top level bases.
|
|
In and Out
|
Allow tabbing into and out of the base.
|
|
In Only
|
Allow tabbing into the base only.
|
|
Out Only
|
Allow tabbing off of the base only.
|
The default Tab Mode of lower level bases and widgets is Inherit. The tabbing support defined for a top level or parent base is inherited by widget children unless otherwise specified. When the value is Inherit, look at the tabbing support of the parent base to determine what support the individual widget has for tabbing.
In the generated *.pro file, this value is specified with the TAB_MODE keyword to the widget creation routine.
Keyboard Accelerators for Button Widgets
Button widgets now support the ACCELERATOR keyword. Accelerators allow you to activate button widget events using keyboard key combinations instead of requiring mouse clicks. These can enhance the usability of your IDL application.
Support for accelerators varies slightly by platform and usage:
- Under Microsoft Windows, accelerators can be defined for menu items and various types of WIDGET_BUTTON widgets.
- Under UNIX, accelerators can only be applied to menu items.
- Context menu items do not support accelerators on any platform.
See WIDGET_BUTTON for more information.
Special steps are required to enable accelerators that use the Alt key on Macintosh platforms. See Enabling Alt Key Accelerators on Macintosh for details.
Disabling Accelerators
Ordinarily, accelerators are processed before keyboard events reach widgets that have keyboard focus. Setting IGNORE_ACCELERATORS allows WIDGET_DRAW and widgets with an editable text area (WIDGET_COMBOBOX, WIDGET_PROPERTYSHEET, WIDGET_TABLE and WIDGET_TEXT) to receive keyboard events instead of the accelerator key combinations being captured by the accelerator. See Disabling Button Widget Accelerators for usage details and examples.
DIALOG_PICKFILE Routine Enhancements
A new Browse for Folder dialog is available under Microsoft Windows when the DIRECTORY keyword is set. You can select, or create and select, a directory using the new dialog. Other improvements include the availability of horizontal scrolling (when needed) to easily see entire filenames regardless of their length.
The following figure shows the new Browse for Folder dialog.
Table Widget Enhancements
The WIDGET_TABLE function features several new keywords. The NO_COLUMN_HEADERS and NO_ROW_HEADERS keywords allow you to customize the display of a table. The CONTEXT_EVENTS keyword causes context menu events to be initiated when you right-click over a table widget. The IGNORE_ACCELERATORS keyword allows editable table cells to receive keyboard combinations mapped to an accelerator. For more information on the new table widget keywords and context menu event structure, see WIDGET_TABLE.
The WIDGET_CONTEXT event structure associated with base, list, property sheet, table, text and tree widgets has been updated with new ROW and COL fields. This may require code changes as described in Avoiding Backward Compatibility Issues.
Property Sheet Widget Enhancements
The following enhancements to the WIDGET_PROPERTYSHEET function improve the usability and appearance of property sheets. Natural sizing and the ability to select multiple properties are internal changes that automatically improve property sheet usability. Other improvements allow you to programmatically control the selection and editability of properties. Enhancements include:
- Property sheets without an explicit size definition (lacking a specified SCR_XSIZE or XSIZE keyword value) are now naturally sized. Column widths depend on the contents of the components. Naturally sized property sheets allow the full contents of the longest cell to be visible in a column, as shown in the left-hand image in the following figure. When a size definition is provided, selecting the cell displays the list contents in a drop-down box that is wide enough for the longest item as shown in the right-hand image in the following figure.
See Property Sheet Sizing for more information.
- Setting the MULTIPLE_PROPERTIES keyword allows multiple properties to be selected at a single time by depressing the Shift key and left-clicking (to make adjacent selections), or by depressing the Ctrl key and left-clicking (to make nonadjacent selections). Properties can also be programmatically selected using the PROPERTYSHEET_SETSELECTED keyword as described in WIDGET_CONTROL.
- To support multiple selection, the WIDGET_PROPSHEET_SELECT event structure IDENTIFIER field has been expanded, and there is a new NSELECTED field. See the "Select Event" section of WIDGET_PROPERTYSHEET for details. Programs accessing this event structure may require code changes. See Avoiding Backward Compatibility Issues for details.
- The new EDITABLE keyword allows you to mark a property sheet as read-only. You can select properties in a read-only property sheet, but cannot modify property values.
- The IGNORE_ACCELERATORS keyword allows editable text cells in a property sheet to receive keyboard combinations mapped to an accelerator.
- A property sheet can be surrounded by a border of a specified width using the FRAME keyword, or can appear to be inset by setting the SUNKEN_FRAME keyword.
See WIDGET_PROPERTYSHEET for details on the new keywords.
- The new spinner control associated with a selected number cell allows you to click, or click and hold the up or down arrows to change the numerical value. The appearance of a number cell on a property sheet is controlled by the VALID_RANGE keyword to IDLitComponent::RegisterProperty method. See IDLitComponent::RegisterProperty for details.
WIDGET_CONTROL and WIDGET_INFO Routine Enhancements
The following sections describe enhancements that have been made to the WIDGET_INFO and WIDGET_CONTROL routines in IDL 6.1. Major areas of functionality added to widgets in this release, including tabbing and programmatic selection within property sheets, can be enabled and disabled using WIDGET_CONTROL or returned using WIDGET_INFO.
WIDGET_CONTROL Routine Enhancements
WIDGET_CONTROL routine enhancements include:
- TAB_MODE keyword - provides the ability to control tabbing support for widgets that support tabbing. See Tabbing in Widget Applications for more information.
- PROPERTYSHEET_SETSELECTED keyword - allows programmatic selection of properties on property sheet widgets.
- EDITABLE keyword - defines a property sheet widget as read-only, allowing the user to select, but not modify properties.
- MULTIPLE_PROPERTIES keyword - enables or disables multiple property selection in a property sheet widget.
See WIDGET_CONTROL for details.
WIDGET_INFO Routine Enhancements
WIDGET_INFO routine enhancements include:
- TAB_MODE keyword - provides the ability to determine the tabbing support of any widget.
- PROPERTYSHEET_NSELECTED keyword - returns the number of selected properties in a property sheet widget.
- PROPERTYSHEET_SELECTED keyword - returns the name (identifier) of each selected property in a property sheet widget.
- MULTIPLE_PROPERTIES keyword - returns a value indicating the support for multiple property selection in a property sheet widget.
See WIDGET_INFO for details.