Message boxes

Message boxes shows simple messages on the desktop. Whenever you want to show some information on the screen, like questions or warnings, you may use one of these functions. When an error occures use the seal_error() function instead for compatibility.


msgbox ()
     Description:
       Displays a messagebox with formatted text. Supports the
       same formatting as used in the "printf()" function. Width
       and height of the window depends on the size of the text.

     Syntax:
       l_dword  msgbox ( l_dword wflags, l_dword  bflags, l_text in_text, ... );

     Parameters:
       wflags      Flags that sets the type of messagebox.
       bflags      Flags that sets which buttons to use.
       in_text     Formatting of the text to show.
       ...         The string (or strings) to display.

     Returns:
       A message that depends on which button was pressed.



msgboxsize ()
     Description:
       Displays a messagebox with formatted text and with
       the defined minimal width. The hight depends on the
       size of the text. Supports the same formatting as 
       used in the "printf()" function.


     Syntax:
       l_dword  msgboxsize ( l_rect minx, l_dword wflags, l_dword  bflags, 
                             l_text in_text, ... );

     Parameters:
       minx        The minimal width of the messagebox.
       wflags      Flags that sets the type of messagebox.
       bflags      Flags that sets which buttons to use.
       in_text     Formatting of the text to show.
       ...         The string (or strings) to display.

     Returns:
       A message that depends on which button was pressed.



msginfo ()
     Description:
       Creates an information messagebox with a MB_OK button only
       and with the defined minimal width. 

     Syntax:
       p_appwin msginfo ( l_rect minx, l_dword wflags, 
                          l_text in_text, ... );

     Parameters:
       minx        The minimal width of the messagebox.
       wflags      Flags that sets the type of messagebox.
       in_text     Formatting of the text to show.
       ...         The string (or strings) to display.

     Returns:
       A pointer to this box.



show_info ()
     Description:
       Creates an information messagebox with a MB_OK button only
       and with the defined minimal width. May later be disposed 
       with the hide_info() function.

     Syntax:
       void* show_info ( l_rect minx, l_dword wflags, l_text in_text, ... );

     Parameters:
       minx        The minimal width of the messagebox.
       wflags      Flags that sets the type of messagebox.
       in_text     Formatting of the text to show.
       ...         The string (or strings) to display.

     Returns:
       A pointer in (void*).  



hide_info ()
     Description:
       Disposes an information messagebox previously created
       with the show_info() function.

     Syntax:
       void  hide_info ( void *o )

     Parameters:
       o           The messagebox to dispose.

     Returns:
       -



msgprocess ()
     Description:
       Creates a process window. See also the PROCESS object.

     Syntax:
       p_appwin msgprocess ( l_rect minx, l_text process_title, 
                             l_text in_text, l_dword size, l_dword *ind );

     Parameters:
       minx        The minimal width of the messagebox.
       title       Title of the window.
       in_text     Message to display.
       size        Size of the process, e.g. 100 if displaying percentage.
       ind         Pointer to a l_dword variable that contains the
                   current position in the process.

     Returns:
       A pointer to the window.



show_process ()
     Description:
       Creates a new msgprocess() with minimal size (minx = 400).
       Dispose this window with hide_process() when finished.

     Syntax:
       void *show_process ( l_text process_title, l_text in_text, 
                            l_dword size, l_dword *ind )

     Parameters:
       title       Title of the window.
       in_text     Message to display.
       size        Size of the process, e.g. 100 if displaying percentage.
       ind         Pointer to a l_dword variable that contains the
                   current position in the process.

     Returns:
       -



hide_process ()
     Description:
       Disposes a message process previously created with show_process().

     Syntax:
       void hide_process ( void *o )

     Parameters:
       o           The messagebox to dispose.

     Returns:
       -




Flags used by message boxes


     wflags
       Determines the style of the messagebox flags.

       MW_WARNING      - Warning message box.
       MW_ERROR        - Error message box.
       MW_INFO         - Info message box.
       MW_QUESTION     - Question message box.
       MW_UNAVAILABLE  - Unavailable message box.



     bflags
       Determines which buttons to be available. You may use 
       a combination of these buttons for your dialog and when 
       one of them is pressed it will send its message to the 
       application.

       MB_CLOSE      - Message box contains button CLOSE.
       MB_CANCEL     - Message box contains button CANCEL.
       MB_YES        - ...
       MB_NO         - ...
       MB_HELP       - ...
       MB_OK         - ...



     Messages:
       These are the messages sent by the different buttons
       when they are pressed:

       MB_CLOSE      - MSG_CLOSE
       MB_CANCEL     - MSG_CANCEL
       MB_HELP       - MSG_HELP
       MB_YES        - MSG_YES
       MB_NO         - MSG_NO
       MB_OK         - MSG_OK




Example:

An example of showing a process window:

       l_dword ind = 0;
       void *x = show_process("Process", "Calling 1000x", 1000, &ind);

       for ((*ind); (*ind) < 1000; (*ind)++) {
            delay(50);
       };

       hide_process(x);