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);
75 add(LFUN_DIALOG_TABULAR_INSERT);
89 struct keyword_item toolTags[TO_LAST - 1] = {
90 { "end", TO_ENDTOOLBAR },
92 { "layouts", TO_LAYOUTS },
93 { "newline", TO_NEWLINE },
94 { "separator", TO_SEPARATOR }
98 void ToolbarDefaults::read(LyXLex & lex)
101 if (compare_no_case(lex.GetString(), "toolbar"))
102 lyxerr << "Toolbar::read: ERROR wrong token:`"
103 << lex.GetString() << '\'' << endl;
110 lex.pushTable(toolTags, TO_LAST - 1);
112 if (lyxerr.debugging(Debug::PARSER))
113 lex.printTable(lyxerr);
115 while (lex.IsOK() && !quit) {
118 if (lex.next(true)) {
119 func = lex.GetString();
120 lyxerr[Debug::PARSER]
121 << "Toolbar::read TO_ADD func: `"
122 << func << "'" << endl;
140 // should not set automatically
145 lex.printError("Toolbar::read: "
146 "Unknown toolbar tag: `$$Token'");
154 void ToolbarDefaults::add(string const & func)
156 int const tf = lyxaction.LookupFunc(func);
159 lyxerr << "Toolbar::add: no LyX command called `"
160 << func << "' exists!" << endl;