Commit 61538420 authored by Jan Möbius's avatar Jan Möbius

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 ed64782b
......@@ -1201,7 +1201,7 @@ public:
*/
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
*
......@@ -1222,30 +1222,37 @@ public:
/** Struct containing information about pickModes
*/
struct PickMode
class PickMode
{
/// Constructor
PickMode(const std::string& _n, bool _t, bool _v, QCursor _c, QToolBar *_tb = NULL) :
name(_n), tracking(_t), visible(_v), cursor(_c), toolbar(_tb) {}
/// Name of the pickMode
std::string name;
/** MouseTracking enabled for this mode?
*/
bool tracking;
/** Defines if the Mode will be visible in the popup Menu
*/
bool visible;
/** Cursor used in this pickMode
*/
QCursor cursor;
/** Additinal toolbar showd in this pickMode
*/
QToolBar * toolbar;
public:
/// Constructor
PickMode(const std::string& _n, bool _t, bool _v, QCursor _c, QToolBar *_tb = 0 ) :
name(_n),
tracking(_t),
visible(_v),
cursor(_c),
toolbar(_tb) {};
~PickMode() {};
/// Name of the pickMode
std::string name;
/** MouseTracking enabled for this mode?
*/
bool tracking;
/** Defines if the Mode will be visible in the popup Menu
*/
bool visible;
/** Cursor used in this pickMode
*/
QCursor cursor;
/** Additional toolbar showed in this pickMode
*/
QToolBar * toolbar;
};
/** Vector of all Picking modes
......
......@@ -329,12 +329,17 @@ void CoreWidget::setPickModeMouseTracking(const std::string& _name, bool _mouseT
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++)
if ( pick_modes_[i].name == _mode ){
// Set the new toolbar for that mode
pick_modes_[i].toolbar = _toolbar;
// Activate the toolbar if this mode is currently active
if (pick_mode_name_ == _mode && pickingMode() )
pickToolbar_->attachToolbar (_toolbar);
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