> 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 advice. I have already tried this as I read in documentation 
manual, but doesn´t work. I am using the dragging, so I need to save the state 
when the mouse is pushed, but if I return 0, it just stops and do nothing (no 
dragging).
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 1;
                case FL_PUSH:
                        mouseClickX = Fl::event_x();
                        mouseClickY = Fl::event_y();
                        if(Fl::event_button()==1)
                                picking(Fl::event_x(),Fl::event_y());

                        return 1;//IF I PUT 0 HERE, IT DOESN´T WORK
                case FL_MOUSEWHEEL:

                        camera.zoom(exp(Fl::event_dy()*0.08));
                        this->redraw();
                        return 1;
                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 1;

                        }

For the handle function in the main window, can I just write it like this?
int main(int argc, char **argv) {
        Fl_Window *window = new Fl_Window(500,500);
        BR_GLwindow brglwindow(10,10,480,400,0,&objects);
        ***...***
        window->resizable(&brglwindow);
        window->end();
        window->show(argc, argv);
        return Fl::run();

        }
int handle(int event)
{
        switch(event)
        {
        case FL_RELEASE:
                std::cout<<"test";
                return 1;
        ***...***

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

Reply via email to