📄 fjveditortest.dfm
字号:
object frmEditor: TfrmEditor
Left = 321
Top = 100
Width = 549
Height = 428
Caption = 'TJvEditor and TJvHLEditor components demo'
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = True
ShowHint = True
OnCreate = FormCreate
OnDestroy = FormDestroy
PixelsPerInch = 96
TextHeight = 13
object PageControl1: TPageControl
Left = 0
Top = 33
Width = 541
Height = 349
ActivePage = TabSheet12
Align = alClient
TabOrder = 0
TabStop = False
OnChange = PageControl1Change
OnEnter = PageControl1Enter
object TabSheet1: TTabSheet
Caption = 'Delphi'
object JvEditor: TJvHLEditor
Left = 0
Top = 0
Width = 533
Height = 321
Cursor = crIBeam
Lines.Strings = (
'unit fJvEditorTest;'
''
'interface'
''
'uses'
' Windows, Messages, SysUtils, Classes, Graphics, Controls, Form' +
's, Dialogs,'
' JvEditor, IParser, StdCtrls, ExtCtrls, ComCtrls;'
''
'type'
' TJvEditor = class(TForm)'
' GutterImages: TImageList;'
' PageControl1: TPageControl;'
' TabSheet1: TTabSheet;'
' JvEditor: TJvEditor;'
' TabSheet2: TTabSheet;'
' RAEditor1: TJvEditor;'
' TabSheet3: TTabSheet;'
' RAEditor2: TJvEditor;'
' TabSheet4: TTabSheet;'
' TabSheet5: TTabSheet;'
' RAEditor3: TJvEditor;'
' RAEditor4: TJvEditor;'
' Panel1: TPanel;'
' Label1: TLabel;'
' Label2: TLabel;'
' ilCompletions: TImageList;'
' procedure FormCreate(Sender: TObject);'
' procedure FormDestroy(Sender: TObject);'
' procedure RAEditorGetLineAttr(Sender: TJvEditor; var Line: S' +
'tring;'
' index: Integer; var Attrs: TLineAttrs);'
' procedure RAEditorPaintGutter(Sender: TJvEditor; Canvas: TCa' +
'nvas);'
' procedure PageControl1Change(Sender: TObject);'
' procedure PageControl1Enter(Sender: TObject);'
' procedure RAEditorCompletionDrawItem(Control: TWinControl;'
' Index: Integer; Rect: TRect; State: TOwnerDrawState);'
' private'
' Parser : TJvIParser;'
' end;'
''
'var'
' Editor: TJvEditor ;'
''
'implementation'
''
'uses RAUtilsW;'
''
'{$R *.DFM}'
''
'procedure TJvEditor .RAEditorGetLineAttr(Sender: TJvEditor; var ' +
'Line: String;'
' index: Integer; var Attrs: TLineAttrs);'
''
' procedure SetColor(FC, BC : TColor; Style : TFontStyles);'
' var'
' i : integer;'
' begin'
' for i := Parser.PosBeg[0]+1 to Parser.PosEnd[0] do begin'
' Attrs[i].FC := FC;'
' Attrs[i].BC := BC;'
' Attrs[i].Style := Style;'
' end;'
' end;'
'var'
' Token : string;'
' i : integer;'
'const'
' Symbols = ['#39','#39', '#39':'#39', '#39';'#39', '#39'.'#39', '#39'['#39', '#39']'#39', '#39'('#39', '#39')'#39', '#39'='#39', '#39'+'#39','
' '#39'-'#39', '#39'/'#39', '#39'<'#39', '#39'>'#39', '#39'%'#39', '#39'*'#39', '#39'~'#39', '#39#39#39#39', '#39'\'#39', '#39'^'#39'];'
'const'
' DelphiKeyWords : string ='
' '#39' constructor destructor record procedure with of '#39'+'
' '#39'repeat until try finally except for to downto case ' +
' '#39'+'
' '#39'type interface implementation initialization finalizati' +
'on '#39'+'
' '#39'default private public protected published automated ' +
' property '#39'+'
' '#39'program read write override object nil raise '#39'+'
' '#39'on set xor shr shl begin end args if then else '#39 +
'+'
' '#39'endif goto while do var true false or and not mod' +
' unit '#39'+'
' '#39'function uses external const class inherited '#39
' ;'
''
' BuilderKeyWords : string ='
' '#39' __asm _asm asm auto __automated break bool case ca' +
'tch __cdecl '#39'+'
' '#39'_cdecl cdecl char class __classid __closure const co' +
'nst_cast '#39'+'
' '#39'continue __declspec default delete __dispid do double' +
' dynamic_cast '#39'+'
' '#39'else enum __except explicit _export __export extern ' +
'false __fastcall '#39'+'
' '#39'_fastcall __finally float for friend goto if __impor' +
't _import inline '#39'+'
' '#39'int __int8 __int16 __int32 __int64 long mutable name' +
'space new operator '#39'+'
' '#39'__pascal _pascal pascal private protected __property ' +
'public __published '#39'+'
' '#39'register reinterpret_cast return __rtti short signed ' +
'sizeof static static_cast '#39'+'
' '#39'__stdcall _stdcall struct switch template this __thre' +
'ad throw true __try '#39'+'
' '#39'try typedef typename typeid union using unsigned vir' +
'tual void volatile '#39'+'
' '#39'wchar_t while '#39
' ;'
''
' SQLKeyWords : string ='
' '#39' active as add asc after ascending all at alter a' +
'uto '#39'+'
' '#39'and autoddl any avg based between basename blob '#39'+'
' '#39'base_name blobedit before buffer begin by cache com' +
'piletime '#39'+'
' '#39'cast computed char close character conditional cha' +
'racter_length connect '#39'+'
' '#39'char_length constraint check containing check_point_l' +
'en continue check_point_length count '#39'+'
' '#39'collate create collation cstring column current co' +
'mmit cursor '#39'+'
' '#39'committed database descending date describe db_key ' +
' descriptor debug disconnect '#39'+'
' '#39'dec display decimal distinct declare do default do' +
'main '#39'+'
' '#39'delete double desc drop echo exception edit execute' +
' '#39'+'
' '#39'else exists end exit entry_point extern escape e' +
'xternal '#39'+'
' '#39'event extract fetch foreign file found filter fro' +
'm '#39'+'
' '#39'float full for function gdscode grant generator gr' +
'oup '#39'+'
' '#39'gen_id commit_group_wait global group_commit_wait_time ' +
'goto '#39'+'
' '#39'having help if input_type immediate insert in int ' +
' '#39'+'
' '#39'inactive integer index into indicator is init iso' +
'lation '#39'+'
' '#39'inner isql input join key '#39'+'
' '#39'lc_messages like lc_type logfile left log_buffer_siz' +
'e length log_buf_size '#39'+'
' '#39'lev long level manual merge max message '#39'+'
' '#39'maximum min maximum_segment minimum max_segment modu' +
'le_name names not '#39'+'
' '#39'national null natural numeric nchar num_log_bufs no' +
' num_log_buffers '#39'+'
' '#39'noauto octet_length or of order on outer only out' +
'put '#39'+'
' '#39'open output_type option overflow page post_event page' +
'length precision '#39'+'
' '#39'pages prepare page_size procedure parameter protecte' +
'd password primary '#39'+'
' '#39'plan privileges position public quit '#39'+'
' '#39'raw_partitions retain rdb db_key return read retur' +
'ning_values real returns '#39'+'
' '#39'record_version revoke references right release rollb' +
'ack reserv runtime '#39'+'
' '#39'reserving schema sql segment sqlcode select sqlerr' +
'or set sqlwarning '#39'+'
' '#39'shadow stability shared starting shell starts show' +
' statement '#39'+'
' '#39'singular static size statistics smallint sub_type ' +
'snapshot sum '#39'+'
' '#39'some suspend sort table translate terminator transl' +
'ation then trigger to trim '#39'+'
' '#39'transaction uncommitted upper union user unique usin' +
'g update '#39'+'
' '#39'value varying values version varchar view variable '#39 +
'+'
' '#39'wait while when with whenever work where write '#39'+'
''
' '#39'term new old '#39
' ;'
''
' function IsDelphiKeyWord(St : string) : boolean;'
' begin'
' Result := Pos('#39' '#39'+ANSILowerCase(St)+'#39' '#39', DelphiKeyWords) <> ' +
'0;'
' end;'
' function IsBuilderKeyWord(St : string) : boolean;'
' begin'
' Result := Pos('#39' '#39'+St+'#39' '#39', BuilderKeyWords) <> 0;'
' end;'
' function IsSQLKeyWord(St : string) : boolean;'
' begin'
' Result := Pos('#39' '#39'+ANSILowerCase(St)+'#39' '#39', SQLKeyWords) <> 0;'
' end;'
''
' function IsStringConstant(St : string) : boolean;'
' var'
' LS : integer;'
' begin'
' LS := Length(St);'
' if (LS >= 2) and (((St[1] = '#39#39#39#39') and (St[LS] = '#39#39#39#39')) or ((' +
'St[1] = '#39'"'#39') and (St[LS] = '#39'"'#39'))) then'
' Result := true else'
' Result := false'
' end;'
''
' function IsRealConstant(St : string) : boolean;'
' var'
' i, j : integer;'
' Point : boolean;'
' begin'
' Result := false;'
' if (St = '#39'.'#39') or (St = '#39#39') then exit;'
' if St[1] = '#39'-'#39' then'
' if Length(St) = 1 then exit'
' else j := 2'
' else j := 1;'
' Point := false;'
' for i := j to Length(St) do'
' if St[i] = '#39'.'#39' then'
' if Point then exit else Point := true'
' else if (St[i] < '#39'0'#39') or (St[i] > '#39'9'#39') then exit;'
' Result := true;'
' end;'
''
' function IsIntConstant(St : string) : boolean;'
' var'
' i, j : integer;'
' Sym : set of char;'
' begin'
' Result := false;'
' if (Length(St) = 0) or ((Length(St) = 1) and (St[1]='#39'$'#39')) th' +
'en exit;'
' Sym := StConstSymbols10;'
' if (St[1] = '#39'-'#39') or (St[1] = '#39'$'#39') then begin'
' if Length(St) = 1 then exit'
' else j := 2;'
' if St[1] = '#39'$'#39' then Sym := StConstSymbols;'
' end else j := 1;'
' for i := j to Length(St) do'
' if not (St[i] in Sym) then exit;'
' Result := true;'
' end;'
''
'var'
' F : boolean;'
' L : integer;'
' FC : TColor;'
' FS : TFontStyles;'
'begin'
' Parser.pcProgram := PChar(Line);'
' Parser.pcPos := Parser.pcProgram;'
' L := Sender.Tag;'
' if (L = 1) and (Length(Line) > 0) and (Line[1] = '#39'#'#39') then'
' begin'
' FC := clGreen;'
' FS := Sender.Font.Style;'
' end else'
' begin'
' FC := clOlive; {潆
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -