PDA

View Full Version : delete the selected image using delete key


mallesh
01-28-2004, 05:48 AM
Hi Antun,

I am trying to delete the selected image using delete key in the keyboard. But when i press the delete key, it will delete all images instead of selected one.

How can i do this ?

I am sending this code as attachment.

thanks
Mallesh.

antun
01-28-2004, 11:00 AM
I moved the onkeydown method into the clipartView class definition. Since you were already using a selection manager, I retrieved the selected replicated view from there:


<method event="onkeydown" reference="LzKeys" args="k" >
if (k==46) {
var selectedNode = this.selector.selected[0];
selectedNode.datapath.deleteNode();
}
</method>


-Antun

mallesh
01-29-2004, 06:01 AM
Hi Antun,
Thanks for your solution.
The above code working fine .But i don't want to delete the images but need to make those images set visible false.Becouse in later stage i have to make those images visible true.So how do i do this?


Thanks
Mallesh.

antun
01-29-2004, 11:51 AM
Instead of calling deleteNode() on the datapath of the selected node, just call setVisible( false ):


selectedNode.setVisible( false );


-Antun