* VERSION 3.2.0
* Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
- * Copyright (c) 2001-2004, The GROMACS development team,
+ * Copyright (c) 2001-2013, The GROMACS development team,
* check out http://www.gromacs.org for more information.
* This program is free software; you can redistribute it and/or
#include <string.h>
#include <smalloc.h>
-#include <x11.h>
#include <macros.h>
+#include "x11.h"
#include "popup.h"
#include "pulldown.h"
-static gmx_bool PDCallBack(t_x11 *x11, XEvent *event, Window w, void *data)
+static bool PDCallBack(t_x11 *x11, XEvent *event, Window w, void *data)
{
t_pulldown *pd;
int i, x, x1, y, nsel;
;
}
pd->nsel = nsel;
- x1 = max(0, min(pd_width(pd)-menu_width(pd->m[nsel]), pd->xpos[nsel]));
- show_menu(x11, pd->m[nsel], x1, y+1, FALSE);
+ x1 = std::max(0, std::min(pd_width(pd)-menu_width(pd->m[nsel]), pd->xpos[nsel]));
+ show_menu(x11, pd->m[nsel], x1, y+1, false);
}
break;
case ButtonRelease:
default:
break;
}
- return FALSE;
+ return false;
}
-t_pulldown *init_pd(t_x11 *x11, Window Parent, int width, int height,
+t_pulldown *init_pd(t_x11 *x11, Window Parent, int width,
unsigned long fg, unsigned long bg,
int nmenu, int *nsub, t_mentry *ent[], const char **title)
{
pd->nsel = -1;
}
-void check_pd_item(t_pulldown *pd, int nreturn, gmx_bool bStatus)
+void check_pd_item(t_pulldown *pd, int nreturn, bool bStatus)
{
int i;
w = 0;
for (i = 0; (i < pd->nmenu); i++)
{
- w = max(w, menu_width(pd->m[i]));
+ w = std::max(w, menu_width(pd->m[i]));
}
- w = max(w, pd->xpos[pd->nmenu]);
+ w = std::max(w, pd->xpos[pd->nmenu]);
return w;
}
h = 0;
for (i = 0; (i < pd->nmenu); i++)
{
- h = max(h, menu_height(pd->m[i]));
+ h = std::max(h, menu_height(pd->m[i]));
}
return h;