Root/
1 | /*************************************************************************** |
2 | * Copyright (C) 2006 by Massimiliano Torromeo * |
3 | * massimiliano.torromeo@gmail.com * |
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 2 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, write to the * |
17 | * Free Software Foundation, Inc., * |
18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
19 | ***************************************************************************/ |
20 | |
21 | #ifndef MENUSETTINGRGBA_H |
22 | #define MENUSETTINGRGBA_H |
23 | |
24 | #include "menusetting.h" |
25 | #include "surface.h" |
26 | #include "inputmanager.h" |
27 | |
28 | class GMenu2X; |
29 | class Touchscreen; |
30 | |
31 | class MenuSettingRGBA : public MenuSetting { |
32 | private: |
33 | Touchscreen &ts; |
34 | unsigned short selPart; |
35 | int y; |
36 | std::string strR, strG, strB, strA; |
37 | RGBAColor originalValue; |
38 | RGBAColor *_value; |
39 | |
40 | void update_value(int value); |
41 | void dec(); |
42 | void inc(); |
43 | void leftComponent(); |
44 | void rightComponent(); |
45 | |
46 | bool edit; |
47 | void updateButtonBox(); |
48 | |
49 | public: |
50 | MenuSettingRGBA( |
51 | GMenu2X *gmenu2x, Touchscreen &ts, |
52 | const std::string &name, const std::string &description, |
53 | RGBAColor *value); |
54 | virtual ~MenuSettingRGBA() {}; |
55 | |
56 | virtual void draw(int y); |
57 | virtual void handleTS(); |
58 | virtual bool handleButtonPress(InputManager::Button button); |
59 | virtual void drawSelected(int y); |
60 | virtual bool edited(); |
61 | |
62 | void setSelPart(unsigned short value); |
63 | void setR(unsigned short r); |
64 | void setG(unsigned short g); |
65 | void setB(unsigned short b); |
66 | void setA(unsigned short a); |
67 | unsigned short getSelPart(); |
68 | RGBAColor value(); |
69 | }; |
70 | |
71 | #endif |
72 |
Branches:
install_locations
master
opkrun
packages