Sat, 09 Jul 2022 23:05:25 +0200
Increased some labels sizes.
316
dcd472be9ae8
Added led, manometer, thermometer and wallclock from the abandoned AnalogWidgets project as plugins. There is some work to do but it's already usable for the monitor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
1 | /*************************************************************************** |
dcd472be9ae8
Added led, manometer, thermometer and wallclock from the abandoned AnalogWidgets project as plugins. There is some work to do but it's already usable for the monitor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
2 | * Copyright (C) 2006-2008 by Tomasz Ziobrowski * |
dcd472be9ae8
Added led, manometer, thermometer and wallclock from the abandoned AnalogWidgets project as plugins. There is some work to do but it's already usable for the monitor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
3 | * http://www.3electrons.com * |
dcd472be9ae8
Added led, manometer, thermometer and wallclock from the abandoned AnalogWidgets project as plugins. There is some work to do but it's already usable for the monitor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
4 | * e-mail: t.ziobrowski@3electrons.com * |
dcd472be9ae8
Added led, manometer, thermometer and wallclock from the abandoned AnalogWidgets project as plugins. There is some work to do but it's already usable for the monitor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
5 | * * |
dcd472be9ae8
Added led, manometer, thermometer and wallclock from the abandoned AnalogWidgets project as plugins. There is some work to do but it's already usable for the monitor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
6 | * * |
dcd472be9ae8
Added led, manometer, thermometer and wallclock from the abandoned AnalogWidgets project as plugins. There is some work to do but it's already usable for the monitor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
7 | * This program is free software; you can redistribute it and/or modify * |
dcd472be9ae8
Added led, manometer, thermometer and wallclock from the abandoned AnalogWidgets project as plugins. There is some work to do but it's already usable for the monitor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
8 | * it under the terms of the GNU General Public License as published by * |
dcd472be9ae8
Added led, manometer, thermometer and wallclock from the abandoned AnalogWidgets project as plugins. There is some work to do but it's already usable for the monitor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
9 | * the Free Software Foundation; either version 2 of the License, or * |
dcd472be9ae8
Added led, manometer, thermometer and wallclock from the abandoned AnalogWidgets project as plugins. There is some work to do but it's already usable for the monitor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
10 | * (at your option) any later version. * |
dcd472be9ae8
Added led, manometer, thermometer and wallclock from the abandoned AnalogWidgets project as plugins. There is some work to do but it's already usable for the monitor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
11 | * * |
dcd472be9ae8
Added led, manometer, thermometer and wallclock from the abandoned AnalogWidgets project as plugins. There is some work to do but it's already usable for the monitor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
12 | * This program is distributed in the hope that it will be useful, * |
dcd472be9ae8
Added led, manometer, thermometer and wallclock from the abandoned AnalogWidgets project as plugins. There is some work to do but it's already usable for the monitor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * |
dcd472be9ae8
Added led, manometer, thermometer and wallclock from the abandoned AnalogWidgets project as plugins. There is some work to do but it's already usable for the monitor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
dcd472be9ae8
Added led, manometer, thermometer and wallclock from the abandoned AnalogWidgets project as plugins. There is some work to do but it's already usable for the monitor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
15 | * GNU General Public License for more details. * |
dcd472be9ae8
Added led, manometer, thermometer and wallclock from the abandoned AnalogWidgets project as plugins. There is some work to do but it's already usable for the monitor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
16 | * * |
dcd472be9ae8
Added led, manometer, thermometer and wallclock from the abandoned AnalogWidgets project as plugins. There is some work to do but it's already usable for the monitor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
17 | * You should have received a copy of the GNU General Public License * |
dcd472be9ae8
Added led, manometer, thermometer and wallclock from the abandoned AnalogWidgets project as plugins. There is some work to do but it's already usable for the monitor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
18 | * along with this program; if not, write to the * |
dcd472be9ae8
Added led, manometer, thermometer and wallclock from the abandoned AnalogWidgets project as plugins. There is some work to do but it's already usable for the monitor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
19 | * Free Software Foundation, Inc., * |
dcd472be9ae8
Added led, manometer, thermometer and wallclock from the abandoned AnalogWidgets project as plugins. There is some work to do but it's already usable for the monitor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
20 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
dcd472be9ae8
Added led, manometer, thermometer and wallclock from the abandoned AnalogWidgets project as plugins. There is some work to do but it's already usable for the monitor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
21 | ***************************************************************************/ |
dcd472be9ae8
Added led, manometer, thermometer and wallclock from the abandoned AnalogWidgets project as plugins. There is some work to do but it's already usable for the monitor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
22 | |
dcd472be9ae8
Added led, manometer, thermometer and wallclock from the abandoned AnalogWidgets project as plugins. There is some work to do but it's already usable for the monitor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
23 | #ifndef WIDGETWITHBACKGROUND_H |
dcd472be9ae8
Added led, manometer, thermometer and wallclock from the abandoned AnalogWidgets project as plugins. There is some work to do but it's already usable for the monitor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
24 | #define WIDGETWITHBACKGROUND_H |
dcd472be9ae8
Added led, manometer, thermometer and wallclock from the abandoned AnalogWidgets project as plugins. There is some work to do but it's already usable for the monitor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
25 | |
dcd472be9ae8
Added led, manometer, thermometer and wallclock from the abandoned AnalogWidgets project as plugins. There is some work to do but it's already usable for the monitor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
26 | #include <QWidget> |
dcd472be9ae8
Added led, manometer, thermometer and wallclock from the abandoned AnalogWidgets project as plugins. There is some work to do but it's already usable for the monitor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
27 | |
dcd472be9ae8
Added led, manometer, thermometer and wallclock from the abandoned AnalogWidgets project as plugins. There is some work to do but it's already usable for the monitor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
28 | class QPixmap; |
dcd472be9ae8
Added led, manometer, thermometer and wallclock from the abandoned AnalogWidgets project as plugins. There is some work to do but it's already usable for the monitor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
29 | |
dcd472be9ae8
Added led, manometer, thermometer and wallclock from the abandoned AnalogWidgets project as plugins. There is some work to do but it's already usable for the monitor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
30 | class WidgetWithBackground : public QWidget |
dcd472be9ae8
Added led, manometer, thermometer and wallclock from the abandoned AnalogWidgets project as plugins. There is some work to do but it's already usable for the monitor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
31 | { |
dcd472be9ae8
Added led, manometer, thermometer and wallclock from the abandoned AnalogWidgets project as plugins. There is some work to do but it's already usable for the monitor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
32 | Q_OBJECT |
319 | 33 | public: |
34 | /** Constructor */ | |
316
dcd472be9ae8
Added led, manometer, thermometer and wallclock from the abandoned AnalogWidgets project as plugins. There is some work to do but it's already usable for the monitor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
35 | WidgetWithBackground(QWidget * parent = 0); |
dcd472be9ae8
Added led, manometer, thermometer and wallclock from the abandoned AnalogWidgets project as plugins. There is some work to do but it's already usable for the monitor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
36 | |
319 | 37 | /** Destructor - removes the bitmap. */ |
316
dcd472be9ae8
Added led, manometer, thermometer and wallclock from the abandoned AnalogWidgets project as plugins. There is some work to do but it's already usable for the monitor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
38 | ~WidgetWithBackground (); |
dcd472be9ae8
Added led, manometer, thermometer and wallclock from the abandoned AnalogWidgets project as plugins. There is some work to do but it's already usable for the monitor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
39 | |
dcd472be9ae8
Added led, manometer, thermometer and wallclock from the abandoned AnalogWidgets project as plugins. There is some work to do but it's already usable for the monitor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
40 | /** |
319 | 41 | * An operation to repaint a control - |
42 | * Pastes the background bitmap onto the control - | |
43 | * Generate it earlier if needed. | |
316
dcd472be9ae8
Added led, manometer, thermometer and wallclock from the abandoned AnalogWidgets project as plugins. There is some work to do but it's already usable for the monitor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
44 | */ |
dcd472be9ae8
Added led, manometer, thermometer and wallclock from the abandoned AnalogWidgets project as plugins. There is some work to do but it's already usable for the monitor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
45 | void drawBackground (); |
dcd472be9ae8
Added led, manometer, thermometer and wallclock from the abandoned AnalogWidgets project as plugins. There is some work to do but it's already usable for the monitor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
46 | |
319 | 47 | /** Repaints the control by painting the background unconditionally. */ |
316
dcd472be9ae8
Added led, manometer, thermometer and wallclock from the abandoned AnalogWidgets project as plugins. There is some work to do but it's already usable for the monitor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
48 | void updateWithBackground (); |
319 | 49 | |
316
dcd472be9ae8
Added led, manometer, thermometer and wallclock from the abandoned AnalogWidgets project as plugins. There is some work to do but it's already usable for the monitor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
50 | /** |
319 | 51 | * Returns whether a control has been modified. |
52 | * This information is set when the background bitmap changes, that is, | |
53 | * the size of the component changes or the background needs to be repainted. | |
54 | */ | |
316
dcd472be9ae8
Added led, manometer, thermometer and wallclock from the abandoned AnalogWidgets project as plugins. There is some work to do but it's already usable for the monitor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
55 | bool doRepaintBackground(); |
319 | 56 | |
57 | protected: | |
58 | /** Invoke paintBackground - redrawing the background */ | |
316
dcd472be9ae8
Added led, manometer, thermometer and wallclock from the abandoned AnalogWidgets project as plugins. There is some work to do but it's already usable for the monitor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
59 | void repaintBackground(); |
dcd472be9ae8
Added led, manometer, thermometer and wallclock from the abandoned AnalogWidgets project as plugins. There is some work to do but it's already usable for the monitor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
60 | |
dcd472be9ae8
Added led, manometer, thermometer and wallclock from the abandoned AnalogWidgets project as plugins. There is some work to do but it's already usable for the monitor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
61 | /** |
319 | 62 | * Repaints the background of the control |
63 | * @param painter the device on which we are to paint. | |
64 | * @param background this is the background of the indicator | |
316
dcd472be9ae8
Added led, manometer, thermometer and wallclock from the abandoned AnalogWidgets project as plugins. There is some work to do but it's already usable for the monitor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
65 | */ |
dcd472be9ae8
Added led, manometer, thermometer and wallclock from the abandoned AnalogWidgets project as plugins. There is some work to do but it's already usable for the monitor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
66 | virtual void paintBackground (QPainter & painer) = 0; |
dcd472be9ae8
Added led, manometer, thermometer and wallclock from the abandoned AnalogWidgets project as plugins. There is some work to do but it's already usable for the monitor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
67 | |
319 | 68 | protected: |
69 | /** Background buffer. */ | |
316
dcd472be9ae8
Added led, manometer, thermometer and wallclock from the abandoned AnalogWidgets project as plugins. There is some work to do but it's already usable for the monitor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
70 | QPixmap * m_pixmap; |
319 | 71 | |
316
dcd472be9ae8
Added led, manometer, thermometer and wallclock from the abandoned AnalogWidgets project as plugins. There is some work to do but it's already usable for the monitor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
72 | /** |
319 | 73 | * Sets this variable after a property change |
74 | */ | |
316
dcd472be9ae8
Added led, manometer, thermometer and wallclock from the abandoned AnalogWidgets project as plugins. There is some work to do but it's already usable for the monitor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
75 | bool m_modified; |
dcd472be9ae8
Added led, manometer, thermometer and wallclock from the abandoned AnalogWidgets project as plugins. There is some work to do but it's already usable for the monitor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
76 | }; |
319 | 77 | |
316
dcd472be9ae8
Added led, manometer, thermometer and wallclock from the abandoned AnalogWidgets project as plugins. There is some work to do but it's already usable for the monitor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
78 | #endif //WIDGETWITHBACKGROUND_H |
dcd472be9ae8
Added led, manometer, thermometer and wallclock from the abandoned AnalogWidgets project as plugins. There is some work to do but it's already usable for the monitor screens.
Michiel Broek <mbroek@mbse.eu>
parents:
diff
changeset
|
79 |