Navigation: Interface Design Concepts >

Dialog Windows

 

 

 

 

Dialog Windows are opened from MakerPlot-J instructions and may simply provide information to the user or request information.

 

Information Dialog:

The !dialoginfo string instruction will open the MakerPlot-J Information Window and ADD the string to it while ringing the bell. Closing or clicking OK will clear and hide the Window.  \n may be used for new lines or \t to insert a tab.

 

!dialogInfo Hello World!
!dialogInfo ---------------\nI am MakerPlot-J!

!dialogInfo [systemTime] an event occurred

 

 

Warning Dialog:

The !dialogWarning  instruction will open the MakerPlot-J Information Window and ADD the string to it while sounding an alarm. Closing or clicking OK will clear and hide the Window.  \n may be used for new lines or \t to insert a tab.

 

!dialogWarning Don't Click that!

!dialogWarning ---------------\nTemperature Exceeded, currently [ain1]!

!dialogWarning [systemTime] Pressure Exceeded!

 

 

Requesting Values With Dialogs

Dialog values for main are a special case in that they will prompt the user for input and return that value. Processing is halted until the user completes the response.

 

Color Dialog

 

dialogColor will prompt the user to select a color. Colors are returned as Decimal RGB with Alpha (opaqueness) values, such as 255:128:64:128 - Full Red, half green, quarter blue, half opaque.

 

? [dialogColor]

A Color Dialog will open and once the user selects a color through any of the choice tabs, the color will be listed in the Debug/CLI.

135:200:15:255

 

A default color may also be passed, such passing the RGB color, a color constant, or the color property of an interface or control.

? [dialogColor 255:0:0:255]

? [dialogColor RED]

? [dialogColor [lblMeters.backColor]]

 

In event code, this can be used to prompt the user for a color to set, such as button to set the back color of the main interface while passing it the current back color:

!backColor=[dialogColor [backColor]]

 

Yes-No Dialog

 

dialogYesNo will display a yes/no dialog window with the provided messages. Choosing Yes will return a 1, Choosing No will return a 0.

? [dialogYesNo Are you feeling OK?]

 

Like all values, these may be used in conditionals to make decisions for operation. Note the the response does not need to be compared to 1 or 0, a 1 returned will make the conditional true and the !then code will run.

!if [dialogYesNo Should I ring the bell?] !then !bell

 

Value Dialog

 

dialogGetValue will request and return a user value, numeric or alpha-numeric.

? [dialogGetValue Please enter the amount of drive]

!lblDrive = [dialogGetValue Please enter the amount of drive:]

 

 

 

 

 

Copyright © 2024 SelmaWare Solutions, LLC