Стартовый пул
This commit is contained in:
106
ATSynEdit/app/demo_load/project1.lpi
Normal file
106
ATSynEdit/app/demo_load/project1.lpi
Normal file
@@ -0,0 +1,106 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<CONFIG>
|
||||
<ProjectOptions>
|
||||
<Version Value="9"/>
|
||||
<PathDelim Value="\"/>
|
||||
<General>
|
||||
<SessionStorage Value="InProjectDir"/>
|
||||
<MainUnit Value="0"/>
|
||||
<Title Value="project1"/>
|
||||
<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="4">
|
||||
<Unit0>
|
||||
<Filename Value="project1.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
</Unit0>
|
||||
<Unit1>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<ComponentName Value="fmMain"/>
|
||||
<HasResources Value="True"/>
|
||||
<ResourceBaseClass Value="Form"/>
|
||||
<UnitName Value="Unit1"/>
|
||||
</Unit1>
|
||||
<Unit2>
|
||||
<Filename Value="..\..\atsynedit\atsynedit.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="ATSynEdit"/>
|
||||
</Unit2>
|
||||
<Unit3>
|
||||
<Filename Value="..\..\atsynedit\atstrings.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
</Unit3>
|
||||
</Units>
|
||||
</ProjectOptions>
|
||||
<CompilerOptions>
|
||||
<Version Value="11"/>
|
||||
<PathDelim Value="\"/>
|
||||
<Target>
|
||||
<Filename Value="project1"/>
|
||||
</Target>
|
||||
<SearchPaths>
|
||||
<IncludeFiles Value="$(ProjOutDir)"/>
|
||||
<OtherUnitFiles Value="..\..\atsynedit"/>
|
||||
<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="3">
|
||||
<Item1>
|
||||
<Name Value="EAbort"/>
|
||||
</Item1>
|
||||
<Item2>
|
||||
<Name Value="ECodetoolError"/>
|
||||
</Item2>
|
||||
<Item3>
|
||||
<Name Value="EFOpenError"/>
|
||||
</Item3>
|
||||
</Exceptions>
|
||||
</Debugging>
|
||||
</CONFIG>
|
||||
20
ATSynEdit/app/demo_load/project1.lpr
Normal file
20
ATSynEdit/app/demo_load/project1.lpr
Normal file
@@ -0,0 +1,20 @@
|
||||
program project1;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
uses
|
||||
{$IFDEF UNIX}{$IFDEF UseCThreads}
|
||||
cthreads,
|
||||
{$ENDIF}{$ENDIF}
|
||||
Interfaces, // this includes the LCL widgetset
|
||||
Forms, Unit1, atstrings, atsynedit;
|
||||
|
||||
{$R *.res}
|
||||
|
||||
begin
|
||||
RequireDerivedFormResource:=True;
|
||||
Application.Initialize;
|
||||
Application.CreateForm(TfmMain, fmMain);
|
||||
Application.Run;
|
||||
end.
|
||||
|
||||
68
ATSynEdit/app/demo_load/unit1.lfm
Normal file
68
ATSynEdit/app/demo_load/unit1.lfm
Normal file
@@ -0,0 +1,68 @@
|
||||
object fmMain: TfmMain
|
||||
Left = 222
|
||||
Height = 442
|
||||
Top = 254
|
||||
Width = 932
|
||||
Caption = 'App'
|
||||
ClientHeight = 442
|
||||
ClientWidth = 932
|
||||
OnCreate = FormCreate
|
||||
OnShow = FormShow
|
||||
LCLVersion = '1.5'
|
||||
object Panel1: TPanel
|
||||
Left = 0
|
||||
Height = 442
|
||||
Top = 0
|
||||
Width = 626
|
||||
Align = alClient
|
||||
BevelOuter = bvNone
|
||||
Caption = 'Panel1'
|
||||
TabOrder = 0
|
||||
end
|
||||
object Panel2: TPanel
|
||||
Left = 632
|
||||
Height = 442
|
||||
Top = 0
|
||||
Width = 300
|
||||
Align = alRight
|
||||
BevelOuter = bvNone
|
||||
ClientHeight = 442
|
||||
ClientWidth = 300
|
||||
TabOrder = 1
|
||||
object bGettext: TButton
|
||||
Left = 0
|
||||
Height = 25
|
||||
Top = 400
|
||||
Width = 80
|
||||
Caption = 'Get text'
|
||||
OnClick = bGettextClick
|
||||
TabOrder = 0
|
||||
end
|
||||
object List: TShellListView
|
||||
Left = 0
|
||||
Height = 442
|
||||
Top = 0
|
||||
Width = 300
|
||||
Align = alClient
|
||||
Color = clWhite
|
||||
HideSelection = False
|
||||
ReadOnly = True
|
||||
RowSelect = True
|
||||
SortColumn = 0
|
||||
SortType = stText
|
||||
TabOrder = 1
|
||||
ViewStyle = vsSmallIcon
|
||||
OnClick = ListClick
|
||||
ObjectTypes = [otNonFolders]
|
||||
end
|
||||
end
|
||||
object Splitter1: TSplitter
|
||||
Left = 626
|
||||
Height = 442
|
||||
Top = 0
|
||||
Width = 6
|
||||
Align = alRight
|
||||
Beveled = True
|
||||
ResizeAnchor = akRight
|
||||
end
|
||||
end
|
||||
76
ATSynEdit/app/demo_load/unit1.pas
Normal file
76
ATSynEdit/app/demo_load/unit1.pas
Normal file
@@ -0,0 +1,76 @@
|
||||
unit Unit1;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
|
||||
ExtCtrls, ShellCtrls, atstrings, atsynedit, atstringproc;
|
||||
|
||||
type
|
||||
{ TfmMain }
|
||||
TfmMain = class(TForm)
|
||||
bGettext: TButton;
|
||||
Panel1: TPanel;
|
||||
Panel2: TPanel;
|
||||
List: TShellListView;
|
||||
Splitter1: TSplitter;
|
||||
procedure bGettextClick(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure ListClick(Sender: TObject);
|
||||
private
|
||||
{ private declarations }
|
||||
fDir: string;
|
||||
ed: TATSynEdit;
|
||||
public
|
||||
{ public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
fmMain: TfmMain;
|
||||
|
||||
implementation
|
||||
|
||||
{$R *.lfm}
|
||||
|
||||
{ TfmMain }
|
||||
|
||||
procedure TfmMain.FormCreate(Sender: TObject);
|
||||
begin
|
||||
ed:= TATSynEdit.Create(Self);
|
||||
ed.Parent:= Panel1;
|
||||
ed.Align:= alClient;
|
||||
ed.Font.Name:= 'Courier New';
|
||||
ed.OptUnprintedVisible:= false;
|
||||
ed.OptRulerVisible:= false;
|
||||
ed.OptWrapMode:= cWrapOff;
|
||||
|
||||
fDir:= ExtractFilePath(Application.Exename)+'../../test_files';
|
||||
end;
|
||||
|
||||
procedure TfmMain.FormShow(Sender: TObject);
|
||||
begin
|
||||
List.Root:= fDir;
|
||||
end;
|
||||
|
||||
procedure TfmMain.ListClick(Sender: TObject);
|
||||
var
|
||||
s: string;
|
||||
begin
|
||||
s:= List.GetPathFromItem(List.Selected);
|
||||
if not FileExistsUTF8(s) then Exit;
|
||||
|
||||
ed.LoadFromFile(s);
|
||||
ed.SetFocus;
|
||||
Caption:= 'App - '+ExtractFileName(s);
|
||||
end;
|
||||
|
||||
procedure TfmMain.bGettextClick(Sender: TObject);
|
||||
begin
|
||||
ShowMessage(UTF8Encode(ed.Strings.TextString));
|
||||
end;
|
||||
|
||||
|
||||
end.
|
||||
Reference in New Issue
Block a user