|
View:
New views
11 Messages
—
Rating Filter:
Alert me
|
|
|
Properties Window on clicking a node on a TreeHi,
I am not sure if this mail was sent on the mailing list as I don't see it yet and had got a delivery failure notice. So, sending it again. I want to add a functionality in my Tree Widget that whenever a Node is clicked on I get a window attached to that node (similar to when we do a right click to any file or folder in a file system and get a popup window with options like Cut, Copy ... ,Properties. I want a similar functinality on single click of a tree node). I have used the "click" event and am able to get an alert box whenever I click any node.But how do I show a a window relative to each node with some options like Add, Delete etc. regards -- Amit Rana ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ qooxdoo-devel mailing list qooxdoo-devel@... https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel |
|
|
Re: Properties Window on clicking a node on a TreeAmit,
> I am not sure if this mail was sent on the mailing list as I don't > see it yet and had got a delivery failure notice. So, sending it > again. Yes, I've had this problem too. Seems like Sourceforge has some list problems. > I want to add a functionality in my Tree Widget that whenever a > Node is clicked on I get a window attached to that node (similar to > when we do a right click to any file or folder in a file system and > get a popup window with options like Cut, Copy ... ,Properties. I > want a similar functinality on single click of a tree node). > > I have used the "click" event and am able to get an alert box > whenever I click any node.But how do I show a a window relative to > each node with some options like Add, Delete etc. Take a look at http://n2.nabble.com/mouse-coordinates-relative-to-widget-td9374.html This is for 0.7.x - you may have to change it for 0.8.x Hugh ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ qooxdoo-devel mailing list qooxdoo-devel@... https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel |
|
|
Re: Properties Window on clicking a node on a Tree
Hi,
Hugh Gibson ha scritto: problem is still there i suppose. :-)Amit, I figured that I can use qx.ui.menu.Menu from one the the demos and its working. The problem is that for leaf nodes in my tree, the context menu appears correctly at the bottom (but not at the right ... it starts not from bottom right of the node but from its bottom and extreme left). Also, for non-leaf nodes, the context menu gets shifted from the top and appears not below the non-leaf node but below its lowest leaf node. I am still trying to figure out the problem here. My code snippet is : var contextMenu = new qx.ui.menu.Menu; var insertButton = new qx.ui.menu.Button("Insert"); var deleteButton = new qx.ui.menu.Button("Delete"); contextMenu.add(insertButton,deleteButton); var d = qx.ui.core.ClientDocument.getInstance(); d.add(contextMenu); var ele = myTree.getSelectedElement().getElement(); contextMenu.setLeft(qx.html.Location.getPageBoxLeft(ele)); //Problem here contextMenu.setTop(qx.html.Location.getPageBoxBottom(ele)); // //Problem here contextMenu.show(); yes .. i am using 0.7.3.Take a look at http://n2.nabble.com/mouse-coordinates-relative-to-widget-td9374.html This is for 0.7.x - you may have to change it for 0.8.x thanks for the help Hugh . I guess i already found this part but unfortunately, its not working in the way I want.Hugh regards Amit ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ qooxdoo-devel mailing list qooxdoo-devel@... https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel |
|
|
Re: Properties Window on clicking a node on a TreeAmit Rana ha scritto:
> Hi, > > Hugh Gibson ha scritto: >> Amit, >> >> >>> I am not sure if this mail was sent on the mailing list as I don't >>> see it yet and had got a delivery failure notice. So, sending it >>> again. >>> >> >> Yes, I've had this problem too. Seems like Sourceforge has some list >> problems. >> > problem is still there i suppose. :-) >> >> >>> I want to add a functionality in my Tree Widget that whenever a >>> Node is clicked on I get a window attached to that node (similar to >>> when we do a right click to any file or folder in a file system and >>> get a popup window with options like Cut, Copy ... ,Properties. I >>> want a similar functinality on single click of a tree node). >>> >>> I have used the "click" event and am able to get an alert box >>> whenever I click any node.But how do I show a a window relative to >>> each node with some options like Add, Delete etc. >>> >> >> > I figured that I can use qx.ui.menu.Menu from one the the demos and > its working. > The problem is that for leaf nodes in my tree, the context menu > appears correctly at the bottom (but not at the right ... it starts > not from bottom right of the node but from its bottom and extreme left). > Also, for non-leaf nodes, the context menu gets shifted from the top > and appears not below the non-leaf node but below its lowest leaf node. > I am still trying to figure out the problem here. > > My code snippet is : > > /var contextMenu = new qx.ui.menu.Menu; > > var insertButton = new qx.ui.menu.Button("Insert"); > var deleteButton = new qx.ui.menu.Button("Delete"); > contextMenu.add(insertButton,deleteButton); > > var d = qx.ui.core.ClientDocument.getInstance(); > d.add(contextMenu); > > var ele = myTree.getSelectedElement().getElement(); > contextMenu.setLeft(qx.html.Location.getPageBoxLeft(ele)); > //Problem here > contextMenu.setTop(qx.html.Location.getPageBoxBottom(ele)); // // > //Problem here/ > / > / contextMenu.setLeft(qx.bom.element.Location.getRight(ele)); contextMenu.setTop(qx.bom.element.Location.getBottom(ele)); but got same results as before. > /contextMenu.show();/ >> Take a look at >> http://n2.nabble.com/mouse-coordinates-relative-to-widget-td9374.html >> >> This is for 0.7.x - you may have to change it for 0.8.x >> >> > yes .. i am using 0.7.3. >> Hugh >> > thanks for the help Hugh . I guess i already found this part but > unfortunately, its not working in the way I want. > > > regards > Amit -- Amit Rana SpagoBI Developer Research & Innovation Division Engineering Ingegneria Informatica S.p.A. Strada 2, Palazzo D3 - 20090, Milanofiori Assago (Milan) - Italy Mobile: +39-3276115975 www.eng.it www.spagoworld.org ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ qooxdoo-devel mailing list qooxdoo-devel@... https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel |
|
|
Re: Properties Window on clicking a node on a Tree> I figured that I can use qx.ui.menu.Menu from one the the demos and
> its working. > The problem is that for leaf nodes in my tree, the context menu > appears correctly at the bottom (but not at the right ... it starts > not from bottom right of the node but from its bottom and extreme > left). You are using getPageBoxLeft so I'm not surprised thst it's positioned at the left. > Also, for non-leaf nodes, the context menu gets shifted from the > top and appears not below the non-leaf node but below its lowest > leaf node. > I am still trying to figure out the problem here. Sounds like the non-leaf node contains all its leaf nodes rather than being just above it. I suggest you se Firebug's HTML inspect option to find a relevant element you can use for real coordinates like a label for the node. Or take the top of the element and add afixed offset. Hugh ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ qooxdoo-devel mailing list qooxdoo-devel@... https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel |
|
|
Re: Properties Window on clicking a node on a TreeHugh Gibson wrote: > >> I figured that I can use qx.ui.menu.Menu from one the the demos and >> its working. >> The problem is that for leaf nodes in my tree, the context menu >> appears correctly at the bottom (but not at the right ... it starts >> not from bottom right of the node but from its bottom and extreme >> left). > > You are using getPageBoxLeft so I'm not surprised thst it's positioned at > the left. > > I have also tried : > > var ele = myTree.getSelectedElement().getElement(); > > contextMenu.setLeft(qx.html.Location.getPageBoxRight(ele)); > contextMenu.setTop(qx.html.Location.getPageBoxBottom(ele)); > > as well as, > > contextMenu.setLeft(qx.bom.element.Location.getRight(ele)); > contextMenu.setTop(qx.bom.element.Location.getBottom(ele)); > > but, it is not giving the desired result. No clues why !! > >> Also, for non-leaf nodes, the context menu gets shifted from the >> top and appears not below the non-leaf node but below its lowest >> leaf node. >> I am still trying to figure out the problem here. > > Sounds like the non-leaf node contains all its leaf nodes rather than > being just above it. I suggest you se Firebug's HTML inspect option to > find a relevant element you can use for real coordinates like a label for > the node. Or take the top of the element and add afixed offset. > > Hugh > > thanks for the suggestion ... i will try to find a way .. there must be > some easy way in Qooxdoo :-) > > Amit -- View this message in context: http://n2.nabble.com/Properties-Window-on-clicking-a-node-on-a-Tree-tp1112787p1117582.html Sent from the qooxdoo mailing list archive at Nabble.com. ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ qooxdoo-devel mailing list qooxdoo-devel@... https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel |
|
|
Re: Properties Window on clicking a node on a TreeApart from the 2 small problems mentioned below, the main problem is the event listener on a tree node. I want that whenever I click on any node of my tree, I should get a context menu for that node. I am able to to if I use the "click" eventlistener. But, if I use it, then even if I click anywhere outside the node, the context menu pops up (which I don't want). To avoid this, I used the "changeSelection" event listner, but it does not show the context menu. I used an alert box and it is shown but the context menu is not shown. regards Amit Amit Rana ha scritto: Hugh Gibson wrote: ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ qooxdoo-devel mailing list qooxdoo-devel@... https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel |
|
|
Re: Properties Window on clicking a node on a Tree
Hi all,
I am facing a couple of problems in my Tree widget. 1. Context Menu on Node : I want to get a context menu for a node when it is clicked on. So, I have included the "click" event listener. But then, even if I click outside the tree (Not on a node but outside, I still get the context menu) which I don't want. Please see the screenshot attached. As you can see that my mouse is away from a node but I still get the alert on click. I know that this is how the click event works. I checked the Demo browser and there the "changeSelection" listener is used. I tried using it, but strangely it doesn't show the context menu. It shows alert box but not a context menu. Also, clicking in the left side region of a node with children always selects its first leaf node by default. Strange !! 2. Setting Current element to Null In my tree widget constructor, I call the setSelectedElement(null) and set the current element to null. And, this works because when I call alert(this.getSelectedElement()), I get the result as undefined. I have also done the same inside a function called after my tree is created and after I have select some element in tree. But then it doesn't set the current element to null. Any help is appreciated as I am struck on my tree widget issues since last 2 weeks. :-( regards Amit Amit Rana ha scritto:
-- Amit Rana SpagoBI Developer ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ qooxdoo-devel mailing list qooxdoo-devel@... https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel |
|
|
Re: Properties Window on clicking a node on a Tree> I am facing a couple of problems in my Tree widget.
You don't say which version you are using, or which tree. > > 1. *Context Menu on Node :* > I want to get a context menu for a node when it is clicked on. So, > I have included the "click" event listener. But then, even if I > click outside the tree (Not on a node but outside, I still get the > context menu) which I don't want. I'm using 0.7.x qx.ui.tree.Tree. To get a context menu I add a listener on each node for the "contextmenu" event. > 2. *Setting Current element to Null > *In my tree widget constructor, I call the setSelectedElement(null) > and set the current element to null. And, this works because when I > call alert(this.getSelectedElement()), I get the result as > undefined. > > I have also done the same inside a function called after my tree is > created and after I have select some element in tree. But then it > doesn't set the current element to null. No idea on this one. Derrell? Hugh ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ qooxdoo-devel mailing list qooxdoo-devel@... https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel |
|
|
Re: Properties Window on clicking a node on a TreeOn Mon, Oct 6, 2008 at 8:15 AM, Amit Rana <amit.rana@...> wrote:
As Hugh mentioned, you didn't give us quite enough detail to know what's going on. Please post a small test program demonstrating the problem(s) you're having and I'm sure one of us will be able to help you. Derrell ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ qooxdoo-devel mailing list qooxdoo-devel@... https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel |
|
|
Re: Properties Window on clicking a node on a TreeI am sorry for missing out the details (was pretty frustrated as I am unable to get what i want ;-) ) Hugh Gibson wrote: I am using v0.7.3 and testing on FF3 and IE7. And, I am referring to qx.ui.tree.Tree Widget. Thanks for the suggestion. I had tried it earlier but I guess I had missed on something. I will try again and let you know. Here is the code snippet : /* ------------ myTree class ------------------------*/ qx.Class.define("myTree", { extend: qx.ui.tree.Tree, //Constructor start construct : function(config) { var trs = qx.ui.tree.TreeRowStructure.getInstance().standard("Root"); this.base(arguments, trs); this.setSelectedElement(null); alert(this.getSelectedElement()); //shows undefined which is correct }, members: { onClickMenu: function(e){ var contextMenu = new qx.ui.menu.Menu; var insertButton = new qx.ui.menu.Button("Insert",null,myCommand1); var deleteButton = new qx.ui.menu.Button("Delete",null,myCommand2); contextMenu.addToDocument(); //contextMenu.show(); if (contextMenu.isSeeable()) //code which never gets executed .. Not sure why { alert('hi'); contextMenu.hide(); this.setSelectedElement(null); alert(this.getSelectedElement); } else { var ele = this.getSelectedElement().getElement(); contextMenu.setLeft(qx.html.Location.getPageBoxLeft(ele)); contextMenu.setTop(qx.html.Location.getPageBoxBottom(ele)); contextMenu.show(); // alert('hi'); // contextMenu.setDisplay(true); } this.setSelectedElement(null); alert(this.getSelectedElement()); //shows TreeFolder or TreeFile but not undefined as it should ... incorrect } } }); I call this code from my other file as follows: var tree = new myTree(); tree.addEventListener("click",tree.onClickMenu,tree); Also, when I remove the line contextMenu.show(); from the else part and put below contextMenu.addToDocument(); (as commented now), I don't see the context menu on node click. But when I add an alert and setDispaly() in the else part, I see the context Menu for a brief moment before the pop-up box comes. Am i doing something wrong here ? Thanks for the replies. I am happy for all the help. Hope I learn how to really work on Qooxdoo and understand it (little by little). qooxdoo-devel mailing list qooxdoo-devel@... https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel Best regards Amit Rana SpagoBI Developer ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ qooxdoo-devel mailing list qooxdoo-devel@... https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel |
| Free Forum Powered by Nabble | Forum Help |