On Wednesday 06 November 2002 2:24 pm, Jean-Marc Lasgouttes wrote:
> Here is what I get with the document layout popup? Am I the only one
> seeing this?
>
> JMarc

No, I see it too.

Would it make sense to add something like this (untested) code to the resize 
code we already use to check that the labels fit on the tab buttons?

Angus

double get_scale_to_fit(FL_FORM * form)
{
        double scale = 1.0;
        for (FL_OBJECT * ob = form->first; ob; ob = ob->next) {
                if (ob->objclass != FL_BUTTON)
                        continue;
                // Probably need to check that the label is inside the button...

                int lw, lh;
                fl_get_string_dimension(ob->lstyle, ob->lsize, ob->label,
                                           ob->label, int(strlen(ob->label)),
                                           &lw, &lh);

                // I guess it should also have something for the borders...
                int const length = lw;
                
                double const ob_scale = double(length) / double(ob->w);
                scale = std::max(scale, ob_scale);
        }
        return scale;
}

Reply via email to