home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 June
/
SIMTEL_0692.cdr
/
msdos
/
turbopas
/
pull20.arc
/
PULLSTAT.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1988-01-12
|
30KB
|
718 lines
{ =========================================================================== }
{ PullStat.pas - User Statistics for pull-down menus. ver 2.0, 01-12-87 }
{ }
{ This file contains all the data for GetUserPullStats, GetOverrideStats and }
{ CheckGlobalKeys to configure the menus. }
{ =========================================================================== }
{$R-,S-,I-,D-,T-,F-,V-,B-,N-,L+ }
UNIT PullStat;
INTERFACE
uses
CRT,Qwik,WndwVars,PullVars,Pull,PullDir;
{ ------------------ Set up your window names here in order: ---------------- }
{ This is optional, but it sure helps you in not only understanding the
program, but also makes it unquestionably easier to rearrange. }
type
MainMenuNames = (NoMainMenu,FilesMenu,ColorMenu,AutoPartsMenu,EnterDataMenu,
OptionsMenu,UtilitiesMenu,IRSmenu,QuitMenu);
SubMenuNames = (NoSubMenu,TiresMenu,RadioMenu,UpdateMenu,DateMenu,
BrandsMenu);
DataWndwNames = (NoDW,BytesDW,WordsDW,IntegersDW,LongIntsDW,RealsDW,HexDW,
CharsDW,StringsDW,PathDW,FileMaskDW,DateDW,YearDW);
HelpWndwNames = (NoHW,WorkWndwHW,TopMenuHW,FilesMenuHW,DirectoryMenuHW,
BrandsMenuHW,EnterDataMenuHW,IRSmenuHW,DateMenuHW,
UpdateMenuHW,ExecChoiceHW,SingleChoiceHW,MultipleChoiceHW,
NumericHW,TextHW);
HelpLineNames = (NoHL, { HL - HelpLine; L - Last }
HLw1,HLw2,HLw3,HLw4,HLw5,HLw6, { Work window }
HLw7,HLw8,HLw9,HLw10,HLwL,
HLt1,HLtL, { Top menu }
HLb1,HLb2,HLb3,HLb4,HLb5, { Brands submenu }
HLb6,HLb7,HLbL,
HLf1,HLf2,HLf3,HLf4,HLf5, { Files submenu }
HLf6,HLf7,HLf8,HLf9,HLfL,
HLdir1,HLdir2,HLdir3,HLdir4,HLdir5, { Directory submenu }
HLdir6,HLdir7,HLdir8,HLdir9,HLdirL,
HLe1,HLe2,HLe3,HLe4,HLe5, { Enter data submenu }
HLe6,HLe7,HLe8,HLe9,HLe10,
HLe11,HLe12,HLe13,HLe14,HLeL,
HLi1,HLi2,HLiL, { IRS menu }
HLd1,HLd2,HLd3,HLdL, { Date submenu }
HLu1,HLu2,HLuL, { Update submenu }
HLx1,HLx2,HLxL, { eXecute choice menu }
HLs1,HLs2,HLsL, { Single choice menu }
HLm1,HLm2,HLmL, { Multiple choice menu }
HLn1,HLn2,HLnL, { Numeric data entry window }
HLtx1,HLtx2,HLtxL); { Text data entry window }
{ Careful! - Always test your last main menu, submenu, data window, and help
window for run-time error! It makes sure you have allotted enough memory
with your constants. The compiler cannot check it with these typed scalars.}
procedure GetUserPullStats;
procedure GetOverrideStats;
procedure CheckGlobalKeys;
IMPLEMENTATION
{ ************************ GetUserPullStats ********************************* }
{ The major configurations for all menus go here. The program first clears }
{ all RECORD values to $00. The values below will set new values. Therefore, }
{ setting RECORD values to "false" or the like is not necessary. }
{ --------------------------------------------------------------------------- }
procedure GetUserPullStats;
begin
LocationWarning:=true; { If true and a Submenu won't fit, a message is
displayed. (It says "Too many Windows", but this
will be changed next time.) If false, you can
override the location without the message. }
{ ------------------ Set up your colors and borders here: ---------------- }
TopMenuAttr:= black+LightGrayBG; TopMenuHattr:= white+BlackBG;
MainMenuBattr:=lightgray+BlackBG;
MainMenuHattr:=black+LightGrayBG; MainMenuLattr:=yellow+BlackBG;
MainMenuCattr:=lightgray+BlackBG;
SubMenuWattr:= black+CyanBG; SubMenuBattr:= black+CyanBG;
if VideoMode=7 then
begin
TopMenuLattr :=TopMenuAttr;
MainMenuWattr:=lightgray+BlackBG;
SubMenuHattr :=black +LightGrayBG;
SubMenuLattr :=white +BlackBG;
SubMenuCattr :=lightgray+BlackBG;
end
else
begin
TopMenuLattr :=red +LightGrayBG;
MainMenuWattr:=white+BlackBG;
SubMenuHattr :=white+BlueBG;
SubMenuLattr :=white+CyanBG;
SubMenuCattr :=blue +CyanBG;
end;
DataWndwWattr:=black+BrownBG; DataWndwBattr:=black+BrownBG;
HelpWndwWattr:=black+GreenBG; HelpWndwBattr:=black+LightGrayBG;
MsgLineAttr :=green+BlackBG; KeyStatusAttr:=black+GreenBG;
Brdr[UserBrdr1].BrdrArray:='╒═╕││└─┘╞═╡╤│┴╪';
MainMenuBrdr:=UserBrdr1; SubMenuBrdr :=SingleBrdr;
DataWndwBrdr:=HdoubleBrdr; HelpWndwBrdr:=HdoubleBrdr;
HelpWndwModes:=ZoomMode+ShadowRight;
RowsBelowHelp:=4; RowsBelowMsg:=0;
{ ------------------------- Top Menu defaults ----------------------------- }
TopMenuRow:=2; { Top menu to appear on row 2 }
MPulled:=3; { Main menu title to be HiLited when F10 is pressed. }
MoreCmdSeq:='ATB'; { Sequence of command letter(s) as if keyed in. This }
{ will be the default menu(s) pulled. }
PullDown:=false; { Set this true if you want the command sequence}
{ to pull down the menus at startup. }
{ ------------------- Set up your MainMenu records here: ------------------ }
MainMenuRow:=3; { First row of Main menus to appear on screen row 3 }
with MainMenu[ord(FilesMenu)] do
begin
MenuMode:=ExecSingleChoice; SingleFlagLine:=5;
Title:='Files';
Line[1]:='Path'; LineMode[1]:=ToDataWndw;
LinkNum [1]:=ord(PathDW);
Line[2]:='Mask for Directory'; LineMode[2]:=ToDataWndw;
LinkNum [2]:=ord(FileMaskDW);
Line[3]:='Directory'; LineMode[3]:=ToUserWndw;
Line[4]:='──────────────────'; LineMode[4]:=Comment;
Line[5]:='Merge';
Line[6]:='make Backup';
Line[7]:='text Out';
Line[8]:=''; LineMode[8]:=Partition;
Line[9]:='Help comment'; LineMode[9]:=Comment;
MenuLines:=9; DefaultLine:=3;
MsgLineNum:=3; HelpWndwNum:=ord(FilesMenuHW);
end;
with MainMenu[ord(ColorMenu)] do
begin
MenuMode:=SingleChoice; SingleFlagLine:=2;
Title:='Color';
Line[1]:='Blue';
Line[2]:='Green';
Line[3]:='Orange';
Line[4]:='Yellow';
Line[5]:='Red';
Line[6]:='Cyan';
Line[7]:='Ultraviolet';
MenuLines:=7; DefaultLine:=5;
MsgLineNum:=3; HelpWndwNum:=ord(SingleChoiceHW);
end;
with MainMenu[ord(AutoPartsMenu)] do
begin
MenuMode:=MultipleChoice;
Title:='AutoParts';
Line[1]:='Tires'; LineMode[1]:=ToSubMenu;
LinkNum [1]:=ord(TiresMenu);
Line[2]:='Radio'; LineMode[2]:=ToSubMenu;
LinkNum [2]:=ord(RadioMenu);
Line[3]:='Seats'; LineMode[3]:=ToDataWndw;
LinkNum [3]:=ord(BytesDW);
Line[4]:='Mirrors'; Flagged[4]:=true;
Line[5]:='Locks';
Line[6]:='HiBeams'; Flagged[6]:=true;
Line[7]:='Wheels';
MenuLines:=7; DefaultLine:=1;
MsgLineNum:=3; HelpWndwNum:=ord(MultipleChoiceHW);
end;
with MainMenu[ord(EnterDataMenu)] do
begin
MenuMode:=MultipleChoice;
Title:='EnterData';
Line[1]:='Byte'; LineMode[1]:=ToDataWndw;
LinkNum [1]:=ord(BytesDW);
Line[2]:='Word'; LineMode[2]:=ToDataWndw;
LinkNum [2]:=ord(WordsDW);
Line[3]:='Integer'; LineMode[3]:=ToDataWndw;
LinkNum [3]:=ord(IntegersDW);
Line[4]:='LongInt'; LineMode[4]:=ToDataWndw;
LinkNum [4]:=ord(LongIntsDW);
Line[5]:='Real'; LineMode[5]:=ToDataWndw;
LinkNum [5]:=ord(RealsDW);
Line[6]:='Hex'; LineMode[6]:=ToDataWndw;
LinkNum [6]:=ord(HexDW);
Line[7]:='Character'; LineMode[7]:=ToDataWndw;
LinkNum [7]:=ord(CharsDW);
Line[8]:='String'; LineMode[8]:=ToDataWndw;
LinkNum [8]:=ord(StringsDW);
MenuLines:=8; DefaultLine:=2;
MsgLineNum:=3; HelpWndwNum:=ord(EnterDataMenuHW);
end;
with MainMenu[ord(OptionsMenu)] do
begin
MenuMode:=MultipleChoice;
Title:='Options';
Line[1]:='Dual drive';
Line[2]:='Hard disk'; Flagged[2]:=true;
Line[3]:='Extended Mem';
Line[4]:='CGA'; Flagged[4]:=true;
Line[5]:='VGA';
Line[6]:='KeyBoard';
Line[7]:='Price limit'; LineMode[7]:=ToDataWndw;
LinkNum [7]:=ord(IntegersDW);
MenuLines:=7; DefaultLine:=1;
MsgLineNum:=3; HelpWndwNum:=ord(MultipleChoiceHW);
end;
with MainMenu[ord(UtilitiesMenu)] do
begin
{ MenuMode:=ExecChoice; } { This is the default }
Title:='Utilities';
Line[1]:='Copy files';
Line[2]:='Delete files';
Line[3]:='List file';
Line[4]:='Edit file';
Line[5]:='Find file';
Line[6]:='Rename file';
Line[7]:='Sort files';
MenuLines:=7; DefaultLine:=2;
MsgLineNum:=3; HelpWndwNum:=ord(ExecChoiceHW);
end;
with MainMenu[ord(IRSmenu)] do
begin
{ MenuMode:=ExecChoice; } { This is the default }
Title:='IRSaccounting';
Line[1]:='Date'; LineMode[1]:=ToSubMenu;
LinkNum [1]:=ord(DateMenu);
Line[2]:='Cost';
Line[3]:='Revenue';
Line[4]:='Taxes';
Line[5]:='Insurance';
Line[6]:='Update'; LineMode[6]:=ToSubMenu;
LinkNum [6]:=ord(UpdateMenu);
Line[7]:='Years'; LineMode[7]:=ToDataWndw;
LinkNum [7]:=ord(BytesDW);
MenuLines:=7; DefaultLine:=1;
MsgLineNum:=3; HelpWndwNum:=ord(IRSmenuHW);
end;
with MainMenu[ord(QuitMenu)] do
begin
{ MenuMode:=ExecChoice; } { This is the default }
Title:='Quit';
Line[1]:='Stay';
Line[2]:='Quit';
MenuLines:=2; DefaultLine:=1; BackToDefault:=true;
MsgLineNum:=3; HelpWndwNum:=ord(ExecChoiceHW);
end;
{ ----------------------- Set up your SubMenus here: --------------------- }
{ Careful! -- indexes to SubMenus must be numbered in order of level; i.e.,
ALL SubMenus first, ALL SubSubMenus second, ALL SubSubSubMenus, ... etc. }
with SubMenu[ord(TiresMenu)] do
begin
MenuMode:=SingleChoice; SingleFlagLine:=5;
Line[1]:='Brands'; LineMode[1]:=ToSubMenu;
LinkNum[1] :=ord(BrandsMenu);
Line[2]:='Radials';
Line[3]:='Knobbies';
Line[4]:='Track';
Line[5]:='Snow';
Line[6]:='All-Weather';
Line[7]:='4-ply';
MenuLines:=7; DefaultLine:=1;
MsgLineNum:=4; HelpWndwNum:=ord(SingleChoiceHW);
end;
with SubMenu[ord(RadioMenu)] do
begin
MenuMode:=MultipleChoice;
Line[1]:='FM Stereo'; Flagged[1]:=true;
Line[2]:='AM Radio'; Flagged[2]:=true;
Line[3]:='Tape player';
Line[4]:='Compact Disc';
MenuLines:=4; DefaultLine:=4;
MsgLineNum:=4; HelpWndwNum:=ord(MultipleChoiceHW);
end;
with SubMenu[ord(DateMenu)] do
begin
{ MenuMode:=ExecChoice; } { This is the default }
Line[1]:='Month'; LineMode[1]:=ToDataWndw;
LinkNum [1]:=ord(DateDW);
Line[2]:='Day'; LineMode[2]:=ToDataWndw;
LinkNum [2]:=ord(DateDW);
Line[3]:='Year'; LineMode[3]:=ToDataWndw;
LinkNum [3]:=ord(YearDW);
MenuLines:=3; DefaultLine:=1; BackToDefault:=true;
MsgLineNum:=4; HelpWndwNum:=ord(DateMenuHW);
end;
with SubMenu[ord(UpdateMenu)] do
begin
{ MenuMode:=ExecChoice; } { This is the default }
Line[1]:='1 process';
Line[2]:='2 process and pop';
Line[3]:='3 pop and process';
Line[4]:='4 pop, process, pull';
Line[5]:='5 pop, pull to Years';
Line[6]:='6 pop, pull Radio';
MenuLines:=6; DefaultLine:=4;
MsgLineNum:=4; HelpWndwNum:=ord(UpdateMenuHW);
end;
{ Here's a SubSubMenu: }
with SubMenu[ord(BrandsMenu)] do
begin
MenuMode:=SingleChoice; SingleFlagLine:=2;
Line[1]:='Michelin';
Line[2]:='General';
Line[3]:='Firestone';
Line[4]:='Bridgestone';
Line[5]:='WeatherGuard';
MenuLines:=5; DefaultLine:=3;
MsgLineNum:=4; HelpWndwNum:=ord(BrandsMenuHW);
end;
{ ----------------- Set up your Data Windows here: --------------------- }
{ Justification will default with numbers right justified and string to }
{ the left if none is specified. }
AutoNumLock:=true; { Turns NumLock on with data entry }
CapsLockCol:=41; { First column for ' CAPS NUM SCROLL ' on MsgLine. }
with DataWndw[ord(BytesDW)] do
begin
Line[1]:='Currently:';
Line[2]:='Enter byte:';
{ TypeOfData:=Bytes; } { This is the default }
Field:=3;
{ Justify:=Right; } { This is the default }
MsgLineNum:=5; HelpWndwNum:=ord(NumericHW);
end;
with DataWndw[ord(WordsDW)] do
begin
Line[1]:='Currently:';
Line[2]:='Enter word:';
TypeOfData:=Words;
Field:=5;
{ Justify:=Right; } { This is the default }
MsgLineNum:=5; HelpWndwNum:=ord(NumericHW);
end;
with DataWndw[ord(IntegersDW)] do
begin
Line[1]:='Currently:';
Line[2]:='Enter integer:';
TypeOfData:=Integers;
Field:=6;
MsgLineNum:=5; HelpWndwNum:=ord(NumericHW);
end;
with DataWndw[ord(LongIntsDW)] do
begin
Line[1]:='Currently:';
Line[2]:='Enter integer:';
TypeOfData:=LongInts;
Field:=11;
MsgLineNum:=5; HelpWndwNum:=ord(NumericHW);
end;
with DataWndw[ord(RealsDW)] do
begin
Line[1]:='Currently:';
Line[2]:='Enter real:';
TypeOfData:=Reals;
Field:=17;
Decimals:=08; { Neg value uses R:F. Pos value - R:F:D. }
MsgLineNum:=5; HelpWndwNum:=ord(NumericHW);
end;
with DataWndw[ord(CharsDW)] do
begin
Line[1]:='Currently:';
Line[2]:='Enter char:';
TypeOfData:=Chars;
Field:=1;
MsgLineNum:=6; HelpWndwNum:=ord(TextHW);
end;
with DataWndw[ord(HexDW)] do
begin
Line[1]:='Currently:';
Line[2]:='Enter hex:';
TypeOfData:=UserNums;
Field:=4;
MsgLineNum:=6; HelpWndwNum:=ord(NumericHW);
end;
with DataWndw[ord(StringsDW)] do
begin
Line[1]:='Currently:';
Line[2]:='Enter string:';
TypeOfData:=Strings;
Field:=25; { If field is too large to fit, program
centers it on screen. You can override. }
MsgLineNum:=6; HelpWndwNum:=ord(TextHW);
end;
with DataWndw[ord(PathDW)] do
begin
Line[1]:='Currently:';
Line[2]:='Enter path:';
TypeOfData:=UserStrings;
Field:=45;
MsgLineNum:=6; HelpWndwNum:=ord(TextHW);
end;
DataWndw[ord(FileMaskDW)]:=DataWndw[ord(PathDW)];
with DataWndw[ord(FileMaskDW)] do
begin
Line[2]:='Enter Mask:';
Field:=12;
end;
with DataWndw[ord(DateDW)] do
begin
Line[1]:='Now:';
Line[2]:='New:';
{ TypeOfData:=Bytes; } { This is the default. }
Field:=2;
MsgLineNum:=5; HelpWndwNum:=ord(NumericHW);
end;
with DataWndw[ord(YearDW)] do
begin
Line[1]:='Now:';
Line[2]:='New:';
TypeOfData:=Integers;
Field:=4;
MsgLineNum:=5; HelpWndwNum:=ord(NumericHW);
end;
{ ----------------------- Set up your Help Windows here: ------------------ }
{ HelpWndw[1] is reserved for the Work window. }
{ HelpWndw[2] is reserved for the top menu. }
HelpMsgLineNum:=7; { Standard message for a Help window }
{ For 2 assignments to a record, save code by not using WITH }
HelpWndw [ord(WorkWndwHW) ].FirstLine := ord(HLw1);
HelpWndw [ord(WorkWndwHW) ].LastLine := ord(HLwL);
HelpWndw [ord(TopMenuHW) ].FirstLine := ord(HLt1);
HelpWndw [ord(TopMenuHW) ].LastLine := ord(HLtL);
HelpWndw [ord(FilesMenuHW) ].FirstLine := ord(HLf1);
HelpWndw [ord(FilesMenuHW) ].LastLine := ord(HLfL);
HelpWndw [ord(DirectoryMenuHW) ].FirstLine := ord(HLdir1);
HelpWndw [ord(DirectoryMenuHW) ].LastLine := ord(HLdirL);
HelpWndw [ord(EnterDataMenuHW) ].FirstLine := ord(HLe1);
HelpWndw [ord(EnterDataMenuHW) ].LastLine := ord(HLeL);
HelpWndw [ord(BrandsMenuHW) ].FirstLine := ord(HLb1);
HelpWndw [ord(BrandsMenuHW) ].LastLine := ord(HLbL);
HelpWndw [ord(IRSmenuHW) ].FirstLine := ord(HLi1);
HelpWndw [ord(IRSmenuHW) ].LastLine := ord(HLiL);
HelpWndw [ord(DateMenuHW) ].FirstLine := ord(HLd1);
HelpWndw [ord(DateMenuHW) ].LastLine := ord(HLdL);
HelpWndw [ord(UpdateMenuHW) ].FirstLine := ord(HLu1);
HelpWndw [ord(UpdateMenuHW) ].LastLine := ord(HLuL);
HelpWndw [ord(ExecChoiceHW) ].FirstLine := ord(HLx1);
HelpWndw [ord(ExecChoiceHW) ].LastLine := ord(HLxL);
HelpWndw [ord(SingleChoiceHW) ].FirstLine := ord(HLs1);
HelpWndw [ord(SingleChoiceHW) ].LastLine := ord(HLsL);
HelpWndw [ord(MultipleChoiceHW)].FirstLine := ord(HLm1);
HelpWndw [ord(MultipleChoiceHW)].LastLine := ord(HLmL);
HelpWndw [ord(NumericHW) ].FirstLine := ord(HLn1);
HelpWndw [ord(NumericHW) ].LastLine := ord(HLnL);
HelpWndw [ord(TextHW) ].FirstLine := ord(HLtx1);
HelpWndw [ord(TextHW) ].LastLine := ord(HLtxL);
{ ------------------- Set up your Help Lines here: ------------------------ }
HelpLine[ord(HLw1)]:=' WELCOME TO PULL20.ARC';
HelpLine[ord(HLw2)]:='These files will enable you to do fully developed';
HelpLine[ord(HLw3)]:='pull-down menus along with:';
HelpLine[ord(HLw4)]:=' - Work window(s)';
HelpLine[ord(HLw5)]:=' - Top, Main, and Multiple Submenus';
HelpLine[ord(HLw6)]:=' . Each menu can have 1 of 5 menu modes';
HelpLine[ord(HLw7)]:=' . Each line can have 1 of 7 line modes';
HelpLine[ord(HLw8)]:=' - Data entry windows';
HelpLine[ord(HLw9)]:=' - Help windows for each of the above';
HelpLine[ord(HLw10)]:=' - Pull/Pop remembers last menu';
HelpLine[ord(HLwL)]:=' - Message lines for prompts and processing';
HelpLine[ord(HLt1)]:='Move cursor and press return OR type a command';
HelpLine[ord(HLtL)]:='letter. ESC to return to the Work window.';
HelpLine[ord(HLb1)]:='Notice the number of levels for the menus. This';
HelpLine[ord(HLb2)]:='menu is a "Single Choice" menu, but you can choose';
HelpLine[ord(HLb3)]:='from 1 of 5 menu modes:';
HelpLine[ord(HLb4)]:=' 1. ExecChoice - process';
HelpLine[ord(HLb5)]:=' 2. ExecSingleChoice - process and flag';
HelpLine[ord(HLb6)]:=' 3. ExecMultipleChoice - process and toggle flag';
HelpLine[ord(HLb7)]:=' 4. SingleChoice - flag';
HelpLine[ord(HLbL)]:=' 5. MultipleChoice - toggle flag';
HelpLine[ord(HLf1)]:='This is a "Execute Single Choice" menu, but there';
HelpLine[ord(HLf2)]:='are 5 of the 7 possible line modes used here:';
HelpLine[ord(HLf3)]:='* 1. Choice - interact with other menu choices';
HelpLine[ord(HLf4)]:=' 2. ExecOnly - process but do not flag';
HelpLine[ord(HLf5)]:='* 3. Comment - bypassed by highlight';
HelpLine[ord(HLf6)]:='* 4. Partition - mid-menu border';
HelpLine[ord(HLf7)]:='* 5. ToDataWndw - pulls data entry window';
HelpLine[ord(HLf8)]:=' 6. ToSubMenu - pulls next submenu level';
HelpLine[ord(HLf9)]:='* 7. ToUserWndw - like ExecOnly plus menu symbol';
HelpLine[ord(HLfL)]:='Any combination of the seven works!';
HelpLine[ord(HLe1)]:='Each data entry window can be tailored to any type';
HelpLine[ord(HLe2)]:='of data:';
HelpLine[ord(HLe3)]:=' 1. Byte - 0..255';
HelpLine[ord(HLe4)]:=' 2. Word - 0..65535';
HelpLine[ord(HLe5)]:=' 3. Integer - -32768..32767';
HelpLine[ord(HLe6)]:=' 4. LongInt - -2147483647..2147483647';
HelpLine[ord(HLe7)]:=' 5. Real - any format';
HelpLine[ord(HLe8)]:=' 6. UserNums - user defined numbers, like hex';
HelpLine[ord(HLe9)]:=' 7. Char - one character';
HelpLine[ord(HLe10)]:=' 8. String - any length';
HelpLine[ord(HLe11)]:=' 9. UserStrings - strings limited by special sets';
HelpLine[ord(HLe12)]:='Data entry will check validity, range, and user-';
HelpLine[ord(HLe13)]:='defined limits. Sets will limit data entry to';
HelpLine[ord(HLe14)]:='valid characters only. Field length and labels';
HelpLine[ord(HLeL)]:='are also user-defined.';
HelpLine[ord(HLi1)]:='This is an "Execute Choice" menu. But sure to see';
HelpLine[ord(HLi2)]:='the example of sequential data entry on "Date" and';
HelpLine[ord(HLiL)]:='menu control on "Update".';
HelpLine[ord(HLd1)]:='This is an "Execute Choice" menu, but there are no';
HelpLine[ord(HLd2)]:='"choice" lines. Instead, the lines are all data';
HelpLine[ord(HLd3)]:='entry lines that have been made to allow either';
HelpLine[ord(HLdL)]:='random or sequential access. Start with "Month".';
HelpLine[ord(HLu1)]:='This is an "Execute Choice" menu. This one will';
HelpLine[ord(HLu2)]:='show you a few of the possibilities of actually';
HelpLine[ord(HLuL)]:='controlling the menus themselves.';
HelpLine[ord(HLx1)]:=' This is an "Execute Choice" menu.';
HelpLine[ord(HLx2)]:=' Notice that there are no flags.';
HelpLine[ord(HLxL)]:=' "'#240'" means linked SubMenu; "'#250'" - DataWndw.';
HelpLine[ord(HLs1)]:=' This is a "Single Choice" menu.';
HelpLine[ord(HLs2)]:=' Notice there''s only one flag.';
HelpLine[ord(HLsL)]:=' "'#240'" means linked SubMenu; "'#250'" - DataWndw.';
HelpLine[ord(HLm1)]:=' This is a "Multiple Choice" menu.';
HelpLine[ord(HLm2)]:=' Notice several flags.';
HelpLine[ord(HLmL)]:=' "'#240'" means linked SubMenu; "'#250'" - DataWndw.';
{ Directory }
HelpLine[ord(HLdir1)]:='Directory can optionally default to a closely';
HelpLine[ord(HLdir2)]:='matching name, if any, in the file name entry';
HelpLine[ord(HLdir3)]:='field. Pressing CR replaces the name. Cursor and';
HelpLine[ord(HLdir4)]:='letter keys move the highlight:';
HelpLine[ord(HLdir5)]:=' Letter key - find name with same first letter';
HelpLine[ord(HLdir6)]:=' '^X'/'^Y' - move up/down';
HelpLine[ord(HLdir7)]:=' Home/End - move to upper/lower file name';
HelpLine[ord(HLdir8)]:=' PgUp/PgDn - move up/down a page';
HelpLine[ord(HLdir9)]:=' ^Home/^End - move to top/bottom file name';
HelpLine[ord(HLdirL)]:=' ^PgUp/^PgDn - move to top/bottom page';
HelpLine[ord(HLn1)]:='This is a numeric scratch pad. Enter data between';
HelpLine[ord(HLn2)]:='the symbols. Only certain characters are valid.';
HelpLine[ord(HLnL)]:='BS is active. To clear, ESC+CR. Try to mess up!.';
HelpLine[ord(HLtx1)]:='This is a text scratch pad. Enter data between';
HelpLine[ord(HLtx2)]:='the symbols. Only certain characters are valid.';
HelpLine[ord(HLtxL)]:='DEL+CR allows a null entry.';
{ ------------------ Set up your Message Lines here: ---------------------- }
{ Concatonations here allow source to print on 80 col printer. }
{ MsgLine[1] is reserved as the Work window message line. }
{ MsgLine[2] is reserved as the top menu message line. }
MsgLine[1]:=' F1-help F2-pull F10-cmd ESC-pull '+
' ';
MsgLine[2]:=' F1-help F2-pop LTR-cmd ESC-return '+
' '^[^Z' hilight CR-select ';
MsgLine[3]:=' F1-help F2-pop LTR-cmd ESC-return '+
' '^[^Z' menus '^X^Y'-hilight CR-select ';
MsgLine[4]:=' F1-help F2-pop LTR-cmd ESC-return '+
' '^X^Y'-hilight CR-select ';
MsgLine[5]:=' F1-help F2-pop F10-cmd ESC-return '+
' CR-enter ';
MsgLine[6]:=' F1-help F2-pop ESC-return '+
' DEL-null CR-enter ';
MsgLine[7]:=' F1-return LTR-cmd ESC-return '+
' ';
MsgLine[8]:=' Processing ... '+
' ';
MsgLine[9]:=' F1-help F2-pull F10-cmd ESC-pull '+
' CR-enter ';
MsgLine[10]:=' F1-help F2-pop F10-top ESC-return '+
' LTR/'^X^Y'-hilight CR-select ';
MsgLine[11]:=' Alt-F-Files Alt-D-Directory Alt-P-Pat'+
'h Alt-X-Exit ';
{ ---------------- Set up your Error Message Lines here: -------------------- }
{ ErrMsgLine[1] is reserved for the Invalid numerical entries. }
ErrMsgLine[1]:=' Invalid entry. ESC-acknowledge';
ErrMsgLine[2]:=' Invalid path. Use [d:][path]. Press ESC.';
ErrMsgLine[3]:=' $2500 limit. ESC-acknowledge';
ErrMsgLine[4]:=' Range is: -300 >= WorkWndwInteger >= 4000; Press ESC';
ErrMsgLine[5]:=' Enter 1..12 ESC-acknowledge';
ErrMsgLine[6]:=' Enter 1..31 ESC-acknowledge';
ErrMsgLine[7]:=' Range is: 1960 >= Year >= 2010; Press ESC';
ErrMsgLine[8]:=' Limit is 250 file names. ESC-acknowldege';
end; { procedure GetUserPullStats }
{ *************************** GetOverrideStats ****************************** }
{ You can OVERRIDE the automatic Colors, Sizes, and Locations here. }
{ --------------------------------------------------------------------------- }
procedure GetOverrideStats;
begin
DataWndw[ord(StringsDW)].RowAlt:=12;
DataWndw[ord(StringsDW)].ColAlt:=18;
with DirectoryMenu do
begin
Title:='Directory';
LinkDir:=Right;
MenuLines:=CRTrows-7;
Row:=4;
Rows:=CRTrows-5;
with MainMenu[ord(FilesMenu)] do
DirectoryMenu.Col:=Col+Cols-2;
Cols:=16;
Battr:=DataWndwBattr;
Wattr:=DataWndwWattr;
Hattr:=yellow;
Border:=SubMenuBrdr;
MsgLineNum:=10;
HelpWndwNum:=ord(DirectoryMenuHW);
end;
with SubMenu[ord(BrandsMenu)] do
begin
Wattr:= black+BrownBG;
Battr:= black+BrownBG;
if VideoMode<>7 then
begin
Hattr:=yellow+BlackBG;
Lattr:=yellow+BrownBG;
end;
end;
SubMenu[ord(DateMenu)].LinkDir:=Left;
{ This following changes the command letters on Main Menu 1 to other than
1st letters. '#00' is for inaccessible lines. }
MainMenu[ord(FilesMenu)].CmdLtrs:='PMD'#00'MBO';
end;
{ ************************* CHECK GLOBAL KEYS ******************************* }
{ This procedure gives you the option to add global keys similar to TP4 such }
{ as Alt-R or Alt-F3. This is for extended keys only. }
{ --------------------------------------------------------------------------- }
const
AltF = #33; { Files menu }
AltC = #46; { Colors menu }
AltA = #30; { AutoParts menu }
AltE = #18; { EnterData menu }
AltO = #24; { Options menu }
AltU = #22; { Utilities menu }
AltI = #23; { IRSaccounting menu }
AltQ = #16; { Quit menu }
AltD = #32; { Directory menu }
AltP = #25; { Path Data entry }
AltX = #45; { Immediately exit program }
type SeqStr = string[MaxWndw];
procedure SetCmdSeq (NewCmdSeq: SeqStr);
var
Lmin,Lold,Lnew: byte;
i: word;
begin
Lold:=length( CmdSeq);
Lnew:=length(NewCmdSeq);
if Lnew<Lold then
Lmin:=Lnew
else Lmin:=Lold;
i:=1;
while (i<=Lmin) and (NewCmdSeq[i]=CmdSeq[i]) do
inc (i);
delete (NewCmdSeq,1,pred(i));
MoreCmdSeq:=NewCmdSeq;
PopLevels:=Lold-pred(i);
end;
{ Any of the keys can be modified. PopKey and TopKey1 were defined in
PullVars.pas. }
procedure CheckGlobalKeys;
begin
PullDown:=true;
case Key of
PopKey: begin PullDown:=false; PopToWorkWndw:=true; end; { F2 }
TopKey1: PopToTop:=true; { F10 }
AltF: SetCmdSeq ('F');
AltC: SetCmdSeq ('C');
AltA: SetCmdSeq ('A');
AltE: SetCmdSeq ('E');
AltO: SetCmdSeq ('O');
AltU: SetCmdSeq ('U');
AltI: SetCmdSeq ('I');
AltQ: SetCmdSeq ('Q');
AltD: SetCmdSeq ('FD');
AltP: SetCmdSeq ('FP');
AltX: begin PopToWorkWndw:=true; Quit:=true; end;
else PullDown:=false;
end
end;
BEGIN
AddrGetUserPullStats:=@GetUserPullStats;
AddrGetOverrideStats:=@GetOverrideStats;
AddrCheckGlobalKeys :=@CheckGlobalKeys;
END.