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"
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);
74 add(LFUN_DIALOG_TABULAR_INSERT);
88 struct keyword_item toolTags[TO_LAST - 1] = {
89 { "end", TO_ENDTOOLBAR },
91 { "layouts", TO_LAYOUTS },
92 { "newline", TO_NEWLINE },
93 { "separator", TO_SEPARATOR }
97 void ToolbarDefaults::read(LyXLex & lex)
100 if (compare_no_case(lex.GetString(), "toolbar"))
101 lyxerr << "Toolbar::read: ERROR wrong token:`"
102 << lex.GetString() << '\'' << endl;
109 lex.pushTable(toolTags, TO_LAST - 1);
111 if (lyxerr.debugging(Debug::PARSER))
112 lex.printTable(lyxerr);
114 while (lex.IsOK() && !quit) {
118 func = lex.GetString();
119 lyxerr[Debug::PARSER]
120 << "Toolbar::read TO_ADD func: `"
121 << func << "'" << endl;
139 // should not set automatically
144 lex.printError("Toolbar::read: "
145 "Unknown toolbar tag: `$$Token'");
153 void ToolbarDefaults::add(string const & func)
155 int const tf = lyxaction.LookupFunc(func);
158 lyxerr << "Toolbar::add: no LyX command called`"
159 << func << "'exists!" << endl;