On Sunday 24 November 2002 11:27 pm, Darren Freeman wrote:
> On Fri, 2002-11-22 at 02:12, Angus Leeming wrote:
> > On Thursday 14 November 2002 3:36 pm, Darren Freeman wrote:
> > > Dear list,
> > >
> > > the spelchecker status bar is still corrupted. Attached is a screenshot
> > > at 100%. When I looked at it glosely in GIMP I realised that the weird
> > > characters are actually two copies of 100% on top of each other, one
> > > normal size and a second much smaller over the % sign of the first.
> >
> > Darren, I think I've fixed this properly in cvs. Perhaps you'd try it
> > out. Angus
>
> Angus,
>
> Now that CVS is fixed I tried it - still screwed.
>
> Not only that but now the word count doesn't increment. I tested with a
> single line of jibberish, the word count stayed on 0 until all was
> completed.
Ummm. I broke it. Now fixed.
> Still corrupted text - probably a font issue. It seems to print the
> percentage twice, once in the desired font and again much smaller and
> off to the right a little bit, thus the small version overwrites the %
> sign of the bigger version.
If this is /still/ horrible, then try adding this to
FormSpellchecker::updateState(State state):
case STOPPED:
{
controller().stop();
double const wordcount = controller().getCount();
fl_set_slider_bounds(dialog_->slider_progress, 0.0, wordcount);
fl_set_slider_value(dialog_->slider_progress, wordcount);
fl_set_object_label(dialog_->slider_progress, "100 %");
+ fl_redraw_object(dialog_->slider_progress);
break;
}
If it still is being overwritten, then blast it with
fl_redraw_form(form());
Having said that, the above solutions are of the hammer variety. I suspect
that resetting the label does not trigger a redraw event if the slider value
is not changed. Ie, I suspect this value is already "wordcount".
Try
case STOPPED:
{
controller().stop();
double const wordcount = controller().getCount();
+ double const currentcount =
+fl_get_slider_value(dialog_->slider_progress);
+ if (currentcount == wordcount)
+ break;
+
fl_set_slider_bounds(dialog_->slider_progress, 0.0, wordcount);
fl_set_slider_value(dialog_->slider_progress, wordcount);
fl_set_object_label(dialog_->slider_progress, "100 %");
break;
}
This latter would be the clean solution. Tell me what you find.
Angus