#5632 Python method commands (#5649)

* General PdmObjectMethods for scripting.
This commit is contained in:
Gaute Lindkvist
2020-03-10 14:11:22 +01:00
committed by GitHub
parent 587478cbd1
commit c51aa91c42
145 changed files with 2646 additions and 1587 deletions

View File

@@ -21,6 +21,8 @@
#include "RiaGuiApplication.h"
#include "RiuPlotMainWindow.h"
#include "cafPdmFieldIOScriptability.h"
CAF_PDM_SOURCE_INIT( RicfSetPlotWindowSize, "setPlotWindowSize" );
//--------------------------------------------------------------------------------------------------
@@ -28,20 +30,20 @@ CAF_PDM_SOURCE_INIT( RicfSetPlotWindowSize, "setPlotWindowSize" );
//--------------------------------------------------------------------------------------------------
RicfSetPlotWindowSize::RicfSetPlotWindowSize()
{
RICF_InitField( &m_height, "height", -1, "Height", "", "", "" );
RICF_InitField( &m_width, "width", -1, "Width", "", "", "" );
CAF_PDM_InitScriptableFieldWithIO( &m_height, "height", -1, "Height", "", "", "" );
CAF_PDM_InitScriptableFieldWithIO( &m_width, "width", -1, "Width", "", "", "" );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RicfCommandResponse RicfSetPlotWindowSize::execute()
caf::PdmScriptResponse RicfSetPlotWindowSize::execute()
{
RiaGuiApplication* guiApp = RiaGuiApplication::instance();
if ( guiApp )
{
guiApp->getOrCreateAndShowMainPlotWindow()->resize( m_width, m_height );
return RicfCommandResponse();
return caf::PdmScriptResponse();
}
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, "Need GUI ResInsight to set plot window size" );
return caf::PdmScriptResponse( caf::PdmScriptResponse::COMMAND_ERROR, "Need GUI ResInsight to set plot window size" );
}