In JSL, is it possible to identify a selected (or clicked-on) box in a diagram?Hi,
I click on a box in a hierarchical diagram.
How can I know (using JSL) which box has been selected?
Thanks.
Shaul.
Re: In JSL, is it possible to identify a selected (or clicked-on) box in a diagram?OK! it works. Thanks a lot. Here's the JSL that swiches "h2" on and off.
namesdefaulttohere(1);
shw2=1;
w=newwindow("w",
h1=hierbox("h1",
b2=buttonbox("b2",
shw2=1-shw2;
h2<<VISIBILITY></VISIBILITY>Re: In JSL, is it possible to identify a selected (or clicked-on) box in a diagram?Ok... It seems to be an elegant solution to the lack of an inherent open/close possibility. I got it and will try it and will inform asap.
As I mentioned before, the need is to manipulate the visibility of parts of a diagram.
Thanks again.
Re: In JSL, is it possible to identify a selected (or clicked-on) box in a diagram?As I said already, I'm not sure what behaviour you are looking for nor, at a higher level, of what you want to acomplish (there's almost always more than one way to deliver the desired functionality). Not knowing the latter, this slight modification of the example above may or may not help.
Names Default To Here( 1 );
Diagram(
hierarchy(
Hier Box(
bb1 = Button Box( "Great Grand Parent", Speak(bb1<<GETBUTTONNAME></GETBUTTONNAME>
Re: In JSL, is it possible to identify a selected (or clicked-on) box in a diagram?Thanks. Indeed there is no direct way to address my need.
However, I will redefine my need, maybe for the developers of JMP, for future versions:
The need is to be able to open or to close parts of a diagram, just like it can be doen with OUTLINEBOXes.
Again, Thank you both.
Re: In JSL, is it possible to identify a selected (or clicked-on) box in a diagram?Thanks. However, I didn't understand how to extract the identification of the box (slected or clicked).
Re: In JSL, is it possible to identify a selected (or clicked-on) box in a diagram?Select Help > Scripting Index. Change browser to show Display Boxes. Select HierBox in the first list. I do not find anything in the proctocol for this object that directly addresses your need.
You can also use Show Properties( HierBox() ) and examine the Log.
This object is self-contained in the case of editing actions. None of the editing or change states are surfaced to JSL.
Re: In JSL, is it possible to identify a selected (or clicked-on) box in a diagram?I'm not quite sure what behaviour you want. But it might be possible to take this kind of approach, where 'doSomething()' makes changes to the display tree. If you are removing or hiding nodes then I guess you would need another button to restore them.
Names Default To Here( 1 );
doSomething = Expr( Beep() );
Diagram(
hierarchy(
Hier Box(
Button Box( "Great Grand Parent", doSomething, <<UNDERLINESTYLE></UNDERLINESTYLE>
Re: In JSL, is it possible to identify a selected (or clicked-on) box in a diagram?I'd like to make my point clear.
Suppose I create a diagram. In that diagram, I 'd like to hide any selected box.
I could do it if I had something like "Is Selected" property of the HierBox which, it seems, I don't have.
So I will demonstrate the idea as if I could have a variable (shw) indicating the selection of "h2" (HierBox #2):
shw=1;
w=newwindow("w",
h1=hierbox("h1",
h2=hierbox("h2",
<<VISIBILITY></VISIBILITY>Since shw=1, the diagram is completely shown, However, shw=0, "h2" and "h3" are hidden and only "h1" is shown..
Re: In JSL, is it possible to identify a selected (or clicked-on) box in a diagram?Of course, My question referes to an automatic identification by JSL
Re: In JSL, is it possible to identify a selected (or clicked-on) box in a diagram?Here's a simple code:
w=newwindow("w",
h1=hierbox("h1",
h2=hierbox("h2",
h3=hierbox("h3")
)
)
);
Now, when I get the diagram and click on one of the boxes, I'd like to know exactly which box has been selected.
Thanks.
Re: In JSL, is it possible to identify a selected (or clicked-on) box in a diagram?Probably more details are required to give a sensible response. How, exactly, did you generate the diagram, please?