libyui-ncurses
Loading...
Searching...
No Matches
NCProgressBar.h
1/*
2 Copyright (C) 2000-2012 Novell, Inc
3 This library is free software; you can redistribute it and/or modify
4 it under the terms of the GNU Lesser General Public License as
5 published by the Free Software Foundation; either version 2.1 of the
6 License, or (at your option) version 3.0 of the License. This library
7 is distributed in the hope that it will be useful, but WITHOUT ANY
8 WARRANTY; without even the implied warranty of MERCHANTABILITY or
9 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
10 License for more details. You should have received a copy of the GNU
11 Lesser General Public License along with this library; if not, write
12 to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
13 Floor, Boston, MA 02110-1301 USA
14*/
15
16
17/*-/
18
19 File: NCProgressBar.h
20
21 Author: Michael Andres <ma@suse.de>
22
23/-*/
24
25#ifndef NCProgressBar_h
26#define NCProgressBar_h
27
28#include <iosfwd>
29
30#include <yui/YProgressBar.h>
31#include "NCWidget.h"
32
33class NCProgressBar;
34
35
36class NCProgressBar : public YProgressBar, public NCWidget
37{
38private:
39
40 friend std::ostream & operator<<( std::ostream & str, const NCProgressBar & obj );
41
42 NCProgressBar & operator=( const NCProgressBar & );
44
45
46 typedef long long Value_t;
47
48 NClabel label;
49 Value_t maxval;
50 Value_t cval;
51 NCursesWindow * lwin;
52 NCursesWindow * twin;
53
54 void setDefsze();
55 void tUpdate();
56
57protected:
58
59 virtual const char * location() const { return "NCProgressBar"; }
60
61 virtual void wCreate( const wrect & newrect );
62 virtual void wDelete();
63
64 virtual void wRedraw();
65
66public:
67
68 NCProgressBar( YWidget * parent,
69 const std::string & label,
70 int maxValue = 100 );
71 virtual ~NCProgressBar();
72
73 virtual int preferredWidth();
74 virtual int preferredHeight();
75
76 virtual void setSize( int newWidth, int newHeight );
77
78 virtual void setLabel( const std::string & nlabel );
79
80 virtual void setValue( int newValue );
81
82 virtual void setEnabled( bool do_bv );
83};
84
85
86#endif // NCProgressBar_h
Definition NCProgressBar.h:37
virtual void setEnabled(bool do_bv)
Definition NCProgressBar.cc:77
Definition NCWidget.h:46
Multi-line string, with optional hotkey, drawable.
Definition NCtext.h:82
C++ class for windows.
Definition ncursesw.h:907
A rectangle is defined by its position and size: wpos Pos, wsze Sze.
Definition position.h:194