Home>>Programming>>C++Builder>> » Specify Default Project, Main Form and Use the Help System Interfaces in C Builder

Specify Default Project, Main Form and Use the Help System Interfaces in C Builder

Last Updated on September 13, 2018 By hcyaobin

Specifying a default project, new form, and main form

By default, when you choose File|New|Application or File|New|Form, C++Builder displays a blank form. You can change this behavior by reconfiguring the Repository:

  1. Choose Tools|Repository.
  2. If you want to specify a default project, select the Projects page and choose an item under Objects. Then select the New Project check box.
  3. If you want to specify a default form, select a Repository page (such as Forms), them choose a form under Objects. To specify the default new form (File|New|Form), select the New Form check box. To specify the default main form for new projects, select the Main Form check box.
  4. Click OK.

Enabling Help in applications

Both the VCL and CLX support displaying Help from applications using an object-based mechanism that allows Help requests to be passed on to one of multiple external Help viewers. To support this, an application must include a class that implements the ICustomHelpViewer interface (and, optionally, one of several interfaces descended from it), and registers itself with the global Help Manager.
The VCL provides to all applications an instance of TWinHelpViewer, which implements all of these interfaces and provides a link between applications and WinHelp. CLX requires that you provide your own implementation. On Windows, CLX applications can use the WinHelpViewer unit provided as part of the VCL if they bind to it statically–that is, by including that unit as part of your project instead of linking it to the VCL package.

The Help Manager maintains a list of registered viewers and passes requests to them in a two-phase process: it first asks each viewer if it can provide support for a particular Help keyword or context, and then it passes the Help request on to the viewer which says it can provide such support.

If more than one viewer supports the keyword, as would be the case in an application that had registered viewers for both WinHelp and HyperHelp on Windows or Man and Info on Linux, the Help Manager can display a selection box through which the user of the application can determine which Help viewer to invoke. Otherwise, it displays the first responding Help system encountered.

Help system interfaces

The Help system allows communication between your application and Help viewers through a series of interfaces. These interfaces are all defined in HelpIntfs, which also contains the implementation of the Help Manager.
ICustomHelpViewer provides support for displaying Help based upon a provided keyword and for displaying a table of contents listing all Help available in a particular viewer.
IExtendedHelpViewer provides support for displaying Help based upon a numeric Help context and for displaying topics; in most Help systems, topics function as high-level keywords (for example, “IntToStr” might be a keyword in the Help system, but “String manipulation routines” could be the name of a topic).

ISpecialWinHelpViewer provides support for responding to specialized WinHelp messages that an application running under Windows may receive and which are not easily generalizable. In general, only applications operating in the Windows environment need to implement this interface, and even then it is only required for applications that make extensive use of non-standard WinHelp messages.
IHelpManager provides a mechanism for the Help viewer to communicate back to the application抯 Help Manager and request additional information. IHelpManager is obtained at the time the Help viewer registers itself.

IHelpSystem provides a mechanism through which TApplication passes Help requests on to the Help system. TApplication obtains an instance of an object which implements both IHelpSystem and IHelpManager at application load time and exports that instance as a property; this allows other code within the application to file Help requests directly when appropriate.
IHelpSelector provides a mechanism through which the Help system can invoke the user interface to ask which Help viewer should be used in cases where more than one viewer is capable of handling a Help request, and to display a Table of Contents. This display capability is not built into the Help Manager directly to allow the Help Manager code to be identical regardless of which widget set or class library is in use.

Add a Comment

Your email address will not be published. Required fields are marked *