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 )
|
||||
{
|
||||
setCursor ( cursor );
|
||||
|
|
|
@ -199,6 +199,10 @@ namespace Hurricane {
|
|||
string SelectCommand::_name = "SelectCommand";
|
||||
|
||||
|
||||
const string& SelectCommand::getStaticName ()
|
||||
{ return _name; }
|
||||
|
||||
|
||||
SelectCommand::SelectCommand ()
|
||||
: AreaCommand ()
|
||||
, _selectionPopup(NULL)
|
||||
|
|
|
@ -146,6 +146,7 @@ namespace Hurricane {
|
|||
void unbindCommand ( Command* );
|
||||
inline void setActiveCommand ( Command* );
|
||||
inline Command* getActiveCommand () const;
|
||||
Command* getCommand ( const std::string& ) const;
|
||||
inline void resetActiveCommand ();
|
||||
inline void setCursorStep ( DbU::Unit );
|
||||
inline void setRealSnapGridStep ( DbU::Unit step );
|
||||
|
|
|
@ -54,6 +54,7 @@ namespace Hurricane {
|
|||
public:
|
||||
enum SelectMode { AllMode=0, NetMode=1, NoAnonNetMode=2 };
|
||||
public:
|
||||
static const string& getStaticName ();
|
||||
SelectCommand ();
|
||||
virtual ~SelectCommand ();
|
||||
virtual const string& getName () const;
|
||||
|
|
Loading…
Reference in New Issue