+ dynamically hide/show and enable/disable item in property editor

This commit is contained in:
wmayer
2016-03-05 13:13:23 +01:00
parent 7ba4da0913
commit c15da7f463
6 changed files with 75 additions and 0 deletions

View File

@@ -29,6 +29,7 @@
#include "PropertyContainer.h"
#include "Property.h"
#include "Application.h"
// inclution of the generated files (generated out of PropertyContainerPy.xml)
#include "PropertyContainerPy.h"
@@ -110,9 +111,13 @@ PyObject* PropertyContainerPy::setEditorMode(PyObject *args)
return 0;
}
unsigned long status = prop->getStatus();
prop->setStatus(Property::ReadOnly,(type & 1) > 0);
prop->setStatus(Property::Hidden,(type & 2) > 0);
if (status != prop->getStatus())
GetApplication().signalChangePropertyEditor(*prop);
Py_Return;
}
@@ -128,6 +133,7 @@ PyObject* PropertyContainerPy::setEditorMode(PyObject *args)
}
// reset all bits first
unsigned long status = prop->getStatus();
prop->setStatus(Property::ReadOnly, false);
prop->setStatus(Property::Hidden, false);
@@ -139,6 +145,9 @@ PyObject* PropertyContainerPy::setEditorMode(PyObject *args)
prop->setStatus(Property::Hidden, true);
}
if (status != prop->getStatus())
GetApplication().signalChangePropertyEditor(*prop);
Py_Return;
}
}