Root/src/menusettingrgba.h

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#ifndef MENUSETTINGRGBA_H
21#define MENUSETTINGRGBA_H
22
23#include "menusetting.h"
24#include "surface.h"
25#include "inputmanager.h"
26
27class GMenu2X;
28
29class MenuSettingRGBA : public MenuSetting {
30private:
31    unsigned short selPart;
32    int y;
33    std::string strR, strG, strB, strA;
34    RGBAColor originalValue;
35    RGBAColor *_value;
36
37    void update_value(int value);
38    void dec();
39    void inc();
40    void leftComponent();
41    void rightComponent();
42
43public:
44    MenuSettingRGBA(
45            GMenu2X *gmenu2x, const std::string &name,
46            const std::string &description, RGBAColor *value);
47    virtual ~MenuSettingRGBA() {};
48
49    virtual void draw(int y);
50    virtual void handleTS();
51    virtual void manageInput(bevent_t *event);
52    virtual void adjustInput();
53    virtual void drawSelected(int y);
54    virtual bool edited();
55
56    void setSelPart(unsigned short value);
57    void setR(unsigned short r);
58    void setG(unsigned short g);
59    void setB(unsigned short b);
60    void setA(unsigned short a);
61    unsigned short getSelPart();
62    RGBAColor value();
63};
64
65#endif
66

Archive Download this file



interactive