Use the Status Dialog

  • Konuyu başlatan Konuyu başlatan guclusat
  • Başlangıç Tarihi Başlangıç Tarihi

guclusat

Tanınmış Üye
Süper Moderatör
Use the Status Dialog
In AutoPlay Media Studio, it is possible to display a status dialog to your user using built in actions. This is
useful if, for example, your application uses a loop that takes quite a bit of time to complete.
As an example, we will create a loop that counts to 20,000, and display a status window letting the user
know the status of the count:

1. Create a button object, and add the following code to its On Click event:
Kod:
--set the minimum and maximum values
minimum_value = 0;
maximum_value = 20000;
--status dialog window settings
StatusDlg.Show(); --show the status dialog window
StatusDlg.SetTitle("Counting from " .. minimum_value .. " to " ..
maximum_value); --set the title
StatusDlg.SetMeterRange(minimum_value, maximum_value); --set the
range of the meter
--counting loop
loop_control = minimum_value; --set the loop control variable
while loop_control <= maximum_value do --while the loop control
variable is less than or equal to the maximum value
StatusDlg.SetMeterPos(loop_control); --set the meter position
to the loop control variable
StatusDlg.SetStatusText("Currently Counting . . . (" ..
loop_control .. " of " .. maximum_value .. ")"); --set the status
text to reflect the current number
loop_control = loop_control + 1; --increment the loop control
variable
end
Note: The above code when run will count to 20,000, and display a status dialog showing
the progress of the loop.
 
Geri
Yukarı