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,30 +1222,37 @@ public: ...@@ -1222,30 +1222,37 @@ public:
/** Struct containing information about pickModes /** Struct containing information about pickModes
*/ */
struct PickMode class PickMode
{ {
/// Constructor public:
PickMode(const std::string& _n, bool _t, bool _v, QCursor _c, QToolBar *_tb = NULL) : /// Constructor
name(_n), tracking(_t), visible(_v), cursor(_c), toolbar(_tb) {} PickMode(const std::string& _n, bool _t, bool _v, QCursor _c, QToolBar *_tb = 0 ) :
name(_n),
/// Name of the pickMode tracking(_t),
std::string name; visible(_v),
cursor(_c),
/** MouseTracking enabled for this mode? toolbar(_tb) {};
*/
bool tracking; ~PickMode() {};
/** Defines if the Mode will be visible in the popup Menu /// Name of the pickMode
*/ std::string name;
bool visible;
/** MouseTracking enabled for this mode?
/** Cursor used in this pickMode */
*/ bool tracking;
QCursor cursor;
/** Defines if the Mode will be visible in the popup Menu
/** Additinal toolbar showd in this pickMode */
*/ bool visible;
QToolBar * toolbar;
/** Cursor used in this pickMode
*/
QCursor cursor;
/** Additional toolbar showed in this pickMode
*/
QToolBar * toolbar;
}; };
/** Vector of all Picking modes /** Vector of all Picking modes
......
...@@ -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