# To subscribers of the xforms list from Angus Leeming <a.leeming@ic.ac.uk> :
I am willing to have a go at this, but would like some feedback
first. Am I heading in the right direction or going up a blind
alley? Please read this and deluge me with advice.
I posted a patch to the list this morning. It fixes one particular
problem that arises because the tabfolders' geometry is not
updated when it should be.
Another problem with tabfolders as they currently stand is that
they ignore resize events. For that to work would need an
if (ob->objclass == FL_TABFOLDER)
check in the main loop of scale_form found in forms.c.
Thereafter, one would loop over all the FL_FORM * folders in the
tabfolder and call scale_form recursively.
I already have a function that may well do the trick. Here, I
use it to fit internationalised strings into the buttons etc. I
have pasted a butchered version of the code below, to give you a
feel for what I believe is needed.
It strikes me that a "proper fix" to scale_form that combined
the code below with a call to fl_get_wingeometry would cure all
my/our problems with tabfolders in one fell swoop.
Opinions?
Best regards,
Angus
void my_scale_form(FL_FORM * form, double xscl, double yscl)
{
FL_OBJECT * ob;
FL_FORM * folder;
int saved_folder_id;
int tabfolder_size;
int i;
/* call the xforms routine that actually does the work
for the current form only
*/
fl_scale_form(form, xscl, yscl);
/* Loop over all tabfolders in the current form and
call my_scale_form() recursively, so that they
too can be scaled.
*/
for (ob = form->first; ob; ob = ob->next) {
if (ob->objclass != FL_TABFOLDER)
continue;
saved_folder_id = fl_get_folder_number(ob);
tabfolder_size = get_tabfolder_numfolders(ob);
for (i = 0; i < tabfolder_size; ++i) {
fl_set_folder_bynumber(ob, i+1);
folder = fl_get_folder(ob);
my_scale_form(folder, xscl, yscl);
}
/* Return to the originally-visible folder */
fl_set_folder_bynumber(ob, saved_folder_id);
}
}
_________________________________________________
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 : Mon Oct 07 2002 - 10:40:43 EDT