Question about arrows

Please post bug reports, feature requests, or any question regarding the DELPHI AREA projects here.

Question about arrows

Postby zippi » July 19th, 2006, 10:10 am

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: Select all
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.
zippi
Member
Member
 
Posts: 2
Joined: July 19th, 2006, 9:58 am

Postby Kambiz » August 4th, 2006, 1:43 pm

You did it in a wrong way. You should use OnObjectInitInstance event to change default properties of an object.

Code: Select all
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
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm

Postby zippi » August 7th, 2006, 12:07 pm

Kambiz wrote:You did it in a wrong way. You should use OnObjectInitInstance event to change default properties of an object.

Code: Select all
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. :wink:

Zippi
zippi
Member
Member
 
Posts: 2
Joined: July 19th, 2006, 9:58 am


Return to DELPHI AREA Projects

Who is online

Users browsing this forum: No registered users and 2 guests

cron