本文整理汇总了C++中app::Property::getStatus方法的典型用法代码示例。如果您正苦于以下问题:C++ Property::getStatus方法的具体用法?C++ Property::getStatus怎么用?C++ Property::getStatus使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app::Property
的用法示例。
在下文中一共展示了Property::getStatus方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setEditorMode
PyObject* PropertyContainerPy::setEditorMode(PyObject *args)
{
char* name;
short type;
if (PyArg_ParseTuple(args, "sh", &name, &type)) {
App::Property* prop = getPropertyContainerPtr()->getPropertyByName(name);
if (!prop) {
PyErr_Format(PyExc_AttributeError, "Property container has no property '%s'", name);
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;
}
PyErr_Clear();
PyObject *iter;
if (PyArg_ParseTuple(args, "sO", &name, &iter)) {
if (PyTuple_Check(iter) || PyList_Check(iter)) {
Py::Sequence seq(iter);
App::Property* prop = getPropertyContainerPtr()->getPropertyByName(name);
if (!prop) {
PyErr_Format(PyExc_AttributeError, "Property container has no property '%s'", name);
return 0;
}
// reset all bits first
unsigned long status = prop->getStatus();
prop->setStatus(Property::ReadOnly, false);
prop->setStatus(Property::Hidden, false);
for (Py::Sequence::iterator it = seq.begin();it!=seq.end();++it) {
std::string str = (std::string)Py::String(*it);
if (str == "ReadOnly")
prop->setStatus(Property::ReadOnly, true);
else if (str == "Hidden")
prop->setStatus(Property::Hidden, true);
}
if (status != prop->getStatus())
GetApplication().signalChangePropertyEditor(*prop);
Py_Return;
}
}
PyErr_SetString(PyExc_TypeError, "First argument must be str, second can be int, list or tuple");
return 0;
}