Consultor Eletrônico



Kbase 15309: SmartFolders : change pages without the MOUSE ( folders )
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   5/10/1998
SmartFolders : change pages without the MOUSE ( folders )

Windows 95 makes extensive use of Tab folders and one can move
between tabs in at least two ways:
1) If a tab has focus, left and right arrows work.
2) If a tab does not have focus, ctrl-tab moves you to the next tab.

In Progress, you can implement option 2. The CTRL-TAB functionality
provides users with a method of moving from one page of a folder to
the next without using the Mouse. You can use a global variable to
keep track of the page number that you are currently on and with a
CTRL-TAB trigger you can change to the next page.

For example, in your DEFINITIONS section:

def var currentpage as int init 1.


In your Main block before the windowmn.i reference:

on CTRL-TAB anywhere do:
if currentpage = 3 then currentpage = 1.
else currentpage = currentpage + 1.

run select-page in this-procedure (currentpage).
end.


This example will move focus to the next page when a CTRL-TAB
is pressed. If you are already on the last page (in this case, page 3)
then the 1st page will be selected when a CTRL-TAB is pressed.


There are other ways to implement moving from page to page but the
ABOVE METHOD IS RECOMMENDED BECAUSE IT IS CONSISTENT WITH WINDOWS 95
standards for Tab Folders. However, another way to implement this is
to implement accelerator keys on the labels of each tab folder. When
the accelerator is pressed then a trigger could fire that would select
the next page.

For example,

Use the & when adding the label names to your tab folders such as
page &1 and page &2 etc...

Then create a trigger for each of these mnemonics such as:

ON ALT-1 ANYWHERE DO:
run select-page in this-procedure (1).
/* no-apply needed to prevent progress from beeping when the keypress
event is sent to the window */
return no-apply.
end.

ON ALT-2 ANYWHERE DO:
run select-page in this-procedure (2).
return no-apply.
end.

Now when you press the alt-1 key combination, you will select
page 1 of the folder. When you press alt-2 combination you will
select page 2 of the folder. This works well too but remember that
Windows 95 does not use mnemonics in this way with its TAB folders
so it will not be consistent with what WINDOWS 95 users may be
used to.

NOTE: Remember that SmartFolders are really just Progress frames
with images to make them look like folders-- they are not really
WIN95 or Windows 3.1 folder objects. It is not recommended that you
implement the CTRL-TAB functionality that is described above in
a complicated situation where you have more than one SmartFolder
or nested SmartFolders in one window. Instead of writing a lot of
complicated code to emulate WIN 95 objects, it would be better to
consider using a true WIN 95 folder object via the VBX interface.

Progress Software Technical Support Note # 15309