About SimpleGraph Component...plz Help me

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

About SimpleGraph Component...plz Help me

Postby ZarrinPour » November 15th, 2006, 8:56 am

Hi all
Special Thanks to Kambiz for his free and nice component (Tsimple Graph).i was looking for such diagram component and all of a sudden , i came accros this component.it was cool But i have a question???
as i surfed the source code all Graphic nodes are descendent of TgraphNode-->TgraphObject-->TPersistant .

now i want to know is it possible for me to create a custom node like RoundRectangularNode BUT with following specifications:
"This node should has two sections, one for a TLable component and another section for a TEdit component"

In the other hand i want to have a RoundRectangularNode with one Lable and one EditBox inside it !!! Is it possible to do at all?
Could anyone help me please?

Any help greately would be appreciated.
Kind Regards.

:cry:
ZarrinPour
Active Member
Active Member
 
Posts: 12
Joined: September 28th, 2003, 5:50 pm

Postby Johnny_Bit » November 15th, 2006, 4:38 pm

built it just like TLabeled Edit. simple, yet good.
Johnny_Bit
VIP Member
VIP Member
 
Posts: 455
Joined: June 15th, 2003, 9:56 am

Postby ZarrinPour » November 16th, 2006, 5:27 am

Johnny_Bit wrote:built it just like TLabeled Edit. simple, yet good.


Hi friend... could you please explain more. if you don't mind.
Kind Regards.
ZarrinPour
Active Member
Active Member
 
Posts: 12
Joined: September 28th, 2003, 5:50 pm

Postby Johnny_Bit » November 16th, 2006, 4:35 pm

Well, as a matter of fact, I'm no simplegraph guy, you should wait till Sunday for Kambiz, as he's the one with the code.

//Edit after Kambiz Posted:
HAIL TO THE KAMBIZ, THE ONE WITH THE CODE!
Last edited by Johnny_Bit on November 19th, 2006, 2:19 pm, edited 1 time in total.
Johnny_Bit
VIP Member
VIP Member
 
Posts: 455
Joined: June 15th, 2003, 9:56 am

Postby Kambiz » November 19th, 2006, 12:33 pm

More explanation means writing the full code. :?

Anyway, in the constructor of your node, you create a TLabeledEdit control and initialize it (You should set control's parent to SG), then you free it in the destructor. Move the control whenever the node is moved or resized.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2408
Joined: March 7th, 2003, 7:10 pm

Postby ZarrinPour » November 23rd, 2006, 8:29 am

Kambiz wrote:(You should set control's parent to SG)


Hi Kambiz
Thanks for your Attention.
To tell the truth, before i started this thread and as i said earlier, i surfed your code and created a simple node(just copy & paste ur code with diffrent name) after that as you said i initialized the node and in constrtuctor i created a TEdit Component and....BUT this TEdit'parent is Simple Graph so no wonder that this TEdit will appear inside SimpleGraph not inside the node. in fact i want a node with one TEdit Control (VCL) inside it so if node moves , this Tedit and other visual control inside the node will moved without any line of code.I hope you understand my meaning.

Kind Regards.
ZarrinPour
Active Member
Active Member
 
Posts: 12
Joined: September 28th, 2003, 5:50 pm

Postby Kambiz » November 23rd, 2006, 6:57 pm

SimpleGraph's nodes are not windowed control, therefore you should adjust the placement of the Edit control by yourself.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2408
Joined: March 7th, 2003, 7:10 pm

Postby Johnny_Bit » November 23rd, 2006, 8:43 pm

Kambiz wrote:SimpleGraph's nodes are not windowed control, therefore you should adjust the placement of the Edit control by yourself.


And before you may ask: It can be done while node is on the move, by using event coordinates, just don't tell us it's too hard to assign two properties to appropriate values. Another question may come by regarding possible flickering: set DoubleBuffered to true, In most cases it helps.

//To Kambiz: You wanted to rewrite SG to GDI+? I'm sure that effects of this would not only help SG gain some neat looks, but it would draw itself faster, and that's sometimes a big issue.
Johnny_Bit
VIP Member
VIP Member
 
Posts: 455
Joined: June 15th, 2003, 9:56 am


Return to DELPHI AREA Products

Who is online

Users browsing this forum: No registered users and 1 guest

cron