Стартовый пул

This commit is contained in:
2024-04-02 08:46:59 +03:00
parent fd57fffd3a
commit 3bb34d000b
5591 changed files with 3291734 additions and 0 deletions

View File

@@ -0,0 +1,266 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="9"/>
<PathDelim Value="\"/>
<General>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<AutoCreateForms Value="False"/>
<Title Value="Demo"/>
<ResourceType Value="res"/>
<UseXPManifest Value="True"/>
</General>
<i18n>
<EnableI18N LFM="False"/>
</i18n>
<VersionInfo>
<StringTable ProductVersion=""/>
</VersionInfo>
<BuildModes Count="1">
<Item1 Name="Default" Default="True"/>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
</local>
</RunParams>
<RequiredPackages Count="1">
<Item1>
<PackageName Value="LCL"/>
</Item1>
</RequiredPackages>
<Units Count="37">
<Unit0>
<Filename Value="demo.lpr"/>
<IsPartOfProject Value="True"/>
</Unit0>
<Unit1>
<Filename Value="formmain.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="fmMain"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
</Unit1>
<Unit2>
<Filename Value="formkey.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="fmCmd"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
</Unit2>
<Unit3>
<Filename Value="..\..\atsynedit\atstrings_editing.inc"/>
<IsPartOfProject Value="True"/>
</Unit3>
<Unit4>
<Filename Value="..\..\atsynedit\atsynedit_carets.inc"/>
<IsPartOfProject Value="True"/>
</Unit4>
<Unit5>
<Filename Value="..\..\atsynedit\atsynedit_cmd_clipboard.inc"/>
<IsPartOfProject Value="True"/>
</Unit5>
<Unit6>
<Filename Value="..\..\atsynedit\atsynedit_cmd_editing.inc"/>
<IsPartOfProject Value="True"/>
</Unit6>
<Unit7>
<Filename Value="..\..\atsynedit\atsynedit_cmd_handler.inc"/>
<IsPartOfProject Value="True"/>
</Unit7>
<Unit8>
<Filename Value="..\..\atsynedit\atsynedit_cmd_keys.inc"/>
<IsPartOfProject Value="True"/>
</Unit8>
<Unit9>
<Filename Value="..\..\atsynedit\atsynedit_cmd_misc.inc"/>
<IsPartOfProject Value="True"/>
</Unit9>
<Unit10>
<Filename Value="..\..\atsynedit\atsynedit_proc.inc"/>
<IsPartOfProject Value="True"/>
</Unit10>
<Unit11>
<Filename Value="..\..\atsynedit\atsynedit_canvasproc.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="ATSynEdit_CanvasProc"/>
</Unit11>
<Unit12>
<Filename Value="..\..\atsynedit\atsynedit_keymap.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="ATSynEdit_Keymap"/>
</Unit12>
<Unit13>
<Filename Value="..\..\atsynedit\atstringproc.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="ATStringProc"/>
</Unit13>
<Unit14>
<Filename Value="..\..\atsynedit\atstringproc_wordjump.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="ATStringProc_WordJump"/>
</Unit14>
<Unit15>
<Filename Value="..\..\atsynedit\atstrings.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="ATStrings"/>
</Unit15>
<Unit16>
<Filename Value="..\..\atsynedit\atsynedit_carets.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="ATSynEdit_Carets"/>
</Unit16>
<Unit17>
<Filename Value="..\..\atsynedit\atsynedit.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="ATSynEdit"/>
</Unit17>
<Unit18>
<Filename Value="..\..\atsynedit\atsynedit_commands.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="ATSynEdit_Commands"/>
</Unit18>
<Unit19>
<Filename Value="..\..\atsynedit\atsynedit_keymap_init.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="ATSynEdit_Keymap_Init"/>
</Unit19>
<Unit20>
<Filename Value="..\..\atsynedit\atsynedit_hilite.inc"/>
<IsPartOfProject Value="True"/>
</Unit20>
<Unit21>
<Filename Value="..\..\atsynedit\atsynedit_sel.inc"/>
<IsPartOfProject Value="True"/>
</Unit21>
<Unit22>
<Filename Value="..\..\atsynedit\atsynedit_gutter.pas"/>
<IsPartOfProject Value="True"/>
</Unit22>
<Unit23>
<Filename Value="formopt.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="fmOpt"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
</Unit23>
<Unit24>
<Filename Value="..\..\atsynedit\atstrings_load.inc"/>
<IsPartOfProject Value="True"/>
</Unit24>
<Unit25>
<Filename Value="..\..\atsynedit\atstrings_undo.pas"/>
<IsPartOfProject Value="True"/>
</Unit25>
<Unit26>
<Filename Value="..\..\atsynedit\atstrings_save.inc"/>
<IsPartOfProject Value="True"/>
</Unit26>
<Unit27>
<Filename Value="..\..\atsynedit\atsynedit_wrapinfo.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="ATSynEdit_WrapInfo"/>
</Unit27>
<Unit28>
<Filename Value="..\..\atsynedit\atsynedit_cmd_sel.inc"/>
<IsPartOfProject Value="True"/>
</Unit28>
<Unit29>
<Filename Value="..\..\atsynedit\atsynedit_debug.inc"/>
<IsPartOfProject Value="True"/>
</Unit29>
<Unit30>
<Filename Value="..\..\atsynedit\atsynedit_edits.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="ATSynEdit_Edits"/>
</Unit30>
<Unit31>
<Filename Value="formcombo.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="fmCombo"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
</Unit31>
<Unit32>
<Filename Value="..\..\atsynedit\atsynedit_ranges.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="ATSynEdit_Ranges"/>
</Unit32>
<Unit33>
<Filename Value="..\..\atsynedit\atsynedit_fold.inc"/>
<IsPartOfProject Value="True"/>
</Unit33>
<Unit34>
<Filename Value="..\..\atsynedit\atsynedit_adapters.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="ATSynEdit_Adapters"/>
</Unit34>
<Unit35>
<Filename Value="formfind.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="fmFind"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
</Unit35>
<Unit36>
<Filename Value="..\..\atsynedit\atsynedit_export_html.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="ATSynEdit_Export_HTML"/>
</Unit36>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="demo"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir);..\..\comp\atsynedit;..\..\atsynedit"/>
<OtherUnitFiles Value="..\..\atsynedit;..\..\proc_lexer"/>
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<IncludeAssertionCode Value="True"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<Checks>
<RangeChecks Value="True"/>
<OverflowChecks Value="True"/>
<StackChecks Value="True"/>
</Checks>
</CodeGeneration>
<Linking>
<Debugging>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<Options>
<Win32>
<GraphicApplication Value="True"/>
</Win32>
</Options>
</Linking>
</CompilerOptions>
<Debugging>
<Exceptions Count="4">
<Item1>
<Name Value="EAbort"/>
</Item1>
<Item2>
<Name Value="ECodetoolError"/>
</Item2>
<Item3>
<Name Value="EFOpenError"/>
</Item3>
<Item4>
<Name Value="ERegExpr"/>
</Item4>
</Exceptions>
</Debugging>
</CONFIG>

View File

