2 /* This file is part of
3 * ======================================================
5 * LyX, The Document Processor
6 * Copyright 1995 Matthias Ettrich
7 * Copyright 1995-2000 The LyX Team.
9 * This file is Copyright 1996-2000
12 * ====================================================== */
22 #include FORMS_H_LOCATION
26 /** The LyX toolbar class
27 This class {\em is} the LyX toolbar, and is not likely to be enhanced
28 further until we begin the move to Qt. We will probably have to make our
29 own QToolBar, at least until Troll Tech makes theirs.
34 Toolbar(LyXView * o, int x, int y);
42 int get_toolbar_func(string const & func);
44 /// The special toolbar actions
46 /// adds space between buttons in the toolbar
48 /// a special combox insead of a button
50 /// begin a new line of button (not working)
57 /// (re)sets the toolbar
58 void set(bool doingmain = false);
60 /** this is to be the entry point to the toolbar
61 frame, where you can change the toolbar realtime. */
63 /// add a new button to the toolbar.
64 void add(int , bool doclean = true);
65 /// name of func instead of kb_action
66 void add(string const & , bool doclean = true);
67 /// invokes the n'th icon in the toolbar
69 /// activates the toolbar
71 /// deactivates the toolbar
73 /// update the state of the icons
76 static void ToolbarCB(FL_OBJECT *, long);
80 static void BubbleTimerCB(FL_OBJECT *, long);
82 static int BubblePost(FL_OBJECT * ob, int event,
83 FL_Coord mx, FL_Coord my, int key, void * xev);
96 action = LFUN_NOACTION;
102 fl_delete_object(icon);
103 fl_free_object(icon);
112 toolbarItem & operator=(const toolbarItem & ti) {
113 // do we have to check icon and IsBitmap too?
115 icon = 0; // locally we need to get the icon anew
121 /// typedef to simplify things
122 typedef std::vector<toolbarItem> ToolbarList;
123 /// The list containing all the buttons
124 ToolbarList toollist;
129 FL_OBJECT * bubble_timer;
131 /// Starting position
149 char const ** getPixmap(kb_action, string const & arg = string());
150 /// removes all toolbar buttons from the toolbar.
165 standardspacing = 2; // the usual space between items
166 sepspace = 6; // extra space
167 xpos = sxpos - standardspacing;
169 buttonwidth = 30; // the standard button width
170 height = 30; // the height of all items in the toolbar