Showing Help with the TIpHtmlPanel Component in Lazarus

The browser behind the TIpHTMLPanel control is old and limited in its capabilities but is fine for rendering the HTML that you write yourself to suit it. The great advantage is that it is not too complex and you have a chance of understanding and even modifying its code. (See the following page for guidance on a newer browser). If you want to put a TIpHTMLPanel on your form when starting from scratch, you will find it in the iPro tab of components.

The following screenshot shows part of the syntax-highlighted HTML code from a help file in the SynEdit control above the help form showing the same code rendered by the internal browser.

Output from program HelpDemoLaz

Output from program HelpDemoLaz

We reproduce part of the SynEdit help file here so that you can see its rich set of features. The SynEdit control is used in the Lazarus editor so you may find it worthwhile to learn some of the following commands.

  • Double click to select a word.
  • Double click to select a word.
  • Triple click to select a line.
  • CTRL+SHIFT+click to extend a selection.
  • Drag with the ALT key down to select columns of text.
  • Drag and drop is supported.
  • Type CTRL+Z to undo and SHIFT+CTRL+Z to redo.
  • Type CTRL+A to select all.
  • Type CTRL+C to copy to clipboard.
  • Type CTRL+V to paste from clipboard.
  • Type Home to position the cursor at the beginning of the current line and End to position it at the end of the line.
  • Type CTRL+Home to position the cursor at start of the document and CTRL+End to position it at the end of the document.
  • Page Up and Page Down work as expected.
  • CTRL+Page Up sends the cursor to the top of the viewed portion and CTRL+Page Down sends it to the bottom.

Using the arrow keys:

  • Type Left, Right, Up and Down, to increment the cursor position in the selected direction.
  • Type CTRL+Right to position the cursor at the start of the next word and CTRL+Right to position it at the start of the previous word.
  • Type CTRL+Up to scroll up by one line and CTRL+Down to scroll down by one line.
  • Type SHIFT+Up to select upwards by one line, or if text is already selected to move up the bottom of the selection by one line.
  • Type SHIFT+Down to extend the selection downwards by one line.

The essential code of the files needed for program HelpDemoLaz follows this introduction. We placed the large text file of the form containing the SynEdit control (uHelpDemo.lfm) at the end. The package file synEdit.pp is 9000 lines long so it is not surprising that the control has many properties.

You can download this zip file containing six Lazarus files for the compilation, the executable in case your compilation fails, three HTML help files and one image. Following advice in the informative Lazarus wiki page Size Matters, we reduced the size of the executable HelpDemoLaz.exe by selecting

  1. the menu item Project > Project Options;
  2. the Linking page (under the heading Compiler Options);
  3. the option to Use external gdb symbols file -Xg.

This gave us a 3MB executable and a separate 17 MB file for debugging purposes. The executable then zipped down to just over 1 MB.

We used some code from the Lazarus example folder named htmlhelp_ipro, without which we would have struggled.

uHelp.pas

unit uHelp;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, Buttons,
  FileUtil, IpHtml, ExtCtrls;

type
  TSimpleIpHtml = class(TIpHtml)
  public
    property OnGetImageX;
  end;

  TfrmHelp = class(TForm)
    IpHtmlPanel1 : TIpHtmlPanel;
    procedure HTMLGetImageX(Sender: TIpHtmlNode; const URL: string;
                            var Picture: TPicture);

    //You can remove this proc and the onHotClick property
    //if you do not need to navigate
    procedure IpHtmlPanel1HotClick(Sender: TObject);
  public
    procedure OpenHTMLFile(const Filename: string);
  end; 

var
  frmHelp: TfrmHelp;

implementation
{$R *.lfm}

procedure TfrmHelp.IpHtmlPanel1HotClick(Sender: TObject);
var
  NodeA : TIpHtmlNodeA;
  NewFilename : String;
begin
  if IpHtmlPanel1.HotNode is TIpHtmlNodeA then
    begin
      NodeA := TIpHtmlNodeA(IpHtmlPanel1.HotNode);
      NewFilename := NodeA.HRef;
      OpenHTMLFile(NewFilename);
    end;
end;

