updating form more than once during runtime?

BluefingerBluefinger Member Posts: 20
Hi,

has someone figured out a way to update the appearance of a form more than once during runtime? It seems like no matter what I do with it, you only see the final version when the code is through.

What I am trying to do is for example to let a warning message flash.

like:
CurrForm.Control01.VISIBLE := TRUE;
SLEEP(300);
CurrForm.Control01.VISIBLE := FALSE;
SLEEP(300);
CurrForm.Control01.VISIBLE := TRUE;
SLEEP(300);
CurrForm.Control01.VISIBLE := FALSE;
SLEEP(300);
CurrForm.Control01.VISIBLE := TRUE;
SLEEP(300);
CurrForm.Control01.VISIBLE := FALSE;

This does not work obviously but you know what I mean. Any ideas?

Thanks!

Comments

  • TonyDuarteTonyDuarte Member Posts: 92
    Think that you need a timer for that.

    The Form property is TimerInterval, set the interval you want for it.

    And in the code "Form - OnTimer()" write the changes for that variable, think it's best, but 300 ms of interval wouldn't be too fast? It's something like 1/3 of second...

    my source for this was:
    auto refresh form

    Read it also and see if it might be of some help ;)
  • BluefingerBluefinger Member Posts: 20
    Thanks but that's not quite what I am looking for for various reasons.

    For example I would need acertain control to appear and disapear (flash) a couple of times during runtime, not when the form is idle. Like a lo-tec animation if you will ...

    There are ways to use the timer but I find none of them very elegant ...
  • TonyDuarteTonyDuarte Member Posts: 92
    You could try to use the logic of a progresswindow then.

    The loop of update -> sleep, could it interest you?
  • BluefingerBluefinger Member Posts: 20
    TonyDuarte wrote:
    You could try to use the logic of a progresswindow then.

    The loop of update -> sleep, could it interest you?

    I am not quite sure if I understand your suggestion correctly but the problem is that the window does not actuallyupdate its appearance until the code is through. So this means that if I use the code from my first post the window just sleeps for a second and a half (5 x 300ms) and then changes it's appearance to the way it was told in the last command (In this case the control is hidden). The update function has no effect as long as the code is performed.
  • rocatisrocatis Member Posts: 163
    I'm fairly certain your only option is to use OnTimer.
    Brian Rocatis
    Senior NAV Developer
    Elbek & Vejrup
  • TonyDuarteTonyDuarte Member Posts: 92
    http://www.mibuso.com/forum/viewtopic.php?t=23896

    It's a discution in here but they explored several cases and might be a logic that you can adapt to your solution.
    And would be a matter to get the timer for the progress bar to work ;)

    But the basis of he progress window for you would be:

    Repeat
    -> update information on the progress window
    -> sleep(x miliseconds)
    Until

    the basis to use it is when you are updating a lot of information you use the progress window to show the % done so the user don't think NAV crashed or something, but I think it can be adapted for your scenario.
Sign In or Register to comment.