Commit 5a9963f5 authored by Jan Möbius's avatar Jan Möbius

Documentation of new toolbox interface

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@7268 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 7ef88609
......@@ -54,6 +54,32 @@ void MouseAndKeyPlugin::initializePlugin() {
emit registerKey(Qt::Key_S, Qt::NoModifier, "Rotate object up");
emit registerKey(Qt::Key_A, Qt::NoModifier, "Rotate object left");
emit registerKey(Qt::Key_D, Qt::NoModifier, "Rotate object right");
tool_ = new QWidget();
QSize size(300, 300);
tool_->resize(size);
// Create button that can be toggled
// to (de)activate plugin's picking mode
pickButton_ = new QPushButton(tr("Select object"));
pickButton_->setCheckable(true);
// Create label
QLabel* label = new QLabel();
label->setText("(De)activate pick mode");
// Set label to be above the button
QGridLayout* grid = new QGridLayout;
grid->addWidget(label, 0, 0);
grid->addWidget(pickButton_, 1, 0);
tool_->setLayout(grid);
// Connect button to slotButtonClicked()
connect( pickButton_, SIGNAL(clicked()), this, SLOT(slotButtonClicked()));
// Add the Toolbox
emit addToolbox( tr("Mouse and Key") , tool_ );
} // End initializePlugin
......@@ -87,39 +113,6 @@ void MouseAndKeyPlugin::pluginsInitialized() {
} // End pluginsInitialized
/*
* Initialize toolbox
*/
bool MouseAndKeyPlugin::initializeToolbox(QWidget*& _widget)
{
tool_ = new QWidget();
_widget = tool_;
QSize size(300, 300);
tool_->resize(size);
// Create button that can be toggled
// to (de)activate plugin's picking mode
pickButton_ = new QPushButton(tr("Select object"));
pickButton_->setCheckable(true);
// Create label
QLabel* label = new QLabel();
label->setText("(De)activate pick mode");
// Set label to be above the button
QGridLayout* grid = new QGridLayout;
grid->addWidget(label, 0, 0);
grid->addWidget(pickButton_, 1, 0);
tool_->setLayout(grid);
// Connect button to slotButtonClicked()
connect( pickButton_, SIGNAL(clicked()), this, SLOT(slotButtonClicked()));
return true;
} // End initializeToolbox
/*
* Is called when button in toolbox has been clicked
......
......@@ -44,6 +44,8 @@ class MouseAndKeyPlugin: public QObject,
void addHiddenPickMode(const std::string _mode);
//KeyInterface
void registerKey(int _key, Qt::KeyboardModifiers _modifiers, QString _description, bool _multiUse = false);
// ToolboxInterface
void addToolbox( QString _name , QWidget* _widget );
private slots:
......@@ -56,8 +58,6 @@ class MouseAndKeyPlugin: public QObject,
void slotKeyEvent( QKeyEvent* _event );
//PickingInterface
void slotPickModeChanged( const std::string& _mode);
//ToolboxInterface
bool initializeToolbox(QWidget*& _widget);
public:
......
......@@ -39,7 +39,7 @@
#include "OpenFlipper/BasePlugin/PluginFunctions.hh"
bool SmootherPlugin::initializeToolbox(QWidget*& _widget)
void SmootherPlugin::initializePlugin()
{
// Create the Toolbox Widget
QWidget* toolBox = new QWidget();
......@@ -63,8 +63,7 @@ bool SmootherPlugin::initializeToolbox(QWidget*& _widget)
connect( smoothButton, SIGNAL(clicked()), this, SLOT(simpleLaplace()) );
_widget = toolBox;
return true;
emit addToolbox( tr("Smoother") , toolBox );
}
/** \brief
......
......@@ -21,11 +21,12 @@ class SmootherPlugin : public QObject, BaseInterface, ToolboxInterface, LoggingI
//LoggingInterface
void log(Logtype _type, QString _message);
void log(QString _message);
// ToolboxInterface
void addToolbox( QString _name , QWidget* _widget );
public:
// ToolboxInterface
bool initializeToolbox(QWidget*& _widget);
// BaseInterface
QString name() { return (QString("Simple Smoother")); };
......@@ -37,6 +38,11 @@ class SmootherPlugin : public QObject, BaseInterface, ToolboxInterface, LoggingI
QSpinBox* iterationsSpinbox_;
private slots:
// BaseInterface
void initializePlugin();
void simpleLaplace();
public slots:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment