cafStudy = (CAF_Study*)activeStudy();
QAction* undo = action( EditUndoId );
- if ( cafStudy && undo->inherits( "QtxListAction" ) )
- ((QtxListAction*)undo)->addNames( cafStudy->undoNames() );
+ if ( cafStudy && undo )
+ undo->setProperty( "names", cafStudy->undoNames() );
QAction* redo = action( EditRedoId );
- if ( cafStudy && redo->inherits( "QtxListAction" ) )
- ((QtxListAction*)redo)->addNames( cafStudy->redoNames() );
+ if ( cafStudy && redo )
+ redo->setProperty( "names", cafStudy->redoNames() );
- undo->setEnabled( cafStudy && cafStudy->canUndo() );
- redo->setEnabled( cafStudy && cafStudy->canRedo() );
+ if ( undo )
+ undo->setEnabled( cafStudy && cafStudy->canUndo() );
+ if ( redo )
+ redo->setEnabled( cafStudy && cafStudy->canRedo() );
}
void CAF_Application::onHelpAbout()
{
SUIT_MessageBox::info1( desktop(), tr( "About" ), tr( "ABOUT_INFO" ), "&OK" );
}
+
+SUIT_Study* CAF_Application::createNewStudy()
+{
+ return new CAF_Study( this );
+}
CAF_Application();
virtual ~CAF_Application();
- virtual QString applicationName() const;
+ virtual QString applicationName() const;
public slots:
- virtual void onHelpAbout();
+ virtual void onHelpAbout();
protected slots:
- virtual bool onUndo( int );
- virtual bool onRedo( int );
+ virtual bool onUndo( int );
+ virtual bool onRedo( int );
protected:
enum { EditUndoId = STD_Application::UserID, EditRedoId, UserID };
protected:
- virtual void createActions();
- virtual void updateCommandsStatus();
+ virtual void createActions();
+ virtual void updateCommandsStatus();
- bool undo( CAF_Study* doc );
- bool redo( CAF_Study* doc );
+ virtual SUIT_Study* createNewStudy();
+
+ bool undo( CAF_Study* doc );
+ bool redo( CAF_Study* doc );
};
#if defined WIN32
myMode = mode;
}
+QStringList QtxListAction::names() const
+{
+ QStringList lst;
+ if ( myFrame )
+ lst = myFrame->names();
+ return lst;
+}
+
/*!
Name: addNames [public]
Desc: Fills the list of actions. Removes the old contents from
{
Q_OBJECT
+ Q_PROPERTY( QStringList names READ names WRITE addNames )
+
class ToolButton;
public:
int popupMode() const;
void setPopupMode( const int );
+ QStringList names() const;
void addNames( const QStringList&, bool = true );
void setComment( const QString&, const QString& = QString::null );
desktop()->toolMgr()->setShown( id, on );
}
+void SUIT_Application::setActionShown( QAction* a, const bool on )
+{
+ setMenuShown( a, on );
+ setToolShown( a, on );
+}
+
+void SUIT_Application::setActionShown( const int id, const bool on )
+{
+ setMenuShown( id, on );
+ setToolShown( id, on );
+}
+
QAction* SUIT_Application::action( const int id ) const
{
SUIT_Application* that = (SUIT_Application*)this;
void setToolShown( QAction*, const bool );
void setToolShown( const int, const bool );//@}
+ void setActionShown( QAction*, const bool );
+ void setActionShown( const int, const bool );
+
static QAction* separator();
QAction* action( const int ) const;
int actionId( const QAction* ) const;