silv
29 Jul 2009, 10:42 AM
The ProgressBar widget looks to have a few problems if it is initially hidden when rendered.
The ProgressBar update text gets aligned left (not middle), and then the two different colors of text get misaligned, as the white text gets centered on the "inner" progress bar, while the darker one remains left-aligned.
I've tested this on FF 3.5 and Safari 4. GWT 1.7 and GXT 2.0.1.
There is a small test case to show this:
public class Samplebug implements EntryPoint {
static float percent = 0;
public void onModuleLoad() {
Viewport v = new Viewport();
v.setLayout(new FitLayout());
final ProgressBar prg = new ProgressBar();
prg.hide();
final Timer t = new Timer() {
public void run() {
percent +=1;
prg.updateProgress(percent / 100, Float.toString(percent));
}
};
Button b = new Button("Go");
b.addSelectionListener(new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
t.scheduleRepeating(500);
prg.show();
}
});
v.add(prg);
v.add(b);
RootPanel.get().add(v);
}
}
Click the "Go" button to make the ProgressBar appear and start counting out.
If I am doing something wrong here, and there is a better way to have the ProgressBar hidden until something triggers it please let me know!
The ProgressBar update text gets aligned left (not middle), and then the two different colors of text get misaligned, as the white text gets centered on the "inner" progress bar, while the darker one remains left-aligned.
I've tested this on FF 3.5 and Safari 4. GWT 1.7 and GXT 2.0.1.
There is a small test case to show this:
public class Samplebug implements EntryPoint {
static float percent = 0;
public void onModuleLoad() {
Viewport v = new Viewport();
v.setLayout(new FitLayout());
final ProgressBar prg = new ProgressBar();
prg.hide();
final Timer t = new Timer() {
public void run() {
percent +=1;
prg.updateProgress(percent / 100, Float.toString(percent));
}
};
Button b = new Button("Go");
b.addSelectionListener(new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
t.scheduleRepeating(500);
prg.show();
}
});
v.add(prg);
v.add(b);
RootPanel.get().add(v);
}
}
Click the "Go" button to make the ProgressBar appear and start counting out.
If I am doing something wrong here, and there is a better way to have the ProgressBar hidden until something triggers it please let me know!