1.uc1601 单按钮模态对话框
View Code
2.UF_UI_message_dialog 多按钮模态对话框
1 //来自“王牌飞行员_里海”的测试源码 2 extern DllExport void ufusr(char *param, int *returnCode, int rlen) 3 { 4 UF_initialize(); 5 int response = 0; 6 char title_string[] = "王牌飞行员_里海"; 7 char *sMessages = "多按钮模态对话框"; 8 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 9 UF_UI_message_buttons_s button; 10 button.button1 = true;//是否显示 11 button.button2 = true; 12 button.button3 = true; 13 button.label1 = "是";//按钮名 14 button.label2 = "否"; 15 button.label3 = "取消"; 16 button.response1 = 1;//返回值 17 button.response2 = 2; 18 button.response3 = 3; 19 UF_UI_message_dialog(title_string, dialog_type, &sMessages, 1, 0, &button, &response); 20 switch (response) 21 { 22 case 1: 23 uc1601(button.label1, 1); break; 24 case 2: 25 uc1601(button.label2, 1); break; 26 case 3: 27 uc1601(button.label3, 1); break; 28 default: 29 uc1601("未知按钮", 1); break; 30 } 31 UF_terminate(); 32 }
3.文件选择对话框
1 //来自“王牌飞行员_里海”的测试源码 2 extern DllExport void ufusr(char *param, int *returnCode, int rlen) 3 { 4 UF_initialize(); 5 //文件选择对话框 6 char sPromptStr[] = "部件选择对话框"; //快捷信息(在提示栏显示) 7 char sTitleStr[] = "部件选择对话框"; //对话框标题(如图) 8 char sFilterStr[] = ".prt"; //文件过滤器,即只处理某一种类型文件(如图) 9 char sDefaultStr[] = "*.prt"; //默认文件名(如图) 10 char sFilePath[256] = ""; //用户选择的文件全路径 11 int iRespones = 0; //函数返回值 12 UF_UI_create_filebox(sPromptStr, sTitleStr, sFilterStr, sDefaultStr, sFilePath, &iRespones); 13 uc1601(sFilePath, 1); 14 15 UF_terminate(); 16 }
原文:https://www.cnblogs.com/KMould/p/11965445.html