00001 /* 00002 File: ColorPick.h 00003 00004 Copyright(C) C. Kotterink, Computed Graphics 00005 */ 00006 #ifndef COLORWIDGET_H 00007 #define COLORWIDGET_H 00008 00009 #include<Frame.h> 00010 #include<Color4.h> 00011 00020 class ColorPick : public Frame 00021 { 00022 DYNAMIC_OBJECT; 00023 public: 00025 ColorPick(int i = 0); 00026 00028 void setColor(const Color4 &c) { 00029 color = c; 00030 } 00032 const Color4 &getColor() { 00033 return color; 00034 } 00035 00036 // Inherited from Region 00037 bool event(int regionId, int evnt); 00038 bool handleEvent(Event &evnt); 00039 void refresh(); 00041 void resize(unsigned short w, unsigned short h); 00042 00043 // Inherited from DynamicObject 00044 void parseSymbol(Token &t, ObjectFile &file); 00045 void writeParams(ostream &stream); 00046 00047 protected: 00048 // Inherited from DynamicObject 00049 void createSymbols(); 00050 00052 void updateUI(); 00053 00054 private: 00055 typedef Frame super; 00056 00058 Color4 color; 00059 }; 00060 #endif