> Hi, test again with returning 0 instead of 1 in your overriden handle() 
> method, returning 1 means that you handled the event and it is not cascaded, 
> returning 0 should let a chance to main window to catch this event AFAIR.
>
Thank you for your reply.
I have already tried this, but when I do it doesn´t work properly. I need to 
do some dragging operation, so I need to safe the state when the mouse is 
pushed FL_PUSH. But when I return 0, the FL_DRAG doesn´t work.
here is the sample code:

int BR_GLwindow::handle(int event)
{
        switch(event)
        {
                case FL_MOVE:
                        mousePoint = 
drawingPlan.intersection(camera.unprojectFar(Fl::event_x(),Fl::event_y()),camera.unprojectNear(Fl::event_x(),Fl::event_y()));
                        this->redraw();
                        return 0;
                case FL_PUSH:
                        mouseClickX = Fl::event_x();
                        mouseClickY = Fl::event_y();
                        if(Fl::event_button()==1)
                                picking(Fl::event_x(),Fl::event_y());

                        return 0; //I NEED TO PUT HERE 1, TO HAVE IT WORKED 
CORRECTLY
                case FL_MOUSEWHEEL:

                        camera.zoom(exp(Fl::event_dy()*0.08));
                        this->redraw();
                        return 0;
                case FL_DRAG:
                        if (Fl::event_button() == 2)
                        {
                                
camera.move(Fl::event_x(),Fl::event_y(),mouseClickX,mouseClickY);
                                this->redraw();
                                mouseClickX=Fl::event_x();
                                mouseClickY=Fl::event_y();
                                return 0;
                        }
                        if (Fl::event_button() == 3)
                        {
                                
camera.rotate(Fl::event_x(),Fl::event_y(),mouseClickX,mouseClickY);
                                this->redraw();
                                mouseClickX=Fl::event_x();
                                mouseClickY=Fl::event_y();
                                return 0;

                        }


_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to