Re: XForms: tabfolder position bug

From: Angus Leeming (angus.leeming@btopenworld.com)
Date: Fri Apr 25 2003 - 05:56:16 EDT

  • Next message: jac@casurgica.com: "Re: XForms: tabfolder position bug"

    # To subscribers of the xforms list from Angus Leeming <angus.leeming@btopenworld.com> :

    (Sorry this reply isn't threaded. I've read your message from the mail
    archive.)

    Jason,
    this report makes total sense. fl_set_object_position does no more than

        obj->x = x;
        obj->y = y;

    For most FL_OBJECTs this is fine, but not for the tabfolder which contains an
    FL_OBJECT (that gray box behind the tabfolder) and a bunch of FL_FORMs, one
    per folder. The tabfolder is the only native widget containing FL_FORMs and
    the current code needs extending to handle it cleanly.

    If you have a copy of the CVS code, you will find (in forms.c)

    void fl_handle_form(FL_FORM * form, int event, int key, XEvent * xev) {
            switch (event) {
            case FL_MOVEORIGIN:
            case FL_OTHER:
            /* need to dispatch it thru all objects and monitor the status of
                forms as it may get closed */
            for (obj1 = form->first; obj1 && form->visible; obj1 = obj1->next)
            if (obj1->visible)
                    fl_handle_object(obj1, event, xx, yy, key, xev);
            break;
             }
    }

    The FL_MOVEORIGIN flag is code that I added to ensure that the tabfolder
    updated the origins of its component FL_FORMs when the dialog is moved around
    the screen (FL_FORMs store absolute position in their x,y vars, FL_OBJECTs
    store coords relative to the top left had corner of their parent FL_FORM.

    Thus, I suspect that if you add a line
            fl_handle_object(obj, FL_MOVEORIGIN, 0, 0, 0, 0);
    to fl_set_object_position then things will 'just work'.

    Best of luck and let us know what happens ;-)

    Angus
    _________________________________________________
    To unsubscribe, send the message "unsubscribe" to
    xforms-request@bob.usuhs.mil or see
    http://bob.usuhs.mil/mailserv/xforms.html
    XForms Home Page: http://world.std.com/~xforms
    List Archive: http://bob.usuhs.mil/mailserv/list-archives/
    Development: http://savannah.nongnu.org/files/?group=xforms



    This archive was generated by hypermail 2b29 : Fri Apr 25 2003 - 05:46:28 EDT