Replace TMemos by TSynMemos in SQL help window and add URI openers. Enables linked URIs in text.

This commit is contained in:
Ansgar Becker
2008-11-25 20:11:50 +00:00
parent d515c89055
commit 2d123ad52a
2 changed files with 61 additions and 13 deletions

View File

@ -126,7 +126,7 @@ object frmSQLhelp: TfrmSQLhelp
Align = alTop Align = alTop
Caption = 'Description:' Caption = 'Description:'
end end
object memoDescription: TMemo object memoDescription: TSynMemo
AlignWithMargins = True AlignWithMargins = True
Left = 0 Left = 0
Top = 44 Top = 44
@ -136,13 +136,27 @@ object frmSQLhelp: TfrmSQLhelp
Margins.Top = 5 Margins.Top = 5
Margins.Right = 0 Margins.Right = 0
Margins.Bottom = 0 Margins.Bottom = 0
SingleLineMode = False
Align = alClient Align = alClient
Lines.Strings = ( Font.Charset = DEFAULT_CHARSET
'memoDescription') Font.Color = clWindowText
ReadOnly = True Font.Height = -13
ScrollBars = ssBoth Font.Name = 'Courier New'
Font.Style = []
TabOrder = 0 TabOrder = 0
OnKeyDown = memosKeyDown OnKeyDown = memosKeyDown
Gutter.Font.Charset = DEFAULT_CHARSET
Gutter.Font.Color = clWindowText
Gutter.Font.Height = -11
Gutter.Font.Name = 'Courier New'
Gutter.Font.Style = []
Gutter.Visible = False
Gutter.Width = 0
Highlighter = URIHighlighter
Options = [eoAutoIndent, eoDragDropEditing, eoEnhanceEndKey, eoGroupUndo, eoHideShowScrollbars, eoShowScrollHint, eoSmartTabDelete, eoSmartTabs, eoTabsToSpaces]
ReadOnly = True
RightEdge = 0
WordWrap = True
end end
end end
object pnlRightBottom: TPanel object pnlRightBottom: TPanel
@ -178,7 +192,7 @@ object frmSQLhelp: TfrmSQLhelp
Caption = 'Search online' Caption = 'Search online'
OnClick = ButtonOnlinehelpClick OnClick = ButtonOnlinehelpClick
end end
object MemoExample: TMemo object MemoExample: TSynMemo
AlignWithMargins = True AlignWithMargins = True
Left = 0 Left = 0
Top = 23 Top = 23
@ -188,14 +202,28 @@ object frmSQLhelp: TfrmSQLhelp
Margins.Top = 5 Margins.Top = 5
Margins.Right = 0 Margins.Right = 0
Margins.Bottom = 0 Margins.Bottom = 0
SingleLineMode = False
Align = alTop Align = alTop
Anchors = [akLeft, akTop, akRight, akBottom] Anchors = [akLeft, akTop, akRight, akBottom]
Lines.Strings = ( Font.Charset = DEFAULT_CHARSET
'MemoExample') Font.Color = clWindowText
ReadOnly = True Font.Height = -13
ScrollBars = ssBoth Font.Name = 'Courier New'
Font.Style = []
TabOrder = 0 TabOrder = 0
OnKeyDown = memosKeyDown OnKeyDown = memosKeyDown
Gutter.Font.Charset = DEFAULT_CHARSET
Gutter.Font.Color = clWindowText
Gutter.Font.Height = -11
Gutter.Font.Name = 'Courier New'
Gutter.Font.Style = []
Gutter.Visible = False
Gutter.Width = 0
Highlighter = URIHighlighter
Options = [eoAutoIndent, eoDragDropEditing, eoEnhanceEndKey, eoGroupUndo, eoHideShowScrollbars, eoShowScrollHint, eoSmartTabDelete, eoSmartTabs, eoTabsToSpaces]
ReadOnly = True
RightEdge = 0
WordWrap = True
end end
object ButtonClose: TButton object ButtonClose: TButton
Left = 316 Left = 316
@ -212,4 +240,20 @@ object frmSQLhelp: TfrmSQLhelp
end end
end end
end end
object URIOpenerDescription: TSynURIOpener
Editor = memoDescription
URIHighlighter = URIHighlighter
Left = 448
Top = 8
end
object URIHighlighter: TSynURISyn
Left = 416
Top = 8
end
object URIOpenerExample: TSynURIOpener
Editor = MemoExample
URIHighlighter = URIHighlighter
Left = 480
Top = 8
end
end end

View File

@ -5,7 +5,8 @@ interface
uses uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ComCtrls, ExtCtrls, ShellApi, Buttons, Registry, Dialogs, StdCtrls, ComCtrls, ExtCtrls, ShellApi, Buttons, Registry,
childwin, PngSpeedButton; childwin, PngSpeedButton, SynMemo, SynEditHighlighter, SynHighlighterURI,
SynURIOpener, SynEdit;
type type
TfrmSQLhelp = class(TForm) TfrmSQLhelp = class(TForm)
@ -18,13 +19,16 @@ type
pnlRightTop: TPanel; pnlRightTop: TPanel;
lblKeyword: TLabel; lblKeyword: TLabel;
lblDescription: TLabel; lblDescription: TLabel;
memoDescription: TMemo; memoDescription: TSynMemo;
Splitter2: TSplitter; Splitter2: TSplitter;
pnlRightBottom: TPanel; pnlRightBottom: TPanel;
lblExample: TLabel; lblExample: TLabel;
MemoExample: TMemo; MemoExample: TSynMemo;
ButtonClose: TButton; ButtonClose: TButton;
btnSearchOnline: TPngSpeedButton; btnSearchOnline: TPngSpeedButton;
URIOpenerDescription: TSynURIOpener;
URIHighlighter: TSynURISyn;
URIOpenerExample: TSynURIOpener;
procedure FormCreate(Sender: TObject); procedure FormCreate(Sender: TObject);
procedure treeTopicsExpanding(Sender: TObject; Node: TTreeNode; procedure treeTopicsExpanding(Sender: TObject; Node: TTreeNode;
var AllowExpansion: Boolean); var AllowExpansion: Boolean);