Angus Leeming wrote: > On Thursday 03 October 2002 11:59 am, Rob Lahaye wrote: > >>If each left & middle mouse click on the canvas runs several >>times through the input-length-check, we need to find out why, >>since it's totally unnecessary. I'll make a note and bring it >>up as soon as CVS is ready for my mega-patch. > > > When you say "canvas" do you mean you're clicking in the main > LyX window or in the Graphics or Paragraph dialogs? The latter > makes sense perhaps, the former does not at all.
Either one of your patches has fixed this, or I was mistaken. It appears to be fixed now :). Another problem, which I have partly solved/bypassed already. It concerns widgets which have been disabled, e.g. with setEnable(widget, false). BTW: read for "widget" here the "input" and "label" parameters in the checkedwidgets.[Ch]. We should not modify the label colour when disabled and this case needs a little more attention. For finding out the dis/enabled state, I need to check whether the widget is active, right? Well, "widget->active" is ALWAYS active, irrespective of it being enabled or disabled. It took me a while to discover this! However, I found that "widget->lcol" has changed from FL_LCOL to FL_INACTIVE. As a result, for example: if (widget->active) does not do its job in checkedwidgets.C, but if (widget->lcol != FL_INACTIVE) does! Does that make sense? Is "widget->active" not reflecting the dis/enabled state? forms.h says: "int active; /* if accept event */" in the FL_OBJECT struct. Well probably you are also puzzled, since you yourself had coded the following in checkedwidgets.C: ------------------- bool CheckedGlueLength::check() const { string const str = input_->active ? getString(input_) : string(); bool const valid = str.empty() || isStrDbl(str) || isValidGlueLength(str); ------------------- The "input_->active ? " is not working since it is always true, even for disabled widgets! Anyway, if I use the lcol-member != FL_INACTIVE check instead of active-member check, it works alright. If you have any ideas on this, please let me know. Regards, Rob.