1 /* This file is part of
2 * ======================================================
4 * LyX, The Document Processor
6 * Copyright 1995 Matthias Ettrich
7 * Copyright 1995-2001 The LyX Team.
10 * ====================================================== */
13 #pragma implementation
18 #include "ToolbarDefaults.h"
19 #include "LyXAction.h"
23 #include "support/lstrings.h"
27 extern LyXAction lyxaction;
28 ToolbarDefaults toolbardefaults;
31 ToolbarDefaults::ToolbarDefaults()
37 void ToolbarDefaults::add(int action)
39 defaults.push_back(action);
43 void ToolbarDefaults::init()
47 //add(LFUN_CLOSEBUFFER);
62 add(LFUN_INSET_FOOTNOTE);
63 add(LFUN_INSET_MARGINAL);
72 add(LFUN_DIALOG_TABULAR_INSERT);
86 struct keyword_item toolTags[TO_LAST - 1] = {
87 { "end", TO_ENDTOOLBAR },
89 { "layouts", TO_LAYOUTS },
90 { "newline", TO_NEWLINE },
91 { "separator", TO_SEPARATOR }
95 void ToolbarDefaults::read(LyXLex & lex)
98 if (compare_no_case(lex.getString(), "toolbar")) {
99 lyxerr << "Toolbar::read: ERROR wrong token:`"
100 << lex.getString() << '\'' << endl;
107 lex.pushTable(toolTags, TO_LAST - 1);
109 if (lyxerr.debugging(Debug::PARSER))
110 lex.printTable(lyxerr);
112 while (lex.isOK() && !quit) {
115 if (lex.next(true)) {
116 string const func = lex.getString();
117 lyxerr[Debug::PARSER]
118 << "Toolbar::read TO_ADD func: `"
119 << func << "'" << endl;
137 // should not set automatically
142 lex.printError("Toolbar::read: "
143 "Unknown toolbar tag: `$$Token'");
151 void ToolbarDefaults::add(string const & func)
153 int const tf = lyxaction.LookupFunc(func);
156 lyxerr << "Toolbar::add: no LyX command called `"
157 << func << "' exists!" << endl;