PDA

View Full Version : Regarding a requirement


Anusha
03-18-2004, 04:25 AM
Hi

Thanks rudresh for u'r solution.It's working fine now.

I am in need of one requirement.

1)I need to have a box say RootButton(here I am using a Button for that).
2)On clicking that box a pop up window should open
I am using floatingList for that.
3)floatingList will have a textbox and a Button.
4)On click event of the Button in the pop up menu I need to set the text of the textbox to the RootButton.

I tried that using this code snippet.. but unable to get the result.. could be please help me in this..

<canvas width="500" height="80">
<class name="SpecialButton" extends="button" onclick="changeLabel()">
<method name="changeLabel">
canvas.RootButton.setAttribute('text', 'Clicked! ');
</method>
</class>

<class name="RootButton" extends="button"></class>

<RootButton text="ONE">
<floatinglist width="80" attach="right">
<edittext></edittext>
<SpecialButton> OK </SpecialButton>
</floatinglist>
</RootButton>
</canvas>


Regards
Anush

thipperudra
03-18-2004, 07:33 PM
Hi Anusha,

<canvas width="500" height="80">
<class name="SpecialButton" extends="button" onclick="changeLabel()">
<method name="changeLabel">
canvas.RB.setAttribute('text', textbox.getText() );
</method>
</class>

<class name="RootButton" extends="button"></class>

<RootButton name="RB" text="ONE">
<floatinglist width="80" attach="right">
<edittext id="textbox" ></edittext>
<SpecialButton> OK </SpecialButton>
</floatinglist>
</RootButton>
</canvas>

Is it above code is the answer for your question.

-Rudresh

Anusha
03-21-2004, 07:46 PM
Hi
Thanks Rudresh for u'r solution.The code which u had sent had given me the expected solution.It's working now.thanks to u once again..

Anusha

Anusha
03-22-2004, 03:27 AM
Hi Rudresh

As per my previous requirement On clicking of a button a pop-up menu should appear and the value of the text box in the Pop up menu should get entered into the button value.It's working now.Now I'm in need of another solution that i need to have a link between the rootbutton(rootnode) and another box(child node).is it possible ???.That link should be continous without any breakages in between...Hope u understood my requirement and suggest me some solution...

Thanks in Advance

Anusha

antun
03-22-2004, 09:09 AM
I don't understand what you are asking. What do you mean by "link"?

-Antun

Now I'm in need of another solution that i need to have a link between the rootbutton(rootnode) and another box(child node).

Anusha
03-22-2004, 10:27 PM
Hi Antun

The "link" means an arrow-headed line which connects the 2 boxes.And the two boxes and the line should come under a group i.e when i'm going to remove the boxes the link should also get removed and they should not break i.e the link should not break...This is my requirement.

--Anush

antun
03-23-2004, 08:21 AM
Yeah, you could do that with a bunch of constraints. There's probably other ways to do it too, but this one's fairly elegant:


<canvas>

<class name="arrow" height="2" bgcolor="black"
x="${this.snapFrom.arrowSnapX}"
y="${this.snapFrom.arrowSnapY}"
rotation="${(90 - Math.atan(
(snapTo.x-snapFrom.x)/(snapTo.y-snapFrom.y)
)) * 57}"
width="${Math.sqrt(
Math.pow(snapTo.x-snapFrom.x,2)
+Math.pow(snapTo.y-snapFrom.y,2) )}"
>
<attribute name="snapFrom" />
<attribute name="snapTo" />

</class>


<class name="arrowSnapBox" bgcolor="red" width="50" height="50"
onmousedown="dragger.apply()">

<method event="onmouseup">
dragger.remove();
</method>

<attribute name="arrowSnapX" value="${this.x + this.width/2}" />
<attribute name="arrowSnapY" value="${this.y + this.height/2}" />
<dragstate name="dragger" />
</class>


<arrowSnapBox id="myFromBox" x="10" y="20" />

<arrow name="foo" snapFrom="$once{myFromBox}" snapTo="$once{myToBox}" />

<arrowSnapBox id="myToBox" x="176" y="250" bgcolor="blue" />

</canvas>


-Antun