XForms: scaling tabfolders to display ALL the tabs

From: Angus Leeming (a.leeming@ic.ac.uk)
Date: Thu May 09 2002 - 05:38:49 EDT

  • Next message: spl@ncmir.ucsd.edu: "XForms: XForms version 1.0 and administrivia"

    Hi, we've used tabfolders in a number of dialogs in LyX and are pretty happy
    with the results. However, they aren't exactly easy to code with. Here's an
    example of unnecessarily difficult code:

    The tabs identifying each leaf of the folder have a label whose length is
    unknown when the dialog is designed. (Because these labels are translated to
    eg German). Consequently, the tabs can become wider than the folder and are
    then, rather elegantly, chopped off by xforms.

    That's all well and good, but the obvious "correct" fix is to ascertain how
    much space the tabs require to be displayed fully and to then scle the dialog
    appropriately. Here's where I have to invent convoluted code.

    The tabfolders have accessor functions returning the names on the tabs
            char * fl_get_folder_name(FL_OBJECT * folder);
    and the leaves of the folder
            FL_FORM * fl_get_folder(FL_OBJECT * folder);
            
    but it appears that the tab buttons themselves have been made deliberately
    hard to get at. There is no
            FL_OBJECT * fl_get_folder_tab(FL_OBJECT * folder);

    This is a shame!

    The tabs CAN be found, but in a convoluted fashion, as they are visible to
    the folder's parent form, folder->form. A comparison of ob->label with
    fl_get_folder_name(folder) allows me to ascertain which objects are tabs and
    hence allows me to work out the space taken up by the tab. All very
    complicated.

    I attach the code that does all this so you can see what I'm taking about.

    Was there a reason for making the tab so hard to get at?
    If not, can we have an accessor function?

    Best regards,
    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/



    This archive was generated by hypermail 2b29 : Thu May 09 2002 - 05:42:31 EDT