Sample program of SimpleGraph

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

Sample program of SimpleGraph

Postby neverush » January 24th, 2012, 6:25 pm

Hi All,
I try to use code from sample program of SimpleGraph with alignment of node caption, but I'm receiving message "Incompatible types: 'TAlignment' and 'TgtTextAlignment'" - see attachment picture. What's wrong? Can you help me, please?
Attachments
Error.jpg
Error.jpg (39.24 KiB) Viewed 2958 times
neverush
Active Member
Active Member
 
Posts: 8
Joined: January 24th, 2012, 4:52 pm

Re: Sample program of SimpleGraph

Postby neverush » January 27th, 2012, 9:47 pm

I have some idea about my problem. There is collision between alignment as taCenter and alignment's property of different component. Problem is that I have no source code for the different component. Acc. I can change SimpleGraph only. How can I rename alignment's property as taCenter to taCenterJustify, for example. What I need to do (sorry, I'm beginner in Delphi)
neverush
Active Member
Active Member
 
Posts: 8
Joined: January 24th, 2012, 4:52 pm

Re: Sample program of SimpleGraph

Postby taazz2 » January 30th, 2012, 7:50 am

Don't change any value you simple add in front of the taCenter the unit name where the value you wand to use is declared.

EG.
TGraphNode(GraphObject).Alignment := SimpleGraph.taCenter;


That whould help you overcome the problem you are having now.
taazz2
Active Member
Active Member
 
Posts: 22
Joined: September 28th, 2011, 4:21 am

Re: Sample program of SimpleGraph

Postby neverush » January 30th, 2012, 5:07 pm

taazz2
Thank you for your answer. But unfortunately your solution dos not work - see attachment picture (unit Simplegraph is declared). Now Delphi don't know taCenter just.
Error:
E2003 Undeclared identifier: 'taCenter'
Attachments
Error1.jpg
Error1.jpg (18.74 KiB) Viewed 2885 times
neverush
Active Member
Active Member
 
Posts: 8
Joined: January 24th, 2012, 4:52 pm

Re: Sample program of SimpleGraph

Postby taazz2 » January 31st, 2012, 12:44 pm

that is because i did not do my homework before posting an answer. SimpleGraph simple uses the TAlignment type declared in classes unit that comes with delphi and does not redeclare it, so instead of SimpleGraph.taCenter you should use Classes.taCenter and yes this time around I checked that it works.

For the record you can ctrl+click on a property to take you to its declaration then ctrl+click the properties type to go to its declaration to find out where something is declared then use that unit as the example above.
taazz2
Active Member
Active Member
 
Posts: 22
Joined: September 28th, 2011, 4:21 am

Re: Sample program of SimpleGraph

Postby neverush » January 31st, 2012, 4:21 pm

taazz2
Thank you for answer. Your solution as Classes.taCenter works fine. -1 my problem :) And ctrl+click is very useful, thanks.
neverush
Active Member
Active Member
 
Posts: 8
Joined: January 24th, 2012, 4:52 pm


Return to DELPHI AREA Projects

Who is online

Users browsing this forum: No registered users and 32 guests

cron