3b219c07c7cdb1e2b9344b97604fb384a9f31d94
[alexxy/gromacs.git] / src / ngmx / pulldown.h
1 /*
2  * $Id$
3  * 
4  *       This source code is part of
5  * 
6  *        G   R   O   M   A   C   S
7  * 
8  * GROningen MAchine for Chemical Simulations
9  * 
10  *               VERSION 2.0
11  * 
12  * Copyright (c) 1991-1999
13  * BIOSON Research Institute, Dept. of Biophysical Chemistry
14  * University of Groningen, The Netherlands
15  * 
16  * Please refer to:
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)
20  * 
21  * Also check out our WWW page:
22  * http://md.chem.rug.nl/~gmx
23  * or e-mail to:
24  * gromacs@chem.rug.nl
25  * 
26  * And Hey:
27  * Great Red Oystrich Makes All Chemists Sane
28  */
29
30 #ifndef _pulldown_h
31 #define _pulldown_h
32
33 static char *SRCID_pulldown_h = "$Id$";
34
35 #ifdef HAVE_IDENT
36 #ident  "@(#) pulldown.h 1.4 11/23/92"
37 #endif /* HAVE_IDENT */
38 #include "popup.h"
39
40 typedef struct {
41   t_windata wd;
42   int       nmenu;
43   int       nsel;
44   int       *xpos;
45   t_menu    **m;
46   char      **title;
47 } t_pulldown;
48
49 extern t_pulldown *init_pd(t_x11 *x11,Window Parent,int width,int height,
50                            unsigned long fg,unsigned long bg,
51                            int nmenu,int *nsub,t_mentry *ent[],char **title);
52 /* nmenu is the number of submenus, title are the titles of
53  * the submenus, nsub are the numbers of entries in each submenu
54  * ent are the entries in the pulldown menu, analogous to these in the
55  * popup menu.
56  * The Parent is the parent window, the width is the width of the parent
57  * window. The Menu is constructed as a bar on the topside of the window
58  * (as usual). It calculates it own height by the font size.
59  * !!!
60  * !!! Do not destroy the ent structure, or the titles, while using
61  * !!! the menu.
62  * !!!
63  * When the menu is selected, a ClientMessage will be sent to the Parent
64  * specifying the selected item in xclient.data.l[0].
65  */
66
67 extern void hide_pd(t_x11 *x11,t_pulldown *pd);
68 /* Hides any menu that is still on the screen when it shouldn't */
69
70 extern void check_pd_item(t_pulldown *pd,int nreturn,bool bStatus);
71 /* Set the bChecked field in the pd item with return code
72  * nreturn to bStatus. This function must always be called when
73  * the bChecked flag has to changed.
74  */
75
76 extern void done_pd(t_x11 *x11,t_pulldown *pd);
77 /* This routine destroys the menu pd, and unregisters it with x11 */
78
79 extern int pd_width(t_pulldown *pd);
80 /* Return the width of the window */
81
82 extern int pd_height(t_pulldown *pd);
83 /* Return the height of the window */
84
85 #endif  /* _pulldown_h */