<<

Contents

Search

>>

 

MESSAGEBOX

 

 

Function

 

 

Syntax:

MESSAGEBOX([<WAIT|NOWAIT>,<Exit Macro>],<Header>,<Text>,<Button Texts>,<Button Types>,<Separator>,<Image Name>,<Position of Image>,<Default Value>,<Font Style>,<Font Height>,<Button Height>,<Button Width>,<ESC Allowed>[,<Foreground Red>,<Foreground Green>,<Foreground Blue>[,<Background Red>,<Background Green>,<Background Blue>]])

 

<Exit Macro>

= <MACRONAME>

<Header>

= <STRING-EXPRESSION>

<Text>

= <STRING-EXPRESSION>

<Button Texts>

= <STRING-EXPRESSION>

<Button Types>

= <STRING-EXPRESSION>

<Separator>

= <STRING-EXPRESSION>

<Image Name>

= <STRING-EXPRESSION>

<Position of Image>

= <NUM-EXPRESSION>

<Default Value>

= <NUM-EXPRESSION>

<Font Style>

= <NUM-EXPRESSION>

<Font Height>

= <NUM-EXPRESSION>

<Button Height>

= <NUM-EXPRESSION>

<Button Width>

= <NUM-EXPRESSION>

<ESC Allowed>

= <NUM-EXPRESSION>

<Foreground Red>

= <NUM-EXPRESSION>

<Foreground Green>

= <NUM-EXPRESSION>

<Foreground Blue>

= <NUM-EXPRESSION>

<Background Red>

= <NUM-EXPRESSION>

<Background Green>

= <NUM-EXPRESSION>

<Background Blue>

= <NUM-EXPRESSION>

 

 

Meaning:

Creates a dialog with message text and buttons.

 

The instruction WINDOWPOS defines the position of the window.

 

MESSAGEBOX returns the following values:

 

0: ESC has been pressed

1: Button No. 1 has been pressed

2: Button No. 2 has been pressed

…

Handle with NOWAIT

-1: Internal error

-99: No active window found

 

With NOWAIT the message window is shown, the function is terminated immediately and returns the identification number (Handle) of the message box. The instruction CLOSE_MESSAGEBOX can close a message box that has been opened with NOWAIT. The macro <Exit Macro> is executed after the MESSAGEBOX has been finished. The variable EBUS_TRANSFER then contains the return code.

 

With WAIT MESSAGEBOX is started hierarchically and the function only is terminated only after the MESSAGEBOX has been closed.

 

The parameters <Foreground Red>,<Foreground Green> and <Foreground Blue> defines the color with which the <Text> is shown in the window. If these parameters are missing, the text is shown in black (0,0,0).

 

The parameters <Background Red>,<Background Green> and <Background Blue> define the background color of the window. If these parameters are missing or if one of them has a value < 0, the window is displayed in the standard color.

 

Parameter:

WAIT|NOWAIT

WAIT: The function  waits until MESSAGEBOX has been closed.

NOWAIT: The function is terminated immediately and returns the handle of the window.

 

Exit Macro

Is executed after the MESSAGEBOX has been closed. EBUS_TRANSFER contains the return code.

 

Header

Header of the window

 

Text

Text to be displayed in the window. Every <Separator> leads to a line break. If  <Position of Image> = 0, the <Text> is shown right next to the image, otherwise below the image.

 

Button Texts

Contains separated by <Separator> the texts that are to be displayed on the buttons. The number of buttons to be created is hereby specified as well.

 

Button Types

Contains separated by <Separator> the button types. The number of a standard picture or @<Image Name> can be specified. The following standard pictures are available:

 

1 =

2 =

3 =

4 =

5 =

 

Separator

Defines the character for <Button Texts>, <Button Types> and <Text>. If <Separator> is the empty string "", the semi-colon ";" is the separator.

 

Image Name

Specifies the name of an image file. The image is shown on top of the window. If <Position of Image> = 0, the image is shown left-bound, otherwise centered. The image file should also be defined with #ADD_IMAGE in the program so that it can be included in the jar file. The stop sign Stopp.gif is an available standard image. If <Image Name> is the empty string "", no image is displayed.

 

Position of Image

Defines the position of the image:

0: left-bound

otherwise: centered

 

Default Value

Defines the default value of the button

 

Font Style

Defines the font style for the text display. The same assignments as with the instruction PRINTFONT apply.

 

Font Height

Defines the font height of the  texts as multiple of the row height.

 

Button Height

Defines the height of the buttons as multiple of the row height.

 

Button Width

Defines the width of the buttons in columns.

 

ESC Allowed

0: The window cannot be cancelled with ESC.

otherwise: ESC can be pressed.

 

Foreground Red

Red value

 

Foreground Green

Green value

 

Foreground Blue

Blue value

 

Background Red

Red value

 

Background Green

Green value

 

Background Blue

Blue value

 

Sample:

WINDOWPOS(0,0)

H% = MESSAGEBOX(

     "Delete",               /* Header

     "Delete data record ?", /* Text

     "&Yes;&No;&Cancel",     /* Button Texts

     "1;2;@cancel.jpg",      /* Button Types

     ";",                    /* Separator

     "stop.gif",             /* Image Name

     0,                      /* Image left

     2,                      /* Default 'No'

     2,                      /* Font Style bold

     1.1,                    /* Font Height

     1.5,                    /* Button Height

     12,                     /* Button Width

     0,                      /* ESC not allowed

     255,0,0,                /* Text color red

     255,255,255)            /* Background color white

 

IF H% = 1

THEN ... /* Yes has been selected

ENDIF

 

See also:

MESSAGE

ERRORMES

CLOSE_MESSAGEBOX

EBUS_TRANSFER