diff --git a/Common/CommandLine.cpp b/Common/CommandLine.cpp index 7e81c7848347cc26bef195b3220682e4dafac22f..b5d07587e4537340ac55372592f23e9a0f8bdcc1 100644 --- a/Common/CommandLine.cpp +++ b/Common/CommandLine.cpp @@ -127,34 +127,25 @@ std::vector<std::string> GetShortcutsUsage() { // If you make changes in this routine, please also change the texinfo // documentation (doc/texinfo/gmsh.texi) - std::vector<std::string> s; - #if defined(__APPLE__) # define CC(str) "Cmd+" str " " #else # define CC(str) "Ctrl+" str #endif - s.push_back(" "); - s.push_back("Keyboard shortcuts:"); - s.push_back(" "); + std::vector<std::string> s; s.push_back(" Left arrow Go to previous time step"); s.push_back(" Right arrow Go to next time step"); s.push_back(" Up arrow Make previous view visible"); s.push_back(" Down arrow Make next view visible"); - s.push_back(" "); - s.push_back(" < Go back to previous context"); - s.push_back(" > Go forward to next context"); s.push_back(" 0 Reload project file"); s.push_back(" 1 or F1 Mesh lines"); s.push_back(" 2 or F2 Mesh surfaces"); s.push_back(" 3 or F3 Mesh volumes"); s.push_back(" Escape Cancel lasso zoom/selection, toggle mouse selection ON/OFF"); - s.push_back(" "); s.push_back(" g Go to geometry module"); s.push_back(" m Go to mesh module"); s.push_back(" p Go to post-processing module"); s.push_back(" s Go to solver module"); - s.push_back(" "); s.push_back(" Shift+a Bring all windows to front"); s.push_back(" Shift+g Show geometry options"); s.push_back(" Shift+m Show mesh options"); @@ -164,8 +155,8 @@ std::vector<std::string> GetShortcutsUsage() s.push_back(" Shift+u Show post-processing view plugins"); s.push_back(" Shift+w Show post-processing view options"); s.push_back(" Shift+Escape Enable full mouse selection"); - s.push_back(" "); s.push_back(" " CC("i") " Show statistics window"); + s.push_back(" " CC("d") " Attach/detach menu"); s.push_back(" " CC("l") " Show message console"); #if defined(__APPLE__) s.push_back(" " CC("m") " Minimize window"); @@ -175,7 +166,6 @@ std::vector<std::string> GetShortcutsUsage() s.push_back(" " CC("q") " Quit"); s.push_back(" " CC("r") " Rename project file"); s.push_back(" " CC("s") " Save file as"); - s.push_back(" "); s.push_back(" Shift+" CC("c") " Show clipping plane window"); s.push_back(" Shift+" CC("m") " Show manipulator window"); s.push_back(" Shift+" CC("n") " Show option window"); @@ -183,7 +173,6 @@ std::vector<std::string> GetShortcutsUsage() s.push_back(" Shift+" CC("s") " Save mesh in default format"); s.push_back(" Shift+" CC("u") " Show plugin window"); s.push_back(" Shift+" CC("v") " Show visibility window"); - s.push_back(" "); s.push_back(" Alt+a Loop through axes modes"); s.push_back(" Alt+b Hide/show bounding boxes"); s.push_back(" Alt+c Loop through predefined color schemes"); @@ -204,7 +193,6 @@ std::vector<std::string> GetShortcutsUsage() s.push_back(" Alt+x Set X view"); s.push_back(" Alt+y Set Y view"); s.push_back(" Alt+z Set Z view"); - s.push_back(" "); s.push_back(" Alt+Shift+a Hide/show small axes"); s.push_back(" Alt+Shift+b Hide/show mesh volume faces"); s.push_back(" Alt+Shift+d Hide/show mesh surface faces"); @@ -217,9 +205,7 @@ std::vector<std::string> GetShortcutsUsage() s.push_back(" Alt+Shift+x Set -X view"); s.push_back(" Alt+Shift+y Set -Y view"); s.push_back(" Alt+Shift+z Set -Z view"); - s.push_back(" "); return s; - #undef CC } @@ -228,10 +214,6 @@ std::vector<std::string> GetMouseUsage() // If you make changes in this routine, please also change the texinfo // documentation (doc/texinfo/gmsh.texi) std::vector<std::string> s; - - s.push_back(" "); - s.push_back("Mouse actions:"); - s.push_back(" "); s.push_back(" Move - Highlight the entity under the mouse pointer"); s.push_back(" and display its properties"); s.push_back(" - Resize a lasso zoom or a lasso (un)selection"); @@ -251,8 +233,6 @@ std::vector<std::string> GetMouseUsage() s.push_back(" For a 2 button mouse, Middle button = Shift+Left button"); s.push_back(" For a 1 button mouse, Middle button = Shift+Left button, " "Right button = Alt+Left button"); - s.push_back(" "); - return s; } diff --git a/Fltk/aboutWindow.cpp b/Fltk/aboutWindow.cpp index a1cd819de09574367dd38c18d9173c4357b0d2bc..b7ced55dcabc15e81850bda13db6ed06bfbcc6f2 100644 --- a/Fltk/aboutWindow.cpp +++ b/Fltk/aboutWindow.cpp @@ -25,38 +25,78 @@ aboutWindow::aboutWindow() int width = 28 * FL_NORMAL_SIZE; int height = 18 * BH; - win = new paletteWindow - (width, height, CTX::instance()->nonModalWindows ? true : false, "About Gmsh"); - win->box(GMSH_WINDOW_BOX); - - Fl_Help_View *o = new Fl_Help_View(0, 0, width, height); - o->textfont(FL_HELVETICA); - o->textsize(FL_NORMAL_SIZE); - o->box(FL_FLAT_BOX); - std::ostringstream sstream; - sstream << "<center><h3>Gmsh</h3><br>version " << GetGmshVersion() - << "<p>Copyright (C) 1997-2012" - << "<br>Christophe Geuzaine and Jean-Francois Remacle" - << "<p><a href=\"http://geuz.org/gmsh/doc/CREDITS.txt\">Credits</a> " - << "and <a href=\"http://geuz.org/gmsh/doc/LICENSE.txt\">licensing " - << "information</a>" - << "<p>Please send all questions and bug reports to " - << "<a href=\"mailto:gmsh@geuz.org\">gmsh@geuz.org</a></center>" - << "<ul>" - << "<li><i>GUI toolkit:</i> FLTK " - << FL_MAJOR_VERSION << "." << FL_MINOR_VERSION << "." << FL_PATCH_VERSION - << "<li><i>Build OS:</i> " << GetGmshBuildOS() - << "<li><i>Build date:</i> " << GetGmshBuildDate() - << "<li><i>Build host:</i> " << GetGmshBuildHost() - << "<li><i>Build options:</i>" << GetGmshBuildOptions() - << "<li><i>Packaged by:</i> " << GetGmshPackager() - << "</ul>" - << "<center>Visit <a href=\"http://geuz.org/gmsh/\">http://geuz.org/gmsh/</a> " - << "for more information</center>"; - o->value(sstream.str().c_str()); - o->link(help_link); - - win->position(Fl::x() + Fl::w()/2 - width / 2, - Fl::y() + Fl::h()/2 - height / 2); - win->end(); + { + win = new paletteWindow + (width, height, CTX::instance()->nonModalWindows ? true : false, "About Gmsh"); + win->box(GMSH_WINDOW_BOX); + + Fl_Help_View *o = new Fl_Help_View(0, 0, width, height); + o->textfont(FL_HELVETICA); + o->textsize(FL_NORMAL_SIZE); + o->box(FL_FLAT_BOX); + std::ostringstream sstream; + sstream << "<center><h3>Gmsh</h3><br>version " << GetGmshVersion() + << "<p>Copyright (C) 1997-2012" + << "<br>Christophe Geuzaine and Jean-Francois Remacle" + << "<p><a href=\"http://geuz.org/gmsh/doc/CREDITS.txt\">Credits</a> " + << "and <a href=\"http://geuz.org/gmsh/doc/LICENSE.txt\">licensing " + << "information</a>" + << "<p>Please send all questions and bug reports to " + << "<a href=\"mailto:gmsh@geuz.org\">gmsh@geuz.org</a></center>" + << "<ul>" + << "<li><i>GUI toolkit:</i> FLTK " + << FL_MAJOR_VERSION << "." << FL_MINOR_VERSION << "." << FL_PATCH_VERSION + << "<li><i>Build OS:</i> " << GetGmshBuildOS() + << "<li><i>Build date:</i> " << GetGmshBuildDate() + << "<li><i>Build host:</i> " << GetGmshBuildHost() + << "<li><i>Build options:</i>" << GetGmshBuildOptions() + << "<li><i>Packaged by:</i> " << GetGmshPackager() + << "</ul>" + << "<center>Visit <a href=\"http://geuz.org/gmsh/\">http://geuz.org/gmsh/</a> " + << "for more information</center>"; + o->value(sstream.str().c_str()); + o->link(help_link); + win->position(Fl::x() + Fl::w()/2 - width / 2, + Fl::y() + Fl::h()/2 - height / 2); + win->end(); + } + + { + winhelp = new paletteWindow + (width, height, CTX::instance()->nonModalWindows ? true : false, + "Keyboard and Mouse Usage"); + winhelp->box(GMSH_WINDOW_BOX); + + Fl_Help_View *o = new Fl_Help_View(0, 0, width, height); + o->textfont(FL_HELVETICA); + o->textsize(FL_NORMAL_SIZE - 1); + o->box(FL_FLAT_BOX); + + std::string s; + s += "<h3>Keyboard Shortcuts</h3>"; + s += "<pre>"; + { + std::vector<std::string> s0 = GetShortcutsUsage(); + for(unsigned int i = 0; i < s0.size(); i++) + s += s0[i] + "<br>"; + } + s += "</pre>"; + + s += "<h3>Mouse Actions</h3>"; + s += "<pre>"; + { + std::vector<std::string> s0 = GetMouseUsage(); + for(unsigned int i = 0; i < s0.size(); i++) + s += s0[i] + "<br>"; + } + s += "</pre>"; + + o->value(s.c_str()); + + winhelp->resizable(o); + winhelp->position(Fl::x() + Fl::w()/2 - width / 2, + Fl::y() + Fl::h()/2 - height / 2); + winhelp->end(); + } + } diff --git a/Fltk/aboutWindow.h b/Fltk/aboutWindow.h index f610262bb9fd82c785e62d64a6a24c603e7ec7ca..ffe8eb516854b5a2458201021812b498a7c46c74 100644 --- a/Fltk/aboutWindow.h +++ b/Fltk/aboutWindow.h @@ -13,7 +13,7 @@ class aboutWindow{ public: - Fl_Window *win; + Fl_Window *win, *winhelp; public: aboutWindow(); }; diff --git a/Fltk/graphicWindow.cpp b/Fltk/graphicWindow.cpp index 3e9b3d83f3b47c4f6d24c818b3d5521269843f50..86f3af91c1e8670adf4894ff47fc4f8e110cec4a 100644 --- a/Fltk/graphicWindow.cpp +++ b/Fltk/graphicWindow.cpp @@ -524,35 +524,17 @@ void file_watch_cb(Fl_Widget *w, void *data) drawContext::global()->draw(); } -static void help_short_cb(Fl_Widget *w, void *data) -{ - std::vector<std::string> s = GetShortcutsUsage(); - for(unsigned int i = 0; i < s.size(); i++) - Msg::Direct("%s", s[i].c_str()); - FlGui::instance()->showMessages(); -} - -static void help_mouse_cb(Fl_Widget *w, void *data) -{ - std::vector<std::string> s = GetMouseUsage(); - for(unsigned int i = 0; i < s.size(); i++) - Msg::Direct("%s", s[i].c_str()); - FlGui::instance()->showMessages(); -} - -static void help_command_line_cb(Fl_Widget *w, void *data) -{ - Msg::Direct(" "); - PrintUsage("gmsh"); - FlGui::instance()->showMessages(); -} - static void help_online_cb(Fl_Widget *w, void *data) { std::string prog = FixWindowsPath(CTX::instance()->webBrowser); SystemCall(ReplaceSubString("%s", "http://geuz.org/gmsh/doc/texinfo/", prog)); } +static void help_basic_cb(Fl_Widget *w, void *data) +{ + FlGui::instance()->about->winhelp->show(); +} + void help_about_cb(Fl_Widget *w, void *data) { FlGui::instance()->about->win->show(); @@ -1982,9 +1964,7 @@ static Fl_Menu_Item bar_table[] = { {0}, {"&Help", 0, 0, 0, FL_SUBMENU}, {"On&line Documentation", 0, (Fl_Callback *)help_online_cb, 0, FL_MENU_DIVIDER}, - {"M&ouse Actions", 0, (Fl_Callback *)help_mouse_cb, 0}, - {"&Keyboard Shortcuts", 0, (Fl_Callback *)help_short_cb, 0}, - {"C&ommand Line Options", 0, (Fl_Callback *)help_command_line_cb, 0}, + {"&Keyboard and Mouse Usage", 0, (Fl_Callback *)help_basic_cb, 0}, {"&Current Options", 0, (Fl_Callback *)status_options_cb, (void*)"?", FL_MENU_DIVIDER}, {"&About Gmsh", 0, (Fl_Callback *)help_about_cb, 0}, {0}, @@ -2046,9 +2026,7 @@ static Fl_Menu_Item sysbar_table[] = { {0}, {"Help", 0, 0, 0, FL_SUBMENU}, {"Online Documentation", 0, (Fl_Callback *)help_online_cb, 0, FL_MENU_DIVIDER}, - {"Mouse Actions", 0, (Fl_Callback *)help_mouse_cb, 0}, - {"Keyboard Shortcuts", 0, (Fl_Callback *)help_short_cb, 0}, - {"Command Line Options", 0, (Fl_Callback *)help_command_line_cb, 0}, + {"Keyboard and Mouse Usage", 0, (Fl_Callback *)help_basic_cb, 0}, {"Current Options", 0, (Fl_Callback *)status_options_cb, (void*)"?"}, {0}, {0} diff --git a/doc/texinfo/gmsh.texi b/doc/texinfo/gmsh.texi index 3ee6687aea27b1ed3b9360f942f9741986d0f517..17147dd009bc92443f36a46923f12084c1677b6a 100644 --- a/doc/texinfo/gmsh.texi +++ b/doc/texinfo/gmsh.texi @@ -1039,10 +1039,6 @@ Make next view visible @sp 1 @c ---------------------------------------------- -@item < -Go back to previous context -@item > -Go forward to next context @item 0 Reload project file @item 1 or F1 @@ -1088,6 +1084,8 @@ Show post-processing view options @item Ctrl+i Show statistics window +@item Ctrl+d +Attach/detach menu @item Ctrl+l Show message console @item Ctrl+n