diff --git a/anchoring/anchoring b/anchoring/anchoring new file mode 100755 index 0000000..7fdff30 Binary files /dev/null and b/anchoring/anchoring differ diff --git a/anchoring/anchoring.ico b/anchoring/anchoring.ico new file mode 100644 index 0000000..0341321 Binary files /dev/null and b/anchoring/anchoring.ico differ diff --git a/anchoring/anchoring.lpi b/anchoring/anchoring.lpi new file mode 100644 index 0000000..353f381 --- /dev/null +++ b/anchoring/anchoring.lpi @@ -0,0 +1,79 @@ + + + + + + + + + <Scaled Value="True"/> + <ResourceType Value="res"/> + <UseXPManifest Value="True"/> + <XPManifest> + <DpiAware Value="True"/> + </XPManifest> + <Icon Value="0"/> + </General> + <BuildModes Count="1"> + <Item1 Name="Default" Default="True"/> + </BuildModes> + <PublishOptions> + <Version Value="2"/> + <UseFileFilters Value="True"/> + </PublishOptions> + <RunParams> + <FormatVersion Value="2"/> + <Modes Count="0"/> + </RunParams> + <RequiredPackages Count="1"> + <Item1> + <PackageName Value="LCL"/> + </Item1> + </RequiredPackages> + <Units Count="2"> + <Unit0> + <Filename Value="anchoring.lpr"/> + <IsPartOfProject Value="True"/> + </Unit0> + <Unit1> + <Filename Value="main_anchoring.pas"/> + <IsPartOfProject Value="True"/> + <ComponentName Value="Form1"/> + <ResourceBaseClass Value="Form"/> + </Unit1> + </Units> + </ProjectOptions> + <CompilerOptions> + <Version Value="11"/> + <Target> + <Filename Value="anchoring"/> + </Target> + <SearchPaths> + <IncludeFiles Value="$(ProjOutDir)"/> + <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/> + </SearchPaths> + <Linking> + <Debugging> + <DebugInfoType Value="dsDwarf2"/> + </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> diff --git a/anchoring/anchoring.lpr b/anchoring/anchoring.lpr new file mode 100644 index 0000000..b8a9bf4 --- /dev/null +++ b/anchoring/anchoring.lpr @@ -0,0 +1,22 @@ +program anchoring; + +{$mode objfpc}{$H+} + +uses + {$IFDEF UNIX}{$IFDEF UseCThreads} + cthreads, + {$ENDIF}{$ENDIF} + Interfaces, // this includes the LCL widgetset + Forms, main_anchoring + { you can add units after this }; + +{$R *.res} + +begin + RequireDerivedFormResource:=True; + Application.Scaled:=True; + Application.Initialize; + Application.CreateForm(TForm1, Form1); + Application.Run; +end. + diff --git a/anchoring/main_anchoring.lfm b/anchoring/main_anchoring.lfm new file mode 100644 index 0000000..e874b91 --- /dev/null +++ b/anchoring/main_anchoring.lfm @@ -0,0 +1,9 @@ +object Form1: TForm1 + Left = 361 + Height = 240 + Top = 125 + Width = 320 + Caption = 'Form1' + OnCreate = FormCreate + LCLVersion = '2.0.12.0' +end diff --git a/anchoring/main_anchoring.pas b/anchoring/main_anchoring.pas new file mode 100644 index 0000000..d74d1a8 --- /dev/null +++ b/anchoring/main_anchoring.pas @@ -0,0 +1,79 @@ +unit main_anchoring; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls, StdCtrls; + +type + + { TForm1 } + + TForm1 = class(TForm) + procedure FormCreate(Sender: TObject); + private + + public + + end; + +var + Form1: TForm1; + +implementation + +{$R *.lfm} + +{ TForm1 } + +procedure TForm1.FormCreate(Sender: TObject); +var + Memo1, Memo2: TMemo; + splitter: TSplitter; + sl: TStringList; +begin + Height := 140; + sl := TStringList.Create; + + try + sl.CommaText := 'Memo1 line2 line3 line4 line5'; + + Memo1 := TMemo.Create(Self); + with Memo1 do + begin + Lines.AddStrings(sl); + Align := alLeft; + Parent := Self; + end; + + splitter := TSplitter.Create(Self); + with splitter do + begin + Align := alNone; + Left := 120; + Parent := Self; + AnchorParallel(akBottom, 0, Parent); + end; + + Memo1.AnchorToNeighbour(akRight, 0, splitter); + + sl.Clear; + sl.CommaText := '"Memo 2", "2nd added line","3rd added line", "4th added line", "5th added line"'; + Memo2 := TMemo.Create(Self); + with Memo2 do + begin + Align := alRight; + AnchorToNeighbour(akLeft, 0, splitter); + Lines.AddStrings(sl); + Parent := Self; + end; + + finally + sl.Free; + end; +end; + +end. +