procedure TfrmHelp.HTMLGetImageX(Sender : TIpHtmlNode; const URL : string;
                                 var Picture: TPicture);
var
  PicCreated: boolean;
begin
  try
    if FileExistsUTF8(URL) then
      begin
        PicCreated := False;
        if Picture = nil then
          begin
            Picture := TPicture.Create;
            PicCreated := True;
          end;
        Picture.LoadFromFile(URL);
      end;
  except
    if PicCreated then
      Picture.Free;
    Picture := nil;
  end;
end;

procedure TfrmHelp.OpenHTMLFile(const Filename : string);
var
  fs : TFileStream;
  NewHTML : TSimpleIpHtml;
begin
  try
    fs := TFileStream.Create(UTF8ToSys(Filename), fmOpenRead);
    try
      NewHTML := TSimpleIpHtml.Create; // Beware: Will be freed automatically by IpHtmlPanel1
      NewHTML.OnGetImageX := @HTMLGetImageX;
      NewHTML.LoadFromStream(fs);
    finally
      fs.Free;
    end;
    IpHtmlPanel1.SetHtml(NewHTML);
  except
    on E: Exception do
      begin
        MessageDlg('Unable to open HTML file', 'HTML File: ' + Filename + #13 +
                 'Error: ' + E.Message,mtError, [mbCancel], 0);
      end;
  end;
end;

end.

uHelp.lfm

object frmHelp: TfrmHelp
  Left = 683
  Height = 327
  Top = 492
  Width = 569
  Caption = 'Help'
  ClientHeight = 327
  ClientWidth = 569
  LCLVersion = '0.9.30'
  object IpHtmlPanel1: TIpHtmlPanel
    Left = 0
    Height = 327
    Top = 0
    Width = 569
    Align = alClient
    FixedTypeface = 'Courier New'
    DefaultTypeFace = 'default'
    DefaultFontSize = 12
    FlagErrors = False
    PrintSettings.MarginLeft = 0.5
    PrintSettings.MarginTop = 0.5
    PrintSettings.MarginRight = 0.5
    PrintSettings.MarginBottom = 0.5
    TabOrder = 0
    OnHotClick = IpHtmlPanel1HotClick
  end
end

uHelpDemo.pas

unit uHelpDemo;

interface

uses
  Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
  StdCtrls, Menus, SynHighlighterHTML, SynEdit;

