#include #include #include #include #include # include using namespace std; // typedef void (*PFUNC_NOTIFY)(void *o); class ColorWin : public Fl_Window { private: uchar r,g,b; // Color RGB actual Fl_Value_Slider *vs_red, *vs_green, *vs_blue; // Widgets de la apli. Fl_Box *boxColor; // Fl_Button *bOk; // Fl_Button *bCancel; // PFUNC_NOTIFY pNotifyFunc; // void *pNotyArg; int wx, wy, ww, wh; // Dimesiones de la ventana principal int margen; // Separación entre boxes int mw, mh; // Dimensión de la barra de menú void updateBoxColor (); void updateSliders() { vs_red->value(r); vs_green->value(g); vs_blue->value(b); } static void valueSlidersCb(Fl_Widget *, void *); void creaValueSliders (void); // funciones de "callback()" // static void aceptarCb(Fl_Widget *); // static void cancelarCb(Fl_Widget *); public: ColorWin(char *title=NULL,int x=50, int y=50, int w=482, int h=242); Fl_Color getRGB() { return fl_rgb_color(r,g,b); } uchar red() { return r; }; uchar green() { return g; }; uchar blue() { return b; }; void setColor(uchar _r, uchar _g, uchar _b) { r = _r; g = _g; b = _b; }; void setColor(Fl_Color color) { Fl::get_color(color,r,g,b); updateSliders(); updateBoxColor(); } // void show(PFUNC_NOTIFY, void *); };