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