1 /* This file is part of
2 * ======================================================
4 * LyX, The Document Processor
6 * Copyright 1995 Matthias Ettrich
7 * Copyright 1995-2000 The LyX Team.
10 * ====================================================== */
13 #pragma implementation
18 #include "ToolbarDefaults.h"
19 #include "LyXAction.h"
26 extern LyXAction lyxaction;
27 ToolbarDefaults toolbardefaults;
30 ToolbarDefaults::ToolbarDefaults()
36 void ToolbarDefaults::add(int action)
38 defaults.push_back(action);
42 void ToolbarDefaults::init()
46 //add(LFUN_CLOSEBUFFER);
61 add(LFUN_INSET_FOOTNOTE);
62 add(LFUN_INSET_MARGINAL);
72 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) {
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;