NX9+VS2012
public:
void SetBlockUIShow();
void EnumInt::SetBlockUIShow()
{
//获取枚举控件
PropertyList* EnumProps = enum0->GetProperties();
int EnumValue = EnumProps->GetEnum("Value");
delete EnumProps;
EnumProps = NULL;
//得到ini类型值
//条件判断,当枚举为下拉第一个时显示哪些控件
if ( EnumValue == 0 )
{
face_select0->SetShow(true);
bodySelect0->SetShow(false);
}
else
{
face_select0->SetShow(false);
bodySelect0->SetShow(true);
}
}
//使用方法
将自己写的函数SetBlockUIShow();加到如下地方:
1.dialogShow里
void EnumInt::dialogShown_cb()
{
try
{
//---- Enter your callback code here -----
SetBlockUIShow();//此处
}
catch(exception& ex)
{
//---- Enter your exception handling code here -----
EnumInt::theUI->NXMessageBox()->Show("Block Styler", NXOpen::NXMessageBox::DialogTypeError, ex.what());
}
}
2.update_cb里的枚举控件下
int EnumInt::update_cb(NXOpen::BlockStyler::UIBlock* block)
{
try
{
if(block == enum0)
{
//---------Enter your code here-----------
SetBlockUIShow();//此处
}
2018年11月25日
Caesar卢尚宇
[email protected]
//设置名字
enum0->SetLabel("选择");
//设置控件变灰色
enum0->SetEnable(false);
//设置控件是否显示
enum0->SetShow(true);
2018年11月25日
Caesar卢尚宇
[email protected]