多按钮模态对话框

 1     //多按钮模态对话框
 2     int response = 0;
 3     char title_string[] = "Cyan青蓝";
 4     char *sMessages = "心之所愿,无事不成";
 5     UF_UI_MESSAGE_DIALOG_TYPE dialog_type =
 6         //UF_UI_MESSAGE_QUESTION;//对话框类型
 7         UF_UI_MESSAGE_ERROR;
 8     //UF_UI_MESSAGE_WARNING;
 9     //UF_UI_MESSAGE_INFORMATION;
10 
11     UF_UI_message_buttons_s button;
12     button.button1 = true;//控制按钮的数量
13     button.button2 = true;//按钮好像就最多3个请自行测试
14     button.button3 = false;
15     button.label1 = "aaa";//按钮的名字
16     button.label2 = "bbb";
17     button.label3 = "ccc";
18     button.response1 = 1;//按钮的返回值
19     button.response2 = 2;
20     button.response3 = 3;
21     UF_UI_message_dialog(title_string, dialog_type, &sMessages, 1, 0, &button, &response);
22     switch (response)
23     {
24     case 1:uc1601(button.label1, 1); break;//显示所选按钮的名字
25     case 2:uc1601(button.label2, 1); break;
26     case 3:uc1601(button.label3, 1); break;
27     default:uc1601("未知按钮", 1); break;
28     }

转自https://www.ugapi.com/thread-10155.html

原文地址:https://www.cnblogs.com/liuxiaoqing1/p/12809706.html