Hm, thank you for your answer!
Here some more details!
This sendButton executes the creation of a new Button on your desktop!
So everytime you press this Button, you have a new Button on your mousetip and
can place it with a click.
Every placed button also has an addListener. So if you dblclick a placed
button, then you get the button
again to your for placing it somewhere else on your screen.
The move function does the placement nearly like drag and drop.
func1
sendButton.addListener("execute", function(e) {
var button_new = new qx.ui.form.Button(label icon);
//Class Icon has all the button_new and a lot of other properties stored
var icon_new = new cws.Icon(button_new);
this.dbdatainstance.addtoIconArray(icon_new);
//This is a function for moving your button
//You have the button on your mousetip and then you can place it with a klick
this.moveIcon(desktop, icon_new);
button_new.addListener("dblclick", function(e) {
if(cws.Application.loginvalue == true){
//This is a function for moving your button
//You get the new added button on your mousetip and then you can place it with
a klick wherever you want on the desktop
this.moveIcon(desktop, icon_new);
}
},this);
}
All this code I posted above works really fine! I can add as many buttons on
the screen as I want, and every button has it´s own listener.
So by clicking them, you can place every button individually on the screen.
All the icons(Buttons) are stored to an Msql DB and loaded every time I start
my browser in a local Datastructure.
So if I restart my browser I want to get all my added icons on the screen
again! Also with the listeners!
Now I made another mechanism like this:
func2
var iconarray = this.dbdatainstance.getIconArray();
for (var i=0; i < iconarray.getLength(); i++)
{
var icon = iconarray.getItem(i);
var button = icon.getButton();
button.addListener("dblclick", function(e) {
if(cws.Application.loginvalue == true){
this.moveObject(desktop, icon);
}
},this);
}
All buttons are restored on the desktop so far, with all the right properties
out of the Db. The now problem is, that
Somehow always the last listener is on every button! So If I want to move any
button, always the last one is moved!
I don´t know why this doesn´t happen in func1 ! I know that trough iteration
the icon is always the last, but why isn´t that also in func1 so?
Please Help!
------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:
Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel