2014-07-08 12:39:12 +02:00
|
|
|
#ifndef CSV_WIDGET_SCENETOOL_MODE_H
|
|
|
|
#define CSV_WIDGET_SCENETOOL_MODE_H
|
2013-09-28 11:27:24 +02:00
|
|
|
|
|
|
|
#include "scenetool.hpp"
|
|
|
|
|
2013-09-28 13:10:42 +02:00
|
|
|
#include <map>
|
|
|
|
|
|
|
|
class QHBoxLayout;
|
|
|
|
|
2014-07-08 12:39:12 +02:00
|
|
|
namespace CSVWidget
|
2013-09-28 11:27:24 +02:00
|
|
|
{
|
2013-10-07 11:14:11 +02:00
|
|
|
class SceneToolbar;
|
2014-11-06 13:26:19 +01:00
|
|
|
class ModeButton;
|
2013-10-07 11:14:11 +02:00
|
|
|
|
2013-09-28 11:27:24 +02:00
|
|
|
///< \brief Mode selector tool
|
|
|
|
class SceneToolMode : public SceneTool
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
2013-09-28 13:10:42 +02:00
|
|
|
QWidget *mPanel;
|
|
|
|
QHBoxLayout *mLayout;
|
2014-11-06 13:26:19 +01:00
|
|
|
std::map<ModeButton *, std::string> mButtons; // widget, id
|
2013-10-07 11:14:11 +02:00
|
|
|
int mButtonSize;
|
2014-04-03 13:00:19 +02:00
|
|
|
int mIconSize;
|
2014-07-13 14:21:50 +02:00
|
|
|
QString mToolTip;
|
2014-07-14 14:17:27 +02:00
|
|
|
PushButton *mFirst;
|
2014-11-06 13:26:19 +01:00
|
|
|
ModeButton *mCurrent;
|
|
|
|
SceneToolbar *mToolbar;
|
2014-07-13 14:21:50 +02:00
|
|
|
|
2014-11-06 13:26:19 +01:00
|
|
|
void adjustToolTip (const ModeButton *activeMode);
|
2013-09-28 13:10:42 +02:00
|
|
|
|
2013-09-28 11:27:24 +02:00
|
|
|
public:
|
|
|
|
|
2014-07-13 14:21:50 +02:00
|
|
|
SceneToolMode (SceneToolbar *parent, const QString& toolTip);
|
2013-09-28 13:10:42 +02:00
|
|
|
|
|
|
|
virtual void showPanel (const QPoint& position);
|
|
|
|
|
2014-07-10 13:18:24 +02:00
|
|
|
void addButton (const std::string& icon, const std::string& id,
|
2014-07-13 14:21:50 +02:00
|
|
|
const QString& tooltip = "");
|
2013-09-28 13:10:42 +02:00
|
|
|
|
2014-11-07 11:11:43 +01:00
|
|
|
/// The ownership of \a button is transferred to *this.
|
|
|
|
void addButton (ModeButton *button, const std::string& id);
|
|
|
|
|
2013-09-28 13:10:42 +02:00
|
|
|
signals:
|
|
|
|
|
|
|
|
void modeChanged (const std::string& id);
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
|
|
|
|
void selected();
|
2013-09-28 11:27:24 +02:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|