home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload
/
ShartewareOverload.cdr
/
windows
/
kpwdemo.zip
/
KPHELP.SRC
< prev
next >
Wrap
Text File
|
1990-06-28
|
7KB
|
179 lines
(*========================== KPHELP.SRC ===============================
This file is compiled to the file KPHELP.HKB. When F1 is selected
the following occurs:
1] The topic !HELP is created. If there is already a knowledge
base in memory, !HELP is appended to the end of the knowledge base.
2] The file WIN.INI is checked for the line KPHELP=path where path is
the path where the KnowledgePro is loaded. This line is written into
WIN.INI when KnowledgePro is installed. The topic !HELPDIR is
created inside !HELP and is assigned the name of the path for its
value. This is used in KPHELP to locate the text and index files.
3] KPHELP.HKB is loaded from the directory named in the WIN.INI file.
It is loaded into the topic !HELP.
4] !HELP is called and help is executed.
KPHELP creates the help window and then executes a WAIT. The user can
select menu items or hypertext to access help. KPHELP runs until Quit
is selected or the window is closed from the control menu. When the
window is closed, the help files are closed and a CONTINUE is given to
cancel the WAIT. !HELP is then deleted from memory.
KPHELP reads hypertext from the file KPHELP.hlp. Since this file is
over 300K, it has been indexed to decrease access time. The file was
indexed using the knowledge base INDEX.KB which is included with your
system.
--------------- Changing KPHELP ----------
Since all the code and text for KPHELP is provided, you can change it
to suit your own preference. If you rename or change any of the file
shipped with the system be sure to save copies of the originals.
1] Changing the text of KPHELP. You may want to edit the existing
text of the help files to include information you find helpful. To
do this you will have to load the file KPHELP.hlp into a text editor
that will hold a 300+K file. This file size cannot be edited in
the KnowledgePro editor. Be sure to save the text file in straight
ASCII format. The layout of the file is straightforward and will
be obvious when you look at the file. The format is described in
both INDEX.KB and ENGINE.KB, a hypertext file reading engine.
Once the file is created, it must be indexed using INDEX.KB.
You can either use the file names KPHELP.Hlp and KPHELP.NDX or,
you can change the names of the files used in KPHELP.SRC. If
you change KPHELP.SRC it must be compiled to KPHELP.HKB before it
will run correctly.
2] Changing the help knowledge base. If you want to change the way
the help knowledge base runs, you can alter KPHELP.SRC and recompile
it to KPHELP.HKB. If you want to use a new help knowledge base,
you can change the KPHELP=path\filename line in your WIN.INI file.
Reload Windows to read the new information from WIN.INI.
If you change the help knowledge base be sure to make all topic names
local so they will all be correctly removed from any knowledge base
which may be running in memory.
3] Changing how the help knowledge base is called. Whichever file is
named in the KPHELP=path\filename line of the WIN.INI file is
run whenever F1 is selected. If you want to change the help
knowledge base so it can be run from the File/Run menu command
you should add the line
!HELPDIR=path.
where path is the name of the directory where the help files are
located, to the first line of the knowledge base. Next, re-compile
the knowledge base to KPHELP.HKB.
======================================================================== *)
if element (system_info (), 3) < 8
then :w1 is window (Finish,5,2,83,23,,[PopUp,ThickFrame,MaximizeBox,ControlMenu,VertScroll,ShowChildren,Siblings],,,,close_event)
else :w1 is window (Finish,5,2,70,23,,[PopUp,ThickFrame,MaximizeBox,ControlMenu,VertScroll,ShowChildren,Siblings],,,,close_event).
if last (system_info ()) > 2
then :font is oem_fixed_font and
:color is blue
else :font is create_font ([12,8,400,'f','t','f',255,1,49,'Terminal']) and
:color is [].
hyper_display (?color,,?font).
use_font (oem_fixed_font).
:format is ''.
make_modal (?w1).
:m1 is menu ([&Top,&Functions,&Back,&Print,&Copy,&Quit,&Help],select).
if string_copy (?!helpdir, string_length (?!helpdir), 1) <> '\'
then !helpdir is concat (?!helpdir,'\').
:txtfile is concat (?!helpdir,'kphelp.hlp').
:ndxfile is concat (?!helpdir,'kphelp.ndx').
set_file_pos ([?txtFile,?ndxFile],0).
:list is [].
select:&Top ().
show_window (?w1).
wait ().
topic select (item).
do (?item).
topic &Top.
disable_menu_item (?m1,©).
list is [].
set_title (,'KnowledgePro (Windows) Help').
text (#e,'
Screen Interface: Topics, OOP and Program Control:
#mCreate Objects#m #mTopics#m
#mManipulate Objects#m #mObject-oriented Features#m
#mUsing Text#m #mProgram Control#m
#mGraphics#m #mBooleans, Rules and Arithmetic#m
#mStyles for Windows#m
Files and External Resources: Miscellaneous:
#mExternal Files#m #mError Handling#m
#mExternal Programs#m #mDebugging#m
#mUsing the Clipboard#m #mSend Text to Printer#m
#mDynamic Data Exchange#m #mSystem Information#m
List, Strings and Conversion:
#mLists#m
#mStrings#m
#mConversion between Lists and Strings#m
#mDescription of Events#m
#mKnowledge Bases Included#m
#mConverting from KnowledgePro (DOS) ver. 1.X#m ').
end.
topic &Functions.
disable_menu_item (?m1,©).
list is [].
mark ('Alphabetic Listing of Functions').
end.
topic &Back.
disable_menu_item (?m1,©).
list is remove (?list,last (?list)).
if ?list is []
then select:&top ()
else :item is last (?list) and
list is remove (?list,?item) and
mark (?item).
end. (* Back *)
topic &Print.
print (get_text ()).
end.
topic &Copy.
text_to_clipboard (?Format).
end.
topic &Help.
disable_menu_item (?m1,©).
mark (Help).
end.
topic &Quit.
close_window (?w1).
end. (* mQuit *)
end. (* select *)
topic Finish.
close ([?ndxfile,?txtfile]).
use_font (system_font).
continue ().
end.
topic mark (item).
list gets (?item).
disable_menu_item (?m1,©).
set_file_pos (?ndxfile,0).
:IndexInfo is read (?ndxfile,concat ('//',?item),'//').
set_file_pos (?txtfile, first (?IndexInfo)).
:t is read_char (?txtfile, element (?IndexInfo, 2)).
text (#e,?t).
set_title (,?item).
end. (* mark *)
topic 'This is the font for hypertext on the current monitor.'.
(* this topic prevents MARK from being called when the sample
hypertext is selected. *)
end.