@@ -0,0 +1,41 @@
program demo;
{$mode objfpc}{$H+}
uses
//heaptrc,
{$IFDEF UNIX}{$IFDEF UseCThreads}
cthreads,
{$ENDIF}{$ENDIF}
Interfaces, // this includes the LCL widgetset
Forms,
atsynedit_canvasproc,
atsynedit_keymap,
atstringproc,
atstringproc_wordjump,
atstrings,
atstrings_undo,
atsynedit_carets,
atsynedit,
atsynedit_gutter,
atsynedit_commands,
atsynedit_keymap_init,
atsynedit_wrapinfo,
atsynedit_edits,
atsynedit_ranges, ATSynEdit_Adapters,
formmain,
formkey,
formopt,
formcombo, formfind, atsynedit_export_html;
{$R *.res}
begin
Application.Title:= 'Demo';
RequireDerivedFormResource:= True;
Application.Initialize;
Application.CreateForm(TfmMain, fmMain);
Application.CreateForm(TfmOpt, fmOpt);
Application.Run;
end.

View File

@@ -0,0 +1,21 @@
program demo;
{$mode objfpc}{$H+}
uses
{$IFDEF UNIX}{$IFDEF UseCThreads}
cthreads,
{$ENDIF}{$ENDIF}
Interfaces, // this includes the LCL widgetset
Forms, formmain,
ATSynEdit, ATStrings, ATStringProc, ATCanvasProc;
{$R *.res}
begin
RequireDerivedFormResource:=True;
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.Run;
end.

View File

@@ -0,0 +1,58 @@
object fmCombo: TfmCombo
Left = 426
Height = 240
Top = 370
Width = 397
Caption = 'Combo'
ClientHeight = 240
ClientWidth = 397
OnCreate = FormCreate
Position = poScreenCenter
LCLVersion = '1.5'
object Panel1: TPanel
Left = 16
Height = 49
Top = 32
Width = 335
BevelOuter = bvNone
ClientHeight = 49
ClientWidth = 335
TabOrder = 0
object Label1: TLabel
Left = 0
Height = 17
Top = 4
Width = 97
Caption = 'ATComboEdit:'
ParentColor = False
end
end
object ButtonPanel1: TButtonPanel
Left = 6
Height = 29
Top = 205
Width = 385
OKButton.Name = 'OKButton'
OKButton.DefaultCaption = True
HelpButton.Name = 'HelpButton'
HelpButton.DefaultCaption = True
CloseButton.Name = 'CloseButton'
CloseButton.DefaultCaption = True
CancelButton.Name = 'CancelButton'
CancelButton.DefaultCaption = True
TabOrder = 1
ShowButtons = [pbClose]
ShowBevel = False
end
object chkEnabled: TCheckBox
Left = 17
Height = 24
Top = 174
Width = 80
Caption = 'Enabled'
Checked = True
OnChange = chkEnabledChange
State = cbChecked
TabOrder = 2
end
end

View File

