]> Creatis software - clitk.git/blob - vv/vvToolCreatorBase.cxx
removed headers
[clitk.git] / vv / vvToolCreatorBase.cxx
1 #include "vvToolCreatorBase.h"
2 #include "vvToolManager.h"
3 #include <QAction>
4 #include <QMenu>
5
6 //------------------------------------------------------------------------------
7 vvToolCreatorBase::vvToolCreatorBase(QString name): mExperimental(false) { 
8   mToolName = name;
9   vvToolManager::GetInstance()->AddTool(this); 
10 }
11 //------------------------------------------------------------------------------
12
13
14 //------------------------------------------------------------------------------
15 void vvToolCreatorBase::InsertToolInMenu(vvMainWindowBase * m) { 
16   mMainWindow = m; 
17   // Create main action
18   if (mToolIconFilename == "noicon") 
19     mAction = new QAction(QString("&").append(mToolMenuName), this);
20   else 
21     mAction = new QAction(QIcon(mToolIconFilename), 
22                           QString("&").append(mToolMenuName), this);
23   mAction->setStatusTip(mToolTip);
24   // Connect the action
25   connect(mAction, SIGNAL(triggered()), this, SLOT(MenuToolSlot()));
26   if (mExperimental)
27       mMainWindow->GetExperimentalToolMenu()->addAction(mAction);
28   else
29       mMainWindow->GetToolMenu()->addAction(mAction);
30
31 //------------------------------------------------------------------------------
32