Created
May 18, 2016 18:15
-
-
Save jbratu/b92c49ce52cdbe2a66712cf40a48ef2c to your computer and use it in GitHub Desktop.
Gas Gauge Processing Message with Updating Text. The standard help file for the OpenInsight Msg function shows a sample gas gauge for showing progress but it doesn't contain an example of how to change the processing text to indicate what the loop is currently working on. This example expands upon the help file example for Msg() and includes the…
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Subroutine CS_TEST_MSG_GASGAUGE(void) | |
$Insert Msg_Equates | |
//Number of example processing loops | |
MAX_LOOPS = 1000 | |
def = '' | |
def<MCAPTION$> = 'Gas Guage with Cancel Button' | |
def<MTYPE$> = 'GCU' | |
def<MTEXT$> = 'Initializing...' | |
def<MEXTENT$> = MAX_LOOPS | |
def<MTEXTWIDTH$> = 400 ;* Width of the progress window | |
//Display the message for the first time | |
msgup = Msg(@WINDOW, def) | |
For i = 1 To MAX_LOOPS | |
//Update the text and progress of the message | |
Call Set_Property("MSG.ST_TEXT", "TEXT", "Working on loop " : i) | |
Resp = Msg(@WINDOW,MsgUp, i, MSGINSTUPDATE$) | |
//If user canceled then abort the loop | |
If Resp EQ 0 Then | |
i = MAX_LOOPS | |
End | |
//Allow processing of cancel events | |
Call Yield() | |
Next | |
//Take down the message | |
Call Msg(@WINDOW, MsgUp) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment