]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/iconpalette.h
some math fixes
[lyx.git] / src / frontends / qt2 / iconpalette.h
1 /**
2  * \file iconpalette.h
3  * Copyright 2001 the LyX Team
4  * Read the file COPYING
5  *
6  * \author John Levon
7  */
8
9 #ifndef ICONPALETTE_H
10 #define ICONPALETTE_H
11
12 #include <config.h>
13
14 #include "LString.h"
15  
16 #include <qwidget.h>
17
18 #include <map>
19
20 class QPixmap;
21 class QPushButton;
22 class QGridLayout;
23
24 /**
25  * For holding an arbitrary set of icons.
26  */
27 class IconPalette : public QWidget {
28         Q_OBJECT
29 public:
30         IconPalette(QWidget * parent, char const * name);
31
32         /// add a button
33         void add(QPixmap const & pixmap, string name, string tooltip);
34
35 signals:
36         void button_clicked(string);
37
38 protected:
39         virtual void resizeEvent(QResizeEvent * e);
40  
41 protected slots:
42         virtual void clicked();
43
44 private:
45         typedef std::map<QPushButton *, string> ButtonMap;
46
47         int crow_;
48         int ccol_;
49  
50         QGridLayout * layout_;
51  
52         ButtonMap button_map_;
53 };
54
55 #endif // ICONPALETTE_H