本文整理汇总了C++中BaseObject::GetDescription方法的典型用法代码示例。如果您正苦于以下问题:C++ BaseObject::GetDescription方法的具体用法?C++ BaseObject::GetDescription怎么用?C++ BaseObject::GetDescription使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BaseObject
的用法示例。
在下文中一共展示了BaseObject::GetDescription方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdateGadgets
void UpdateGadgets(Bool relevants=false)
{
Int32 mode;
Bool add_dynamics;
GetBool(CHK_ADDDYNAMICS, add_dynamics);
GetInt32(CMB_MODE, mode);
BaseDocument* doc = GetActiveDocument();
BaseObject* op = doc ? doc->GetActiveObject() : nullptr;
Enable(EDT_MAXCONN, mode != CMB_MODE_CHAIN);
Enable(EDT_RADIUS, mode != CMB_MODE_CHAIN);
Enable(CHK_CLOSED, mode == CMB_MODE_CHAIN);
Enable(CHK_COMPOUND, add_dynamics);
// Need at least two child objects on the active object.
Bool execEnabled = op != nullptr && op->GetDown() != nullptr
&& op->GetDown()->GetNext() != nullptr;
Enable(BTN_EXECUTE, execEnabled);
if (relevants)
{
FreeChildren(CMB_TYPE);
Int32 pluginid;
GetInt32(CMB_FORCE, pluginid);
do {
BaseObject* op = BaseObject::Alloc(pluginid);
if (!op) break;
AutoFree<BaseObject> free(op);
AutoAlloc<Description> desc;
if (!op->GetDescription(desc, DESCFLAGS_DESC_0)) break;
BaseContainer temp;
AutoAlloc<AtomArray> arr;
const BaseContainer* param = desc->GetParameter(FORCE_TYPE, temp, arr);
if (!param) break;
const BaseContainer* cycle = param->GetContainerInstance(DESC_CYCLE);
if (!cycle) break;
const BaseContainer* icons = param->GetContainerInstance(DESC_CYCLEICONS);
Int32 i = 0;
Int32 last_id = -1;
while (true) {
Int32 id = cycle->GetIndexId(i++);
if (id == NOTOK) break;
Int32 icon = icons ? icons->GetInt32(id) : -1;
String name = cycle->GetString(id);
if (name.Content()) {
if (icon > 0) name += "&i" + String::IntToString(icon);
if (last_id < 0) last_id = id;
AddChild(CMB_TYPE, id, name);
}
}
SetInt32(CMB_TYPE, last_id);
} while (0);
LayoutChanged(CMB_TYPE);
}
}