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

*** empty log message ***

parent 4075da9a
No related branches found
No related tags found
No related merge requests found
// $Id: Colorbar_Window.cpp,v 1.4 2001-02-03 13:10:26 geuzaine Exp $ // $Id: Colorbar_Window.cpp,v 1.5 2001-02-03 15:55:18 geuzaine Exp $
#include "Gmsh.h" #include "Gmsh.h"
#include "GmshUI.h" #include "GmshUI.h"
...@@ -320,9 +320,11 @@ void Colorbar_Window::draw(){ ...@@ -320,9 +320,11 @@ void Colorbar_Window::draw(){
// Update // Update
void Colorbar_Window::update(char *name, float min, float max, ColorTable *table){ void Colorbar_Window::update(char *name, float min, float max,
ColorTable *table, int *changed){
label = name; label = name;
ct = table; ct = table;
viewchanged = changed;
minval = min; minval = min;
maxval = max; maxval = max;
redraw(); redraw();
...@@ -460,6 +462,7 @@ int Colorbar_Window::handle(int event){ ...@@ -460,6 +462,7 @@ int Colorbar_Window::handle(int event){
if(compute){ if(compute){
ColorTable_Recompute(ct, 1, 1); ColorTable_Recompute(ct, 1, 1);
draw(); draw();
*viewchanged = 1;
} }
// discard the event for other uses // discard the event for other uses
return 1; return 1;
...@@ -533,6 +536,8 @@ int Colorbar_Window::handle(int event){ ...@@ -533,6 +536,8 @@ int Colorbar_Window::handle(int event){
// changing color graph // changing color graph
int a, b, value; int a, b, value;
*viewchanged = 1;
value = y_to_intensity(ypos); value = y_to_intensity(ypos);
if (pentry<=entry) { if (pentry<=entry) {
......
...@@ -10,8 +10,8 @@ class Colorbar_Window : public Fl_Window { ...@@ -10,8 +10,8 @@ class Colorbar_Window : public Fl_Window {
// new // new
int x_to_index(int x); int x_to_index(int x);
int index_to_x(int index); int index_to_x(int index);
int intensity_to_y(int intensity);
int y_to_intensity(int y); int y_to_intensity(int y);
int intensity_to_y(int intensity);
void redraw_range(int a, int b); void redraw_range(int a, int b);
void redraw_marker(); void redraw_marker();
...@@ -26,11 +26,12 @@ class Colorbar_Window : public Fl_Window { ...@@ -26,11 +26,12 @@ class Colorbar_Window : public Fl_Window {
int marker_pos; // position of marker as index into table int marker_pos; // position of marker as index into table
ColorTable *ct; // pointer to the color table (allocated in Post_View) ColorTable *ct; // pointer to the color table (allocated in Post_View)
int *viewchanged;// pointer to changed bit in view
public: public:
Colorbar_Window(int x,int y,int w,int h,const char *l=0); Colorbar_Window(int x,int y,int w,int h,const char *l=0);
void update(char *name, float min, float max, ColorTable *ct); void update(char *name, float min, float max, ColorTable *ct, int *changed);
}; };
......
// $Id: GUI.cpp,v 1.33 2001-02-03 14:03:46 geuzaine Exp $ // $Id: GUI.cpp,v 1.34 2001-02-03 15:55:18 geuzaine Exp $
// To make the interface as visually consistent as possible, please: // To make the interface as visually consistent as possible, please:
// - use the BH, BW, WB, IW values for button heights/widths, window borders, etc. // - use the BH, BW, WB, IW values for button heights/widths, window borders, etc.
...@@ -787,8 +787,8 @@ void GUI::create_graphic_window(int argc, char **argv){ ...@@ -787,8 +787,8 @@ void GUI::create_graphic_window(int argc, char **argv){
} }
g_status_label[0] = new Fl_Box(x,glheight+2,(width-x)/3,sh-4); g_status_label[0] = new Fl_Box(x,glheight+2,(width-x)/3,sh-4);
g_status_label[1] = new Fl_Box(x+(width-x)/3,glheight+2,(height-x)/3,sh-4); g_status_label[1] = new Fl_Box(x+(width-x)/3,glheight+2,(width-x)/3,sh-4);
g_status_label[2] = new Fl_Box(x+2*(width-x)/3,glheight+2,(height-x)/3-2,sh-4); g_status_label[2] = new Fl_Box(x+2*(width-x)/3,glheight+2,(width-x)/3-2,sh-4);
for(i = 0 ; i<3 ; i++){ for(i = 0 ; i<3 ; i++){
g_status_label[i]->box(FL_FLAT_BOX); g_status_label[i]->box(FL_FLAT_BOX);
g_status_label[i]->labelsize(CTX.fontsize); g_status_label[i]->labelsize(CTX.fontsize);
...@@ -1910,7 +1910,7 @@ void GUI::update_view_window(int num){ ...@@ -1910,7 +1910,7 @@ void GUI::update_view_window(int num){
view_input[0]->value(v->Name); view_input[0]->value(v->Name);
view_input[1]->callback(view_options_format_cb, (void*)num); view_input[1]->callback(view_options_format_cb, (void*)num);
view_input[1]->value(v->Format); view_input[1]->value(v->Format);
view_colorbar_window->update(v->Name, v->Min, v->Max, &v->CT); view_colorbar_window->update(v->Name, v->Min, v->Max, &v->CT, &v->Changed);
// range // range
if(v->RangeType==DRAW_POST_CUSTOM) activate_custom(1); if(v->RangeType==DRAW_POST_CUSTOM) activate_custom(1);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment