home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Media Share 9
/
MEDIASHARE_09.ISO
/
clarion
/
pulldn1.zip
/
PULLDN1.COM
/
ONEMENU.CLA
next >
Wrap
Text File
|
1989-02-27
|
15KB
|
415 lines
MEMBER('PullDown')
!*****************************************************************************
!* To modify this procedure for any desired layout:
!*
!* Modify Screen fOneMenu and Windows wTopic1, wTopic2, wTopic3 & wTopic4.
!* Windows wTopic1, wTopic2, wTopic3 & wTopic4 MUST exist even
!* if not used, unless program modifications are done.
!* I would recommend keeping the window names generic. Minimizes
!* required changes when adapting for different purposes.
!*
!* Modify Routines SetMenu (for menu names), EnterKey (for menu actions).
!*
!* Modify ibNbrTopics declaration (Minimum = 2, Maximum = 5 as set up.
!*
!* Topic 'Quit' (or 'Exit' or whatever) must be the LAST topic.
!* 'LAST topic' does not mean Nbr 5 - just the last non-nulled topic.
!*
!* If screen color scheme changed then color declarations must also be
!* changed in the variable section.
!*
!* Modified & Uploaded by Bill Mueller of Mueller's PC Consulting.
!*
!*****************************************************************************
!***************************************************** Procedure OneMenu *****
OneMenu PROCEDURE
fOneMenu SCREEN PRE(Scr),HUE(6,0,0)
OMIT('**-END-**')
╔══════════════════════════════════════════════════════════════════════════════╗
║ ■■■■■■■■■■■■ ■■■■■■■■■■■■ ■■■■■■■■■■■■ ■■■■■■■■■■■■ ■■■■■■■■■■■■ ║
╠══════════════════════════════════════════════════════════════════════════════╣
║ ║
║ ║
║ ║
║ ██ ██ ║
║ ██ ██ ║
║ ██ ██ ║
║ ██ ██ ████████████ ║
║ ███ ███ ██ ║
║ ███ ███ ██ ████████████ ║
║ ████ ██ ██ ║
║ ██ ██ ║
║ ██ ████████████ ║
║ ██ ██ ║
║ ██ ║
║ ████████████ ║
║ ║
║ The Vacation Tracking System ║
║ ║
║ ║
║ Ver 1.1 Copyright 1987 Barrington Systems, Inc. ALL RIGHTS RESERVED ║
╚══════════════════════════════════════════════════════════════════════════════╝
■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
**-END-**
ROW(1,1) STRING('╔═{78}╗'),HUE(3,0)
ROW(2,1) STRING('║<0{78}>║'),HUE(3,0)
ROW(3,1) STRING('╠═{78}╣'),HUE(3,0)
ROW(4,1) REPEAT(20);STRING('║<0{78}>║'),HUE(3,0) .
ROW(24,1) STRING('╚═{78}╝'),HUE(3,0)
ROW(7,21) REPEAT(3);STRING('██<0{8}>██'),HUE(11,1) .
ROW(10,21) STRING('██<0{8}>██<0{3}>█{12}'),HUE(11,1)
ROW(11,21) STRING('███<0{6}>███<0{8}>██'),HUE(11,1)
ROW(12,23) STRING('███<0,0>███<0{10}>██<0{8}>█{12}'),HUE(11,1)
ROW(13,25) STRING('████<0{12}>██<0{8}>██'),HUE(11,1)
ROW(14,41) STRING('██<0{8}>██'),HUE(11,1)
ROW(15,41) STRING('██<0{8}>█{12}'),HUE(11,1)
ROW(16,41) STRING('██<0{18}>██'),HUE(11,1)
ROW(17,61) STRING('██'),HUE(11,1)
ROW(18,51) STRING('█{12}'),HUE(11,1)
ROW(20,27) STRING('The Vacation Tracking System'),HUE(13,0)
ROW(23,6) STRING('Ver 1.1 Copyright 1987 Barrington Systems,'|
& ' Inc. ALL RIGHTS RESERVED')
ssMenu1 ROW(2,5) STRING(12),HUE(7,0)
ssMenu2 COL(20) STRING(12),HUE(7,0)
ssMenu3 COL(35) STRING(12),HUE(7,0)
ssMenu4 COL(50) STRING(12),HUE(7,0)
ssMenu5 COL(65) STRING(12),HUE(7,0)
ssMsg ROW(25,1) STRING(80),ENH
.
!************************ Screen wTopic1 *****
wTopic1 SCREEN WINDOW(11,17),AT(IBWINROW,IBWINCOL),HUE(6,0)
OMIT('**-END-**')
╗ ╔
║ ║
║ Request Vac ║
║ ║
║ Cancel Vac ║
║ ║
║ Vac Inquiry ║
║ ║
║ Post Vacs ║
║ ║
╚═══════════════╝
**-END-**
ROW(1,1) STRING('╗<0{15}>╔'),HUE(3,0)
ROW(2,1) REPEAT(9);STRING('║<0{15}>║'),HUE(3,0) .
ROW(11,1) STRING('╚═{15}╝'),HUE(3,0)
ROW(1,1) MENU,REQ
ROW(3,4) STRING('Request Vac')
ROW(5,4) STRING('Cancel Vac')
ROW(7,4) STRING('Vac Inquiry')
ROW(9,4) STRING('Post Vacs')
. .
!************************** Screen wTopic2 *****
wTopic2 SCREEN WINDOW(15,17),AT(IBWINROW,IBWINCOL),HUE(6,0)
OMIT('**-END-**')
╗ ╔
║ ║
║ Calendar ║
║ ║
║ Day Info ║
║ ║
║ Status Report ║
║ ║
║ Employee List ║
║ ║
║ Mail Labels ║
║ ║
║ Excess Days ║
║ ║
╚═══════════════╝
**-END-**
ROW(1,1) STRING('╗<0{15}>╔'),HUE(3,0)
ROW(2,1) REPEAT(13);STRING('║<0{15}>║'),HUE(3,0) .
ROW(15,1) STRING('╚═{15}╝'),HUE(3,0)
ROW(1,1) MENU,REQ
ROW(3,3) STRING('Calendar')
ROW(5,3) STRING('Day Info')
ROW(7,3) STRING('Status Report')
ROW(9,3) STRING('Employee List')
ROW(11,3) STRING('Mail Labels')
ROW(13,3) STRING('Excess Days')
. .
!************************ Screen wTopic3 *****
wTopic3 SCREEN WINDOW(9,17),AT(IBWINROW,IBWINCOL),HUE(6,0)
OMIT('**-END-**')
╗ ╔
║ ║
║ Add ║
║ ║
║ Change ║
║ ║
║ Delete ║
║ ║
╚═══════════════╝
**-END-**
ROW(1,1) STRING('╗<0{15}>╔'),HUE(3,0)
ROW(2,1) REPEAT(7);STRING('║<0{15}>║'),HUE(3,0) .
ROW(9,1) STRING('╚═{15}╝'),HUE(3,0)
ROW(1,1) MENU,REQ
ROW(3,6) STRING('Add')
ROW(5,6) STRING('Change')
ROW(7,6) STRING('Delete')
. .
!************************ Screen wTopic4 *****
wTopic4 SCREEN WINDOW(19,17),AT(IBWINROW,IBWINCOL),HUE(6,0)
OMIT('**-END-**')
╗ ╔
║ ║
║ Back Up Files ║
║ ║
║ Restore Files ║
║ ║
║ Rbld Employee ║
║ ║
║ Rbld Vacation ║
║ ║
║ Change Dept ║
║ ║
║ Chng Holidays ║
║ ║
║ Change Year ║
║ ║
║ DOS Shell ║
║ ║
╚═══════════════╝
**-END-**
ROW(1,1) STRING('╗<0{15}>╔'),HUE(3,0)
ROW(2,1) REPEAT(17);STRING('║<0{15}>║'),HUE(3,0) .
ROW(19,1) STRING('╚═{15}╝'),HUE(3,0)
ROW(1,1) MENU,REQ
ROW(3,3) STRING('Back Up Files')
ROW(5,3) STRING('Restore Files')
ROW(7,3) STRING('Rbld Employee')
ROW(9,3) STRING('Rbld Vacation')
ROW(11,3) STRING('Change Dept')
ROW(13,3) STRING('Chng Holidays')
ROW(15,3) STRING('Change Year')
ROW(17,3) STRING('DOS Shell')
. .
!************************* Vars for OneMenu *****
ibBackColor BYTE(0) !* Background color
ibCol BYTE !* Column current topic starts in.
ibForeOn BYTE(15) !* Foreground when on topic
ibForeOff BYTE(7) !* Foreground when off topic
ibForeQuit BYTE(22) !* Foreground for 'Quit' option
ibNbrTopics BYTE(5) !* Number of non-null topics
ibRow BYTE !* Topic row.
ibTopicPos BYTE !* Current Topic position
ibWinCol BYTE !* Column of current topic window.
ibWinRow BYTE !* Row of current topic window.
s12TopicMsg STRING(12) !* Topic menu choice
CODE !************************* Code for OneMenu *****
OPEN(fOneMenu)
DO Show_Msg !* Show line 25 help.
DO MenuAlerts !* Turn on alert keys for menu
DO SetMenu !* Display main menu line.
ibRow = ROW(ssMenu1) !* Row of main menu line.
ibWinRow = ibRow + 1 !* Row for topic option windows.
ibCol = COL(ssMenu1) !* Column for first topic.
ibWinCol = ibCol - 2 !* Column for first topic window.
ibTopicPos = 1 !* Set to first topic.
s12TopicMsg = ssMenu1 !* Set to first topic choice.
DO TopicOn !* Display topic in ibForeOn color.
DO OpenTopic !* Open topic window.
LOOP !* Main LOOP
ACCEPT !* Get a key
IF ibTopicPos = ibNbrTopics AND KEYCODE() = Enter_Key
BREAK !***** EXITS PROCEDURE *****
END
CASE KEYCODE() !* Check what key was pressed.
OF Left_Key
DO LeftKey !* Do LeftKey processing.
OF Right_Key
DO RightKey !* DO RightKey processing.
OF Esc_Key
DO EscKey !* Do EscKey processing.
OF Enter_Key
DO CloseTopic !* Close Topic window.
ssMsg = '' !* Clear line 25 help.
DO EnterKey !* Do EnterKey processing.
DO Show_Msg !* Display line 25 help.
DO SetMenu !* Display Main menu line.
DO TopicOn !* Highlight topic.
DO OpenTopic !* Open Topic window.
DO MenuAlerts !* Turn on alert keys for menu
ELSE
BEEP()
END !** CASE KEYCODE() **
END !** Main LOOP **
!********************* ROUTINEs for OneMenu *****
Show_Msg ROUTINE !************************* Routine Show_Msg *****
ssMsg = CENTER('<<F1> = Help, <26> to choose Subject, to choose' & |
' Topic, <<Esc> selects Quit.',SIZE(ssMsg))
SetMenu ROUTINE !************************** Routine SetMenu *****
ssMenu1 = CENTER('Vacations',SIZE(ssMenu1))
ssMenu2 = CENTER('Reports',SIZE(ssMenu2))
ssMenu3 = CENTER('Employees',SIZE(ssMenu3))
ssMenu4 = CENTER('Utilities',SIZE(ssMenu4))
ssMenu5 = CENTER('Quit',SIZE(ssMenu5))
!** EXAMPLE of changing the topic layout **
!** To remove the utilities topic, change last 2 lines to **
!* ssMenu4 = CENTER('Quit',SIZE(ssMenu4))
!* ssMenu5 = CENTER('',SIZE(ssMenu5))
!** And change declaration for ibNbrTopics in Var section above **
!* ibNbrTopics BYTE(4) !* Number of topics
!***** 'Quit' must be the last topic *****
SetCol ROUTINE !*************************** Routine SetCol *****
CASE ibTopicPos !* Check what topic we're on - set Column & Msg.
OF 1; ibCol = COL(ssMenu1); s12TopicMsg = ssMenu1
OF 2; ibCol = COL(ssMenu2); s12TopicMsg = ssMenu2
OF 3; ibCol = COL(ssMenu3); s12TopicMsg = ssMenu3
OF 4; ibCol = COL(ssMenu4); s12TopicMsg = ssMenu4
OF 5; ibCol = COL(ssMenu5); s12TopicMsg = ssMenu5
END !** CASE ibTopicPos **
ibWinCol = ibCol - 2 !* Set window column position.
OpenTopic ROUTINE !************************ Routine OpenTopic *****
CASE ibTopicPos !* Check what topic we're on & open window
OF 1; OPEN(wTopic1)
OF 2; OPEN(wTopic2)
OF 3; OPEN(wTopic3)
OF 4; OPEN(wTopic4)
END !** CASE ibTopicPos **
CloseTopic ROUTINE !*********************** Routine CloseTopic *****
CASE ibTopicPos !* Check what topic we're on & close window
OF 1; CLOSE(wTopic1)
OF 2; CLOSE(wTopic2)
OF 3; CLOSE(wTopic3)
OF 4; CLOSE(wTopic4)
END !** CASE ibTopicPos **
LeftKey ROUTINE !************************** Routine LeftKey *****
!* Left Arrow processing routine
IF ibTopicPos <> ibNbrTopics THEN DO CloseTopic; END
DO TopicOff
ibTopicPos -= 1
IF ibTopicPos = 0 THEN ibTopicPos = ibNbrTopics; END
DO SetCol
DO TopicOn
IF ibTopicPos = ibNbrTopics !* Topic 'Quit'
DO BadKey
ELSE !* Other Topics
DO OpenTopic
END !** IF ibTopicPos = ibNbrTopics **
RightKey ROUTINE !************************* Routine RightKey *****
!* Right Arrow processing routine
IF ibTopicPos <> ibNbrTopics THEN DO CloseTopic; END
DO TopicOff
ibTopicPos += 1
IF ibTopicPos > ibNbrTopics THEN ibTopicPos = 1; END
DO SetCol
DO TopicOn
IF ibTopicPos = ibNbrTopics !* Topic 'Quit'
DO BadKey
ELSE !* Other Topics
DO OpenTopic
END !** IF ibTopicPos = ibNbrTopics **
EscKey ROUTINE !*************************** Routine EscKey *****
!* Escape key processing routine
IF ibTopicPos <> ibNbrTopics
DO CloseTopic
DO TopicOff
ibTopicPos = ibNbrTopics !* Set topic to 'Quit'.
DO SetCol
DO TopicOn
END
LOOP
ASK !* Get a key
IF KEYCODE() = Enter_Key OR KEYCODE() = Right_Key OR KEYCODE() = Left_Key
BREAK
ELSE BEEP()
END
END
EnterKey ROUTINE !************************* Routine EnterKey *****
!* Enter key processing routine
CASE ibTopicPos !* Check what topic we're on
OF 1 !* First Topic
EXECUTE CHOICE() !* Run menu choice
! REQUEST !* Vacation request
! INQUIRY(1) !* Cancel
! INQUIRY(0) !* Inquiry
! POST_VACS !* Post Vacations
END !** EXECUTE CHOICE() for Topic 1 **
OF 2 !* Second Topic.
EXECUTE CHOICE()
! CALENDAR
! DAY_REPT
! STAT_REPT
! EMP_REPT
! LABELS
! EXCESS
END !** EXECUTE CHOICE() for Topic 2 **
OF 3 !* Third Topic.
EXECUTE CHOICE()
! EMP_PROCESS
! EMP_PROCESS
! EMP_PROCESS
END !** EXECUTE CHOICE() for Topic 3 **
OF 4 !* Forth Topic.
EXECUTE CHOICE()
! BACK_UP
! REPLACE
! EMP_FIX
! VAC_FIX
! DEPTMAINT
! HOLMAINT
! NEW_YEAR
! DOS_RUN
END !** EXECUTE CHOICE() for Topic 4 **
!* Next line needed if the procedures above are based on
!* screens rather than windows as are Topics 1, 2 & 3.
OPEN(fOneMenu)
END !** CASE ibTopicPos **
BadKey ROUTINE !*************************** Routine BadKey *****
LOOP
ASK !* Get a key.
IF KEYCODE() = Left_Key OR KEYCODE() = Right_Key OR KEYCODE() = Enter_Key
BREAK
ELSE BEEP()
END
END
MenuAlerts ROUTINE !*********************** Routine MenuAlerts *****
ALERT()
ALERT(Left_Key)
ALERT(Right_Key)
ALERT(Esc_Key)
TopicOff ROUTINE !************************* Routine TopicOff *****
SETHUE(ibForeOff,ibBackColor) !* Sets color for off topic
SHOW(ibRow,ibCol,s12TopicMsg)
SETHUE(); NORMAL !* Restores color to default
TopicOn ROUTINE !************************** Routine TopicOn *****
IF ibTopicPos = ibNbrTopics
SETHUE(ibForeQuit,ibBackColor) !* Sets color for 'Quit' topic
REVERSE
ELSE
SETHUE(ibForeOn,ibBackColor) !* Sets color for on topic
END
SHOW(ibRow,ibCol,s12TopicMsg)
SETHUE(); NORMAL !* Restores color to default