Hi,
I need such an example where the timer control closes a dialog box after two minutes, and it counts down in itself or in an another integer or text control or in a progress bar: "You have left 50..40..30..20..10..5..4..3..2..1 seconds to chose other than the default answers". Possibly a button to stop the timer and the countdown and hold on the dialog waiting for the user's forever.
-
- VIP Member
- Posts: 215
- Joined: 24 Apr 2007 12:26
Is there any example of timer Control?
TIA, Regards,
Frank Nagy
Frank Nagy
-
- VIP Member
- Posts: 68
- Joined: 5 Oct 2011 15:16
tickAction/2 with counter:
Code: Select all
implement main
clauses
run() :-
_ = fignyaDLG::new().
end implement main
goal
main::run().
implement fignyaDLG
inherits dialog
clauses
new() :-
dialog::new(window::getActiveWindow()),
addShowListener({ :-
Timer = tickAction(1000, timerAct),
addMouseDownListener({ :- timerKill(Timer), setText("...") }) }),
show().
facts
counter : integer := 11.
predicates
timerAct : ().
clauses
timerAct() :-
counter := counter - 1,
if 0 = counter then
close()
else
setText(string::format("%d (click to stop)", counter))
end if.
end implement fignyaDLG
class fignyaDLG : dialog
open core
end class fignyaDLG
-
- VIP Member
- Posts: 215
- Joined: 24 Apr 2007 12:26