L3DT users' wiki
Large 3D terrain generator

MessageBox

Description

Display a modal pop-up message box.

Function prototype

uint MessageBox <string:Message> <uint:Style>

Arguments

Name Type Comment
Message string The text to be displayed in the message box.
Style uint A conbination of bit flags that specify the buttons, icons and behaviour of the message box (see codes below).

The supported values of Style are identical to those of the Microsoft Foundation Classes Message box styles, which are:

  • Message box types
    • 0x00000000 (MB_OK) - The message box contains one pushbutton: OK.
    • 0x00000001 (MB_OKCANCEL) - The message box contains two pushbuttons: OK and Cancel.
    • 0x00000002 (MB_ABORTRETRYIGNORE) - The message box contains three pushbuttons: Abort, Retry, and Ignore.
    • 0x00000003 (MB_YESNOCANCEL) The message box contains three pushbuttons: Yes, No, and Cancel.
    • 0x00000004 (MB_YESNO) - The message box contains two pushbuttons: Yes and No.
    • 0x00000005 (MB_RETRYCANCEL) - The message box contains two pushbuttons: Retry and Cancel.
  • Message-Box Icons
    • 0x00000010 (MB_ICONSTOP) A stop-sign icon appears in the message box.
    • 0x00000020 (MB_ICONQUESTION) - A question-mark icon appears in the message box.
    • 0x00000030 (MB_ICONEXCLAMATION) - An exclamation-point icon appears in the message box.
    • 0x00000040 (MB_ICONINFORMATION) - An icon consisting of an ā€œIā€ in a circle appears in the message box.
  • Message-Box Default Buttons
    • 0x00000000 (MB_DEFBUTTON1) - The first button is the default. Note that the first button is always the default unless MB_DEFBUTTON2 or MB_DEFBUTTON3 is specified.
    • 0x00000100 (MB_DEFBUTTON2) - The second button is the default.
    • 0x00000200 (MB_DEFBUTTON3) - The third button is the default.

Return value

The return value is identical to those of the Microsoft Foundation Classes AfxMessageBox function, which are:

  • 0 - An error occurred:
  • 1 (IDOK) - The OK button was selected.
  • 2 (IDCANCEL) The Cancel button was selected.
  • 3 (IDABORT) - the Abort button was selected.
  • 4 (IDRETRY) - The Retry button was selected.
  • 5 (IDIGNORE) - The Ignore button was selected.
  • 6 (IDYES) - The Yes button was selected.
  • 7 (IDNO) - The No button was selected.

Example

// style is question icon and yes/no buttons, testing for IDYES
if <iseq 6 <MessageBox "Restart L3DT?" 0x00000024>>
  application.Restart
endif

ā€¦ the output of which looks like:

An example message box

Comments

None.

 
plugins/general/zeoscript/reference/functions/messagebox.txt · Last modified: 2017/08/31 06:23 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki