GUI ScreenIO for Windows

 ScreenIO.com


How to Create a Selector Control

Overview

A selector control is unique to GUI ScreenIO.  It looks and acts much like a pushbutton control in that it returns an event to your program when it is pressed, but its contents are loaded the same way as an edit control's, which makes it easier to change than a regular pushbutton label.  

Users can't change the contents, but they can Click the Selector field, or, when it has focus, use the standard windows behavior of pressing the space-bar to trigger the button.

Optionally you can set  selector fields to return events when a user types characters while the pushbutton has focus.  This is labeled "Return when user presses a character" in the editor.  This is a feature carried forward by popular demand from legacy Screenio product.  Selectors were often used to display lists of items, and then jump to a position in the list by typing a letter,  for example, scrolling to a account names beginning with the Letter J by just typing a J while any selector field had focus.  This situation would be better handled by a listview, but the this feature still is available.

These "Letter" events will all be in the 2000 range: 2048 plus the ASCII value of the character.  Letter A (ASCII 64) comes back as 2113.  One oddity to be aware of is that the space bar triggers buttons in the Windows environment.  If a button has focus, pressing space bar triggers that button.  Since Selector Fields are implemented as buttons this behavior is present.  If you select the Return when user presses a character option, pressing Space bar while the selector has focus returns two events, One for the Space Character (2048 + 32 = 2080), and another for the triggering of the button (600n where n is the field number).

There will be a specific 88 level data name for the 600n, in the copybook, but "Return when user presses a character" events will simply have single 88 indicating a range of event values.

Best Uses:

Selector Fields are often used for Menu Panels, which are panels with what appears to be buttons, but the content of the button label can be changed by your program depending on the situation, or the particular user.  Since it is pointless to put out menu options that are empty, the Invisible If Empty option saves you the trouble of making it invisible manually.

The content you move into the control with your program show up as the Label of the Button.  

These controls honor the & feature.  By putting "&Letter" into the selector field, the button would read Letter, with the L underlined.  Non-mouse users could press Alt-L to trigger this Selector field.  They can also tab to it, and press Space Bar, or Click it with the mouse.

Select the selector control tool from the toolbar:  

Draw the control on your panel, complete the properties of the control, and you're finished. 

Related topics:


2000-2006 Norcom, all rights reserved 

TOC

Send feedback to Norcom