2002-09-24 13:57:09 +00:00
|
|
|
// -*- C++ -*-
|
2002-08-30 16:20:27 +00:00
|
|
|
/**
|
|
|
|
* \file iconpalette.h
|
2002-09-24 13:57:09 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
2002-08-30 16:20:27 +00:00
|
|
|
*
|
|
|
|
* \author John Levon
|
2002-09-24 13:57:09 +00:00
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS
|
2002-08-30 16:20:27 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef ICONPALETTE_H
|
|
|
|
#define ICONPALETTE_H
|
|
|
|
|
2002-09-24 13:57:09 +00:00
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
2002-08-30 16:20:27 +00:00
|
|
|
|
|
|
|
#include <qwidget.h>
|
2002-09-24 13:57:09 +00:00
|
|
|
#include "LString.h"
|
|
|
|
#include <utility>
|
2002-09-08 02:37:57 +00:00
|
|
|
#include <vector>
|
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-09-24 13:57:09 +00:00
|
|
|
|
2002-08-30 16:20:27 +00:00
|
|
|
QGridLayout * layout_;
|
2002-09-24 13:57:09 +00:00
|
|
|
|
2002-09-08 02:37:57 +00:00
|
|
|
typedef std::pair<QPushButton *, string> Button;
|
2002-09-24 13:57:09 +00:00
|
|
|
|
2002-09-08 02:37:57 +00:00
|
|
|
std::vector<Button> buttons_;
|
2002-08-30 16:20:27 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // ICONPALETTE_H
|