>>>>> "Angus" == Angus Leeming <[EMAIL PROTECTED]> writes:

Angus> I have hit a small nastiness when trying to replace the LFUNs
Angus> below with a single LFUN_DIALOG_SHOW <name>. They all have
Angus> different "attrib"s, Noop, NoBuffer, etc.

Angus> Replace these { LFUN_DIALOG_PREFERENCES, "dialog-preferences",
Angus> NoBuffer }, { LFUN_FORKS_SHOW, "show-forks", NoBuffer }, {
Angus> LFUN_HELP_ABOUTLYX, "help-aboutlyx", NoBuffer }, {
Angus> LFUN_HELP_TEXINFO, "help-Texinfo", NoBuffer }, {
Angus> LFUN_LATEX_LOG, "latex-view-log", ReadOnly }, {
Angus> LFUN_LAYOUT_CHARACTER, "layout-character", ReadOnly }, {
Angus> LFUN_LAYOUT_DOCUMENT, "layout-document", ReadOnly }, {
Angus> LFUN_LAYOUT_PREAMBLE, "layout-preamble", ReadOnly }, {
Angus> LFUN_MATH_PANEL, "math-panel", Noop }, { LFUN_MENUPRINT,
Angus> "buffer-print", ReadOnly }, { LFUN_MENUSEARCH, "find-replace",
Angus> ReadOnly }, { LFUN_SPELLCHECK, "spellchecker", Noop }, {
Angus> LFUN_VC_HISTORY, "vc-history", ReadOnly }, with this {
Angus> LFUN_DIALOG_SHOW, "dialog-show", Argument },

Angus> Replace these
Angus>         { LFUN_DIALOG_PREFERENCES, "dialog-preferences", NoBuffer },
Angus>         { LFUN_FORKS_SHOW, "show-forks", NoBuffer },
Angus>         { LFUN_HELP_ABOUTLYX, "help-aboutlyx", NoBuffer },
Angus>         { LFUN_HELP_TEXINFO, "help-Texinfo", NoBuffer },
Angus>         { LFUN_LATEX_LOG, "latex-view-log", ReadOnly },
Angus>         { LFUN_LAYOUT_CHARACTER, "layout-character", ReadOnly },
Angus>         { LFUN_LAYOUT_DOCUMENT, "layout-document", ReadOnly },
Angus>         { LFUN_LAYOUT_PREAMBLE, "layout-preamble", ReadOnly },
Angus>         { LFUN_MATH_PANEL, "math-panel", Noop },
Angus>         { LFUN_MENUPRINT, "buffer-print", ReadOnly },
Angus>         { LFUN_MENUSEARCH, "find-replace", ReadOnly },
Angus>         { LFUN_SPELLCHECK, "spellchecker", Noop },
Angus>         { LFUN_VC_HISTORY, "vc-history", ReadOnly },
Angus> with this
Angus>         { LFUN_DIALOG_SHOW, "dialog-show", Argument },

The current solution to this kind of problem is to code the
limitations in LyXFunc::getStatus(). It is done for that. I know
getStatus is not a great thing, but it is the correct solution in the
current context.

The flags are just a shortcut for coding simple restrictions in a
table driven way. We do not have to code everything there.

JMarc

Reply via email to