On May 22, 2007, at 3:13 PM, Zaphod Beeblebrox wrote:
> - Focus stealing prevention level: Low (other available "None",
> "Normal", "High", "Extreme" -- none of these has the intended effect)
Try "none". I doubt that it'll work, but who knows, it might.
>> My suggested solution would be to customize the drawing function of
>> the widget containing the image, and then - depending on some flag
>> you would set in the handle() function - draw the magnifying class on
>> top of the image, avoiding another window altogether. You can even go
>> and create an image with a magnifying glass, antialiase edges and a
>> drop shadow to give the impression of depth... . Plus, if the
>> magnifier must overlap other parts of the window, you can draw it in
>> the top-levels draw() function, but you must make sure to set damage
>> flags correctly when the mouse moves. The only drawback is, that you
>> magnifying glass can not leave the top-level window.
>
> Please correct me if I got you wrong: your idea would be to insert
> the magnifying MLBox as "floating" widget into the MyBox containing
> window? The MyBox draw() should then contain a reference to drawing
> an overlapping MLBox on top of the image?! or just building a moving
> square containing the magnified part with no special MLBox class
> mention would answer rather well?!
I don't have your original mail right now and I am not sure about the
MLBox. The idea is to override the toplevel draw() function with
something like this:
void MyWindow::draw() { // FLTK 1.1.x code, but 2.0 is basically the
same
// first draw all the usual interface
Fl_Window::draw();
// now draw the magnifier
if (magnifier_on) { // a new variable in MyWindow, if you like
fl_color(FL_BLACK);
fl_rect(mag_x, mag_y, mag_w, mag_h); // show some outline
// now draw the zoomed image inside the rectangle
}
}
The handler of your widget showing the image could do something like
this:
int handle(int ev) {
switch (ev) {
case FL_ENTER: return 1; // receive FL_MOVE messages
case FL_MOVE:
window()->magnifier_on = 1;
window()->mag_x = Fl::event_x()-20;
window()->mag_w = 40;
// etc.
window()->redraw();
return 0;
case FL_LEAVE:
window()->redraw();
return 0;
}
return Fl_XXXX::handle(ev);
}
----
http://robowerk.com/
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk