Consultor Eletrônico



Kbase 16665: Tab Order and Smart Objects
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   5/10/1998
Tab Order and Smart Objects

SmartObjects and Tab Order
--------------------------
In most cases, the default tab order in a smartObject application
is sufficient; however, in some cases you may want to change the
tab order. This Knowledgebase entry shows you how to change the
tab order in a smartContainer so that the simple or smart objects
are tabbed to in the order that the programmer chooses.

For example, a smartContainer contains four smartViewers
with the following handles:

h_v-cust1t
h_v-cust2t
h_v-cust3t
h_v-cust4t

Let's say that the default tab order starts with h_v-cust1t and
goes to h_v-cust2t to h_v-cust3t to h_v-cut4t. If you wanted to
reverse this order for some reason you could do the following in the
local-initalize() routine of the smart container:

/* get the frame handles of all of the objects */
/* note that the frame handles v1-handle,v2-handle etc have
been defined as
type widget-handle in the definitions section */
run get-attribute in h_v-cust1t (input "adm-object-handle").
assign v1-handle = widget-handle(return-value).
run get-attribute in h_v-cust2t (input "adm-object-handle").
assign v2-handle = widget-handle(return-value).
run get-attribute in h_v-cust3t (input "adm-object-handle").
assign v3-handle = widget-handle(return-value).
run get-attribute in h_v-cust4t (input "adm-object-handle").
assign v4-handle = widget-handle(return-value).

/* get the field group handle */
par-handle = v1-handle:parent.

/* change the first and last tab items for the field group */
par-handle:first-tab-item = v4-handle.
par-handle:last-tab-item = v1-handle.

/* change the order of viewer 2 and 3 */
stat-ok = v3-handle:move-after-tab-item(v4-handle).
stat-ok = v2-handle:move-after-tab-item(v3-handle).

This same scenario works if some of the objects in the
container are simple objects although this is a rare situation
(It is normally recommended that simple objects are placed inside
smartObjects rather than directly in the smartContainer).


Tab Order and Paging
--------------------
In a more complicated example, you may want have some of the viewers
on other pages of a SmartFolder or SmartWindow. In this case, you need
to set up the tab order (as shown in the above example) in the
local-initialize routine of the smartContainer. This sets up the tab
order for page 0. Additionally, you will need to handle any new
objects in the tab order when new pages become visible due to
changing of pages. This can be done by including code in the
local-change-page routine of the container that will check what page
is current and setting up the tab order accordingly.

An example application that has a smartFrame that contains a
smartViewer and a smartFolder (each page with a viewer on it)
can be downloaded from the Progress FTP site. This sample
application has the tab order going from the first smartViewer
that is contained in the smartFrame to which ever smartViewer is
shown on the Folder and then to the corresponding panels.

There is code in the local-initialize() and local-change-page()
routines of the smartFrame to illustrate some of the above
principles.

To download this example, please see kbase entry
13869 Steps for using ftp between Bedford and the customer site
and retrieve all of the code that is in the /ftp/pub/tab directory.

Please note that this example runs against the Version 8.1A
Progress sports database.


OMITTING
--------
It is not possible to omit a smartObject or a simple object from
the tab order if it is able to take focus.
NOTE: there are future plans for implementing a NO-FOCUS attribute
on a button which will take it out of the tab order. This
is tenatively scheduled for 8.2A but this is subject to change.


TAB EDITOR
----------
In 8.1A a Tab Editor tool has been provided to help you design your
tab order WITHIN a smartObject such as a viewer. It does not affect
tab order BETWEEN smartObjects. The Tab Editor is documented in the
UIB Developers Guide beginning on page 2-33.


OTHER KNOWLEDGEBASE ENTRIES
---------------------------
13455 Effects on TAB order using ENABLE or VISIBLE and SENSITIVE
13632 TAB order in Version 7 -- with and without the UIB

Progress Software Technical Support Note # 16665