type
  TfrmRequestHelp = class(TForm)
    btnHelp: TButton;
    btnFont: TButton;
    FontDialog1: TFontDialog;
    mmiBrowser: TMenuItem;
    mmiSaveAs: TMenuItem;
    mmiOpen: TMenuItem;
    mmiSave: TMenuItem;
    mmiFile: TMenuItem;
    mmiAbout: TMenuItem;
    mmiFormHelp: TMenuItem;
    mmRequestHelp: TMainMenu;
    mmiHelp: TMenuItem;
    OpenDialog1: TOpenDialog;
    SaveDialog1: TSaveDialog;
    SynEdit1: TSynEdit;
    SynHTMLSyn1: TSynHTMLSyn;
    procedure btnFontClick(Sender: TObject);
    procedure btnHelpClick(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure FormResize(Sender: TObject);
    procedure mmiAboutClick(Sender: TObject);
    procedure mmiBrowserClick(Sender: TObject);
    procedure mmiFormHelpClick(Sender: TObject);
    procedure mmiOpenClick(Sender: TObject);
    procedure mmiSaveAsClick(Sender: TObject);
    procedure mmiSaveClick(Sender: TObject);
  end; 

var
  frmRequestHelp: TfrmRequestHelp;

implementation
{$R *.lfm}
uses
  uHelp;
var
  CurrentPathname : string;

procedure TfrmRequestHelp.btnHelpClick(Sender: TObject);
begin
  frmHelp.Show;
  frmHelp.OpenHTMLFile('syn_help.html');
end;

procedure TfrmRequestHelp.btnFontClick(Sender: TObject);
begin
  with FontDialog1 do
    begin
      FontDialog1.Font.Name:= 'Courier New';
      if Execute then
        begin
          SynEdit1.Font := Font;
        end;
    end;
end;

procedure TfrmRequestHelp.FormCreate(Sender: TObject);
begin
  CurrentPathname := ExtractFilePath(ParamStr(0)) + 'turbopower_help.html';
  SynEdit1.Lines.LoadFromFile(CurrentPathname);
  btnFont.Left := ClientWidth - 180;
  btnHelp.Left := ClientWidth - 75;
end;

procedure TfrmRequestHelp.FormResize(Sender: TObject);
begin
  SynEdit1.Width := ClientWidth;
  SynEdit1.Height := ClientHeight - 30;
  btnFont.Left := ClientWidth - 180;
  btnHelp.Left := ClientWidth - 75;
end;

procedure TfrmRequestHelp.mmiAboutClick(Sender: TObject);
begin
  frmHelp.Show;
  frmHelp.OpenHTMLFile('about.html');
end;

procedure TfrmRequestHelp.mmiBrowserClick(Sender: TObject);
begin
  frmHelp.Show;
  frmHelp.OpenHTMLFile('turbopower_help.html');
end;

procedure TfrmRequestHelp.mmiFormHelpClick(Sender: TObject);
begin
  frmHelp.Show;
  frmHelp.OpenHTMLFile('syn_help.html');
end;

procedure TfrmRequestHelp.mmiOpenClick(Sender: TObject);
begin
  with OpenDialog1 do
    begin
      if Execute then
        begin
          InitialDir := '';  //current directory (folder)
          CurrentPathname := Filename;
          SynEdit1.Lines.LoadFromFile(CurrentPathname);
        end;
    end;
end;

procedure TfrmRequestHelp.mmiSaveAsClick(Sender: TObject);
begin
  with SaveDialog1 do
    begin
      if Execute then
        begin
          InitialDir := '';  //current directory (folder)
          CurrentPathname := Filename; //the path you navigate to plus the name you type
          {Add the extension if not present so that you can find
           the file easily with the filter set}
          if pos('.', CurrentPathname ) < 1 then
            CurrentPathname := CurrentPathname + '.html';
          SynEdit1.Lines.SaveToFile(CurrentPathname);
        end;
    end;
end;

procedure TfrmRequestHelp.mmiSaveClick(Sender: TObject);
begin
  if pos('.', CurrentPathname ) < 1 then
    CurrentPathname := CurrentPathname + '.html';
  SynEdit1.Lines.SaveToFile(CurrentPathname);
end;

end.

HelpDemoLaz.lpr

program HelpDemoLaz;

{$mode objfpc}{$H+}
{$apptype gui}

uses
  Interfaces,
  Forms, uHelpDemo, uHelp, turbopoweripro;
begin
  Application.Initialize;
  Application.CreateForm(TfrmRequestHelp, frmRequestHelp);
  Application.CreateForm(TfrmHelp, frmHelp);
  Application.Run;
end.

HelpDemoLaz.lpi

<?xml version="1.0"?>
<CONFIG>
  <ProjectOptions>
    <Version Value="9"/>
    <PathDelim Value="\"/>
    <General>
      <MainUnit Value="0"/>
      <ResourceType Value="res"/>
      <UseXPManifest Value="True"/>
      <ActiveWindowIndexAtStart Value="0"/>
    </General>
    <i18n>
      <EnableI18N LFM="False"/>
    </i18n>
    <VersionInfo>
      <StringTable ProductVersion=""/>
    </VersionInfo>
    <BuildModes Count="1" Active="Default">
      <Item1 Name="Default" Default="True"/>
    </BuildModes>
    <PublishOptions/>     
    <RunParams>
      <local>
        <FormatVersion Value="1"/>
      </local>
    </RunParams>
    <RequiredPackages Count="3">
      <Item1>
        <PackageName Value="TurboPowerIPro"/>
      </Item1>
      <Item2>
        <PackageName Value="SynEdit"/>
      </Item2>
      <Item3>
        <PackageName Value="LCL"/>
      </Item3>
    </RequiredPackages>
    <Units Count="5">
      <Unit0>
        <Filename Value="HelpDemoLaz.lpr"/>
        <IsPartOfProject Value="True"/>        
      </Unit0>
      <Unit1>
        <Filename Value="uHelpDemo.pas"/>
        <IsPartOfProject Value="True"/>
        <ComponentName Value="frmRequestHelp"/>
        <HasResources Value="True"/>
        <ResourceBaseClass Value="Form"/>
        <UnitName Value="uHelpDemo"/>      
      </Unit1>
      <Unit2>
        <Filename Value="uHelp.lfm"/>
        <IsPartOfProject Value="True"/>    
        <DefaultSyntaxHighlighter Value="LFM"/>
      </Unit2>
      <Unit3>
        <Filename Value="uHelp.pas"/>
        <IsPartOfProject Value="True"/>
        <ComponentName Value="frmHelp"/>
        <HasResources Value="True"/>
        <ResourceBaseClass Value="Form"/>
        <UnitName Value="uHelp"/>  
      </Unit3>
      <Unit4>
        <Filename Value="uHelpDemo.lfm"/>
        <IsPartOfProject Value="True"/>  
        <DefaultSyntaxHighlighter Value="LFM"/>
      </Unit4>
    </Units>    
  </ProjectOptions>
  <CompilerOptions>
    <Version Value="9"/>
    <PathDelim Value="\"/>
    <Target>
      <Filename Value="HelpDemoLaz"/>
    </Target>
    <SearchPaths>
      <IncludeFiles Value="$(ProjOutDir)"/>
      <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
    </SearchPaths>
    <Linking>
      <Options>
        <Win32>
          <GraphicApplication Value="True"/>
        </Win32>
      </Options>
    </Linking>
    <Other>
      <CompilerMessages>
        <UseMsgFile Value="True"/>
      </CompilerMessages>
      <CompilerPath Value="$(CompPath)"/>
    </Other>
  </CompilerOptions>
  <Debugging>
    <Exceptions Count="3">
      <Item1>
        <Name Value="EAbort"/>
      </Item1>
      <Item2>
        <Name Value="ECodetoolError"/>
      </Item2>
      <Item3>
        <Name Value="EFOpenError"/>
      </Item3>
    </Exceptions>
  </Debugging>
</CONFIG>

uHelpDemo.lfm

object frmRequestHelp: TfrmRequestHelp
  Left = 387
  Height = 363
  Top = 187
  Width = 799
  Caption = 'Request Help'
  ClientHeight = 334
  ClientWidth = 799
  Menu = mmRequestHelp
  OnCreate = FormCreate
  OnResize = FormResize
  LCLVersion = '0.9.30'
  object btnHelp: TButton
    Left = 720
    Height = 25
    Top = 0
    Width = 75
    Caption = 'Help'
    OnClick = btnHelpClick
    TabOrder = 0
  end
  inline SynEdit1: TSynEdit
    Left = 0
    Height = 305
    Top = 24
    Width = 800
    Font.Height = -13
    Font.Name = 'Courier New'
    Font.Pitch = fpFixed
    Font.Quality = fqNonAntialiased
    ParentColor = False
    ParentFont = False
    TabOrder = 1
    Gutter.Width = 57
    Gutter.MouseActions = <    
      item
        Shift = []
        ShiftMask = []
        Button = mbLeft
        ClickCount = ccAny
        ClickDir = cdDown
        Command = 13
        MoveCaret = False
        Option = 0
        Priority = 0
      end    
      item
        Shift = []
        ShiftMask = []
        Button = mbRight
        ClickCount = ccSingle
        ClickDir = cdUp
        Command = 12
        MoveCaret = False
        Option = 0
        Priority = 0
      end>
    RightGutter.Width = 0
    RightGutter.MouseActions = <    
      item
        Shift = []
        ShiftMask = []
        Button = mbLeft
        ClickCount = ccAny
        ClickDir = cdDown
        Command = 13
        MoveCaret = False
        Option = 0
        Priority = 0
      end    
      item
        Shift = []
        ShiftMask = []
        Button = mbRight
        ClickCount = ccSingle
        ClickDir = cdUp
        Command = 12
        MoveCaret = False
        Option = 0
        Priority = 0
      end>
    Highlighter = SynHTMLSyn1
    Keystrokes = <    
      item
        Command = ecUp
        ShortCut = 38
      end    
      item
        Command = ecSelUp
        ShortCut = 8230
      end    
      item
        Command = ecScrollUp
        ShortCut = 16422
      end    
      item
        Command = ecDown
        ShortCut = 40
      end    
      item
        Command = ecSelDown
        ShortCut = 8232
      end    
      item
        Command = ecScrollDown
        ShortCut = 16424
      end    
      item
        Command = ecLeft
        ShortCut = 37
      end    
      item
        Command = ecSelLeft
        ShortCut = 8229
      end    
      item
        Command = ecWordLeft
        ShortCut = 16421
      end    
      item
        Command = ecSelWordLeft
        ShortCut = 24613
      end    
      item
        Command = ecRight
        ShortCut = 39
      end    
      item
        Command = ecSelRight
        ShortCut = 8231
      end    
      item
        Command = ecWordRight
        ShortCut = 16423
      end    
      item
        Command = ecSelWordRight
        ShortCut = 24615
      end    
      item
        Command = ecPageDown
        ShortCut = 34
      end    
      item
        Command = ecSelPageDown
        ShortCut = 8226
      end    
      item
        Command = ecPageBottom
        ShortCut = 16418
      end    
      item
        Command = ecSelPageBottom
        ShortCut = 24610
      end    
      item
        Command = ecPageUp
        ShortCut = 33
      end    
      item
        Command = ecSelPageUp
        ShortCut = 8225
      end    
      item
        Command = ecPageTop
        ShortCut = 16417
      end    
      item
        Command = ecSelPageTop
        ShortCut = 24609
      end    
      item
        Command = ecLineStart
        ShortCut = 36
      end    
      item
        Command = ecSelLineStart
        ShortCut = 8228
      end    
      item
        Command = ecEditorTop
        ShortCut = 16420
      end    
      item
        Command = ecSelEditorTop
        ShortCut = 24612
      end    
      item
        Command = ecLineEnd
        ShortCut = 35
      end    
      item
        Command = ecSelLineEnd
        ShortCut = 8227
      end    
      item
        Command = ecEditorBottom
        ShortCut = 16419
      end    
      item
        Command = ecSelEditorBottom
        ShortCut = 24611
      end    
      item
        Command = ecToggleMode
        ShortCut = 45
      end    
      item
        Command = ecCopy
        ShortCut = 16429
      end    
      item
        Command = ecPaste
        ShortCut = 8237
      end    
      item
        Command = ecDeleteChar
        ShortCut = 46
      end    
      item
        Command = ecCut
        ShortCut = 8238
      end    
      item
        Command = ecDeleteLastChar
        ShortCut = 8
      end    
      item
        Command = ecDeleteLastChar
        ShortCut = 8200
      end    
      item
        Command = ecDeleteLastWord
        ShortCut = 16392
      end    
      item
        Command = ecUndo
        ShortCut = 32776
      end    
      item
        Command = ecRedo
        ShortCut = 40968
      end    
      item
        Command = ecLineBreak
        ShortCut = 13
      end    
      item
        Command = ecSelectAll
        ShortCut = 16449
      end    
      item
        Command = ecCopy
        ShortCut = 16451
      end    
      item
        Command = ecBlockIndent
        ShortCut = 24649
      end    
      item
        Command = ecLineBreak
        ShortCut = 16461
      end    
      item
        Command = ecInsertLine
        ShortCut = 16462
      end    
      item
        Command = ecDeleteWord
        ShortCut = 16468
      end    
      item
        Command = ecBlockUnindent
        ShortCut = 24661
      end    
      item
        Command = ecPaste
        ShortCut = 16470
      end    
      item
        Command = ecCut
        ShortCut = 16472
      end    
      item
        Command = ecDeleteLine
        ShortCut = 16473
      end    
      item
        Command = ecDeleteEOL
        ShortCut = 24665
      end    
      item
        Command = ecUndo
        ShortCut = 16474
      end    
      item
        Command = ecRedo
        ShortCut = 24666
      end    
      item
        Command = ecGotoMarker0
        ShortCut = 16432
      end    
      item
        Command = ecGotoMarker1
        ShortCut = 16433
      end    
      item
        Command = ecGotoMarker2
        ShortCut = 16434
      end    
      item
        Command = ecGotoMarker3
        ShortCut = 16435
      end    
      item
        Command = ecGotoMarker4
        ShortCut = 16436
      end    
      item
        Command = ecGotoMarker5
        ShortCut = 16437
      end    
      item
        Command = ecGotoMarker6
        ShortCut = 16438
      end    
      item
        Command = ecGotoMarker7
        ShortCut = 16439
      end    
      item
        Command = ecGotoMarker8
        ShortCut = 16440
      end    
      item
        Command = ecGotoMarker9
        ShortCut = 16441
      end    
      item
        Command = ecSetMarker0
        ShortCut = 24624
      end    
      item
        Command = ecSetMarker1
        ShortCut = 24625
      end    
      item
        Command = ecSetMarker2
        ShortCut = 24626
      end    
      item
        Command = ecSetMarker3
        ShortCut = 24627
      end    
      item
        Command = ecSetMarker4
        ShortCut = 24628
      end    
      item
        Command = ecSetMarker5
        ShortCut = 24629
      end    
      item
        Command = ecSetMarker6
        ShortCut = 24630
      end    
      item
        Command = ecSetMarker7
        ShortCut = 24631
      end    
      item
        Command = ecSetMarker8
        ShortCut = 24632
      end    
      item
        Command = ecSetMarker9
        ShortCut = 24633
      end    
      item
        Command = EcFoldLevel1
        ShortCut = 41009
      end    
      item
        Command = EcFoldLevel2
        ShortCut = 41010
      end    
      item
        Command = EcFoldLevel1
        ShortCut = 41011
      end    
      item
        Command = EcFoldLevel1
        ShortCut = 41012
      end    
      item
        Command = EcFoldLevel1
        ShortCut = 41013
      end    
      item
        Command = EcFoldLevel6
        ShortCut = 41014
      end    
      item
        Command = EcFoldLevel7
        ShortCut = 41015
      end    
      item
        Command = EcFoldLevel8
        ShortCut = 41016
      end    
      item
        Command = EcFoldLevel9
        ShortCut = 41017
      end    
      item
        Command = EcFoldLevel0
        ShortCut = 41008
      end    
      item
        Command = EcFoldCurrent
        ShortCut = 41005
      end    
      item
        Command = EcUnFoldCurrent
        ShortCut = 41003
      end    
      item
        Command = EcToggleMarkupWord
        ShortCut = 32845
      end    
      item
        Command = ecNormalSelect
        ShortCut = 24654
      end    
      item
        Command = ecColumnSelect
        ShortCut = 24643
      end    
      item
        Command = ecLineSelect
        ShortCut = 24652
      end    
      item
        Command = ecTab
        ShortCut = 9
      end    
      item
        Command = ecShiftTab
        ShortCut = 8201
      end    
      item
        Command = ecMatchBracket
        ShortCut = 24642
      end    
      item
        Command = ecColSelUp
        ShortCut = 40998
      end    
      item
        Command = ecColSelDown
        ShortCut = 41000
      end    
      item
        Command = ecColSelLeft
        ShortCut = 40997
      end    
      item
        Command = ecColSelRight
        ShortCut = 40999
      end    
      item
        Command = ecColSelPageDown
        ShortCut = 40994
      end    
      item
        Command = ecColSelPageBottom
        ShortCut = 57378
      end    
      item
        Command = ecColSelPageUp
        ShortCut = 40993
      end    
      item
        Command = ecColSelPageTop
        ShortCut = 57377
      end    
      item
        Command = ecColSelLineStart
        ShortCut = 40996
      end    
      item
        Command = ecColSelLineEnd
        ShortCut = 40995
      end    
      item
        Command = ecColSelEditorTop
        ShortCut = 57380
      end    
      item
        Command = ecColSelEditorBottom
        ShortCut = 57379
      end>
    MouseActions = <    
      item
        Shift = []
        ShiftMask = [ssShift, ssAlt]
        Button = mbLeft
        ClickCount = ccSingle
        ClickDir = cdDown
        Command = 1
        MoveCaret = True
        Option = 0
        Priority = 0
      end    
      item
        Shift = [ssShift]
        ShiftMask = [ssShift, ssAlt]
        Button = mbLeft
        ClickCount = ccSingle
        ClickDir = cdDown
        Command = 1
        MoveCaret = True
        Option = 1
        Priority = 0
      end    
      item
        Shift = [ssAlt]
        ShiftMask = [ssShift, ssAlt]
        Button = mbLeft
        ClickCount = ccSingle
        ClickDir = cdDown
        Command = 3
        MoveCaret = True
        Option = 0
        Priority = 0
      end    
      item
        Shift = [ssShift, ssAlt]
        ShiftMask = [ssShift, ssAlt]
        Button = mbLeft
        ClickCount = ccSingle
        ClickDir = cdDown
        Command = 3
        MoveCaret = True
        Option = 1
        Priority = 0
      end    
      item
        Shift = []
        ShiftMask = []
        Button = mbRight
        ClickCount = ccSingle
        ClickDir = cdUp
        Command = 12
        MoveCaret = False
        Option = 0
        Priority = 0
      end    
      item
        Shift = []
        ShiftMask = []
        Button = mbLeft
        ClickCount = ccDouble
        ClickDir = cdDown
        Command = 6
        MoveCaret = True
        Option = 0
        Priority = 0
      end    
      item
        Shift = []
        ShiftMask = []
        Button = mbLeft
        ClickCount = ccTriple
        ClickDir = cdDown
        Command = 7
        MoveCaret = True
        Option = 0
        Priority = 0
      end    
      item
        Shift = []
        ShiftMask = []
        Button = mbLeft
        ClickCount = ccQuad
        ClickDir = cdDown
        Command = 8
        MoveCaret = True
        Option = 0
        Priority = 0
      end    
      item
        Shift = []
        ShiftMask = []
        Button = mbMiddle
        ClickCount = ccSingle
        ClickDir = cdDown
        Command = 10
        MoveCaret = True
        Option = 0
        Priority = 0
      end    
      item
        Shift = [ssCtrl]
        ShiftMask = [ssShift, ssAlt, ssCtrl]
        Button = mbLeft
        ClickCount = ccSingle
        ClickDir = cdUp
        Command = 11
        MoveCaret = False
        Option = 0
        Priority = 0
      end>
    MouseSelActions = <    
      item
        Shift = []
        ShiftMask = []
        Button = mbLeft
        ClickCount = ccSingle
        ClickDir = cdDown
        Command = 9
        MoveCaret = False
        Option = 0
        Priority = 0
      end>
    Options = [eoAutoIndent, eoGroupUndo, eoScrollPastEol, eoSmartTabs, eoTabsToSpaces, eoTrimTrailingSpaces, eoBracketHighlight, eoHideRightMargin]
    ScrollBars = ssAutoVertical
    BracketHighlightStyle = sbhsBoth
    inline SynLeftGutterPartList1: TSynGutterPartList
      object SynGutterMarks1: TSynGutterMarks
        Width = 24
      end
      object SynGutterLineNumber1: TSynGutterLineNumber
        Width = 17
        MouseActions = <>
        MarkupInfo.Background = clBtnFace
        MarkupInfo.Foreground = clNone
        DigitCount = 2
        ShowOnlyLineNumbersMultiplesOf = 1
        ZeroStart = False
        LeadingZeros = False
      end
      object SynGutterChanges1: TSynGutterChanges
        Width = 4
        ModifiedColor = 59900
        SavedColor = clGreen
      end
      object SynGutterSeparator1: TSynGutterSeparator
        Width = 2
      end
      object SynGutterCodeFolding1: TSynGutterCodeFolding
        MouseActions = <        
          item
            Shift = []
            ShiftMask = []
            Button = mbRight
            ClickCount = ccSingle
            ClickDir = cdUp
            Command = 16
            MoveCaret = False
            Option = 0
            Priority = 0
          end        
          item
            Shift = []
            ShiftMask = [ssShift]
            Button = mbMiddle
            ClickCount = ccAny
            ClickDir = cdDown
            Command = 14
            MoveCaret = False
            Option = 0
            Priority = 0
          end        
          item
            Shift = [ssShift]
            ShiftMask = [ssShift]
            Button = mbMiddle
            ClickCount = ccAny
            ClickDir = cdDown
            Command = 14
            MoveCaret = False
            Option = 1
            Priority = 0
          end        
          item
            Shift = []
            ShiftMask = []
            Button = mbLeft
            ClickCount = ccAny
            ClickDir = cdDown
            Command = 0
            MoveCaret = False
            Option = 0
            Priority = 0
          end>
        MarkupInfo.Background = clNone
        MarkupInfo.Foreground = clGray
        MouseActionsExpanded = <        
          item
            Shift = []
            ShiftMask = []
            Button = mbLeft
            ClickCount = ccAny
            ClickDir = cdDown
            Command = 14
            MoveCaret = False
            Option = 0
            Priority = 0
          end>
        MouseActionsCollapsed = <        
          item
            Shift = [ssCtrl]
            ShiftMask = [ssCtrl]
            Button = mbLeft
            ClickCount = ccAny
            ClickDir = cdDown
            Command = 15
            MoveCaret = False
            Option = 0
            Priority = 0
          end        
          item
            Shift = []
            ShiftMask = [ssCtrl]
            Button = mbLeft
            ClickCount = ccAny
            ClickDir = cdDown
            Command = 15
            MoveCaret = False
            Option = 1
            Priority = 0
          end>
      end
    end
  end
  object btnFont: TButton
    Left = 624
    Height = 25
    Top = 0
    Width = 91
    Caption = 'Change Font'
    OnClick = btnFontClick
    TabOrder = 2
  end
  object mmRequestHelp: TMainMenu
    left = 63
    top = 65510
    object mmiFile: TMenuItem
      Caption = '&File'
      object mmiOpen: TMenuItem
        Caption = '&Open'
        OnClick = mmiOpenClick
      end
      object mmiSave: TMenuItem
        Caption = '&Save'
        OnClick = mmiSaveClick
      end
      object mmiSaveAs: TMenuItem
        Caption = 'Save &As'
        OnClick = mmiSaveAsClick
      end
    end
    object mmiHelp: TMenuItem
      Caption = '&Help'
      object mmiFormHelp: TMenuItem
        Caption = 'Help with this &form'
        OnClick = mmiFormHelpClick
      end
      object mmiBrowser: TMenuItem
        Caption = 'Help with the browser'
        OnClick = mmiBrowserClick
      end
      object mmiAbout: TMenuItem
        Caption = '&About HelpDemoLaz'
        OnClick = mmiAboutClick
      end
    end
  end
  object SynHTMLSyn1: TSynHTMLSyn
    DefaultFilter = 'HTML Document (*.htm,*.html)|*.htm;*.html'
    Enabled = False
    AndAttri.FrameEdges = sfeAround
    ASPAttri.FrameEdges = sfeAround
    CommentAttri.Foreground = clBlue
    CommentAttri.FrameEdges = sfeAround
    CommentAttri.Style = [fsBold]
    IdentifierAttri.FrameEdges = sfeAround
    KeyAttri.FrameEdges = sfeAround
    SpaceAttri.FrameEdges = sfeAround
    SymbolAttri.Foreground = clRed
    SymbolAttri.FrameEdges = sfeAround
    TextAttri.FrameEdges = sfeAround
    UndefKeyAttri.FrameEdges = sfeAround
    ValueAttri.FrameEdges = sfeAround
    left = 152
    top = 65528
  end
  object OpenDialog1: TOpenDialog
    Filter = 'HTML file|*.html|All files|*.*'
    left = 288
    top = 65507
  end
  object SaveDialog1: TSaveDialog
    Filter = 'HTML file|*.html|All files|*.*'
    left = 406
    top = 65509
  end
  object FontDialog1: TFontDialog
    MinFontSize = 0
    MaxFontSize = 0
    left = 528
    top = 65528
  end
end
Programming - a skill for life!

How to provide help in Delphi and Lazarus applications