00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef MAINFLTKMENU
00011 #define MAINFLTKMENU
00012
00013 #include "FL/Fl_Menu_Item.H"
00014 #include "VMDFltkMenu.h"
00015 #include "ResizeArray.h"
00016
00017 class MolBrowser;
00018 class Fl_Menu_Bar;
00019 class Fl_Slider;
00020 class Fl_Int_Input;
00021 class Fl_Check_Button;
00022 class Fl_Counter;
00023 class Fl_Button;
00024
00025 #define VMDLEANGUI 1
00026
00027 typedef enum {MENU_ALWAYS_ON=0, MENU_NEED_SEL=1, MENU_NEED_UNIQUE_SEL=3} MenuBehavior;
00028
00031 class MainFltkMenu: public VMDFltkMenu {
00032 friend class MolBrowser;
00033
00034 private:
00035 Fl_Menu_Bar *menubar;
00036 MolBrowser *browser;
00037
00038 enum {UNDEFINED, NO_SELECTED_MOL, ONE_SELECTED_MOL, MANY_SELECTED_MOL} guistate;
00039
00040 Fl_Menu_Item *file_menuitems;
00041 Fl_Menu_Item *molecule_menuitems;
00042 Fl_Menu_Item *display_menuitems;
00043 Fl_Menu_Item *axes_menuitems;
00044 Fl_Menu_Item *backgroundmode_menuitems;
00045 Fl_Menu_Item *stage_menuitems;
00046 Fl_Menu_Item *stereo_menuitems;
00047 Fl_Menu_Item *stereoswap_menuitems;
00048 #if !defined(VMDLEANGUI)
00049 Fl_Menu_Item *cachemode_menuitems;
00050 #endif
00051 Fl_Menu_Item *rendermode_menuitems;
00052 Fl_Menu_Item *mouse_menuitems;
00053 Fl_Menu_Item *browserpopup_menuitems;
00054
00055
00056 Fl_Menu_Item *axes_menuitems_storage;
00057 Fl_Menu_Item *backgroundmode_menuitems_storage;
00058 Fl_Menu_Item *stage_menuitems_storage;
00059 Fl_Menu_Item *stereo_menuitems_storage;
00060 Fl_Menu_Item *stereoswap_menuitems_storage;
00061 Fl_Menu_Item *rendermode_menuitems_storage;
00062 #if !defined(VMDLEANGUI)
00063 Fl_Menu_Item *cachemode_menuitems_storage;
00064 #endif
00065 Fl_Menu_Item *mouse_menuitems_storage;
00066
00067 Fl_Slider *frameslider;
00068 Fl_Slider *speed;
00069 Fl_Int_Input *curframe;
00070 Fl_Check_Button *zoom;
00071 Fl_Choice *style;
00072
00073 Fl_Counter *step;
00074 Fl_Button *forward, *reverse;
00075
00076 void update_mousemode(Command *);
00077 void update_dispmode();
00078
00080 static void vmd_main_window_cb(Fl_Widget *, void *);
00081
00082 static void loadfile_cb(Fl_Widget *, void *);
00083 static void savefile_cb(Fl_Widget *, void *);
00084 static void frameslider_cb(Fl_Widget *, void *);
00085 static void zoom_cb(Fl_Widget *w, void *v);
00086
00092 int get_selected_molecule();
00093
00096 void update_menu_state(Fl_Menu_Item* mymenuitems, const MenuBehavior* mymenu_behavior);
00097 void update_gui_state();
00098
00099 protected:
00100 int act_on_command(int, Command *);
00101
00104 virtual void draw();
00105
00106 public:
00107 MainFltkMenu(VMDApp *);
00108 ~MainFltkMenu();
00109 };
00110
00111 #endif
00112