4 * This source code is part of
8 * GROningen MAchine for Chemical Simulations
12 * Copyright (c) 1991-1999
13 * BIOSON Research Institute, Dept. of Biophysical Chemistry
14 * University of Groningen, The Netherlands
17 * GROMACS: A message-passing parallel molecular dynamics implementation
18 * H.J.C. Berendsen, D. van der Spoel and R. van Drunen
19 * Comp. Phys. Comm. 91, 43-56 (1995)
21 * Also check out our WWW page:
22 * http://md.chem.rug.nl/~gmx
27 * Great Red Oystrich Makes All Chemists Sane
33 static char *SRCID_popup_h
= "$Id$";
36 #ident "@(#) popup.h 1.3 11/23/92"
37 #endif /* HAVE_IDENT */
42 Window send_to
; /* Window to send messages to */
43 int nreturn
; /* Value returned when entry is selected */
44 bool bChecked
; /* Indicate whether menu item is check-marked */
45 char *str
; /* Text for menu entry */
49 t_windata wd
; /* The window struct */
50 t_mentry
*m
; /* The menu entry */
51 Window Parent
; /* Parent window id */
55 t_windata wd
; /* The window struct */
56 Window Parent
; /* The parent of the menu */
57 int nitem
; /* The number of menu items */
58 t_child
*item
; /* Array of child windows */
59 bool bGrabbed
; /* Did this menu grab the pointer? */
62 extern t_menu
*init_menu(t_x11
*x11
,Window Parent
,unsigned long fg
,unsigned long bg
,
63 int nent
,t_mentry ent
[],int ncol
);
64 /* This routine will create a popup menu. It will create a
65 * a base window, and child windows for all the items.
66 * If ncol != 0 then ncol columns of items will be created;
67 * otherwise the routine will try to evenly space the menu, eg. if there
68 * are 20 items then the menu will be 2x10 entries, depending on the
71 * !!! Do not destroy the ent structure while using this menu
73 * The routine will create the windows but not map them. That is, this
74 * routine can be called once at the beginning of a program. When a menu
75 * has to be shown, call show_menu.
78 extern void show_menu(t_x11
*x11
,t_menu
*m
,int x
, int y
,bool bGrab
);
79 /* Show the menu in m at (x,y)
80 * This will popup the menu, and when a button is released in the
81 * menu send a ClientMessage to the Parent window of the menu
82 * specifying the selected menu item in xclient.data.l[0].
83 * bGrab specifies whether or not to grab the pointer.
86 extern void hide_menu(t_x11
*x11
,t_menu
*m
);
87 /* Unmaps the window for m, hides the window */
89 extern void check_menu_item(t_menu
*m
,int nreturn
,bool bStatus
);
90 /* Set the bChecked field in the menu item with return code
91 * nreturn to bStatus. This function must always be called when
92 * the bChecked flag has to changed.
95 extern void done_menu(t_x11
*x11
,t_menu
*m
);
96 /* This routine destroys the menu m, and unregisters it with x11 */
98 extern int menu_width(t_menu
*m
);
99 /* Return the width of the window */
101 extern int menu_height(t_menu
*m
);
102 /* Return the height of the window */
104 #endif /* _popup_h */