ui example: improve progress bar object timer
This commit is contained in:
parent
5d8bbf2cd9
commit
e956c3ad1f
18
test/ui.cpp
18
test/ui.cpp
|
@ -44,7 +44,7 @@ ProgressDialog::ProgressDialog (FWidget* parent) : FDialog(parent)
|
||||||
reset->setText("&Reset");
|
reset->setText("&Reset");
|
||||||
reset->setGeometry(2, 6, 8, 1, false);
|
reset->setGeometry(2, 6, 8, 1, false);
|
||||||
reset->setShadow();
|
reset->setShadow();
|
||||||
reset->setFocus();
|
//reset->setFocus();
|
||||||
reset->setDisable();
|
reset->setDisable();
|
||||||
|
|
||||||
more = new FButton(this);
|
more = new FButton(this);
|
||||||
|
@ -112,21 +112,19 @@ void ProgressDialog::onShow (FShowEvent*)
|
||||||
void ProgressDialog::onTimer (FTimerEvent*)
|
void ProgressDialog::onTimer (FTimerEvent*)
|
||||||
{
|
{
|
||||||
int p = progressBar->getPercentage();
|
int p = progressBar->getPercentage();
|
||||||
|
progressBar->setPercentage(++p);
|
||||||
|
flush_out();
|
||||||
|
|
||||||
if ( p < 100 )
|
if ( p == 100 )
|
||||||
{
|
|
||||||
progressBar->setPercentage(++p);
|
|
||||||
flush_out();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
delAllTimer();
|
delAllTimer();
|
||||||
|
activateWindow();
|
||||||
|
raiseWindow();
|
||||||
reset->setEnable();
|
reset->setEnable();
|
||||||
reset->redraw();
|
reset->setFocus();
|
||||||
more->setEnable();
|
more->setEnable();
|
||||||
more->redraw();
|
|
||||||
quit->setEnable();
|
quit->setEnable();
|
||||||
quit->redraw();
|
redraw();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue