>>>>> "Asger" == Asger K Alstrup Nielsen <[EMAIL PROTECTED]> writes:

>> Well, I'd rather think of the toolbars like menus: basically
>> (forgetting combox, etc) they hold a collection of pairs
>> icon/lyxfunc (or text/lyxfunc for menus). Having a global flag for
>> readonly does not make sense if the toolbar does not know whether a
>> function is affected by this flag. Likewise, a 'view PS' lyxfunc
>> should be made unavailable if there is no ps viewer. Currently,
>> this is done by hand in the menu code but, if we want a real menu
>> class, this info will have to be obtained from LyXFunc.

Asger> And the solution is simple: Use an extra lyxfunc.  Each button
Asger> will have two different lyxfunc attached:

Asger> One to call when the action is triggered.  Another to call to
Asger> check whether the button is active.

Why not directly have a LyXFunc::Query() with a large switch like in
Dispatch()? This could even be used in Dispatch itself to return on
read-only functions. Just some cut and paste.

JMarc

Reply via email to