Re: Sql*Forms (Highlighting Fields / using pointer)
Date: 11 Jun 93 15:16:38 EST
Message-ID: <1993Jun11.151638.1_at_mcvax2.d48.lilly.com>
Reply-To: 72072.2122_at_compuserve.com
Sender: 72072.2122_at_compuserve.com
Subject: Re: Sql*Forms (Highlighting Fields / using pointer)
Jennifer Farnham asks:
I would like to use the arrow keys to highlight the choices as I
move thru them.
- cut here ----------------------------- /* Copyright (c) 1988 by the Oracle Corporation */
SQL*FORMS_VERSION = 03.00.16.04.00
TERSE = ON
DEFINE FORM
COMMENT = <<<
Placed in the public domain by
Thomas L. Harleman
Paradigm Consulting, Inc.
11080 Willowmere Drive
Indianapolis, IN 46280
CIS: 72072,2122
This form is an example of
- a simplified menu system,
- using a pointer to highlight menu options,
- building a non-database block of information,
- a simplified user interface (turning off all unnecessary keys) In response to an INTERNET request by Jennifer Farnham. Newsgroups: comp.databases.oracle Subject: Sql*Forms (Highlighting Fields / using pointer) Message-ID: <1993Jun9.220847.485_at_stortek.com> From: v045100_at_otis1.stortek.com (Jennifer Farnham) Date: Wed, 9 Jun 1993 22:08:47 GMT Sender: usenet_at_stortek.com Organization: Storage Technology Corp. Originator: v045100_at_otis1.stortek.com Nntp-Posting-Host: otis1.stortek.com What I want to do is create a menu. I would like to use the arrow keys to highlight the choices as I move thru them. Does anyone else know of a "fancy-shmancy" way of creating a menu with highlighted bars around the choices? Also, has anyone programmed a little pointer to move down the sides of the choices like: Add User Delete User ----> Add Personnel Info Reports Now this isn't our real menu, just a sample to show you what I meant by the pointer. I have seen other menus (sql*forms) with pointers like this, just can't find the code or sample code in the Advanced Sql*Forms book. If anyone has really cool code that they want to share, I would greatly appreciate it. Thanks, Jennifer Farnham StorageTek Boulder, Colorado email to: Jenny_Farnham_at_stortek.com or post here to this newsgroup... :-) >>>
NAME = SAMPLE_MENU
TITLE = SAMPLE MENU
DEFAULT_MENU_APPLICATION = DEFAULT
DEFINE TRIGGER
COMMENT = <<<
This is a demonstration of building records in a non-database block.
>>>
NAME = KEY-STARTUP
TRIGGER_TYPE = V3
TEXT = <<<
BEGIN
:DESCRIPTION := 'SHOW DIRECTORY';
:COMMAND := 'DIR';
:COMMAND_TYPE := 'HOST';
NEXT_RECORD;
:DESCRIPTION := 'ACCOUNTS RECEIVABLE';
:COMMAND := 'RUNFORM RECEIVABLES /';
:COMMAND_TYPE := 'HOST';
NEXT_RECORD;
:DESCRIPTION := 'ACCOUNTS PAYABLE';
:COMMAND := 'PAYABLES';
:COMMAND_TYPE := 'NEW_FORM';
NEXT_RECORD;
:DESCRIPTION := 'PAYROLL';
:COMMAND := 'PAYROLL';
:COMMAND_TYPE := 'CALL';
NEXT_RECORD;
:DESCRIPTION := 'GENERAL LEDGER QUERY';
:COMMAND := 'GENLEDGER';
:COMMAND_TYPE := 'CALL_QUERY';
NEXT_RECORD;
:DESCRIPTION := 'MOVE CURSOR UP';
:COMMAND := 'UP';
:COMMAND_TYPE := 'KEY';
NEXT_RECORD;
:DESCRIPTION := 'EXIT';
:COMMAND := 'KEY-EXIT';
:COMMAND_TYPE := 'TRIGGER';
END;
>>>
ENDDEFINE TRIGGER DEFINE BLOCK
NAME = SAMPLE_MENU
DESCRIPTION = pointer
ROWS_DISPLAYED = 7
ROWS_BUFFERED = 7
BASE_LINE = 6
LINES_PER_ROW = 1
ARRAY_SIZE = 0
DEFINE TRIGGER
COMMENT = <<<
This trigger turns the pointer ON for the current field.
>>>
NAME = PRE-FIELD
TRIGGER_TYPE = V3
TEXT = <<<
:POINTER := '--->';
DISPLAY_FIELD('DESCRIPTION','BOLD-INVERSE');
>>>
ENDDEFINE TRIGGER
DEFINE TRIGGER
COMMENT = <<<
This trigger turns the pointer OFF as the field is exitted.
>>>
NAME = POST-FIELD
TRIGGER_TYPE = V3
TEXT = <<<
:POINTER := NULL;
DISPLAY_FIELD('DESCRIPTION','NORMAL');
>>>
ENDDEFINE TRIGGER
DEFINE TRIGGER
COMMENT = <<<
Checking for the last record will prevent SQL*Forms from automatically
trying to create a new record.
>>>
NAME = KEY-DOWN
TRIGGER_TYPE = V3
TEXT = <<<
IF :SYSTEM.LAST_RECORD = 'FALSE' THEN
DOWN;
END IF;
>>>
ENDDEFINE TRIGGER
DEFINE TRIGGER
COMMENT = <<<
This key is the logical processing key for the form.
>>>
NAME = KEY-ENTER
TRIGGER_TYPE = V3
TEXT = <<<
IF :COMMAND_TYPE = 'HOST' THEN
MESSAGE('PLEASE WAIT...');
SYNCHRONIZE;
HOST(:COMMAND);
ELSIF :COMMAND_TYPE = 'CALL_QUERY' THEN
CALL_QUERY(:COMMAND);
ELSIF :COMMAND_TYPE = 'CALL' THEN
CALL(:COMMAND);
ELSIF :COMMAND_TYPE = 'NEW_FORM' THEN
NEW_FORM(:COMMAND);
ELSIF :COMMAND_TYPE = 'KEY' THEN
DO_KEY(:COMMAND);
ELSIF :COMMAND_TYPE = 'TRIGGER' THEN
EXECUTE_TRIGGER(:COMMAND);
END IF;
>>>
ENDDEFINE TRIGGER
DEFINE TRIGGER
COMMENT = <<<
During development, always add this trigger FIRST, to give yourself a way
out. If another EXIT is added in the menu, this trigger may be removed.
>>>
NAME = KEY-EXIT
TRIGGER_TYPE = V3
TEXT = <<<
EXIT_FORM;
>>>
ENDDEFINE TRIGGER
DEFINE TRIGGER
COMMENT = <<<
This is the second trigger to add to an application. This simplifies the
user interface by limiting the number of active keys. Add only the key
triggers that add value to the user interface.
>>>
NAME = KEY-OTHERS
TRIGGER_TYPE = V3
TEXT = <<<
NULL;
>>>
ENDDEFINE TRIGGER
DEFINE TRIGGER
COMMENT = <<<
Checking for the first record will prevent the SQL*Forms "At First Record"
from appearing.
>>>
NAME = KEY-UP
TRIGGER_TYPE = V3
TEXT = <<<
IF :SYSTEM.CURSOR_RECORD > '1' THEN
UP;
END IF;
>>>
ENDDEFINE TRIGGER
DEFINE FIELD
NAME = NAVIGATION
DATATYPE = CHAR
LENGTH = 1
DISPLAY_LENGTH = 1
QUERY_LENGTH = 1
BASE_TABLE = OFF
PAGE = 1
LINE = 1
COLUMN = 2
UPDATE = OFF
QUERY = OFF
ENDDEFINE FIELD
DEFINE FIELD
COMMENT = <<<
This field is used for record navigation and displaying the pointer to the
current record. (--->)
>>>
NAME = POINTER
DATATYPE = CHAR
LENGTH = 5
DISPLAY_LENGTH = 4
QUERY_LENGTH = 5
BASE_TABLE = OFF
PAGE = 1
LINE = 1
COLUMN = 3
INPUT = OFF
UPDATE = OFF
QUERY = OFF
ENDDEFINE FIELD
DEFINE FIELD
COMMENT = <<<
This is the description of the menu option that the user will see.
>>>
NAME = DESCRIPTION
DATATYPE = CHAR
LENGTH = 21
DISPLAY_LENGTH = 21
QUERY_LENGTH = 21
BASE_TABLE = OFF
PAGE = 1
LINE = 1
COLUMN = 8
HELP = Enter value for : DESCRIPTION
INPUT = OFF
UPDATE = OFF
QUERY = OFF
ENDDEFINE FIELD
DEFINE FIELD
COMMENT = <<<
This hidden field identifies the processing method for the COMMAND.
>>>
NAME = COMMAND_TYPE
DATATYPE = CHAR
LENGTH = 11
DISPLAY_LENGTH = 11
QUERY_LENGTH = 0
BASE_TABLE = OFF
PAGE = 1
LINE = 1
COLUMN = 30
INPUT = OFF
UPDATE = OFF
QUERY = OFF
ENDDEFINE FIELD
DEFINE FIELD
COMMENT = <<<
This is the line that SQL*Forms will process when this record is selected.
>>>
NAME = COMMAND
DATATYPE = CHAR
LENGTH = 40
DISPLAY_LENGTH = 39
QUERY_LENGTH = 40
BASE_TABLE = OFF
PAGE = 1
LINE = 1
COLUMN = 42
INPUT = OFF
UPDATE = OFF
QUERY = OFF
ENDDEFINE FIELD
ENDDEFINE BLOCK DEFINE SCREEN DEFINE PAGE
PAGE = 1
PAGE_XS = 0
PAGE_YS = 0
PAGE_PX0 = 0
PAGE_PY0 = 0
PAGE_PXS = 0
PAGE_PYS = 0
PAGE_SX0 = 0
PAGE_SY0 = 0
MODE = TEXT
BOILER = <<<
SAMPLE MENU
>>>
LINE = 4
BOILER = <<<
Option
>>>
MODE = BOX
LINE = 3
BOILER = <<<
p---------------------------q
| |
(---------------------------)
| |
| |
| |
| |
| |
| |
| |
b---------------------------d
>>>
ENDDEFINE PAGE
ENDDEFINE SCREEN ENDDEFINE FORM
------------------------------ cut here -----------------------------
========================================================================
chicago ,--------+ detroit
Tom Harleman | |
INOUG Committee Member |Indiana |
Paradigm Consulting, Inc. st. | Oracle |
11080 Willowmere Drive louis | Users |
Indianapolis, IN 46280 | Group|
USA | |
| _,+cincinnati
INTERNET: 72072.2122_at_compuserve.com / _,'
Compuserve: 72072,2122 /_,-'louisville
`
EXECUTE_TRIGGER('DISCLAIMER');
Received on Fri Jun 11 1993 - 22:16:38 CEST
