00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef VMDFLTKMENU_H
00022 #define VMDFLTKMENU_H
00023
00024 #include <FL/Fl_Window.H>
00025 #include "VMDMenu.h"
00026
00027
00028
00029
00030
00031 #define VMDMENU_NEW_COLORSCHEME 1
00032
00033
00034 #if defined(VMDMENU_NEW_COLORSCHEME)
00035 #if (FL_MAJOR_VERSION >= 1) && (((FL_MINOR_VERSION >= 1) && (FL_PATCH_VERSION >= 8)) || ((FL_MINOR_VERSION >= 3) && (FL_PATCH_VERSION >= 0)))
00036
00037
00038
00039
00040 #define VMDMENU_BROWSER_BG FL_WHITE
00041 #define VMDMENU_WINDOW fl_gray_ramp(223 * (FL_NUM_GRAY - 1) / 255)
00042 #define VMDMENU_BROWSER_SEL fl_rgb_color(210, 225, 210)
00043
00044
00045 #else
00046 #define VMDMENU_BROWSER_BG fl_gray_ramp(243 * (FL_NUM_GRAY - 1) / 255)
00047 #define VMDMENU_BROWSER_SEL fl_rgb_color(210, 225, 210)
00048 #endif
00049
00050
00051
00052
00053
00054
00055 #define VMDMENU_MOL_ACTIVE "A"
00056 #define VMDMENU_MOL_INACTIVE "@C88A"
00057 #define VMDMENU_MOL_DISPLAYED "D"
00058 #define VMDMENU_MOL_NONDISPLAYED "@C88D"
00059 #define VMDMENU_MOL_FIXED "F"
00060 #define VMDMENU_MOL_NONFIXED "@C88F"
00061
00062
00063 #define VMDMENU_REP_ACTIVE ""
00064
00065 #define VMDMENU_REP_INACTIVE "@C88"
00066
00067
00068 #define VMDMENU_GEOM_ACTIVE ""
00069 #define VMDMENU_GEOM_INACTIVE "@C88"
00070
00071 #else
00072
00073
00074
00075
00076 #define VMDMENU_BROWSER_BG FL_DARKCYAN
00077 #define VMDMENU_BROWSER_SEL FL_YELLOW
00078 #define VMDMENU_MOLBROWSER_INACTIVE "@C203A"
00079
00080
00081
00082
00083
00084 #define VMDMENU_MOL_ACTIVE "A"
00085 #define VMDMENU_MOL_INACTIVE "@C203A"
00086 #define VMDMENU_MOL_DISPLAYED "D"
00087 #define VMDMENU_MOL_NONDISPLAYED "@C203D"
00088 #define VMDMENU_MOL_FIXED "F"
00089 #define VMDMENU_MOL_NONFIXED "@C203F"
00090
00091
00092 #define VMDMENU_REP_ACTIVE ""
00093 #define VMDMENU_REP_INACTIVE "@C203"
00094
00095
00096 #define VMDMENU_GEOM_ACTIVE ""
00097 #define VMDMENU_GEOM_INACTIVE "@C203"
00098 #endif
00099
00100
00101 #if (FL_MAJOR_VERSION >= 1) && (((FL_MINOR_VERSION >= 1) && (FL_PATCH_VERSION >= 8)) || ((FL_MINOR_VERSION >= 3) && (FL_PATCH_VERSION >= 0)))
00102
00103
00104
00105
00106 #define VMDMENU_CHOOSER_BG FL_GRAY
00107 #else
00108 #define VMDMENU_CHOOSER_BG FL_PALEGREEN
00109 #endif
00110 #define VMDMENU_CHOOSER_SEL FL_BLACK
00111 #define VMDMENU_SLIDER_BG FL_WHITE
00112 #define VMDMENU_SLIDER_FG FL_BLACK
00113 #define VMDMENU_SLIDER_SEL FL_YELLOW
00114 #define VMDMENU_MENU_SEL FL_BLACK
00115 #define VMDMENU_CHECKBOX_BG FL_BLACK
00116 #define VMDMENU_CHECKBOX_FG FL_RED
00117
00118
00119 #define VMDMENU_VALUE_BG FL_WHITE
00120 #define VMDMENU_VALUE_SEL FL_YELLOW
00121
00122
00123 #define VMDMENU_VALUE_SEL2 FL_BLACK
00124
00125
00126 #define VMDMENU_CHECKBOX_BG FL_BLACK
00127 #define VMDMENU_CHECKBOX_FG FL_RED
00128
00129
00130 #define VMDMENU_COLOR_RSLIDER fl_rgb_color(255, 0, 0)
00131 #define VMDMENU_COLOR_GSLIDER fl_rgb_color(0, 255, 0)
00132 #define VMDMENU_COLOR_BSLIDER fl_rgb_color(0, 0, 255)
00133
00134
00135 #define VMDMENU_MATSLIDER_BG FL_WHITE
00136 #define VMDMENU_MATSLIDER_FG FL_GRAY
00137
00138
00139 #define VMDMENU_POSITIONER_BG VMDMENU_BROWSER_BG
00140 #define VMDMENU_POSITIONER_SEL VMDMENU_BROWSER_SEL
00141
00142 #if (FL_MAJOR_VERSION >= 1) && (FL_MINOR_VERSION >= 1)
00143 #define VMDFLTKTOOLTIP(obj, string) (obj)->tooltip(string);
00144 #else
00145 #define VMDFLTKTOOLTIP(obj, string)
00146 #endif
00147
00148 class Fl_Choice;
00149
00151 class VMDFltkMenu : public VMDMenu, public Fl_Window {
00152 private:
00153 char *_title;
00154 static void window_cb(Fl_Widget *, void *);
00155
00156 protected:
00157 virtual void do_on();
00158 virtual void do_off();
00159
00160 public:
00161 VMDFltkMenu(const char *menuname, const char *title, VMDApp *);
00162 ~VMDFltkMenu();
00163
00164 virtual void move(int, int);
00165 virtual void where(int &, int &);
00166 };
00167
00169 void fill_fltk_molchooser(Fl_Choice *, VMDApp *, const char *);
00170
00172 char * escape_fltk_menustring(const char *);
00173
00177 void set_chooser_from_string(const char *namestr, class Fl_Choice *chooser);
00178
00179 #endif
00180