@@ -0,0 +1,81 @@
unit formcombo;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls,
StdCtrls, ButtonPanel, ATSynEdit_Edits;
type
{ TfmCombo }
TfmCombo = class(TForm)
ButtonPanel1: TButtonPanel;
chkEnabled: TCheckBox;
Label1: TLabel;
Panel1: TPanel;
procedure chkEnabledChange(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
procedure ComboCommand(Sender: TObject; ACmd: integer; const AText: string; var AHandled: boolean);
{ private declarations }
public
{ public declarations }
ed: TATComboEdit;
end;
var
fmCombo: TfmCombo;
implementation
uses ATSynEdit_Commands;
{$R *.lfm}
{ TfmCombo }
procedure TfmCombo.FormCreate(Sender: TObject);
begin
ed:= TATComboEdit.Create(Self);
ed.Parent:= Panel1;
ed.Align:= alBottom;
ed.OnCommand:= @ComboCommand;
ed.Text:= 'Test';
ed.OptTextHint:= '(empty)';
end;
procedure TfmCombo.chkEnabledChange(Sender: TObject);
begin
ed.Enabled:= chkEnabled.Checked;
end;
procedure TfmCombo.ComboCommand(Sender: TObject; ACmd: integer;
const AText: string; var AHandled: boolean);
var
s: string;
n: integer;
begin
if ACmd=cCommand_KeyEnter then
begin
with ed do
begin
s:= UTF8Encode(Trim(Text));
ShowMessage('Enter: '+s);
Text:= '';
DoCaretSingle(0, 0);
n:= Items.IndexOf(s);
if n>=0 then Items.Delete(n);
Items.Insert(0, s);
end;
AHandled:= true;
end;
end;
end.

View File

@@ -0,0 +1,149 @@
object fmFind: TfmFind
Left = 521
Height = 233
Top = 265
Width = 489
BorderStyle = bsDialog
Caption = 'Find/Replace'
ClientHeight = 233
ClientWidth = 489
OnShow = FormShow
Position = poScreenCenter
LCLVersion = '1.5'
object bFind: TButton
Left = 376
Height = 25
Top = 48
Width = 99
Caption = 'find'
ModalResult = 1
TabOrder = 9
end
object bCancel: TButton
Left = 376
Height = 25
Top = 144
Width = 99
Cancel = True
Caption = 'cancel'
ModalResult = 2
TabOrder = 14
end
object Label1: TLabel
Left = 9
Height = 17
Top = 8
Width = 66
Caption = 'find what:'
ParentColor = False
end
object edFind: TEdit
Left = 9
Height = 27
Top = 32
Width = 359
TabOrder = 0
end
object chkRegex: TCheckBox
Left = 9
Height = 24
Top = 128
Width = 64
Caption = 'regex'
OnChange = chkRegexChange
TabOrder = 3
end
object chkBack: TCheckBox
Left = 9
Height = 24
Top = 200
Width = 92
Caption = 'backward'
TabOrder = 6
end
object chkCase: TCheckBox
Left = 9
Height = 24
Top = 152
Width = 118
Caption = 'case sensitive'
TabOrder = 4
end
object chkWords: TCheckBox
Left = 9
Height = 24
Top = 176
Width = 142
Caption = 'whole words only'
TabOrder = 5
end
object edRep: TEdit
Left = 9
Height = 27
Top = 88
Width = 359
TabOrder = 2
end
object chkRep: TCheckBox
Left = 9
Height = 24
Top = 64
Width = 112
Caption = 'replace with:'
OnChange = chkRepChange
TabOrder = 1
end
object bRep: TButton
Left = 376
Height = 25
Top = 16
Width = 99
Caption = 'replace'
Default = True
ModalResult = 6
TabOrder = 10
end
object bRepAll: TButton
Left = 376
Height = 25
Top = 48
Width = 99
Caption = 'replace all'
ModalResult = 10
TabOrder = 11
end
object chkFromCaret: TCheckBox
Left = 216
Height = 24
Top = 128
Width = 98
Caption = 'from caret'
TabOrder = 7
end
object bCount: TButton
Left = 376
Height = 25
Top = 80
Width = 99
Caption = 'count all'
ModalResult = 5
TabOrder = 12
end
object chkConfirm: TCheckBox
Left = 216
Height = 24
Top = 152
Width = 131
Caption = 'confirm replace'
TabOrder = 8
end
object bMarkAll: TButton
Left = 376
Height = 25
Top = 112
Width = 99
Caption = 'mark all'
ModalResult = 4
TabOrder = 13
end
end

View File

@@ -0,0 +1,85 @@
unit formfind;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ButtonPanel,
StdCtrls;
type
{ TfmFind }
TfmFind = class(TForm)
bCount: TButton;
bMarkAll: TButton;
bFind: TButton;
bCancel: TButton;
bRep: TButton;
bRepAll: TButton;
chkFromCaret: TCheckBox;
chkConfirm: TCheckBox;
chkRep: TCheckBox;
chkRegex: TCheckBox;
chkBack: TCheckBox;
chkCase: TCheckBox;
chkWords: TCheckBox;
edFind: TEdit;
edRep: TEdit;
Label1: TLabel;
procedure chkRegexChange(Sender: TObject);
procedure chkRepChange(Sender: TObject);
procedure FormShow(Sender: TObject);
private
procedure Update;
{ private declarations }
public
{ public declarations }
end;
var
fmFind: TfmFind;
implementation
{$R *.lfm}
{ TfmFind }
procedure TfmFind.chkRegexChange(Sender: TObject);
begin
Update;
end;
procedure TfmFind.chkRepChange(Sender: TObject);
begin
Update;
end;
procedure TfmFind.FormShow(Sender: TObject);
begin
Update;
end;
procedure TfmFInd.Update;
var
rep: boolean;
begin
rep:= chkRep.Checked;
chkWords.Enabled:= not chkRegex.Checked;
chkBack.Enabled:= not chkRegex.Checked;
chkConfirm.Enabled:= rep;
edRep.Enabled:= rep;
bFind.Visible:= not rep;
bRep.Visible:= rep;
bRepAll.Visible:= rep;
if rep then Caption:= 'Replace' else Caption:= 'Find';
if rep then bRep.Default:= true else bFind.Default:= true;
end;
end.

View File

@@ -0,0 +1,59 @@
object fmCmd: TfmCmd
Left = 425
Height = 620
Top = 120
Width = 679
ActiveControl = List
Caption = 'Commands'
ClientHeight = 620
ClientWidth = 679
OnShow = FormShow
Position = poScreenCenter
LCLVersion = '1.5'
object List: TListView
Left = 6
Height = 573
Top = 6
Width = 667
Align = alClient
AutoSort = False
BorderSpacing.Around = 6
Columns = <
item
Caption = 'name'
Width = 350
end
item
Caption = 'key1'
Width = 150
end
item
Caption = 'key2'
Width = 150
end>
ColumnClick = False
ReadOnly = True
RowSelect = True
TabOrder = 0
ViewStyle = vsReport
OnDblClick = ListDblClick
end
object ButtonPanel1: TButtonPanel
Left = 6
Height = 29
Top = 585
Width = 667
OKButton.Name = 'OKButton'
OKButton.DefaultCaption = True
HelpButton.Name = 'HelpButton'
HelpButton.DefaultCaption = True
CloseButton.Name = 'CloseButton'
CloseButton.DefaultCaption = True
CancelButton.Name = 'CancelButton'
CancelButton.DefaultCaption = True
TabOrder = 1
ShowButtons = [pbOK, pbCancel]
ShowGlyphs = []
ShowBevel = False
end
end

View File

@@ -0,0 +1,78 @@
unit formkey;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, comctrls,
ButtonPanel, ATSynedit;
type
{ TfmCmd }
TfmCmd = class(TForm)
ButtonPanel1: TButtonPanel;
List: TListView;
procedure FormShow(Sender: TObject);
procedure ListDblClick(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
edit: TATSynEdit;
end;
var
fmCmd: TfmCmd;
function DoCommandDialog(AEdit: TATSynEdit): integer;
implementation
uses
Menus, LCLProc;
{$R *.lfm}
function DoCommandDialog(AEdit: TATSynEdit): integer;
begin
Result:= 0;
with TfmCmd.Create(nil) do
try
edit:= AEdit;
if ShowModal=mrOk then
if List.Selected<>nil then
Result:= StrToIntDef(List.Selected.SubItems[2], 0);
finally
Free
end;
end;
{ TfmCmd }
procedure TfmCmd.FormShow(Sender: TObject);
var
i: integer;
begin
for i:= 0 to edit.Keymap.Count-1 do
with edit.Keymap.Items[i] do
with List.Items.Add do
begin
Caption:= Name;
SubItems.Add(ShortCutToText(Keys1[0]));
SubItems.Add(ShortCutToText(Keys2[0]));
SubItems.Add(Inttostr(Command));
end;
if List.Items.Count>0 then
List.Selected:= List.Items[0];
end;
procedure TfmCmd.ListDblClick(Sender: TObject);
begin
//ModalResult:= mrOk;
end;
end.

View File

@@ -0,0 +1,73 @@
object fmKeyOpt: TfmKeyOpt
Left = 464
Height = 160
Top = 241
Width = 291
BorderStyle = bsDialog
Caption = 'Hotkey'
ClientHeight = 160
ClientWidth = 291
OnCreate = FormCreate
Position = poScreenCenter
LCLVersion = '1.4.0.2'
object ButtonPanel1: TButtonPanel
Left = 6
Height = 33
Top = 121
Width = 279
OKButton.Name = 'OKButton'
OKButton.DefaultCaption = True
HelpButton.Name = 'HelpButton'
HelpButton.DefaultCaption = True
CloseButton.Name = 'CloseButton'
CloseButton.Caption = 'Clear key'
CloseButton.DefaultCaption = False
CancelButton.Name = 'CancelButton'
CancelButton.DefaultCaption = True
TabOrder = 5
ShowButtons = [pbOK, pbCancel, pbClose]
ShowGlyphs = []
end
object chkCtrl: TCheckBox
Left = 24
Height = 19
Top = 16
Width = 39
Caption = 'Ctrl'
TabOrder = 0
end
object chkAlt: TCheckBox
Left = 24
Height = 19
Top = 40
Width = 35
Caption = 'Alt'
TabOrder = 1
end
object chkShift: TCheckBox
Left = 24
Height = 19
Top = 64
Width = 44
Caption = 'Shift'
TabOrder = 2
end
object chkMeta: TCheckBox
Left = 24
Height = 19
Top = 88
Width = 47
Caption = 'Meta'
TabOrder = 3
end
object ed: TComboBox
Left = 112
Height = 23
Top = 48
Width = 112
DropDownCount = 30
ItemHeight = 15
Style = csDropDownList
TabOrder = 4
end
end

View File

@@ -0,0 +1,129 @@
unit formkeyoption;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ButtonPanel,
StdCtrls;
type
{ TfmKeyOpt }
TfmKeyOpt = class(TForm)
ButtonPanel1: TButtonPanel;
chkCtrl: TCheckBox;
chkAlt: TCheckBox;
chkShift: TCheckBox;
chkMeta: TCheckBox;
ed: TComboBox;
procedure FormCreate(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;
function DoDialogHotkey(S: string): string;
implementation
{$R *.lfm}
function DoDialogHotkey(S: string): string;
var
n: integer;
begin
Result:= S;
with TfmKeyOpt.Create(nil) do
try
chkCtrl.Checked:= Pos('Ctrl+', S)>0;
chkAlt.Checked:= Pos('Alt+', S)>0;
chkShift.Checked:= Pos('Shift+', S)>0;
chkMeta.Checked:= Pos('Meta+', S)>0;
repeat
n:= Pos('+', S);
if n=0 then Break;
Delete(S, 1, n);
until false;
ed.ItemIndex:= ed.Items.IndexOf(S);
if ed.ItemIndex<0 then
ed.ItemIndex:= 0;
case ShowModal of
mrOk:
begin
Result:= ed.Text;
if chkMeta.Checked then Result:= 'Meta+'+Result;
if chkShift.Checked then Result:= 'Shift+'+Result;
if chkAlt.Checked then Result:= 'Alt+'+Result;
if chkCtrl.Checked then Result:= 'Ctrl+'+Result;
end;
mrClose:
Result:= '';
end;
finally
Free;
end;
end;
{ TfmKeyOpt }
procedure TfmKeyOpt.FormCreate(Sender: TObject);
var
i: integer;
begin
for i:= Ord('A') to Ord('Z') do
ed.Items.Add(Chr(i));
for i:= 0 to 9 do
ed.Items.Add(Inttostr(i));
for i:= 1 to 12 do
ed.Items.Add('F'+Inttostr(i));
ed.Items.Add('Left');
ed.Items.Add('Right');
ed.Items.Add('Up');
ed.Items.Add('Down');
ed.Items.Add('Ins');
ed.Items.Add('Del');
ed.Items.Add('Home');
ed.Items.Add('End');
ed.Items.Add('PgUp');
ed.Items.Add('PgDn');
ed.Items.Add('Enter');
ed.Items.Add('BkSp');
ed.Items.Add('Tab');
ed.Items.Add('Esc');
ed.Items.Add('-');
ed.Items.Add('=');
ed.Items.Add('`');
ed.Items.Add(',');
ed.Items.Add('.');
ed.Items.Add(';');
ed.Items.Add('''');
ed.Items.Add('\');
ed.Items.Add('/');
ed.Items.Add('[');
ed.Items.Add(']');
for i:= 0 to 9 do
ed.Items.Add('Num'+Inttostr(i));
ed.Items.Add('NumPlus');
ed.Items.Add('NumMinus');
ed.Items.Add('NumMul');
ed.Items.Add('NumDiv');
ed.Items.Add('NumDot');
ed.Items.Add('NumClear');
ed.Items.Add('NumLock');
ed.Items.Add('ScrollLock');
ed.Items.Add('CapsLock');
ed.Items.Add('Break');
ed.Items.Add('PopUp');
end;
end.

View File

@@ -0,0 +1,556 @@
object fmMain: TfmMain
Left = 266
Height = 498
Top = 242
Width = 953
Caption = 'Demo'
ClientHeight = 498
ClientWidth = 953
Menu = MainMenu1
OnCreate = FormCreate
OnDestroy = FormDestroy
OnResize = FormResize
OnShow = FormShow
Position = poScreenCenter
LCLVersion = '1.5'
object PanelMain: TPanel
Left = 0
Height = 498
Top = 0
Width = 672
Align = alClient
BevelOuter = bvNone
ClientHeight = 498
ClientWidth = 672
TabOrder = 0
object Status: TStatusBar
Left = 0
Height = 21
Top = 477
Width = 672
Panels = <>
end
object StatusMsg: TStatusBar
Left = 0
Height = 21
Top = 456
Width = 672
Font.Color = clBlue
Panels = <>
ParentFont = False
end
object progress: TProgressBar
AnchorSideLeft.Control = PanelMain
AnchorSideLeft.Side = asrBottom
AnchorSideRight.Control = StatusMsg
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = StatusMsg
AnchorSideBottom.Side = asrCenter
Left = 507
Height = 14
Top = 459
Width = 160
Anchors = [akRight, akBottom]
BorderSpacing.Right = 5
Smooth = True
Step = 1
TabOrder = 2
Visible = False
end
object btnStop: TButton
AnchorSideRight.Control = progress
AnchorSideBottom.Control = StatusMsg
AnchorSideBottom.Side = asrCenter
Left = 412
Height = 22
Top = 455
Width = 90
Anchors = [akRight, akBottom]
BorderSpacing.Right = 5
Caption = 'stop'
OnClick = btnStopClick
TabOrder = 3
Visible = False
end
end
object PanelRt: TPanel
Left = 672
Height = 498
Top = 0
Width = 281
Align = alRight
BevelOuter = bvNone
ClientHeight = 498
ClientWidth = 281
TabOrder = 1
object chkGutter: TCheckBox
Left = 8
Height = 24
Top = 8
Width = 68
Caption = 'gutter'
OnChange = chkGutterChange
TabOrder = 0
end
object chkRuler: TCheckBox
Left = 8
Height = 24
Top = 28
Width = 58
Caption = 'ruler'
OnChange = chkRulerChange
TabOrder = 1
end
object chkMinimap: TCheckBox
Left = 8
Height = 24
Top = 48
Width = 85
Caption = 'minimap'
OnChange = chkMinimapChange
TabOrder = 2
end
object edSpaceX: TSpinEdit
Left = 8
Height = 27
Top = 240
Width = 52
MaxValue = 10
MinValue = -5
OnChange = edSpaceXChange
TabOrder = 8
end
object Label1: TLabel
Left = 67
Height = 17
Top = 244
Width = 63
Caption = 'spacing-x'
ParentColor = False
end
object Label2: TLabel
Left = 67
Height = 17
Top = 308
Width = 47
Caption = 'margin'
ParentColor = False
end
object edMarRt: TSpinEdit
Left = 8
Height = 27
Top = 304
Width = 52
MaxValue = 200
MinValue = 20
OnChange = edMarRtChange
TabOrder = 10
Value = 20
end
object gWrap: TGroupBox
Left = 144
Height = 104
Top = 4
Width = 128
Caption = 'wrap'
ClientHeight = 85
ClientWidth = 124
TabOrder = 11
object chkWrapOff: TRadioButton
Left = 8
Height = 24
Top = 0
Width = 46
Caption = 'off'
Checked = True
OnChange = chkWrapOffChange
TabOrder = 0
TabStop = True
end
object chkWrapOn: TRadioButton
Left = 8
Height = 24
Top = 20
Width = 76
Caption = 'at edge'
OnChange = chkWrapOnChange
TabOrder = 1
end
object chkWrapMargin: TRadioButton
Left = 8
Height = 24
Top = 40
Width = 90
Caption = 'at margin'
OnChange = chkWrapMarginChange
TabOrder = 2
end
object chkWrapIndent: TCheckBox
Left = 8
Height = 24
Top = 60
Width = 101
Caption = 'with indent'
OnChange = chkWrapIndentChange
TabOrder = 3
end
end
object edFontsize: TSpinEdit
Left = 8
Height = 27
Top = 176
Width = 52
MaxValue = 40
MinValue = 4
OnChange = edFontsizeChange
TabOrder = 6
Value = 10
end
object Label4: TLabel
Left = 67
Height = 17
Top = 180
Width = 58
Caption = 'font size'
ParentColor = False
end
object gUnpri: TGroupBox
Left = 144
Height = 104
Top = 108
Width = 128
Caption = 'unprintable'
ClientHeight = 85
ClientWidth = 124
TabOrder = 12
object chkUnprintVis: TCheckBox
Left = 8
Height = 24
Top = 1
Width = 61
Caption = 'show'
OnChange = chkUnprintVisChange
TabOrder = 0
end
object chkUnprintSp: TCheckBox
Left = 8
Height = 24
Top = 20
Width = 72
Caption = 'spaces'
OnChange = chkUnprintSpChange
TabOrder = 1
end
object chkUnprintEnd: TCheckBox
Left = 8
Height = 24
Top = 40
Width = 58
Caption = 'ends'
OnChange = chkUnprintEndChange
TabOrder = 2
end
object chkUnprintEndDet: TCheckBox
Left = 8
Height = 24
Top = 60
Width = 101
Caption = 'end-details'
OnChange = chkUnprintEndDetChange
TabOrder = 3
end
end
object edTabsize: TSpinEdit
Left = 8
Height = 27
Top = 208
Width = 52
MaxValue = 12
MinValue = 1
OnChange = edTabsizeChange
TabOrder = 7
Value = 8
end
object Label5: TLabel
Left = 67
Height = 17
Top = 212
Width = 52
Caption = 'tab size'
ParentColor = False
end
object bFont: TButton
Left = 8
Height = 25
Top = 92
Width = 81
Caption = 'font...'
OnClick = bFontClick
TabOrder = 4
end
object chkMicromap: TCheckBox
Left = 8
Height = 24
Top = 68
Width = 95
Caption = 'micromap'
OnChange = chkMicromapChange
TabOrder = 3
end
object edSpaceY: TSpinEdit
Left = 8
Height = 27
Top = 272
Width = 52
MaxValue = 10
MinValue = -5
OnChange = edSpaceYChange
TabOrder = 9
end
object Label6: TLabel
Left = 67
Height = 17
Top = 276
Width = 62
Caption = 'spacing-y'
ParentColor = False
end
object bOpt: TButton
Left = 8
Height = 25
Top = 120
Width = 81
Caption = 'opts...'
OnClick = bOptClick
TabOrder = 5
end
object Memo1: TMemo
Left = 14
Height = 151
Top = 336
Width = 162
ScrollBars = ssBoth
TabOrder = 13
Visible = False
end
object btnMarker: TButton
Left = 144
Height = 25
Top = 224
Width = 96
Caption = 'marker'
OnClick = btnMarkerClick
TabOrder = 14
end
end
object OpenDialog1: TOpenDialog
Options = [ofFileMustExist, ofEnableSizing]
left = 472
top = 20
end
object FontDialog1: TFontDialog
Title = 'Font'
MinFontSize = 0
MaxFontSize = 0
left = 536
top = 20
end
object SaveDialog1: TSaveDialog
Options = [ofOverwritePrompt, ofEnableSizing, ofViewDetail]
left = 504
top = 20
end
object MainMenu1: TMainMenu
left = 432
top = 80
object mnuFile: TMenuItem
Caption = 'File'
object mnuFileOpen: TMenuItem
Caption = 'Open..'
ShortCut = 16463
OnClick = mnuFileOpenClick
end
object mnuFileSav: TMenuItem
Caption = 'Save..'
OnClick = mnuFileSaveClick
end
object mnuFileEnd: TMenuItem
Caption = 'Set ends'
object mnuEndWin: TMenuItem
Caption = 'win'
OnClick = mnuEndWinClick
end
object mnuEndUnix: TMenuItem
Caption = 'unix'
OnClick = mnuEndUnixClick
end
object mnuEndMac: TMenuItem
Caption = 'mac'
OnClick = mnuEndMacClick
end
end
object mnuFileHtml: TMenuItem
Caption = 'Export HTML'
OnClick = mnuFileHtmlClick
end
end
object MenuItem9: TMenuItem
Caption = 'Search'
object mnuFind: TMenuItem
Caption = 'find...'
ShortCut = 16454
OnClick = mnuFindClick
end
object mnuFindNext: TMenuItem
Caption = 'find next'
ShortCut = 114
OnClick = mnuFindNextClick
end
object mnuGoto: TMenuItem
Caption = 'go to..'
ShortCut = 16455
OnClick = bGotoClick
end
end
object mnuEnc: TMenuItem
Caption = 'Encoding'
end
object mnuTst: TMenuItem
Caption = 'Test'
object mnuTCaret1: TMenuItem
Caption = 'set 100 cr''s'
OnClick = mnuTCaret1Click
end
object mnuTCaretK: TMenuItem
Caption = 'set 2000 cr''s'
OnClick = bAddCrtClick
end
object mnuTMargin: TMenuItem
Caption = 'set margins..'
OnClick = mnuTMarginClick
end
object mnuTBms: TMenuItem
Caption = 'toggle bookm'
OnClick = mnuTBmsClick
end
object MenuItem5: TMenuItem
Caption = '-'
end
object mnuSyntax: TMenuItem
Caption = 'hilite syntax'
ShortCut = 16467
OnClick = mnuSyntaxClick
end
object mnuUnderline: TMenuItem
Caption = 'underline ''www'''
OnClick = mnuUnderlineClick
end
object MenuItem1: TMenuItem
Caption = '-'
end
object mnuPane: TMenuItem
Caption = 'show pane'
Checked = True
OnClick = mnuPaneClick
end
object mnuOneLine: TMenuItem
Caption = 'combo..'
OnClick = mnuOneLineClick
end
end
object mnuOpts: TMenuItem
Caption = 'Options'
object mnuOptDlg: TMenuItem
Caption = 'options..'
ShortCut = 120
OnClick = bOptClick
end
object mnuOptSave: TMenuItem
Caption = 'save'
Visible = False
OnClick = btnSaveClick
end
object mnuOptLoad: TMenuItem
Caption = 'load'
Visible = False
OnClick = btnLoadClick
end
end
object mnuHlp: TMenuItem
Caption = 'Help'
object mnuHelpKey: TMenuItem
Caption = 'commands..'
ShortCut = 112
OnClick = bKeymapClick
end
object MenuItem2: TMenuItem
Caption = '-'
end
object mnuHelpMous: TMenuItem
Caption = 'mouse help..'
OnClick = mnuHelpMousClick
end
end
end
object PopupBookmk: TPopupMenu
left = 480
top = 104
object mnuBms: TMenuItem
Caption = 'toggle all bm''s'
OnClick = mnuBmsClick
end
end
object PopupNums: TPopupMenu
left = 523
top = 128
object MenuItem3: TMenuItem
Caption = 'test nums'
Enabled = False
end
end
object PopupFold: TPopupMenu
left = 568
top = 152
object MenuItem4: TMenuItem
Caption = 'test fold'
Enabled = False
end
end
object PopupMinimap: TPopupMenu
left = 448
top = 192
object MenuItem6: TMenuItem
Caption = 'minimap'
Enabled = False
end
end
object PopupMicromap: TPopupMenu
left = 496
top = 216
object MenuItem7: TMenuItem
Caption = 'micromap'
Enabled = False
end
end
object PopupRuler: TPopupMenu
left = 552
top = 240
object MenuItem8: TMenuItem
Caption = 'ruler'
Enabled = False
end
end
object TimerHint: TTimer
Enabled = False
Interval = 5500
OnTimer = TimerHintTimer
left = 560
top = 303
end
object ApplicationProperties1: TApplicationProperties
ShowButtonGlyphs = sbgNever
ShowMenuGlyphs = sbgNever
left = 548
top = 366
end
end

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,474 @@
unit formopt;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
ButtonPanel, Spin, ComCtrls, ATSynEdit, ATSynEdit_CanvasProc;
type
{ TfmOpt }
TfmOpt = class(TForm)
bColDown: TButton;
bColUp: TButton;
ButtonPanel1: TButtonPanel;
chkCrBlinkEn: TCheckBox;
chkMsNormalSel: TCheckBox;
chkMsColumnSel: TCheckBox;
chkUnprintArrowDown: TCheckBox;
chkShowFullHilite: TCheckBox;
chkMsHideCursor: TCheckBox;
chkLeftRtSwapAndSel: TCheckBox;
chkGutterSep: TCheckBox;
chkGutterNumAuto: TCheckBox;
chkGutterBm: TCheckBox;
chkGutterEmpty: TCheckBox;
chkGutterFold: TCheckBox;
chkGutterNum: TCheckBox;
chkGutterStat: TCheckBox;
chkShowFoldLinesAll: TCheckBox;
chkBackspUnindent: TCheckBox;
chkEnterIndent: TCheckBox;
chkMsMenuDown: TCheckBox;
chkTabIndent: TCheckBox;
chkUnindentKeepAlign: TCheckBox;
chkUnprintAsciiRep: TCheckBox;
chkShowFoldLines: TCheckBox;
chkShowFoldAlways: TCheckBox;
chkCrPreferLeft: TCheckBox;
chkKeepCol: TCheckBox;
chkCurLineMin: TCheckBox;
chkScrollHint: TCheckBox;
chkPageKeepRel: TCheckBox;
chkNavHomeEnd: TCheckBox;
chkMsNiceScroll: TCheckBox;
chkSaveEol: TCheckBox;
chkSaveTrim: TCheckBox;
chkShowNum1st: TCheckBox;
chkShowNumCr: TCheckBox;
chkMapSelBorder: TCheckBox;
chkMapSelAlways: TCheckBox;
chkShowNumBg: TCheckBox;
chkTabSpaces: TCheckBox;
chkUndoSv: TCheckBox;
chkUndoGr: TCheckBox;
chkCutNoSel: TCheckBox;
chkDotLn: TCheckBox;
chkMsClickNumSel: TCheckBox;
chkCrStopUnfocus: TCheckBox;
chkEndNonspace: TCheckBox;
chkHomeNonspace: TCheckBox;
chkLeftRtSwap: TCheckBox;
chkNavUpDown: TCheckBox;
chkOvrSel: TCheckBox;
chkMsRtClickMove: TCheckBox;
chkMsDragDrop: TCheckBox;
chkCrMul: TCheckBox;
chkCrVirt: TCheckBox;
chkMsClick2: TCheckBox;
chkMsClick2Drag: TCheckBox;
chkMsClick3: TCheckBox;
chkShowFullSel: TCheckBox;
chkCopyNoSel: TCheckBox;
chkCurCol: TCheckBox;
chkCurLine: TCheckBox;
chkLastOnTop: TCheckBox;
chkOvrPaste: TCheckBox;
chkUnprintEnd: TCheckBox;
chkUnprintEndDet: TCheckBox;
chkUnprintSpace: TCheckBox;
chkUnprintEn: TCheckBox;
edMapCharWidth: TSpinEdit;
edNumAlign: TComboBox;
edIndentKind: TComboBox;
edCrShape: TComboBox;
edCrShape2: TComboBox;
edCrTime: TSpinEdit;
edSizeSep: TSpinEdit;
edWordChars: TEdit;
edIndentSize: TSpinEdit;
edPlusSize: TSpinEdit;
edNumChar: TEdit;
edNumStyle: TComboBox;
edPageSize: TComboBox;
edRulerFSize: TSpinEdit;
edRulerIndent: TSpinEdit;
edRulerSize: TSpinEdit;
edSizeBm: TSpinEdit;
edSizeEmpty: TSpinEdit;
edSizeFold: TSpinEdit;
edSizeNum1: TSpinEdit;
edSizeNum2: TSpinEdit;
edSizeNum: TSpinEdit;
edSizeState: TSpinEdit;
edTabArrowSize: TSpinEdit;
edTabArrowPnt: TSpinEdit;
edTextHint: TEdit;
GroupBox1: TGroupBox;
GroupBox2: TGroupBox;
groupIndent: TGroupBox;
LabChars: TLabel;
Label1: TLabel;
Label10: TLabel;
Label12: TLabel;
Label13: TLabel;
Label14: TLabel;
Label15: TLabel;
Label16: TLabel;
Label17: TLabel;
Label18: TLabel;
Label19: TLabel;
Label2: TLabel;
Label20: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Label8: TLabel;
Label9: TLabel;
LabelArr: TLabel;
LabelArr1: TLabel;
LabelHint: TLabel;
ListCol: TListBox;
ListShapes: TListBox;
PageControl1: TPageControl;
edUndo: TSpinEdit;
edNumSize: TSpinEdit;
TabSheet1: TTabSheet;
TabSheet2: TTabSheet;
TabSheet3: TTabSheet;
TabSheet4: TTabSheet;
TabSheet5: TTabSheet;
TabSheet6: TTabSheet;
TabSheet7: TTabSheet;
TabSheet8: TTabSheet;
TabSheet9: TTabSheet;
procedure bColDownClick(Sender: TObject);
procedure bColUpClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
procedure InitShape(ed: TCombobox);
end;
var
fmOpt: TfmOpt;
procedure DoConfigEditor(ed: TATSynEdit);
implementation
{$R *.lfm}
const
nameBm = 'bookmk';
nameNums = 'nums';
nameState = 'states';
nameFold = 'fold';
nameSep = 'separator';
procedure DoConfigEditor(ed: TATSynEdit);
var
i: integer;
begin
with fmOpt do
begin
with ListCol do
begin
Items.Clear;
for i:= 0 to 4 do
begin
if i=ed.GutterBandBm then Items.Add(nameBm);
if i=ed.GutterBandNum then Items.Add(nameNums);
if i=ed.GutterBandState then Items.Add(nameState);
if i=ed.GutterBandFold then Items.Add(nameFold);
if i=ed.GutterBandSep then Items.Add(nameSep);
end;
ItemIndex:= 0;
end;
//general
chkCurLine.Checked:= ed.OptShowCurLine;
chkCurLineMin.Checked:= ed.OptShowCurLineMinimal;
chkCurCol.Checked:= ed.OptShowCurColumn;
chkLastOnTop.Checked:= ed.OptLastLineOnTop;
chkShowFullSel.Checked:= ed.OptShowFullSel;
chkShowFullHilite.Checked:= ed.OptShowFullHilite;
chkCopyNoSel.Checked:= ed.OptCopyLinesIfNoSel;
chkCutNoSel.Checked:= ed.OptCutLinesIfNoSel;
chkOvrPaste.Checked:= ed.OptOverwriteAllowedOnPaste;
chkDotLn.Checked:= ed.OptShowIndentLines;
edTextHint.Text:= ed.OptTextHint;
edWordChars.Text:= ed.OptWordChars;
chkSaveEol.Checked:= ed.OptSavingForceFinalEol;
chkSaveTrim.Checked:= ed.OptSavingTrimSpaces;
chkScrollHint.Checked:= ed.OptShowScrollHint;
//unprint
chkUnprintEn.Checked:= ed.OptUnprintedVisible;
chkUnprintSpace.Checked:= ed.OptUnprintedSpaces;
chkUnprintEnd.Checked:= ed.OptUnprintedEnds;
chkUnprintEndDet.Checked:= ed.OptUnprintedEndsDetails;
chkUnprintArrowDown.Checked:= OptUnprintedEndArrowOrDot;
chkUnprintAsciiRep.Checked:= ed.OptUnprintedReplaceSpec;
edTabArrowSize.Value:= OptUnprintedTabCharLength;
edTabArrowPnt.Value:= OptUnprintedTabPointerScale;
//caret
chkCrBlinkEn.Checked:= ed.OptCaretBlinkEnabled;
edCrTime.Value:= ed.OptCaretBlinkTime;
chkCrVirt.Checked:= ed.OptCaretVirtual;
chkCrMul.Checked:= ed.OptCaretManyAllowed;
chkCrStopUnfocus.Checked:= ed.OptCaretStopUnfocused;
chkCrPreferLeft.Checked:= ed.OptCaretPreferLeftSide;
edCrShape.ItemIndex:= Ord(ed.OptCaretShape);
edCrShape2.ItemIndex:= Ord(ed.OptCaretShapeOvr);
//gutter
edNumStyle.ItemIndex:= Ord(ed.OptNumbersStyle);
edNumAlign.ItemIndex:= Ord(ed.OptNumbersAlignment);
edNumSize.Value:= ed.OptNumbersFontSize;
edNumChar.Text:= ed.OptNumbersSkippedChar;
edPlusSize.Value:= ed.OptGutterPlusSize;
chkShowNum1st.Checked:= ed.OptNumbersShowFirst;
chkShowNumCr.Checked:= ed.OptNumbersShowCarets;
chkShowNumBg.Checked:= ed.OptShowGutterCaretBG;
chkShowFoldAlways.Checked:= ed.OptGutterShowFoldAlways;
chkShowFoldLines.Checked:= ed.OptGutterShowFoldLines;
chkShowFoldLinesAll.Checked:= ed.OptGutterShowFoldLinesAll;
edRulerSize.Value:= ed.OptRulerSize;
edRulerFSize.Value:= ed.OptRulerFontSize;
edRulerIndent.Value:= ed.OptRulerTextIndent;
chkGutterBm.Checked:= ed.Gutter[ed.GutterBandBm].Visible;
chkGutterNum.Checked:= ed.Gutter[ed.GutterBandNum].Visible;
chkGutterFold.Checked:= ed.Gutter[ed.GutterBandFold].Visible;
chkGutterStat.Checked:= ed.Gutter[ed.GutterBandState].Visible;
chkGutterSep.Checked:= ed.Gutter[ed.GutterBandSep].Visible;
chkGutterEmpty.Checked:= ed.Gutter[ed.GutterBandEmpty].Visible;
edSizeBm.Value:= ed.Gutter[ed.GutterBandBm].Size;
edSizeFold.Value:= ed.Gutter[ed.GutterBandFold].Size;
edSizeState.Value:= ed.Gutter[ed.GutterBandState].Size;
edSizeSep.Value:= ed.Gutter[ed.GutterBandSep].Size;
edSizeEmpty.Value:= ed.Gutter[ed.GutterBandEmpty].Size;
edSizeNum.Value:= ed.Gutter[ed.GutterBandNum].Size;
edSizeNum1.Value:= ed.OptNumbersIndentLeft;
edSizeNum2.Value:= ed.OptNumbersIndentRight;
chkGutterNumAuto.Checked:= ed.OptNumbersAutosize;
//minimap
edMapCharWidth.Value:= ed.OptMinimapCharWidth;
chkMapSelBorder.Checked:= ed.OptMinimapShowSelBorder;
chkMapSelAlways.Checked:= ed.OptMinimapShowSelAlways;
//key
chkTabSpaces.Checked:= ed.OptTabSpaces;
chkOvrSel.Checked:= ed.OptOverwriteSel;
chkNavUpDown.Checked:= ed.OptKeyUpDownNavigateWrapped;
chkNavHomeEnd.Checked:= ed.OptKeyHomeEndNavigateWrapped;
chkKeepCol.Checked:= ed.OptKeyUpDownKeepColumn;
chkLeftRtSwap.Checked:= ed.OptKeyLeftRightSwapSel;
chkLeftRtSwapAndSel.Checked:= ed.OptKeyLeftRightSwapSelAndSelect;
chkHomeNonspace.Checked:= ed.OptKeyHomeToNonSpace;
chkEndNonspace.Checked:= ed.OptKeyEndToNonSpace;
chkTabIndent.Checked:= ed.OptKeyTabIndents;
chkEnterIndent.Checked:= ed.OptAutoIndent;
chkBackspUnindent.Checked:= ed.OptKeyBackspaceUnindent;
edIndentKind.ItemIndex:= Ord(ed.OptAutoIndentKind);
edIndentSize.Value:= ed.OptIndentSize;
chkUnindentKeepAlign.Checked:= ed.OptIndentKeepsAlign;
edPageSize.ItemIndex:= Ord(ed.OptKeyPageUpDownSize);
chkPageKeepRel.Checked:= ed.OptKeyPageKeepsRelativePos;
//mouse
chkMsNormalSel.Checked:= ed.OptMouseEnableNormalSelection;
chkMsColumnSel.Checked:= ed.OptMouseEnableColumnSelection;
chkMsClick2.Checked:= ed.OptMouse2ClickSelectsLine;
chkMsClick3.Checked:= ed.OptMouse3ClickSelectsLine;
chkMsClick2Drag.Checked:= ed.OptMouse2ClickDragSelectsWords;
chkMsClickNumSel.Checked:= ed.OptMouseGutterClickSelectsLine;
chkMsDragDrop.Checked:= ed.OptMouseDragDrop;
chkMsRtClickMove.Checked:= ed.OptMouseRightClickMovesCaret;
chkMsNiceScroll.Checked:= ed.OptMouseNiceScroll;
chkMsHideCursor.Checked:= ed.OptMouseHideCursorOnType;
chkMsMenuDown.Checked:= ed.OptMouseDownForPopup;
//undo
edUndo.Value:= ed.OptUndoLimit;
chkUndoGr.Checked:= ed.OptUndoGrouped;
chkUndoSv.Checked:= ed.OptUndoAfterSave;
if ShowModal=mrOk then
begin
ed.GutterBandBm:= ListCol.Items.IndexOf(nameBm);
ed.GutterBandNum:= ListCol.Items.IndexOf(nameNums);
ed.GutterBandState:= ListCol.Items.IndexOf(nameState);
ed.GutterBandFold:= ListCol.Items.IndexOf(nameFold);
ed.GutterBandSep:= ListCol.Items.IndexOf(nameSep);
//general
ed.OptShowCurLine:= chkCurLine.Checked;
ed.OptShowCurLineMinimal:= chkCurLineMin.Checked;
ed.OptShowCurColumn:= chkCurCol.Checked;
ed.OptTextHint:= edTextHint.Text;
ed.OptWordChars:= edWordChars.Text;
ed.OptOverwriteAllowedOnPaste:= chkOvrPaste.Checked;
ed.OptCopyLinesIfNoSel:= chkCopyNoSel.Checked;
ed.OptCutLinesIfNoSel:= chkCutNoSel.Checked;
ed.OptShowFullSel:= chkShowFullSel.Checked;
ed.OptShowFullHilite:= chkShowFullHilite.Checked;
ed.OptLastLineOnTop:= chkLastOnTop.Checked;
ed.OptShowIndentLines:= chkDotLn.Checked;
ed.OptSavingForceFinalEol:= chkSaveEol.Checked;
ed.OptSavingTrimSpaces:= chkSaveTrim.Checked;
ed.OptShowScrollHint:= chkScrollHint.Checked;
//unprint
ed.OptUnprintedVisible:= chkUnprintEn.Checked;
ed.OptUnprintedSpaces:= chkUnprintSpace.Checked;
ed.OptUnprintedEnds:= chkUnprintEnd.Checked;
ed.OptUnprintedEndsDetails:= chkUnprintEndDet.Checked;
ed.OptUnprintedReplaceSpec:= chkUnprintAsciiRep.Checked;
OptUnprintedTabCharLength:= edTabArrowSize.Value;
OptUnprintedTabPointerScale:= edTabArrowPnt.Value;
OptUnprintedEndArrowOrDot:= chkUnprintArrowDown.Checked;
//caret
ed.OptCaretBlinkEnabled:= chkCrBlinkEn.Checked;
ed.OptCaretBlinkTime:= edCrTime.Value;
ed.OptCaretShape:= TATSynCaretShape(edCrShape.ItemIndex);
ed.OptCaretShapeOvr:= TATSynCaretShape(edCrShape2.ItemIndex);
ed.OptCaretVirtual:= chkCrVirt.Checked;
ed.OptCaretManyAllowed:= chkCrMul.Checked;
ed.OptCaretStopUnfocused:= chkCrStopUnfocus.Checked;
ed.OptCaretPreferLeftSide:= chkCrPreferLeft.Checked;
//gutter
ed.OptNumbersFontSize:= edNumSize.Value;
ed.OptNumbersStyle:= TATSynNumbersStyle(edNumStyle.ItemIndex);
ed.OptNumbersAlignment:= TAlignment(edNumAlign.ItemIndex);
ed.OptNumbersShowFirst:= chkShowNum1st.Checked;
ed.OptNumbersShowCarets:= chkShowNumCr.Checked;
ed.OptNumbersSkippedChar:= edNumChar.Text;
ed.OptGutterShowFoldAlways:= chkShowFoldAlways.Checked;
ed.OptGutterShowFoldLines:= chkShowFoldLines.Checked;
ed.OptGutterShowFoldLinesAll:= chkShowFoldLinesAll.Checked;
ed.OptGutterPlusSize:= edPlusSize.Value;
ed.OptShowGutterCaretBG:= chkShowNumBg.Checked;
ed.OptRulerSize:= edRulerSize.Value;
ed.OptRulerFontSize:= edRulerFSize.Value;
ed.OptRulerTextIndent:= edRulerIndent.Value;
ed.Gutter[ed.GutterBandBm].Visible:= chkGutterBm.Checked;
ed.Gutter[ed.GutterBandNum].Visible:= chkGutterNum.Checked;
ed.Gutter[ed.GutterBandFold].Visible:= chkGutterFold.Checked;
ed.Gutter[ed.GutterBandState].Visible:= chkGutterStat.Checked;
ed.Gutter[ed.GutterBandSep].Visible:= chkGutterSep.Checked;
ed.Gutter[ed.GutterBandEmpty].Visible:= chkGutterEmpty.Checked;
ed.Gutter[ed.GutterBandBm].Size:= edSizeBm.Value;
ed.Gutter[ed.GutterBandNum].Size:= edSizeNum.Value;
ed.Gutter[ed.GutterBandFold].Size:= edSizeFold.Value;
ed.Gutter[ed.GutterBandState].Size:= edSizeState.Value;
ed.Gutter[ed.GutterBandSep].Size:= edSizeSep.Value;
ed.Gutter[ed.GutterBandEmpty].Size:= edSizeEmpty.Value;
ed.OptNumbersAutosize:= chkGutterNumAuto.Checked;
ed.OptNumbersIndentLeft:= edSizeNum1.Value;
ed.OptNumbersIndentRight:= edSizeNum2.Value;
//minimap
ed.OptMinimapCharWidth:= edMapCharWidth.Value;
ed.OptMinimapShowSelBorder:= chkMapSelBorder.Checked;
ed.OptMinimapShowSelAlways:= chkMapSelAlways.Checked;
//key
ed.OptTabSpaces:= chkTabSpaces.Checked;
ed.OptOverwriteSel:= chkOvrSel.Checked;
ed.OptKeyUpDownKeepColumn:= chkKeepCol.Checked;
ed.OptKeyUpDownNavigateWrapped:= chkNavUpDown.Checked;
ed.OptKeyHomeEndNavigateWrapped:= chkNavHomeEnd.Checked;
ed.OptKeyPageUpDownSize:= TATPageUpDownSize(edPageSize.ItemIndex);
ed.OptKeyLeftRightSwapSel:= chkLeftRtSwap.Checked;
ed.OptKeyLeftRightSwapSelAndSelect:= chkLeftRtSwapAndSel.Checked;
ed.OptKeyHomeToNonSpace:= chkHomeNonspace.Checked;
ed.OptKeyEndToNonSpace:= chkEndNonspace.Checked;
ed.OptKeyPageKeepsRelativePos:= chkPageKeepRel.Checked;
ed.OptKeyTabIndents:= chkTabIndent.Checked;
ed.OptAutoIndent:= chkEnterIndent.Checked;
ed.OptKeyBackspaceUnindent := chkBackspUnindent.Checked;
ed.OptAutoIndentKind:= TATAutoIndentKind(edIndentKind.ItemIndex);
ed.OptIndentSize:= edIndentSize.Value;
ed.OptIndentKeepsAlign:= chkUnindentKeepAlign.Checked;
//mouse
ed.OptMouseEnableNormalSelection:= chkMsNormalSel.Checked;
ed.OptMouseEnableColumnSelection:= chkMsColumnSel.Checked;
ed.OptMouse2ClickSelectsLine:= chkMsClick2.Checked;
ed.OptMouse3ClickSelectsLine:= chkMsClick3.Checked;
ed.OptMouse2ClickDragSelectsWords:= chkMsClick2Drag.Checked;
ed.OptMouseGutterClickSelectsLine:= chkMsClickNumSel.Checked;
ed.OptMouseDragDrop:= chkMsDragDrop.Checked;
ed.OptMouseRightClickMovesCaret:= chkMsRtClickMove.Checked;
ed.OptMouseNiceScroll:= chkMsNiceScroll.Checked;
ed.OptMouseHideCursorOnType:= chkMsHideCursor.Checked;
ed.OptMouseDownForPopup:= chkMsMenuDown.Checked;
//undo
ed.OptUndoLimit:= edUndo.Value;
ed.OptUndoGrouped:= chkUndoGr.Checked;
ed.OptUndoAfterSave:= chkUndoSv.Checked;
//apply
ed.Gutter.Update;
ed.Update;
end;
end;
end;
{ TfmOpt }
procedure TfmOpt.FormCreate(Sender: TObject);
begin
InitShape(edCrShape);
InitShape(edCrShape2);
end;
procedure SwapItems(L: TListbox; n1, n2: integer);
var
s: string;
begin
s:= L.Items[n1];
L.Items[n1]:= L.Items[n2];
L.Items[n2]:= s;
L.ItemIndex:= n2;
end;
procedure TfmOpt.bColUpClick(Sender: TObject);
begin
with ListCol do
if ItemIndex>0 then
SwapItems(ListCol, ItemIndex, ItemIndex-1);
end;
procedure TfmOpt.bColDownClick(Sender: TObject);
begin
with ListCol do
if ItemIndex<Count-1 then
SwapItems(ListCol, ItemIndex, ItemIndex+1);
end;
procedure TfmOpt.InitShape(ed: TCombobox);
begin
ed.Items.Clear;
ed.Items.AddStrings(ListShapes.Items);
end;
end.