Re: XForms: Getting a particular tab of a tabfolder.

From: Serge B Bromow (serge@omensys.com)
Date: Thu Oct 04 2001 - 15:03:52 EDT

  • Next message: Jean-Marc Lasgouttes: "Re: XForms: Getting a particular tab of a tabfolder."

    # To subscribers of the xforms list from Serge B Bromow <serge@omensys.com> :

    Jean-Marc Lasgouttes wrote:

    > # To subscribers of the xforms list from Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr> :
    >
    > Hello,
    >
    > I would like to change a tabfolder so that the active tab has its font
    > changed to bold. To do that, I would like to be able (in a callback)
    > to get the button associated to a given tab (the object returned by
    > fl_addto_tabfolder). Is that possible? It seems I am only able to
    > recover the form of the tab contents or the title string of the
    > button...
    >
    > JMarc
    > _________________________________________________
    > 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/

    Hi Jean-Mark

    That's a good question and a good idea to emphasize the
    active tab. So here are some code snippets of what
    worked for me.

    FL_OBJECT *tabbs[20];

    main()
    {
    /* Save tabs object */
    tabbs[1] = fl_addto_tabfolder(fd_tab->tabs,"Print", fd_prt->prt);
    tabbs[2] = fl_addto_tabfolder(fd_tab->tabs,"General", fd_def->def);
    tabbs[3] = fl_addto_tabfolder(fd_tab->tabs,"Taxes", fd_tax->tax);

    /* Highlight first tab */
    fl_set_object_lstyle(tabbs[1], HI_LIGHT_FONT);

    fl_do_forms();
    }

    /* Tab folder call back */
    void tabs_call(FL_OBJECT *ob, long data)
    {
    extern FL_OBJECT *tabbs[];

    /* Highlight current */
    cur = fl_get_active_folder_number(ob);
    fl_set_object_lstyle(tabbs[cur], HI_LIGHT_FONT);

    /* Normal Last */
    lst = fl_get_folder_number(ob);
    fl_set_object_lstyle(tabbs[lst], NORMAL_FONT);
    }

    Thanks for the idea.

    Good luck.

    Serge

    _________________________________________________
    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 Oct 04 2001 - 15:10:47 EDT