购买与咨询 NX 二次开发视频教程,请联系微信号:13890821008 QQ号:85585969
1.uc1601 单按钮模态对话框

//来自“王牌飞行员_里海”的测试源码(qq群753801561)
extern DllExport void ufusr(char *param, int *returnCode, int rlen)
{
UF_initialize();
uc1601("单选模态对话框!", 1);
UF_terminate();
}
2.UF_UI_message_dialog 多按钮模态对话框

//来自“王牌飞行员_里海”的测试源码(qq群753801561)
extern DllExport void ufusr(char *param, int *returnCode, int rlen)
{
UF_initialize();
int response = 0;
char title_string[] = "王牌飞行员_里海";
char *sMessages = "多按钮模态对话框";
UF_UI_MESSAGE_DIALOG_TYPE dialog_type = UF_UI_MESSAGE_QUESTION;//对话框类型 UF_UI_MESSAGE_ERROR,UF_UI_MESSAGE_WARNING,UF_UI_MESSAGE_INFORMATION,UF_UI_MESSAGE_QUESTION
UF_UI_message_buttons_s button;
button.button1 = true;//是否显示
button.button2 = true;
button.button3 = true;
button.label1 = "是";//按钮名
button.label2 = "否";
button.label3 = "取消";
button.response1 = 1;//返回值
button.response2 = 2;
button.response3 = 3;
UF_UI_message_dialog(title_string, dialog_type, &sMessages, 1, 0, &button, &response);
switch (response)
{
case 1:
uc1601(button.label1, 1); break;
case 2:
uc1601(button.label2, 1); break;
case 3:
uc1601(button.label3, 1); break;
default:
uc1601("未知按钮", 1); break;
}
UF_terminate();
}
3.文件选择对话框

//来自“王牌飞行员_里海”的测试源码(qq群753801561)
extern DllExport void ufusr(char *param, int *returnCode, int rlen)
{
UF_initialize();
//文件选择对话框
char sPromptStr[] = "部件选择对话框"; //快捷信息(在提示栏显示)
char sTitleStr[] = "部件选择对话框"; //对话框标题(如图)
char sFilterStr[] = ".prt"; //文件过滤器,即只处理某一种类型文件(如图)
char sDefaultStr[] = "*.prt"; //默认文件名(如图)
char sFilePath[256] = ""; //用户选择的文件全路径
int iRespones = 0; //函数返回值
UF_UI_create_filebox(sPromptStr, sTitleStr, sFilterStr, sDefaultStr, sFilePath, &iRespones);
uc1601(sFilePath, 1);
UF_terminate();
}
4.文件夹选择对话框


●●●请先
登陆 或
注册 后查看●●●