examples: lvlgraph: use designer class

git-svn-id: trunk@40606 -
This commit is contained in:
mattias 2013-03-21 19:44:39 +00:00
parent 446f84c90a
commit 9e90c2665c
4 changed files with 28 additions and 19 deletions

View File

@ -1,7 +1,7 @@
object Form1: TForm1 object Form1: TForm1
Left = 161 Left = 456
Height = 474 Height = 474
Top = 149 Top = 192
Width = 754 Width = 754
Caption = 'Form1' Caption = 'Form1'
ClientHeight = 474 ClientHeight = 474
@ -37,4 +37,16 @@ object Form1: TForm1
Top = 0 Top = 0
Width = 5 Width = 5
end end
object LvlGraphControl1: TLvlGraphControl
Left = 205
Height = 474
Top = 0
Width = 549
Align = alClient
NodeStyle.DefaultImageIndex = -1
NodeStyle.Coloring = lgncRGB
ParentColor = True
TabOrder = 2
TabStop = False
end
end end

View File

@ -1,4 +1,4 @@
unit lvlgraph_dep_unit1; unit LvlGraph_Dep_Unit1;
{$mode objfpc}{$H+} {$mode objfpc}{$H+}
@ -13,14 +13,13 @@ type
{ TForm1 } { TForm1 }
TForm1 = class(TForm) TForm1 = class(TForm)
LvlGraphControl1: TLvlGraphControl;
Panel1: TPanel; Panel1: TPanel;
Splitter1: TSplitter; Splitter1: TSplitter;
TIPropertyGrid1: TTIPropertyGrid; TIPropertyGrid1: TTIPropertyGrid;
procedure FormCreate(Sender: TObject); procedure FormCreate(Sender: TObject);
private private
{ private declarations }
public public
{ public declarations }
end; end;
var var
@ -33,12 +32,8 @@ implementation
{ TForm1 } { TForm1 }
procedure TForm1.FormCreate(Sender: TObject); procedure TForm1.FormCreate(Sender: TObject);
var
LvlGraph: TLvlGraphControl;
begin begin
LvlGraph:=TLvlGraphControl.Create(Self); with LvlGraphControl1 do begin
with LvlGraph do begin
Name:='LvlGraph';
Graph.GetEdge('-Project-','LCL',true); Graph.GetEdge('-Project-','LCL',true);
Graph.GetEdge('-Project-','Cody',true); Graph.GetEdge('-Project-','Cody',true);
Graph.GetEdge('Cody','IDEIntf',true); Graph.GetEdge('Cody','IDEIntf',true);
@ -53,11 +48,9 @@ begin
Graph.GetEdge('Cody','LazUtils',true); Graph.GetEdge('Cody','LazUtils',true);
Graph.GetEdge('-Project-','OpenGLControl',true); Graph.GetEdge('-Project-','OpenGLControl',true);
Graph.GetEdge('OpenGLControl','LCL',true); Graph.GetEdge('OpenGLControl','LCL',true);
Align:=alClient;
Parent:=Self;
end; end;
TIPropertyGrid1.TIObject:=LvlGraph; TIPropertyGrid1.TIObject:=LvlGraphControl1;
end; end;
end. end.

View File

@ -27,18 +27,22 @@
<RunParams> <RunParams>
<local> <local>
<FormatVersion Value="1"/> <FormatVersion Value="1"/>
<LaunchingApplication PathPlusParams="/usr/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
</local> </local>
</RunParams> </RunParams>
<RequiredPackages Count="3"> <RequiredPackages Count="4">
<Item1> <Item1>
<PackageName Value="RunTimeTypeInfoControls"/> <PackageName Value="LazControls"/>
</Item1> </Item1>
<Item2> <Item2>
<PackageName Value="Cody"/> <PackageName Value="RunTimeTypeInfoControls"/>
</Item2> </Item2>
<Item3> <Item3>
<PackageName Value="LCL"/> <PackageName Value="Cody"/>
</Item3> </Item3>
<Item4>
<PackageName Value="LCL"/>
</Item4>
</RequiredPackages> </RequiredPackages>
<Units Count="2"> <Units Count="2">
<Unit0> <Unit0>
@ -52,7 +56,7 @@
<ComponentName Value="Form1"/> <ComponentName Value="Form1"/>
<HasResources Value="True"/> <HasResources Value="True"/>
<ResourceBaseClass Value="Form"/> <ResourceBaseClass Value="Form"/>
<UnitName Value="lvlgraph_dep_unit1"/> <UnitName Value="LvlGraph_Dep_Unit1"/>
</Unit1> </Unit1>
</Units> </Units>
</ProjectOptions> </ProjectOptions>

View File

@ -7,7 +7,7 @@ uses
cthreads, cthreads,
{$ENDIF}{$ENDIF} {$ENDIF}{$ENDIF}
Interfaces, // this includes the LCL widgetset Interfaces, // this includes the LCL widgetset
Forms, runtimetypeinfocontrols, lvlgraph_dep_unit1 Forms, runtimetypeinfocontrols, lazcontrols, lvlgraph_dep_unit1
{ you can add units after this }; { you can add units after this };
{$R *.res} {$R *.res}