BALL  1.4.1
colorTable.h
Go to the documentation of this file.
00001 #ifndef BALL_VIEW_WIDGETS_COLOR_TABLE_H
00002 #include <QtGui/QTableWidget>
00003 
00004 #ifndef BALL_VIEW_KERNEL_PREFERENCESENTRY
00005 # include <BALL/VIEW/KERNEL/preferencesEntry.h>
00006 #endif
00007 
00008 #ifndef BALL_VIEW_KERNEL_COMMON_H
00009 # include <BALL/VIEW/KERNEL/common.h>
00010 #endif
00011 
00012 #ifndef BALL_VIEW_DATATYPE_COLORRGBA_H
00013 # include <BALL/VIEW/DATATYPE/colorRGBA.h>
00014 #endif
00015 
00016 namespace BALL
00017 {
00018   namespace VIEW
00019   {
00023     class BALL_VIEW_EXPORT ColorTable
00024       : public QTableWidget,
00025         public PreferencesEntry::ExtendedPreferencesObject
00026     {
00027         Q_OBJECT
00028 
00029       public:
00030         ColorTable(QWidget* parent = 0, const char* name = 0);
00031 
00032         void setNamesTitle(const String& string);
00033 
00034         String getNamesTitle() const;
00035 
00036         void setContent(const vector<String>& names, const vector<ColorRGBA>& colors);
00037 
00038         void setColors(const vector<ColorRGBA>& colors);
00039 
00040         const vector<ColorRGBA>& getColors() const
00041           { return colors_;}
00042 
00043         const vector<String>& getNames() const
00044           { return names_;}
00045 
00047         virtual bool getValue(String&) const;
00048 
00050         virtual bool setValue(const String& value);
00051 
00052       private slots:
00053 
00054         void beginEdit(int row, int col);
00055 
00056         virtual void mousePressEvent(QMouseEvent* event);
00057 
00058       private:
00059         vector<ColorRGBA> colors_;
00060         vector<String>    names_;
00061         bool              setting_content_;
00062     };
00063   }
00064 }
00065 
00066 #endif //BALL_VIEW_WIDGETS_COLOR_TABLE_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines