Debian Codegraph @

source/progwin.cc

raw
1 // ----------------------------------------------------------------------------
2 //
3 // Copyright (C) 2003-2013 Fons Adriaensen <[email protected]>
4 //
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 3 of the License, or
8 // (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program. If not, see <http://www.gnu.org/licenses/>.
17 //
18 // ----------------------------------------------------------------------------
19
20
21 #include <stdlib.h>
22 #include <stdio.h>
23 #include "progwin.h"
24 #include "styles.h"
25
26
27
28 Progwin::Progwin (X_window *parw, X_resman *resman) :
29 X_window (parw, 0, 0, XDEF, YDEF, XftColors.main_bg->pixel)
30 {
31 _text = new X_textip (this, 0, &Tst0, 24, 20, 302, 18, 127);
32 _text->x_map ();
33 _prog = new X_hmeter (this, &Mprogr, &Sprogr, 24, 60, 12);
34 _prog->x_map ();
35 }
36
37
38 Progwin::~Progwin (void)
39 {
40 }
41
42
43 void Progwin::handle_event (XEvent *E)
44 {
45 switch (E->type)
46 {
47 default:
48 ;
49 }
50 }
51
52
53 void Progwin::show (int x, int y, const char *text)
54 {
55 _text->set_text (text);
56 _prog->set_val (0.0f);
57 x_move (x - XDEF / 2, y - YDEF / 2);
58 x_mapraised ();
59 }
60
61
62 void Progwin::prog (float v)
63 {
64 _prog->set_val (v);
65 }
66
67
68 void Progwin::hide (void)
69 {
70 x_unmap ();
71 }
72
73