9 // functions for WMHistory -----------------------------------------------
12 void WMHistory::setvalue (int value
, int index
, bool dodisplay
)
17 wValues
.push_front(value
);
20 wValues
[index
] = value
;
25 void WMHistory::setvalues (const vector
<int>& values
, bool dodisplay
)
27 vector
<int>::const_iterator src
= values
.begin();
28 deque
<int>::iterator dest
= wValues
.begin();
29 while (src
!= values
.end() && dest
!= wValues
.end())
31 while (dest
!= wValues
.end())
37 void WMHistory::clear(bool dodisplay
)
38 { setvalues(vector
<int>(0), dodisplay
); }
40 void WMHistory::real_display ()
41 // XXX: Currently no vertical style, since it doesn't make a lot of sense
43 WMApp::Xw
.fill_rectangle(window()->pixmap(), b_position(),
47 if (width() < 2 * border() || height() < 2 * border())
48 { cerr
<< "WMError: History " << this << " too small" << endl
; return; }
50 for (int x
= 0; x
< b_width(); x
++)
52 int h
= static_cast<int> (fraction(x
) * b_height());
56 WMApp::Xw
.draw_point(window()->pixmap(), b_right() - 1 - x
, b_bottom() - 1
60 WMApp::Xw
.draw_line(window()->pixmap(), b_right() - 1 - x
, b_bottom() - h
,
61 b_right() - 1 - x
, b_bottom() - h
+ 1, WMColor(Bright
));
63 WMApp::Xw
.draw_line(window()->pixmap(), b_right() - 1 - x
, b_bottom() - h
+ 2, b_right() - 1 - x
, b_bottom() - 1, WMColor(Medium
));