Temporary Message

LawnyToast

New Member
Hello All,

Another minor development question for everyone today...

I am wanting to create a pop-up window or message that appears for 5-8 seconds then disappears without any interaction from the user. This window will be opened up by the users actions, but will not require any response or gesture from them to continue. I have looked through a major portion of my dev documentation including message, display, alert and wait/pause statements. If anyone could help that would be fantastic. This is what I currently have for reference, though it requires the user to press OK to continue operation.

Code:
if (dec(weeklyhrs) + 4) > nHours then do:
  MESSAGE res-group.resource-group + ' has an hourly maximum of ' + string(nHours) + ' hours.'
    SKIP(1)
    'Please consider getting approval before exceeding this limit.' view-as alert-box WARNING buttons OK. /*check*/
end.
 

Cringer

ProgressTalk.com Moderator
Staff member
You're going to want to build a dialog box of your own to display the message, with a pstimer ocx on it that just closes itself after x seconds. You won't get this working with a standard alert-box.
 

Osborne

Active Member
Using a combination of the ideas Cringer and Tom have posted you could do something like this:
Code:
DEFINE BUTTON bOkay LABEL "OK" SIZE 12 BY 1.

DEFINE VARIABLE vText AS CHARACTER FORMAT "X(50)" NO-UNDO.

vText = res-group.resource-group + ' has an hourly maximum of ' + string(nHours) + ' hours.'.

DEFINE FRAME MessageFrame
    vText AT ROW 2 COL 3 SKIP(1)
    bOkay AT 40
    WITH TITLE "Warning" THREE-D NO-LABELS VIEW-AS DIALOG-BOX
         SIZE 56 BY 6.

DISP vText WITH FRAME MessageFrame.
ENABLE bOkay WITH FRAME MessageFrame.
WAIT-FOR CHOOSE OF bOkay IN FRAME MessageFrame PAUSE 5.
 

LawnyToast

New Member
This worked perfectly. Thank you for the help. I took Osborne's advice and used the combined effort. I will now be making the text a little more flashy and distracting to make sure they at least see it. Again, thank you all.
 
Top