Add the ability to get a command by it's name.
This commit is contained in:
parent
be264380ea
commit
214bb4dda4
|
@ -1268,6 +1268,15 @@ namespace Hurricane {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Command* CellWidget::getCommand ( const string& name ) const
|
||||||
|
{
|
||||||
|
for ( size_t i=0 ; i<_commands.size() ; ++i ) {
|
||||||
|
if ( _commands[i]->getName() == name ) return _commands[i];
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void CellWidget::pushCursor ( Qt::CursorShape cursor )
|
void CellWidget::pushCursor ( Qt::CursorShape cursor )
|
||||||
{
|
{
|
||||||
setCursor ( cursor );
|
setCursor ( cursor );
|
||||||
|
|
|
@ -199,6 +199,10 @@ namespace Hurricane {
|
||||||
string SelectCommand::_name = "SelectCommand";
|
string SelectCommand::_name = "SelectCommand";
|
||||||
|
|
||||||
|
|
||||||
|
const string& SelectCommand::getStaticName ()
|
||||||
|
{ return _name; }
|
||||||
|
|
||||||
|
|
||||||
SelectCommand::SelectCommand ()
|
SelectCommand::SelectCommand ()
|
||||||
: AreaCommand ()
|
: AreaCommand ()
|
||||||
, _selectionPopup(NULL)
|
, _selectionPopup(NULL)
|
||||||
|
|
|
@ -146,6 +146,7 @@ namespace Hurricane {
|
||||||
void unbindCommand ( Command* );
|
void unbindCommand ( Command* );
|
||||||
inline void setActiveCommand ( Command* );
|
inline void setActiveCommand ( Command* );
|
||||||
inline Command* getActiveCommand () const;
|
inline Command* getActiveCommand () const;
|
||||||
|
Command* getCommand ( const std::string& ) const;
|
||||||
inline void resetActiveCommand ();
|
inline void resetActiveCommand ();
|
||||||
inline void setCursorStep ( DbU::Unit );
|
inline void setCursorStep ( DbU::Unit );
|
||||||
inline void setRealSnapGridStep ( DbU::Unit step );
|
inline void setRealSnapGridStep ( DbU::Unit step );
|
||||||
|
|
|
@ -54,6 +54,7 @@ namespace Hurricane {
|
||||||
public:
|
public:
|
||||||
enum SelectMode { AllMode=0, NetMode=1, NoAnonNetMode=2 };
|
enum SelectMode { AllMode=0, NetMode=1, NoAnonNetMode=2 };
|
||||||
public:
|
public:
|
||||||
|
static const string& getStaticName ();
|
||||||
SelectCommand ();
|
SelectCommand ();
|
||||||
virtual ~SelectCommand ();
|
virtual ~SelectCommand ();
|
||||||
virtual const string& getName () const;
|
virtual const string& getName () const;
|
||||||
|
|
Loading…
Reference in New Issue