1 // Gmsh - Copyright (C) 1997-2021 C. Geuzaine, J.-F. Remacle
2 //
3 // See the LICENSE.txt file in the Gmsh root directory for license information.
4 // Please report all issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
5 
6 #ifndef OPTION_WINDOW_H
7 #define OPTION_WINDOW_H
8 
9 #include <vector>
10 #include <FL/Fl.H>
11 #include <FL/Fl_Window.H>
12 #include <FL/Fl_Value_Slider.H>
13 #include <FL/Fl_Multi_Browser.H>
14 #include <FL/Fl_Button.H>
15 #include <FL/Fl_Return_Button.H>
16 #include <FL/Fl_Check_Button.H>
17 #include <FL/Fl_Menu_Button.H>
18 #include <FL/Fl_Group.H>
19 #include <FL/Fl_Choice.H>
20 #include <FL/Fl_Input.H>
21 #include <FL/Fl_Value_Input.H>
22 #include <FL/Fl_Box.H>
23 #include "spherePositionWidget.h"
24 #include "colorbarWindow.h"
25 #include "gamepadWindow.h"
26 
27 #define NUM_FONTS 15
28 extern Fl_Menu_Item menu_font_names[];
29 
30 class optionWindow {
31 public:
32   Fl_Window *win;
33   Fl_Multi_Browser *browser;
34   Fl_Return_Button *redraw;
35   gamepadWindow *gmpdoption;
36 
37   struct {
38     Fl_Group *group;
39     std::vector<Fl_Check_Button *> butt;
40     std::vector<Fl_Button *> push;
41     std::vector<Fl_Value_Input *> value;
42     std::vector<Fl_Button *> color;
43     std::vector<Fl_Input *> input;
44     std::vector<Fl_Choice *> choice;
45     Fl_Button *gamepadconfig;
46     spherePositionWidget *sphere;
47   } general;
48   struct {
49     Fl_Group *group;
50     std::vector<Fl_Check_Button *> butt;
51     std::vector<Fl_Value_Input *> value;
52     std::vector<Fl_Button *> color;
53     std::vector<Fl_Choice *> choice;
54   } geo;
55   struct {
56     Fl_Group *group;
57     std::vector<Fl_Check_Button *> butt;
58     std::vector<Fl_Return_Button *> retbutt;
59     std::vector<Fl_Input *> input;
60     std::vector<Fl_Value_Input *> value;
61     std::vector<Fl_Button *> color;
62     std::vector<Fl_Choice *> choice;
63     Fl_Menu_Button *menu;
64   } mesh;
65   struct {
66     Fl_Group *group;
67     std::vector<Fl_Check_Button *> butt;
68     std::vector<Fl_Value_Input *> value;
69     std::vector<Fl_Input *> input;
70   } solver;
71   struct {
72     Fl_Group *group;
73     std::vector<Fl_Check_Button *> butt;
74     std::vector<Fl_Value_Input *> value;
75     std::vector<Fl_Choice *> choice;
76   } post;
77   struct {
78     int index;
79     Fl_Group *group, *range;
80     std::vector<Fl_Check_Button *> butt;
81     std::vector<Fl_Value_Input *> value;
82     std::vector<Fl_Input *> input;
83     std::vector<Fl_Button *> push;
84     std::vector<Fl_Choice *> choice;
85     std::vector<Fl_Button *> color;
86     std::vector<Fl_Box *> label;
87     std::vector<Fl_Menu_Button *> menu;
88     colorbarWindow *colorbar;
89     Fl_Return_Button *ok;
90   } view;
91 
92 public:
93   optionWindow(int deltaFontSize = 0);
~optionWindow()94   ~optionWindow() { Fl::delete_widget(win); }
95   void showGroup(int num, bool showWindow = true,
96                  bool allowMultipleSelections = false);
97   void resetBrowser();
98   void resetExternalViewList();
99   void updateViewGroup(int index);
100   void activate(const char *what);
101 };
102 
103 void options_cb(Fl_Widget *w, void *data);
104 void options_restore_defaults_cb(Fl_Widget *w, void *data);
105 void general_options_cb(Fl_Widget *w, void *data);
106 void geometry_options_cb(Fl_Widget *w, void *data);
107 void mesh_options_cb(Fl_Widget *w, void *data);
108 void solver_options_cb(Fl_Widget *w, void *data);
109 void post_options_cb(Fl_Widget *w, void *data);
110 void view_options_cb(Fl_Widget *w, void *data);
111 void general_gmpdcf_cb(Fl_Widget *w, void *data);
112 void general_options_ok_cb(Fl_Widget *w, void *data);
113 void general_options_rotation_center_select_cb(Fl_Widget *w, void *data);
114 void general_options_axes_fit_cb(Fl_Widget *w, void *data);
115 
116 #endif
117