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"
24 // only until we don't need access to the NEW_INSETS or NEW_TABULAR anymore
25 #include "lyxparagraph.h"
30 extern LyXAction lyxaction;
31 ToolbarDefaults toolbardefaults;
33 ToolbarDefaults::ToolbarDefaults()
39 void ToolbarDefaults::add(int action)
41 defaults.push_back(action);
44 void ToolbarDefaults::init()
48 //add(LFUN_CLOSEBUFFER);
67 add(LFUN_INSET_FOOTNOTE);
68 add(LFUN_INSET_MARGINAL);
78 add(LFUN_DIALOG_TABULAR_INSERT);
93 struct keyword_item toolTags[TO_LAST - 1] = {
94 { "end", TO_ENDTOOLBAR },
96 { "layouts", TO_LAYOUTS },
97 { "newline", TO_NEWLINE },
98 { "separator", TO_SEPARATOR }
102 void ToolbarDefaults::read(LyXLex & lex)
105 if (compare_no_case(lex.GetString(), "toolbar"))
106 lyxerr << "Toolbar::read: ERROR wrong token:`"
107 << lex.GetString() << '\'' << endl;
114 lex.pushTable(toolTags, TO_LAST - 1);
116 if (lyxerr.debugging(Debug::PARSER))
117 lex.printTable(lyxerr);
119 while (lex.IsOK() && !quit) {
124 func = lex.GetString();
126 << "Toolbar::read TO_ADD func: `"
127 << func << "'" << endl;
145 // should not set automatically
150 lex.printError("Toolbar::read: "
151 "Unknown toolbar tag: `$$Token'");
160 void ToolbarDefaults::add(string const & func)
162 int tf = lyxaction.LookupFunc(func);
165 lyxerr << "Toolbar::add: no LyX command called`"
166 << func << "'exists!" << endl;