00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef COLOR_FLTK_MENU_H__
00010 #define COLOR_FLTK_MENU_H__
00011
00012 #include "VMDFltkMenu.h"
00013
00014 #if ((FL_MAJOR_VERSION == 1) && (FL_MINOR_VERSION == 1) && (FL_PATCH_VERSION >= 10)) || ((FL_MAJOR_VERSION >= 1) && (FL_MINOR_VERSION >= 1))
00015 #define VMD_USE_FLTK_COLORCHOOSER 1
00016 #else
00017 #define VMD_USE_VMD_COLORCHOOSER 1
00018 #endif
00019
00020 class VMDApp;
00021 class Fl_Hold_Browser;
00022 class Fl_Value_Slider;
00023 class Fl_Button;
00024 class Fl_Toggle_Button;
00025 class Fl_Box;
00026 class Fl_Choice;
00027 class Fl_Color_Chooser;
00028 class Fl_Input_Choice;
00029
00031 class ColorscaleImage;
00032 class ColorscaleLumaChart;
00033
00035 class ColorFltkMenu : public VMDFltkMenu {
00036 public:
00037 ColorFltkMenu(VMDApp *);
00038 void update_scaleimage();
00039
00040 private:
00041 Fl_Hold_Browser *categorybrowser;
00042 Fl_Hold_Browser *itembrowser;
00043 Fl_Hold_Browser *colorbrowser;
00044
00045 Fl_Hold_Browser *colordefbrowser;
00046
00047 #if defined(VMD_USE_FLTK_COLORCHOOSER)
00048 Fl_Color_Chooser *colchooser;
00049 Fl_Box *colchooserbox;
00050 Fl_Button *colchoosedefaultbutton;
00051 #endif
00052
00053 #if defined(VMD_USE_VMD_COLORCHOOSER)
00054 Fl_Value_Slider *redscale;
00055 Fl_Value_Slider *greenscale;
00056 Fl_Value_Slider *bluescale;
00057 Fl_Button *grayscalebutton;
00058 Fl_Button *defaultbutton;
00059 #endif
00060
00061
00062 Fl_Choice *scalemethod;
00063 Fl_Value_Slider *offsetvalue;
00064 Fl_Value_Slider *midpointvalue;
00065 Fl_Toggle_Button *scalereversebutton;
00066 Fl_Input_Choice *scaleposterize;
00067 ColorscaleImage *image;
00068 ColorscaleLumaChart *scalelumachart;
00069
00070 static void category_cb(Fl_Widget *, void *);
00071 static void item_cb(Fl_Widget *, void *);
00072 static void color_cb(Fl_Widget *, void *);
00073 static void colordef_cb(Fl_Widget *, void *);
00074 static void default_cb(Fl_Widget *, void *v);
00075 static void scalemethod_cb(Fl_Widget *, void *);
00076 static void scalesettings_cb(Fl_Widget *, void *);
00077
00078 #if defined(VMD_USE_FLTK_COLORCHOOSER)
00079 static void colchooser_cb(Fl_Widget *, void *);
00080 #endif
00081 #if defined(VMD_USE_VMD_COLORCHOOSER)
00082 static void rgb_cb(Fl_Widget *, void *);
00083 #endif
00084
00086 void reset_color_categories();
00087
00089 void reset_color_names();
00090
00092 void reset_color_scale();
00093
00097 void update_chosen_color();
00098
00100 void update_color_definition();
00101
00102 void make_window();
00103
00104 protected:
00105 int act_on_command(int, Command *);
00106 };
00107 #endif