Google

SECTION 2.7 - THE POP-UP NOTICE VIEW-OBJECT ROUTINES

2.7.1 INTRODUCTION

The pop-up notice view-object is used to bring important information to the user's attention. The program will only proceed after the user has selected one of the buttons displayed within the notice. It is typically used to indicate error conditions or to request confirmation for a possibly dangerous choice made by the user. The notice may contain one or two messages and may have one or two buttons.

The following sets of routines are available:

Create and Handle a Pop-up Notice View-Object

2.7.2 CREATE AND HANDLE A POP-UP NOTICE VIEW-OBJECT

2.7.2.1 Introduction

The following routines are available:

Display a pop-up notice - xdl_popup_notice

2.7.2.2 Display a pop-up notice - xdl_popup_notice

The routine xdl_popup_notice (xdlf_popup_notice) is used to display a pop-up notice containing one or two messages and wait till its button (or one of it's two buttons) is 'pressed'. Note that the pop-up notice is rather different from other view-objects in that it is a temporary object and does not have a view-object handle.
 
Fortran call:
 
         CALL XDLF_POPUP_NOTICE (IXROOT, IYROOT, MSG1, LENMSG1, 
        +                        MSG2, LENMSG2,
        +                        BUTSTR1, LENBUTSTR1, 
        +                        BUTSTR2, LENBUTSTR2,
        +                        IFONT, IARROW, IBUTTON)
 
Parameters:
 
IXROOT    (R)  X (rootwindow) position for notice (top left) 
               (see xroot)
IYROOT    (R)  Y (rootwindow) position for notice (top left)
               (see yroot)
MSG1      (R)  Address of character string containing first
               message.
               ** Pass address using the XDLSTR function **
               (see msg1)
LENMSG1   (R)  Length of the MSG1 character string (>0) 
               (cf lenmsg1)
MSG2      (R)  Address of character string containing second 
               message.
               ** Pass address using the XDLSTR function **
               (see msg2)
LENMSG2   (R)  Length of the MSG2 character string (>0). If 
               there is no second message to output then give 
               a value of -1. (cf lenmsg2)
BUTSTR1   (R)  Address of character string for the first button
               ** Pass address using the XDLSTR function **
               (see butstr1)
LENBUTSTR1 (R) Length of the BUTSTR1 character string (>0) 
               (cf lenbutstr1)
BUTSTR2   (R)  Address of character string for the second button
               ** Pass address using the XDLSTR function **
               (see butstr2)
LENBUTSTR2 (R) Length of the BUTSTR2 character string (>0). If no
               second button is required then give a value of -1.
               (cf lenbutstr2)
IFONT     (R)  Font type (1 to 5, very small to extra large) 
               (see font_type)
IARROW    (R)  =1 display an arrow pointing to the top left corner
               of the notice provided that it can be placed in the
               requested position, =0 do not. (see arrow)
IBUTTON   (W)  Returns the button number selected (1 or 2)
 
'C' call:
 
int xdl_popup_notice (xroot, yroot, msg1, lenmsg1, msg2, lenmsg2, 
                      butstr1, lenbutstr1, butstr2, lenbutstr2, 
                      font_type, arrow)
 
Parameters:
 
int xroot;          /* x position of the notice popup area 
                       (wrt root) (R)*/
int yroot;          /* y position of the notice popup area 
                       (wrt root) (R)*/
char * msg1;        /* First message (null terminated) string (R)*/
int lenmsg1;        /* Length of message 1. If 0 then the routine will
                       find the length assuming a null terminated 
                       string (R)*/
char * msg2;        /* Second message (null terminated) string - may be 
                       null if no second message required (R)*/
int lenmsg2;        /* Length of message 2. -1 if no second message. 
                       If 0 then the routine will find the length 
                       assuming a null terminated string. (R)*/
char * butstr1;     /* Label string for first button (null terminated) 
                       (R)*/
int lenbutstr1;     /* Length of button 1 string. If 0 then the routine 
                       will find the length assuming a null terminated 
                       string (R)*/
char * butstr2;     /* Label string for second button (null terminated) - 
                       may be null if only one button required (R)*/
int lenbutstr2;     /* Length of button 2 string. -1 if no second button. 
                       If 0 then the routine will find the length assuming 
                       a null terminated string. (R)*/
int font_type;      /* Font type 1 to 5, very-small to extra-large (R)*/
int arrow;          /* =1 draw arrow pointing to origin (provided that
                       notice may be positioned where requested), =0 do
                       not (R)*/
Return:  =1 button one from notice presssed, 
         =2 button two from notice pressed



John W. Campbell
CCLRC Daresbury Laboratory
Last update 4 Feb 1998