From c03e33941e47d35bef6f474d613b1a6735e7ba60 Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Mon, 29 Dec 2008 13:32:29 +0000 Subject: [PATCH] compile fix from Brian --- Common/Options.cpp | 9 ++-- Fltk/visibilityWindow.cpp | 87 +++++++++++++++++++-------------------- 2 files changed, 48 insertions(+), 48 deletions(-) diff --git a/Common/Options.cpp b/Common/Options.cpp index 9b4c7e3b45..11ca77025b 100644 --- a/Common/Options.cpp +++ b/Common/Options.cpp @@ -470,11 +470,12 @@ void Init_Options(int num) CTX.batch = CTX.batch_after_mesh = 0; CTX.output_filename = NULL; CTX.bgm_filename = NULL; - CTX.lc = 1.0; + CTX.lc = 1.; CTX.tmp_viewport[0] = CTX.tmp_viewport[1] = 0; - CTX.min[0] = CTX.min[1] = CTX.min[2] = 0.0; - CTX.max[0] = CTX.max[1] = CTX.max[2] = 1.0; - CTX.cg[0] = CTX.cg[1] = CTX.cg[2] = 0.0; + // nice 2-D defaults for when adding points in a brand new model + CTX.min[0] = CTX.min[1] = CTX.min[2] = CTX.max[2] = 0.; + CTX.max[0] = CTX.max[1] = 1.; + CTX.cg[0] = CTX.cg[1] = CTX.cg[2] = 0.; CTX.polygon_offset = 0; CTX.printing = 0; CTX.mesh_timer[0] = CTX.mesh_timer[1] = CTX.mesh_timer[2] = 0.; diff --git a/Fltk/visibilityWindow.cpp b/Fltk/visibilityWindow.cpp index cdd9304002..90434da13b 100644 --- a/Fltk/visibilityWindow.cpp +++ b/Fltk/visibilityWindow.cpp @@ -421,6 +421,30 @@ static void visibility_sort_cb(Fl_Widget *w, void *data) } } +class listBrowser : public Fl_Browser{ + int handle(int event) + { + switch(event){ + case FL_SHORTCUT: + case FL_KEYBOARD: + if(Fl::test_shortcut(FL_CTRL+'a')){ + for(int i = 0; i < size(); i++) + select(i + 1); + return 1; + } + else if(Fl::test_shortcut(FL_Enter) || + Fl::test_shortcut(FL_KP_Enter)){ + visibility_browser_apply_cb(NULL, NULL); + return 1; + } + } + return Fl_Browser::handle(event); + } + public: + listBrowser(int x, int y, int w , int h, const char* c = 0) + : Fl_Browser(x, y, w, h, c){} +}; + #if defined(HAVE_TREE_BROWSER) static void _add_vertex(GVertex *gv, Flu_Tree_Browser::Node *n) @@ -633,6 +657,25 @@ static void visibility_tree_apply_cb(Fl_Widget *w, void *data) Draw(); } +class treeBrowser : public Flu_Tree_Browser{ + int handle(int event) + { + switch(event){ + case FL_SHORTCUT: + case FL_KEYBOARD: + if(Fl::test_shortcut(FL_Enter) || + Fl::test_shortcut(FL_KP_Enter)){ + visibility_tree_apply_cb(NULL, NULL); + return 1; + } + } + return Flu_Tree_Browser::handle(event); + } + public: + treeBrowser(int x, int y, int w , int h, const char* c = 0) + : Flu_Tree_Browser(x, y, w, h, c){} +}; + #endif void visibility_cb(Fl_Widget *w, void *data) @@ -1002,50 +1045,6 @@ static void visibility_interactive_cb(Fl_Widget *w, void *data) Msg::StatusBar(3, false, ""); } -// derive our own browsers, that react differently to the Enter key -class listBrowser : public Fl_Browser{ - int handle(int event) - { - switch(event){ - case FL_SHORTCUT: - case FL_KEYBOARD: - if(Fl::test_shortcut(FL_CTRL+'a')){ - for(int i = 0; i < size(); i++) - select(i + 1); - return 1; - } - else if(Fl::test_shortcut(FL_Enter) || - Fl::test_shortcut(FL_KP_Enter)){ - visibility_browser_apply_cb(NULL, NULL); - return 1; - } - } - return Fl_Browser::handle(event); - } - public: - listBrowser(int x, int y, int w , int h, const char* c = 0) - : Fl_Browser(x, y, w, h, c){} -}; - -class treeBrowser : public Flu_Tree_Browser{ - int handle(int event) - { - switch(event){ - case FL_SHORTCUT: - case FL_KEYBOARD: - if(Fl::test_shortcut(FL_Enter) || - Fl::test_shortcut(FL_KP_Enter)){ - visibility_tree_apply_cb(NULL, NULL); - return 1; - } - } - return Flu_Tree_Browser::handle(event); - } - public: - treeBrowser(int x, int y, int w , int h, const char* c = 0) - : Flu_Tree_Browser(x, y, w, h, c){} -}; - visibilityWindow::visibilityWindow(int fontsize) : _fontsize(fontsize) { -- GitLab