// E.A. : On windows with python 2.6, there is a conflict
// E.A. : between pymath.h and Standard_math.h which define
// E.A. : some same symbols : acosh, asinh, ...
-#include <Standard_math.hxx>
-#include <pymath.h>
+ #include <Standard_math.hxx>
+ #ifndef DISABLE_PYCONSOLE
+ #include <pymath.h>
+ #endif
#endif
#ifndef DISABLE_PYCONSOLE
+
#include "LightApp_PyInterp.h" // WARNING! This include must be the first!
#include <PyConsole_Console.h>
#endif
*/
void LightApp_Application::onSelectionChanged()
{
+ LightApp_Module* m = dynamic_cast<LightApp_Module*>( activeModule() );
+ bool canCopy = m ? m->canCopy() : false;
+ bool canPaste = m ? m->canPaste() : false;
+
+ action( EditCopyId )->setEnabled(canCopy);
+ action( EditPasteId )->setEnabled(canPaste);
}
/*!
removeViewManager(aMgr);
}
}
+
+/*!
+ Copy of current selection
+ */
+void LightApp_Application::onCopy()
+{
+ LightApp_Module* m = dynamic_cast<LightApp_Module*>( activeModule() );
+ if( m )
+ m->copy();
+}
+
+/*!
+ Paste of current data in clipboard
+ */
+void LightApp_Application::onPaste()
+{
+ LightApp_Module* m = dynamic_cast<LightApp_Module*>( activeModule() );
+ if( m )
+ m->paste();
+}
virtual void onOpenDoc();
virtual void onHelpAbout();
virtual bool onOpenDoc( const QString& );
+ virtual void onCopy();
+ virtual void onPaste();
+ virtual void onSelectionChanged();
protected:
virtual void createActions();
virtual void setActiveStudy( SUIT_Study* );
virtual void updateCommandsStatus();
- virtual void onSelectionChanged();
virtual void beforeCloseDoc( SUIT_Study* );
virtual void afterCloseDoc();
{
return true;
}
+
+/*!
+ virtual method
+ \return true if module can copy the current selection
+*/
+bool LightApp_Module::canCopy() const
+{
+ return false;
+}
+
+/*!
+ virtual method
+ \return true if module can paste previously copied data
+*/
+bool LightApp_Module::canPaste() const
+{
+ return false;
+}
+
+/*!
+ virtual method
+ \brief Copies the current selection into clipboard
+*/
+void LightApp_Module::copy()
+{
+}
+
+/*!
+ virtual method
+ \brief Pastes the current data in the clipboard
+*/
+void LightApp_Module::paste()
+{
+}
virtual LightApp_Displayer* displayer();
virtual LightApp_Selection* createSelection() const;
+ virtual bool canCopy() const;
+ virtual bool canPaste() const;
+ virtual void copy();
+ virtual void paste();
+
public slots:
virtual bool activateModule( SUIT_Study* );
virtual bool deactivateModule( SUIT_Study* );