2002-08-30 16:20:27 +00:00
|
|
|
/**
|
|
|
|
* \file iconpalette.h
|
|
|
|
* Copyright 2001 the LyX Team
|
|
|
|
* Read the file COPYING
|
|
|
|
*
|
|
|
|
* \author John Levon
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef ICONPALETTE_H
|
|
|
|
#define ICONPALETTE_H
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
#include "LString.h"
|
|
|
|
|
|
|
|
#include <qwidget.h>
|
|
|
|
|
2002-09-08 02:37:57 +00:00
|
|
|
#include <vector>
|
|
|
|
#include <algorithm>
|
2002-08-30 16:20:27 +00:00
|
|
|
|
|
|
|
class QPixmap;
|
|
|
|
class QPushButton;
|
|
|
|
class QGridLayout;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* For holding an arbitrary set of icons.
|
|
|
|
*/
|
|
|
|
class IconPalette : public QWidget {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2002-09-08 01:14:08 +00:00
|
|
|
IconPalette(QWidget * parent, char const * name = 0);
|
2002-08-30 16:20:27 +00:00
|
|
|
|
|
|
|
/// add a button
|
|
|
|
void add(QPixmap const & pixmap, string name, string tooltip);
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void button_clicked(string);
|
|
|
|
|
2002-09-07 23:28:05 +00:00
|
|
|
protected:
|
|
|
|
virtual void resizeEvent(QResizeEvent * e);
|
|
|
|
|
2002-08-30 16:20:27 +00:00
|
|
|
protected slots:
|
|
|
|
virtual void clicked();
|
|
|
|
|
|
|
|
private:
|
2002-09-08 02:37:57 +00:00
|
|
|
int maxcol_;
|
2002-08-30 16:20:27 +00:00
|
|
|
|
|
|
|
QGridLayout * layout_;
|
|
|
|
|
2002-09-08 02:37:57 +00:00
|
|
|
typedef std::pair<QPushButton *, string> Button;
|
|
|
|
|
|
|
|
std::vector<Button> buttons_;
|
2002-08-30 16:20:27 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // ICONPALETTE_H
|