From 270c1338d77226ffbde3e0a1edbe329b93a57be5 Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Wed, 5 Apr 2017 23:34:28 +0200 Subject: [PATCH] shortcut to freeze coordinate in interactive mode --- Common/CommandLine.cpp | 5 +++++ Fltk/FlGui.cpp | 12 ++++++++++++ Fltk/contextWindow.cpp | 3 +++ Fltk/graphicWindow.cpp | 6 ++---- doc/texinfo/shortcuts.texi | 10 ++++++++++ 5 files changed, 32 insertions(+), 4 deletions(-) diff --git a/Common/CommandLine.cpp b/Common/CommandLine.cpp index 41a642b8c5..dc0860e0f4 100644 --- a/Common/CommandLine.cpp +++ b/Common/CommandLine.cpp @@ -177,10 +177,15 @@ std::vector<std::pair<std::string, std::string> > GetShortcutsUsage(const std::s s.push_back(mp("2 or F2", "Mesh surfaces")); s.push_back(mp("3 or F3", "Mesh volumes")); s.push_back(mp("Escape", "Cancel lasso zoom/selection, toggle mouse selection ON/OFF")); + s.push_back(mp("e", "End/accept selection in geometry creation mode")); s.push_back(mp("g", "Go to geometry module")); s.push_back(mp("m", "Go to mesh module")); s.push_back(mp("p", "Go to post-processing module")); + s.push_back(mp("q", "Abort selection in geometry creation mode")); s.push_back(mp("s", "Go to solver module")); + s.push_back(mp("x", "Freeze x coordinate in geometry creation mode")); + s.push_back(mp("y", "Freeze y coordinate in geometry creation mode")); + s.push_back(mp("z", "Freeze z coordinate in geometry creation mode")); s.push_back(mp("Shift+a", "Bring all windows to front")); s.push_back(mp("Shift+g", "Show geometry options")); s.push_back(mp("Shift+m", "Show mesh options")); diff --git a/Fltk/FlGui.cpp b/Fltk/FlGui.cpp index af29878e4e..7958e9c7d5 100644 --- a/Fltk/FlGui.cpp +++ b/Fltk/FlGui.cpp @@ -629,6 +629,18 @@ int FlGui::testGlobalShortcuts(int event) graph[i]->gl[j]->invertSelection = 1; status = 0; // trick: do as if we didn't use it } + else if(Fl::test_shortcut('x')) { + elementaryContext->butt[0]->value(!elementaryContext->butt[0]->value()); + status = 1; // trick: do as if we didn't use it + } + else if(Fl::test_shortcut('y')) { + elementaryContext->butt[1]->value(!elementaryContext->butt[1]->value()); + status = 1; // trick: do as if we didn't use it + } + else if(Fl::test_shortcut('z')) { + elementaryContext->butt[2]->value(!elementaryContext->butt[2]->value()); + status = 1; // trick: do as if we didn't use it + } else if(Fl::test_shortcut(FL_Escape) || Fl::test_shortcut(FL_META + FL_Escape) || Fl::test_shortcut(FL_SHIFT + FL_Escape) || diff --git a/Fltk/contextWindow.cpp b/Fltk/contextWindow.cpp index 50798e6d70..29ce7a5b15 100644 --- a/Fltk/contextWindow.cpp +++ b/Fltk/contextWindow.cpp @@ -910,8 +910,11 @@ elementaryContextWindow::elementaryContextWindow(int deltaFontSize) value[i]->callback(elementary_snap_cb); } butt[0] = new Fl_Check_Button(width - 6 * BH, height - WB - BH, 1.2 * BH, BH, "X"); + butt[0]->tooltip("(x)"); butt[1] = new Fl_Check_Button(width - 6 * BH + 1.2 * BH, height - WB - BH, 1.2*BH, BH, "Y"); + butt[1]->tooltip("(y)"); butt[2] = new Fl_Check_Button(width - 6 * BH + 2.4 * BH, height - WB - BH, (6 - 2*1.2) * BH - WB, BH, "Z freeze"); + butt[2]->tooltip("(z)"); } tab1->show(); diff --git a/Fltk/graphicWindow.cpp b/Fltk/graphicWindow.cpp index cdcffc4f87..97c6f22b90 100644 --- a/Fltk/graphicWindow.cpp +++ b/Fltk/graphicWindow.cpp @@ -2759,10 +2759,8 @@ void quick_access_cb(Fl_Widget *w, void *data) status_xyz1p_cb(0, (void *)"z"); } else if(what == "axes"){ - opt_general_axes(0, GMSH_SET|GMSH_GUI, !opt_general_axes(0, GMSH_GET, 0)); - for(unsigned int i = 0; i < PView::list.size(); i++) - if(opt_view_visible(i, GMSH_GET, 0)) - opt_view_axes(i, GMSH_SET | GMSH_GUI, !opt_view_axes(i, GMSH_GET, 0)); + opt_general_axes(0, GMSH_SET|GMSH_GUI, + opt_general_axes(0, GMSH_GET, 0) ? 0 : 3); } else if(what == "orthographic") opt_general_orthographic(0, GMSH_SET | GMSH_GUI, 1); diff --git a/doc/texinfo/shortcuts.texi b/doc/texinfo/shortcuts.texi index e6e202e85e..151e945e4e 100644 --- a/doc/texinfo/shortcuts.texi +++ b/doc/texinfo/shortcuts.texi @@ -24,14 +24,24 @@ Mesh surfaces Mesh volumes @item Escape Cancel lasso zoom/selection, toggle mouse selection ON/OFF +@item e +End/accept selection in geometry creation mode @item g Go to geometry module @item m Go to mesh module @item p Go to post-processing module +@item q +Abort selection in geometry creation mode @item s Go to solver module +@item x +Freeze x coordinate in geometry creation mode +@item y +Freeze y coordinate in geometry creation mode +@item z +Freeze z coordinate in geometry creation mode @item Shift+a Bring all windows to front @item Shift+g -- GitLab