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;
29 ToolbarDefaults::ToolbarDefaults()
35 void ToolbarDefaults::add(int action)
37 defaults.push_back(action);
40 void ToolbarDefaults::init()
44 //add(LFUN_CLOSEBUFFER);
84 struct keyword_item toolTags[TO_LAST - 1] = {
85 { "end", TO_ENDTOOLBAR },
87 { "layouts", TO_LAYOUTS },
88 { "newline", TO_NEWLINE },
89 { "separator", TO_SEPARATOR }
93 void ToolbarDefaults::read(LyXLex & lex)
96 if (compare_no_case(lex.GetString(), "toolbar"))
97 lyxerr << "Toolbar::read: ERROR wrong token:`"
98 << lex.GetString() << '\'' << endl;
105 lex.pushTable(toolTags, TO_LAST - 1);
107 if (lyxerr.debugging(Debug::PARSER))
108 lex.printTable(lyxerr);
110 while (lex.IsOK() && !quit) {
112 lyxerr[Debug::GUI] << "Toolbar::read: current lex text: `"
113 << lex.GetString() << '\'' << endl;
118 func = lex.GetString();
120 << "Toolbar::read TO_ADD func: `"
121 << func << "'" << endl;
139 // should not set automatically
144 lex.printError("Toolbar::read: "
145 "Unknown toolbar tag: `$$Token'");
154 void ToolbarDefaults::add(string const & func)
156 int tf = lyxaction.LookupFunc(func);
159 lyxerr << "Toolbar::add: no LyX command called`"
160 << func << "'exists!" << endl;