horizontal & vertical grid lines no longer expand past the
[dyninst.git] / visiClients / tableVisi / src / tvMetric.C
1 // tvMetric.C
2 // Ariel Tamches
3
4 /*
5  * $Log: tvMetric.C,v $
6  * Revision 1.1  1995/11/04 00:45:59  tamches
7  * First version of new table visi
8  *
9  */
10
11 #include "minmax.h"
12 #include "tvMetric.h"
13
14 tvMetric::tvMetric(const string &iName, const string &iUnitsName,
15                    XFontStruct *nameFontStruct, XFontStruct *unitsNameFontStruct) :
16                       name(iName), unitsName(iUnitsName) {
17    namePixWidth = XTextWidth(nameFontStruct, name.string_of(), name.length());
18    unitsPixWidth = XTextWidth(unitsNameFontStruct, iUnitsName.string_of(),
19                               iUnitsName.length());
20 }
21
22 unsigned tvMetric::getColPixWidth() const {
23    const int horiz_padding_each_side = 3;
24    return max(getNamePixWidth(), getUnitsPixWidth()) + 2*horiz_padding_each_side;
25 }