From 2d123ad52af73375018cc0cd3b012c105a65aee9 Mon Sep 17 00:00:00 2001 From: Ansgar Becker Date: Tue, 25 Nov 2008 20:11:50 +0000 Subject: [PATCH] Replace TMemos by TSynMemos in SQL help window and add URI openers. Enables linked URIs in text. --- source/sqlhelp.dfm | 64 ++++++++++++++++++++++++++++++++++++++-------- source/sqlhelp.pas | 10 +++++--- 2 files changed, 61 insertions(+), 13 deletions(-) diff --git a/source/sqlhelp.dfm b/source/sqlhelp.dfm index 8d0a6cde..d18be109 100644 --- a/source/sqlhelp.dfm +++ b/source/sqlhelp.dfm @@ -126,7 +126,7 @@ object frmSQLhelp: TfrmSQLhelp Align = alTop Caption = 'Description:' end - object memoDescription: TMemo + object memoDescription: TSynMemo AlignWithMargins = True Left = 0 Top = 44 @@ -136,13 +136,27 @@ object frmSQLhelp: TfrmSQLhelp Margins.Top = 5 Margins.Right = 0 Margins.Bottom = 0 + SingleLineMode = False Align = alClient - Lines.Strings = ( - 'memoDescription') - ReadOnly = True - ScrollBars = ssBoth + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Courier New' + Font.Style = [] TabOrder = 0 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 pnlRightBottom: TPanel @@ -178,7 +192,7 @@ object frmSQLhelp: TfrmSQLhelp Caption = 'Search online' OnClick = ButtonOnlinehelpClick end - object MemoExample: TMemo + object MemoExample: TSynMemo AlignWithMargins = True Left = 0 Top = 23 @@ -188,14 +202,28 @@ object frmSQLhelp: TfrmSQLhelp Margins.Top = 5 Margins.Right = 0 Margins.Bottom = 0 + SingleLineMode = False Align = alTop Anchors = [akLeft, akTop, akRight, akBottom] - Lines.Strings = ( - 'MemoExample') - ReadOnly = True - ScrollBars = ssBoth + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Courier New' + Font.Style = [] TabOrder = 0 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 object ButtonClose: TButton Left = 316 @@ -212,4 +240,20 @@ object frmSQLhelp: TfrmSQLhelp 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 diff --git a/source/sqlhelp.pas b/source/sqlhelp.pas index dfc27624..bf92aa5d 100644 --- a/source/sqlhelp.pas +++ b/source/sqlhelp.pas @@ -5,7 +5,8 @@ interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ComCtrls, ExtCtrls, ShellApi, Buttons, Registry, - childwin, PngSpeedButton; + childwin, PngSpeedButton, SynMemo, SynEditHighlighter, SynHighlighterURI, + SynURIOpener, SynEdit; type TfrmSQLhelp = class(TForm) @@ -18,13 +19,16 @@ type pnlRightTop: TPanel; lblKeyword: TLabel; lblDescription: TLabel; - memoDescription: TMemo; + memoDescription: TSynMemo; Splitter2: TSplitter; pnlRightBottom: TPanel; lblExample: TLabel; - MemoExample: TMemo; + MemoExample: TSynMemo; ButtonClose: TButton; btnSearchOnline: TPngSpeedButton; + URIOpenerDescription: TSynURIOpener; + URIHighlighter: TSynURISyn; + URIOpenerExample: TSynURIOpener; procedure FormCreate(Sender: TObject); procedure treeTopicsExpanding(Sender: TObject; Node: TTreeNode; var AllowExpansion: Boolean);