Roughly speaking, the method of usage of the compiler of reference system is simple enough: there is a text file containing the appropriate codes of a format which the compiler transforms to the internal links, falling out windows etc. the Text file should form in the text editor supporting format RTF (rich text format) Microsoft firms. The majority of the modern text editors support this format.
The system of help Windows also includes the menu with additional means. (By operation with Windows 95 it can be necessary to create menu multilayer system.) the similar menu contains such points as Search which deduces the list of keywords and it allows the user to be moved under the list, entering the first letters of its interesting word. Further, by means of a keyword it is possible to pass at once to the necessary section. Also various parts of application (as well as in Visual Basic) can contain the context-dependent help. This method of obtaining of the help is accessible at key press F 1 (or by means of button WhatsThisHelp in Windows environment 95) and produces the information on that tool of the environment which is involved at the moment.
Creation of subject sections of reference system
Basic operation at creation of reference system is determination of a dial-up of subject sections of the help. In an ideal it there should be a short list (no more than one - two screens) that the help, united by the general principle of classification. Normally subject sections will be organized in the form of hierarchical system. It allows the user to be moved easily from the general subjects to more specific. Nevertheless each section should contain enough of links for passage to other subjects needlessly to rise on the uppermost level of hierarchy.
Though determination of a sufficient dial-up of subject sections also happens desirable, to fulfill this requirement it is possible not always. In these cases there can be a necessity to add a pop-up or additional window to reference system.
Practically there are no people (with rare exception) which for creation of reference system would not use the simple packets based on macro definitions, for arrangement of controlling RTF characters. Using a similar packet it is possible to forget safely that обозначет this or that identifier of format RTF, clicking instead some times a mouse. As an example it is possible to result appearance of a toolbar of packet RoboHelp giving access to some of its possibilities.
Anyway, as about it already it was told earlier, (rich text format) the text editor supporting format RTF is necessary for saving of a file which afterwards will be recompiled by the compiler in reference system. (It is connected by that the majority of accessible tools of type RoboHelp are accessible as additional units to the editor of Microsoft Word who, undoubtedly, completely supports the RTF-format specification.)
Each subject section of reference system should be separated from another the character "page break" (hard page break). (This character should be entered independently, unlike other characters of rupture which the test editor puts down automatically. The character can be entered "page break" by combination key stroke CTRL+ENTER in family of editors of firm of Microsoft.) each subject section should contain the identifier of a context-sensitive line, a title, and also the list of accessible keywords. The context-sensitive line is used for passage to section, hence, each section should have a unique line. Keywords are used for the organization of search capabilities in reference system. Naturally, some subject sections I can т have identical keywords.
The binding on the keywords, using identifiers, is a basis for creation of reference system. For example, the context-sensitive line is selected by means of the binding identifier "#". The context-sensitive line can use characters from And to Z, numbers, points and underline characters. The maximum length of a line is restricted by 255 characters.
The title of subject section is selected by means of the binding identifier "$" (dollar sign). The title can contain to 127 characters from a standard dial-up of system Windows. And, at last, keywords are selected by means of the binding identifier "To" (in an uppercase).
(Keywords are not mandatory, however it is possible to assign to subject section more than one keyword, enumerating them in the list divided by signs ";". Keywords can contain the arbitrary characters from standard character set of system Windows. The maximum length of a keyword should not exceed 255 characters.)
Further we note that it is possible to organize the link to a file with raster изображением.bmp, specifying his name in curly brackets. Thus the bitmap image will be placed in an appropriate place of the screen of the help. It is possible to place also the bitmap image on page with the list of subject sections. If for creation of reference system text editor Word for Windows same result it is possible to reach is used, used function Insert Picture. (For an insertion of the image of the big size it is necessary to use an insertion method "By Reference".) the Graphic part of reference system also can be used as passage points to other subjects. If editor Word for Windows it is necessary to create the reference to the bitmap image in a file of subject sections is not used.
Let's attention that some fragments of the text (for example, "Status Area") are underlined by a double line. Such fragments are used as passage points to other sections. After each such fragment the text specifying a place of passage (this text is not displayed in reference system) follows. The general syntax of the similar mechanism of links can be written down as:
JumpString CONTEXT_SroWG
Where the context-sensitive line specifying a place of the link, should be formatted as a hidden text without gaps. In the same way it is possible to allocate the latent context-sensitive line after a fragment of the text underlined by an unary line, for instructions of a location of pop-up help.
Context sensitive help system creation.
The property referring to a file of reference system, is basic property of any object of type of Arr (application). To connect this property to an appropriate slide, it is necessary to fulfill the following:
Creation and help file compilation
The file of the project of reference system contains all information necessary for correct operation of the compiler. Besides, it contains the table (карчу) correspondences for establishment of communications between context-sensitive line and context-sensitive number ID which will be used in the project (once again we remind that there should be a strict correspondence between the information containing in a file of the project of reference system, and the application code).
The file of the project of reference system represents the literal text in format ASCII. As the extension for all similar files of the project используется.hpj. The file of the project of reference system contains the list of all files with subject sections, and also can contain the bitmap image or the correspondence table between context-sensitive lines and context-sensitive numbers ID. It is possible to assign also two context-sensitive lines to the same subject section, modifying a project file.
For establishment of correspondences between context-sensitive number ID and certain subject section it is necessary to fill out a name undressed after a keyword [MAP] then through a gap (i.e. after key press SPACE or TAB) it is necessary to specify context-sensitive number of help. For example, the section [МАР] - a file of the project of reference system can contain the following information:
[MAP]
FILE_MENU 5; 5 is the context number
;Comments follow semicolons
EDIT_MENU 10; 10 is context number
VIEW_MENU 15; 15 is context number
Now, if to cause the tool of creation of reference system with value HelpContextID installed in 5, we receive the screen of the help for subject section FILE_MENU; installing HelpContextID in 10 and causing the tool of creation of reference system, we receive screen EDIT MENU etc.
After creation of a file of the project of reference system it is necessary to cause the compiler of system of the help only. (We note that directories in which there is a compiler, should contain in system variable PATH, otherwise it will be necessary to specify the full way.) for example, in system Windws 95 it is possible to use for this purpose the dialogue panel Run accessible from menu Start in which it is necessary to write something similar:
C:\VB\HC\HC Named fHelpPi-ojectFile
If the compiler is in assigned by default directories (for version Professional). Or it is possible to write:
NANOSECOND NameOfHelpProjectFile
In IUM a case when the directories, the containing compiler, contains in variable PATH.
The compiler of reference system has a considerable quantity of the possibilities which are not considered here. For example, it is possible to compile only certain parts of a file or to control in the sizes and a type of its windows. Besides, it is possible to use all power of the macro definitions written by firm of Microsoft, for the extension of possibilities of the compiler of reference system. This and other information contain in Visual Basic Books Online. Also it is possible to obtain an information considerable quantity, attentively studying the file content Iconwrks.rtf.
Access to reference system Windows
For access to reference system it is possible to use method ShowHelp of the normal dialogue panel. Further the sequence of actions which are necessary for fulfilling for this purpose is resulted:
Declare Function WinHeip Lib "user32" Alias "WinHelpA" (ByVal hHnd As Long, ByVal IpHclpFu
As String, ByVal wCommand As Long, ByVal dwData As Long) As Long
The parameter hWnd ("window's handle) is property parameter hWnd the working form. Parameter IpHelpF specifies a way to the help file (this file is in a directory, distinct from a directory of.ehe-files). It could be necessary the following constants used in parameter wCommand:
Global Const HELP CONTEXT = &H1 ' Display topic by id number
Global Const HELP QUIT - &H2 ' Terminate help
Global Const HELP INDEX = &H3 ' Display index
Global Const HELP HELPONHELP = &H4 ' Display help on using help
Global Const HELP SETINDEX = &H5 ' Set an alternate Index
Global Const HELP KEY = &H101 ' Display topic for keyword in Data
Global Const HELP MULTIKEY = &H201 ' Look up keyword in alternate table
For example, to cause standard reference system "Help on Help", it is necessary испольвать the following procedure:
Public Sub DisplayHelp On Help (X As Form)
Dim Foo As Long ' dummy variable
Foo = WinHeip (X.hWnd, "C:\WINDOWS\HELP\WINDOWS.HLP",
HELP HELPONHELP, CLng (O))
End Sub
After that any line of a type
DisplayHelp_On_Help_Me
Will cause standard reference system Windows.
If for a call of reference system it is used WinHeip API to close additional windows of help, you need to cause again function WinHeip API (since reference system Windows is separate application). It can be made as follows (event Form Unload normally for this purpose is used). Variables Foo and Bar should have the correct type though it is real they do not carry any pay load.
Sub Form_Unload (Cancel As Integer)
Dim Foo As Integer, Bar As String ' dummy variables
Foo = WinHeip (Me.hWnd, Bar, Help_Quit, CLng (O))
End Sub
Operating system Windows 95 has new type of the context-dependent help which is caused by click of a mouse over the image of the small question mark allocated on title of the screen form. Thus the mouse pointer changes the appearance to a question mark then the user can click a mouse on any object. As a result of these actions on the screen the context-dependent information on the selected object is deduced. In the same way, as well as in other variants of the context-dependent help, for correct operation of the help "What's This" it is necessary to install correspondence between application and section MAP in a file of the project of reference system.
Three methods are accessible to embedding of context-dependent help What's This in application. But anyway property WhatsThisHelp should be installed in True.