statusCallback = NULL;
datamin = 0; datamax = LMAX;
hmin = 0; hmax = LMAX;
+ mouse_order = 0;
xzoom = yzoom = 1;
swap_zoom_state=false;
}
int n;
- int button = Fl::event_button();
+ int button;
+
+ button = Fl::event_button();
+
+ // Mouse order = 0: 1->1 2->2 3->3
+ // Mouse order = 1: 2->1 3->2 1->3
+ // Mouse order = 2: 3->1 1->2 2->3
- if ((button == 3) && (Fl::event_state() & FL_ALT))
- button = 2;
+ //if (event == FL_PUSH || event == FL_DRAG || event == FL_RELEASE)
+ //info("Button %d -> ", button);
+ button = button + mouse_order;
+ if (button == 4) button = 1;
+ if (button == 5) button = 2;
+ //if (event == FL_PUSH || event == FL_DRAG || event == FL_RELEASE)
+ //info("%d\n", button);
switch (event)
{
return 1;
}
break;
+ case 'm':
+ mouse_order = (mouse_order+1)%3;
+ external_update();
+ break;
case 'z':
if (Fl::event_state() & FL_CTRL)
exportMTX(false, true);
case FL_DRAG: // Falling case!
case FL_RELEASE:
- // For FL_DRAG, we cannot rely on Fl::event_button() (although
- // it seems to work on unix) I don't know why I can't replace
- // the Fl::event_buttion() above with this, but if I do, the
- // zoom window stops working...
- if (Fl::event_state() & FL_BUTTON1)
- button = 1;
- else if (Fl::event_state() & FL_BUTTON2)
- button = 2;
- else if (Fl::event_state() & FL_BUTTON3)
- {
- if (Fl::event_state() & FL_ALT)
- button = 2;
- else
- button = 3;
- }
// Let's only eat a non-modified button 1 click
if(stupid_windows_focus && (button == 1) && !(Fl::event_state() & FL_SHIFT) && !(Fl::event_state() & FL_CTRL))
{
if(op->parameters[1].value)
id.yflip();
}
+ else if(op->name == "flip endpoints")
+ id.flip_endpoints(op->parameters[0].value, op->parameters[1].value);
else if (op->name == "autoflip")
{
if (id.xmin > id.xmax)
// have updated the iw width and height properly yet.
pf->calculate();
+ external_update();
}
// a little procedure
Global
------
+NEW FEATURE FOR PEOPLE WITH LESS THAN 3 MOUSE BUTTONS!
+m Permutate mouse buttons in image window:
+ (123) -> (231) -> (312) -> (123)
+ Current mouse order is shown in image window title
+
Left Next file (also "." or SPACE)
Right Prev file (also "," or BACKSPACE)
e Reload file
Ctrl-s Turn on autonormalize in zoom window
Shft-s Normalize based on contents of zoom window
+For systems with less than 3 mouse buttons, you can access
+the other features by permutating the mouse button order
+using the "m" shortcut (see above).
+
B1 = left mouse button
B2 = middle mouse button
B3 = right mouse button
-For two button mice, hold down the ALT key to emulate the middle
-buttion (B2) using the right mouse button (B3).
-
B3 Toggle controls
Esc,c Clear linecut
double tmp;
char buf[1024];
- tmp = iw->id.quant_to_raw(iw->hmin);
- snprintf(buf,sizeof(buf),"%e",tmp);
+ double min = iw->id.quant_to_raw(iw->hmin);
+ double max = iw->id.quant_to_raw(iw->hmax);
+
+ if (abs(min)>abs(max))
+ tmp = abs(min);
+ else
+ tmp = abs(max);
+
+ snprintf(buf,sizeof(buf),"%e", -tmp);
proc_parameters[0]->value(buf);
- tmp = iw->id.quant_to_raw(iw->hmax);
- snprintf(buf,sizeof(buf),"%e",tmp);
+ snprintf(buf,sizeof(buf),"%e", tmp);
proc_parameters[1]->value(buf);
- snprintf(buf,sizeof(buf),"%d",iw->id.height);
+ //snprintf(buf,sizeof(buf),"%d",iw->id.height*50);
+ snprintf(buf,sizeof(buf),"%d",10000);
proc_parameters[2]->value(buf);
proc_parameters[0]->do_callback();
flip.addParameter("!Flip Y Axis",0);
Define_Image_Operation(&flip);
+ Image_Operation flip_endpoints("flip endpoints","Flip axis endpoints");
+ flip_endpoints.addParameter("!Flip X Axis",0);
+ flip_endpoints.addParameter("!Flip Y Axis",0);
+ Define_Image_Operation(&flip_endpoints);
+
Image_Operation crop("crop","Crop the Image (0 to keep current, negative possible for lower/right)");
crop.addParameter("left col #", 0);
crop.addParameter("right col #", 0);
index = reinterpret_cast<int>(cmapch->mvalue()->user_data());
static char label[1024];
- snprintf(label, 1024, "%s - %s", filech->text(), cmapch->text());
- iw->label(label);
+ // This seems to be an old piece of code: where is the image window
+ // being labelled?
+ update_title();
snprintf(label, 1024, "Colormap %s", cmapch->text());
(iw->colormap_window)->label(label);
{
char buf[256];
if (iw->id.data3d)
- snprintf(buf, 256, "%s %.0f (%.3g to %.3g), (%.3g to %.3g)",
+ snprintf(buf, 256, "%s %s %.0f (%.3g to %.3g), (%.3g to %.3g)",
current_filename.c_str(),
indexbox->value(),
xmin->value(), xmax->value(),
ymin->value(), ymax->value());
else
- snprintf(buf, 256, "%s (%.3g to %.3g), (%.3g to %.3g)",
+ snprintf(buf, 256, "%s %s (%.3g to %.3g), (%.3g to %.3g)",
+ (iw->mouse_order == 0) ? "(123)" :
+ ((iw->mouse_order == 1) ? "(231)" : "(312)"),
current_filename.c_str(),
xmin->value(), xmax->value(),
ymin->value(), ymax->value());
max = iw->hmax;
width = (max - min);
center = (max + min)/2;
-
+
minv->value(min);
minslider->value(min);
minroller->value(min);
mtx_zname->value(iw->id.mtx.axisname[2].c_str());
xrange->value(iw->line_cut_xauto);
-
+ update_title();
}
void Fetch_ProcWindow_Settings(Image_Operation *op)