2 Copyright 2009 by Hans Baier
10 public class ValueDisplay
: DisplayBase
{
12 private string _text
= "";
13 public new
string text
{
25 private new
int width
= 36;
26 private new
int height
= 16;
29 set_size_request (width
, height
);
30 show_glass_rim
= false;
33 protected override bool draw_contents(Cairo
.Context cr
, Gdk
.EventExpose event
) {
35 double font_size
= inner_height
;
37 cr
.select_font_face ("FreeSans", Cairo
.FontSlant
.NORMAL
, Cairo
.FontWeight
.NORMAL
);
38 cr
.set_font_size (font_size
);
39 Cairo
.TextExtents ext
= Cairo
.TextExtents();
40 cr
.text_extents (text
, ref ext
);
41 double x
= (inner_width
- ext
.x_advance
) / 2.0;
42 double y
= inner_height
* 0.85;
44 DisplayBase
.text (cr
, text
, x
, y
, font_size
);
50 } // namespace Prolooks