ui example: improve progress bar object timer

This commit is contained in:
Markus Gans 2015-07-02 21:21:18 +02:00
parent 5d8bbf2cd9
commit e956c3ad1f
1 changed files with 8 additions and 10 deletions

View File

@ -44,7 +44,7 @@ ProgressDialog::ProgressDialog (FWidget* parent) : FDialog(parent)
reset->setText("&Reset");
reset->setGeometry(2, 6, 8, 1, false);
reset->setShadow();
reset->setFocus();
//reset->setFocus();
reset->setDisable();
more = new FButton(this);
@ -112,21 +112,19 @@ void ProgressDialog::onShow (FShowEvent*)
void ProgressDialog::onTimer (FTimerEvent*)
{
int p = progressBar->getPercentage();
if ( p < 100 )
{
progressBar->setPercentage(++p);
flush_out();
}
else
if ( p == 100 )
{
delAllTimer();
activateWindow();
raiseWindow();
reset->setEnable();
reset->redraw();
reset->setFocus();
more->setEnable();
more->redraw();
quit->setEnable();
quit->redraw();
redraw();
}
}