Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Wiki Markup
{alias:qinformation}
h2. Name

*qinformation* — information dialog

h2. Syntax
{panel:|borderStyle=solid|borderWidth=1|bgColor=#FFFFAA}

*qinformation* _caption text_ \[_button-0-text_] \[_button-1-text_] \[_button-2-text_]

{panel}

h2. Description

The *qinformation* command displays a read-only message dialog with one or more buttons together with a caption. The default is a single 'OK' button. The dialog is modal therefore execution is halted until the user closes the dialog. 

The dialog may optionally have up to three buttons to replace the default 'OK' button. The buttons are implicitly numbered 0, 1, 2. The command will return the number corresponding to the button pressed by the user. 

h2. Arguments
_caption_
{indent}Dialog title. 
{indent}
_text_
{indent}The main text of the dialog 
{indent}
_button-x-text_
{indent}Text to appear on button number x. There may be 1, 2, or 3 buttons provided in place of the default 'OK' button. 
{indent} 

h2. Examples

h3. Ex.1: Information dialog
{anchor:Information dialog}

{noformat:|borderWidth=1|bgColor=#eeeeee}
      # A titled dialog with a message and OK button
      qinformation Information "Hello World"

{noformat}

!att:_img_cmd^qinformation.png!

The above example shows the simplest possible use of *qinformation*. The *OK* button is created automatically. 

h3. Ex.2: Information dialog with extra buttons
{anchor:Information dialog with extra buttons}

{noformat:|borderWidth=1|bgColor=#eeeeee}
# Message with title and buttons. 
# Returns 0 (OK), 1 (Cancel), 2 (Details)
set button [qinformation "Open File" "The file was successfully opened" OK Cancel Details]
if { $button == 0 } {
   # OK button was pressed
} elseif { $button == 1 } {
   # Cancel buttons was pressed
} elseif { $button == 2 } {
   # Details buttons was pressed
}
{noformat}

!att:_img_cmd^qinformation_buttons.png!

Example [#Information dialog with extra buttons] shows a message dialog with a title and extra buttons. The number 0, 1, or 2 is returned to the program, depending on which button the user clicks.

{pagebreak}