Commit d4bf7940 authored by Jan Möbius's avatar Jan Möbius
Browse files

Internal class for pickmode handling, documentation in pickmodetoolbar

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@11572 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 8ef4ce40
...@@ -1201,7 +1201,7 @@ public: ...@@ -1201,7 +1201,7 @@ public:
*/ */
void setPickModeToolbar( const std::string _mode , QToolBar * _toolbar ); void setPickModeToolbar( const std::string _mode , QToolBar * _toolbar );
/** \brief Removes the additinal toolbar of the given PickMode /** \brief Removes the additional toolbar of the given PickMode
* *
* Set the additional toolbar that should be shown in the pickMode * Set the additional toolbar that should be shown in the pickMode
* *
...@@ -1222,11 +1222,18 @@ public: ...@@ -1222,11 +1222,18 @@ public:
/** Struct containing information about pickModes /** Struct containing information about pickModes
*/ */
struct PickMode class PickMode
{ {
public:
/// Constructor /// Constructor
PickMode(const std::string& _n, bool _t, bool _v, QCursor _c, QToolBar *_tb = NULL) : PickMode(const std::string& _n, bool _t, bool _v, QCursor _c, QToolBar *_tb = 0 ) :
name(_n), tracking(_t), visible(_v), cursor(_c), toolbar(_tb) {} name(_n),
tracking(_t),
visible(_v),
cursor(_c),
toolbar(_tb) {};
~PickMode() {};
/// Name of the pickMode /// Name of the pickMode
std::string name; std::string name;
...@@ -1243,7 +1250,7 @@ public: ...@@ -1243,7 +1250,7 @@ public:
*/ */
QCursor cursor; QCursor cursor;
/** Additinal toolbar showd in this pickMode /** Additional toolbar showed in this pickMode
*/ */
QToolBar * toolbar; QToolBar * toolbar;
}; };
......
...@@ -329,12 +329,17 @@ void CoreWidget::setPickModeMouseTracking(const std::string& _name, bool _mouseT ...@@ -329,12 +329,17 @@ void CoreWidget::setPickModeMouseTracking(const std::string& _name, bool _mouseT
void CoreWidget::setPickModeToolbar( const std::string _mode , QToolBar * _toolbar ) void CoreWidget::setPickModeToolbar( const std::string _mode , QToolBar * _toolbar )
{ {
// Get the pickmode that belongs to the given name
for (uint i=0; i < pick_modes_.size(); i++) for (uint i=0; i < pick_modes_.size(); i++)
if ( pick_modes_[i].name == _mode ){ if ( pick_modes_[i].name == _mode ){
// Set the new toolbar for that mode
pick_modes_[i].toolbar = _toolbar; pick_modes_[i].toolbar = _toolbar;
// Activate the toolbar if this mode is currently active
if (pick_mode_name_ == _mode && pickingMode() ) if (pick_mode_name_ == _mode && pickingMode() )
pickToolbar_->attachToolbar (_toolbar); pickToolbar_->attachToolbar (_toolbar);
break; break;
} }
} }
......
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