Does anyone have a good example of using a progress bar with a qx.timer?
Here's what I've tried so far:
// Document is the application root
var root = this.getRoot();
var box = new qx.ui.layout.VBox();
var container = new qx.ui.container.Composite(box);
var pb = new qx.ui.indicator.ProgressBar(0, 100);
var lblPrimary = new qx.ui.basic.Label();
var lblSecondary = new qx.ui.basic.Label();
var totalCount = 100000;
var percentComplete = 0;
var I = 0
// Create a button
var button1 = new qx.ui.form.Button("GO",
"icon/22/apps/internet-web-browser.png");
button1.setMaxWidth(100);
root.add(container, {left:0,top:0});
container.add(lblPrimary);
container.add(pb);
container.add(lblSecondary);
container.add(button1);
lblPrimary.setValue("Please Wait...");
lblSecondary.setValue("Completed: 0 (0%)");
box.setSpacing(10);
container.setPadding(20);
//get real time change from the progressbar
pb.addListener("change", function(e) {
//lblSecondary.setValue("Completed: " + pb.getValue() + " (" + e.getData()
+ "%)");
lblSecondary.setTextColor("black");
});
var timer = new qx.event.Timer(1000);
timer.addListener("interval", updateSendingProgress, this);
timer.start();
// Add an event listener
button1.addListener("execute", function(e) {
for(i = 0; i<totalCount; i++)
{
var percentComplete = i / totalCount * 100;
I = i;
}
this.debug(i);
timer.stop();
});
function updateSendingProgress() {
this.pb.setValue(percentComplete);
this.lblSecondary.setValue("Completed: " + I + " (" + percentComplete +
"%)");
}
//when complete make the info text green
pb.addListener("complete", function(e) {
lblSecondary.setTextColor("green");
});
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel