Skip to content
Snippets Groups Projects
Commit e95943ac authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

label extra windows

parent ca151636
Branches
Tags
No related merge requests found
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
// See the LICENSE.txt file for license information. Please report all // See the LICENSE.txt file for license information. Please report all
// bugs and problems to <gmsh@geuz.org>. // bugs and problems to <gmsh@geuz.org>.
#include <sstream>
#include <FL/Fl.H> #include <FL/Fl.H>
#include <FL/Fl_Tooltip.H> #include <FL/Fl_Tooltip.H>
#include <FL/Fl_Shared_Image.H> #include <FL/Fl_Shared_Image.H>
...@@ -518,10 +519,16 @@ int GUI::testArrowShortcuts() ...@@ -518,10 +519,16 @@ int GUI::testArrowShortcuts()
void GUI::setGraphicTitle(const char *str) void GUI::setGraphicTitle(const char *str)
{ {
// FIXME should use copy_label, but it is broken for Fl_Windows in for(unsigned int i = 0; i < graph.size(); i++){
// fltk 1.1.7 if(!i){
for(unsigned int i = 0; i < graph.size(); i++) graph[i]->setTitle(str);
graph[i]->win->label(str); }
else{
std::ostringstream sstream;
sstream << str << " [" << i << "]";
graph[i]->setTitle(sstream.str());
}
}
} }
void GUI::updateViews() void GUI::updateViews()
......
...@@ -475,6 +475,12 @@ graphicWindow::~graphicWindow() ...@@ -475,6 +475,12 @@ graphicWindow::~graphicWindow()
Fl::delete_widget(win); Fl::delete_widget(win);
} }
void graphicWindow::setTitle(std::string str)
{
_title = str;
win->label(_title.c_str());
}
void graphicWindow::split(openglWindow *g, char how) void graphicWindow::split(openglWindow *g, char how)
{ {
if(tile->find(g) == tile->children()) return; if(tile->find(g) == tile->children()) return;
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#ifndef _GRAPHIC_WINDOW_H_ #ifndef _GRAPHIC_WINDOW_H_
#define _GRAPHIC_WINDOW_H_ #define _GRAPHIC_WINDOW_H_
#include <string>
#include <vector> #include <vector>
#include <FL/Fl_Window.H> #include <FL/Fl_Window.H>
#include <FL/Fl_Button.H> #include <FL/Fl_Button.H>
...@@ -14,6 +15,8 @@ ...@@ -14,6 +15,8 @@
#include "openglWindow.h" #include "openglWindow.h"
class graphicWindow{ class graphicWindow{
private:
std::string _title;
public: public:
Fl_Window *win; Fl_Window *win;
Fl_Tile *tile; Fl_Tile *tile;
...@@ -24,6 +27,7 @@ class graphicWindow{ ...@@ -24,6 +27,7 @@ class graphicWindow{
public: public:
graphicWindow(bool main=true, int numTiles=1); graphicWindow(bool main=true, int numTiles=1);
~graphicWindow(); ~graphicWindow();
void setTitle(std::string str);
void split(openglWindow *g, char how); void split(openglWindow *g, char how);
void setAnimButtons(int mode); void setAnimButtons(int mode);
void checkAnimButtons(); void checkAnimButtons();
......
...@@ -155,7 +155,7 @@ static void file_window_cb(Fl_Widget *w, void *data) ...@@ -155,7 +155,7 @@ static void file_window_cb(Fl_Widget *w, void *data)
graphicWindow *g1 = GUI::instance()->graph.back(); graphicWindow *g1 = GUI::instance()->graph.back();
graphicWindow *g2 = new graphicWindow(false, CTX.num_tiles); graphicWindow *g2 = new graphicWindow(false, CTX.num_tiles);
GUI::instance()->graph.push_back(g2); GUI::instance()->graph.push_back(g2);
g2->win->label(g1->win->label()); GUI::instance()->setGraphicTitle(CTX.filename);
g2->win->resize(g1->win->x() + 10, g1->win->y() + 10, g2->win->resize(g1->win->x() + 10, g1->win->y() + 10,
g1->win->w(), g1->win->h()); g1->win->w(), g1->win->h());
g2->win->show(); g2->win->show();
......
...@@ -133,9 +133,10 @@ ifeq (${ENABLE_MED},1) ...@@ -133,9 +133,10 @@ ifeq (${ENABLE_MED},1)
endif endif
ifeq (${ENABLE_GUI},1) ifeq (${ENABLE_GUI},1)
GMSH_DIRS+=Graphics Fltk contrib/NativeFileChooser GMSH_DIRS+=Graphics Fltk contrib/NativeFileChooser contrib/TreeBrowser
FLAGS+=/DHAVE_FLTK /I${FLTK_PREFIX} /I${FLTK_PREFIX}/FL/images FLAGS+=/DHAVE_FLTK /I${FLTK_PREFIX} /I${FLTK_PREFIX}/FL/images
FLAGS+=/DHAVE_LIBZ /DHAVE_LIBPNG /DHAVE_LIBJPEG /DHAVE_NATIVE_FILE_CHOOSER FLAGS+=/DHAVE_LIBZ /DHAVE_LIBPNG /DHAVE_LIBJPEG
FLAGS+=/DHAVE_NATIVE_FILE_CHOOSER /DHAVE_TREE_BROWSER
GMSH_LIBS+=Fltk/Main.obj lib/*.lib ${FLTK_PREFIX}/lib/fltk*.lib GMSH_LIBS+=Fltk/Main.obj lib/*.lib ${FLTK_PREFIX}/lib/fltk*.lib
GMSH_LIBS+=glu32.lib opengl32.lib advapi32.lib gdi32.lib user32.lib GMSH_LIBS+=glu32.lib opengl32.lib advapi32.lib gdi32.lib user32.lib
GMSH_LIBS+=shell32.lib ole32.lib comctl32.lib comdlg32.lib ws2_32.lib GMSH_LIBS+=shell32.lib ole32.lib comctl32.lib comdlg32.lib ws2_32.lib
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment