| View previous topic :: View next topic |
| Author |
Message |
ZarrinPour Member
Joined: 28 Sep 2003 Posts: 11
|
Posted: 15/11/06 08:56 Post subject: About SimpleGraph Component...plz Help me |
|
|
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.
|
|
| Back to top |
|
 |
Johnny_Bit Administrator
Joined: 15 Jun 2003 Posts: 347
|
Posted: 15/11/06 16:38 Post subject: |
|
|
| built it just like TLabeled Edit. simple, yet good.
|
|
| Back to top |
|
 |
ZarrinPour Member
Joined: 28 Sep 2003 Posts: 11
|
Posted: 16/11/06 05:27 Post subject: |
|
|
| 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.
|
|
| Back to top |
|
 |
Johnny_Bit Administrator
Joined: 15 Jun 2003 Posts: 347
|
Posted: 16/11/06 16:35 Post subject: |
|
|
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 19/11/06 14:19; edited 1 time in total |
|
| Back to top |
|
 |
Kambiz Administrator

Joined: 07 Mar 2003 Posts: 1113 Location: Tehran, Iran
|
Posted: 19/11/06 12:33 Post subject: |
|
|
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 |
|
| Back to top |
|
 |
ZarrinPour Member
Joined: 28 Sep 2003 Posts: 11
|
Posted: 23/11/06 08:29 Post subject: |
|
|
| 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.
|
|
| Back to top |
|
 |
Kambiz Administrator

Joined: 07 Mar 2003 Posts: 1113 Location: Tehran, Iran
|
Posted: 23/11/06 18:57 Post subject: |
|
|
SimpleGraph's nodes are not windowed control, therefore you should adjust the placement of the Edit control by yourself.
_________________ Kambiz |
|
| Back to top |
|
 |
Johnny_Bit Administrator
Joined: 15 Jun 2003 Posts: 347
|
Posted: 23/11/06 20:43 Post subject: |
|
|
| 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.
|
|
| Back to top |
|
 |
|