Delphi
Borland

Les 
fichiers
HELP

 

 

Les fichiers d'aide

Principe

Création de fichiers HLP sous Windows.

 Exemple

J'ai fabriqué un exemple sous DELPHI nommé EXHELP qui permet de voir toute la manipulation des fichiers d'aide (context, jump, command).

 

Voici les commandes correspondantes :

unit Unit1;

 

interface

 

uses

  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,

  StdCtrls, Buttons, Menus;

 

type

  TForm1 = class(TForm)

    Aide: TBitBtn;

    Button1: TButton;

    BitBtn1: TBitBtn;

    Label1: TLabel;

    Edit1: TEdit;

    ListBox1: TListBox;

    PopupMenu1: TPopupMenu;

    Aide1: TMenuItem;

    Aide2: TMenuItem;

    Rubrique: TLabel;

    Label2: TLabel;

    procedure AideClick(Sender: TObject);

    procedure FormCreate(Sender: TObject);

    procedure Button1Click(Sender: TObject);

    procedure Aide2Click(Sender: TObject);

    procedure Aide1Click(Sender: TObject);

    procedure PopupMenu1Popup(Sender: TObject);

    function FormHelp(Command: Word; Data: Integer;

      var CallHelp: Boolean): Boolean;

    procedure ListBox1Click(Sender: TObject);

  private

    { Déclarations privées }

  public

    { Déclarations publiques }

  end;

 

var

  Form1: TForm1;

  ghelp: string;

 

implementation

 

{$R *.DFM}

 

procedure TForm1.AideClick(Sender: TObject);

begin

  Application.HelpCommand(HELP_CONTENTS,0);

end;

 

procedure TForm1.FormCreate(Sender: TObject);

begin

  gHelp:='complexe.hlp';

  Application.HelpFile:=gHelp;

end;

 

procedure TForm1.Button1Click(Sender: TObject);

begin

  try

    Application.helpContext(StrToInt(Edit1.text));

  except

    showmessage('Tapez un nombre correct dans la zone d''édition');

  end;

end;

 

procedure TForm1.Aide2Click(Sender: TObject);

begin

  Application.HelpCommand(HELP_CONTENTS,0);

end;

 

procedure TForm1.Aide1Click(Sender: TObject);

begin

  Application.terminate;

end;

 

procedure TForm1.PopupMenu1Popup(Sender: TObject);

begin

  //PopupMenu1.Popup(25,25)

end;

 

function TForm1.FormHelp(Command: Word; Data: Integer;

  var CallHelp: Boolean): Boolean;

begin

   PopupMenu1.Popup(25,25)

end;

 

procedure TForm1.ListBox1Click(Sender: TObject);

 

var s:string;

 

begin

  s:=ListBox1.Items[ListBox1.ItemIndex];

  Application.HelpJump(s);

end;

 

end.

Bouton ou menu d'aide

begin
  Application.HelpFile := g_repcour+'\QCMINI.HLP';
  Application.HelpCommand(HELP_CONTENTS, 0);
end;

Retour Sommaire


 
 

Aide contextuelle

[MAP]
RF_INDEX=1          ; Index

puis l'événement

begin
  Application.HelpFile := g_repcour+'\NomFic.HLP'; //g_Repcour est le répertoire courant
  Application.HelpContext(1);
end;

HelpContext utilise l'instruction MAP du fichier HPJ. Cela ne semble fonctionner que si MAP contient au moins trois instructions

Autre solution (Application Complexe)

Application.HelpFile:=gHelp; //Chemin+Nom du fichier
  if (fgraph.tag=360) or (fGraph.tag=370) then s:= 'RF_REPRESENTATION_GRAPHIQUE_'
  else s:='RF_LA_FEUILLE_GRAPHIQUE';
  Application.HelpJump(s);
Retour haut de page


 

Genhelp

Permet de générer des fichiers HLP bien ficelés à partir de Word 95. Génial.

ATTENTION. IMPORTANT

Attention pour installer les versions de genhelp versions 6 et 7, il faut être  dans des répertoires de noms courts, sinon les fichiers INF ne sont pas trouvés avec les vieilles version Windows 95 et Word 95.

GenHelp version 7 ne fonctionne qu'avec les versions de WORD95. Sinon il faut adapter les macros écrites en VBA, ce qui est sportif, car la traduction automatique plante systématiquement.

Où trouver Genhelp ?

J'avais trouvé ce logiciel sur le site du CRDP (ou CDDP) de Strasbourg en freeware.

Fonctionne avec Word 95 SR2.


 

La macro à modifier

Ancien nom

Nouveau nom

 

Dans CréationAuto 

CréeProjet

CreeProjet

Dans conversion 

FormatDéfinition

FormatDefinition

Dans FormatDéfinition

GérerGlossaire

GererGlossaire

 

FormatLierDéfinition

FormatLierDefinition

Retour Haut du document


 
 

Compilation des fichiers d'aide

avec Delphi 1

Compilation 16 bits pour Windows 3.x
Ceéez le fichier avec Genhelp sous Winword 6
Sous Dos tapez :
HC31 Nomfich sans extension (cette instruction utilisera les fichiers RTF et HPJ correspondant et créera le fichier HLP automatiquement.
On peut utiliser HC31 de Delphi 1 je l'ai mis dans PATH ou encore celui de VB ou celui de Genhelp (répertoire du modèle Genhelp) qui se nomme HPC

avec Delphi 2 et 3

Compilation 32 bits pour Windows 95 et plus
Créez le fichier HLP  avec le nouveau Genhelp 7
Compilez sous Windows comme d'habitude avec HPJ.EXE.
Si HPJ.EXE et ses utilitaires se trouvent dans le répertoire modèle de GENHELP7 alors on peut compiler directement depuis GENHELP7 avec la commande C32 (dernière icône à droite).

 



Retour Haut de page