| View previous topic :: View next topic |
| Author |
Message |
zippi Member
Joined: 19 Jul 2006 Posts: 2
|
Posted: 19/07/06 10:10 Post subject: Question about arrows |
|
|
Hello,
first, please excuse my bad English.
I have follow Question: I want to change the Arrow in lsnone, the Source is working, but nothing changed.
Please can you help me!
Thank you!
| Code: | procedure TMainForm.sBitBtn1Click(Sender: TObject);
var arrow : tgraphlink;
first,last:tlinkbeginendstyle;
begin
first:=lsnone;
last:=lsnone;
try
arrow:=tgraphlink.Create(simplegraph);
arrow.BeginStyle:=first;
arrow.EndStyle:=last;
SimpleGraph.CommandMode := cmInsertLink;
finally
arrow.Free;
end;
end. |
|
|
| Back to top |
|
 |
Kambiz Administrator

Joined: 07 Mar 2003 Posts: 1231 Location: Tehran, Iran
|
Posted: 04/08/06 13:43 Post subject: |
|
|
You did it in a wrong way. You should use OnObjectInitInstance event to change default properties of an object.
| Code: | procedure TForm1.SimpleGraph1ObjectInitInstance(Graph: TSimpleGraph;
GraphObject: TGraphObject);
begin
if GraphObject is TGraphLink then
with TGraphLink(GraphObject) do
begin
BeginStyle := lsNone;
EndStyle := lsNone;
end;
end; |
_________________ Kambiz
 |
|
| Back to top |
|
 |
zippi Member
Joined: 19 Jul 2006 Posts: 2
|
Posted: 07/08/06 12:07 Post subject: |
|
|
| Kambiz wrote: | You did it in a wrong way. You should use OnObjectInitInstance event to change default properties of an object.
| Code: | procedure TForm1.SimpleGraph1ObjectInitInstance(Graph: TSimpleGraph;
GraphObject: TGraphObject);
begin
if GraphObject is TGraphLink then
with TGraphLink(GraphObject) do
begin
BeginStyle := lsNone;
EndStyle := lsNone;
end;
end; |
|
Hello Kambiz!
Thank you for the advice to the right way. It works great.
Zippi
|
|
| Back to top |
|
 |
|