Warning: file(datafile/online) [function.file]: failed to open stream: No such file or directory in /home/all2one/public_html/bbs/topic.php on line 200
阳光精品论坛 > 『 CAD 专栏 』 > [二次开发] display message dialog
 
欢迎您,客人:高级登录 | 注册 | 取回密码 新贴 | 发帖 | 会员 | 搜索 | 帮助

阳光精品论坛 >> 『 CAD 专栏 』 >> [二次开发] display message dialog本主题已阅读1531次,回复0
发表一个新主题 回复贴子
批量引用回复把本贴加入论坛收藏夹向管理员报告帖子问题
作者 | 本页主题: [二次开发] display message dialog 上一个主题:这样的曲面大家见过没 下一个主题:VSS一步扫出作品演示  
even2004 

 
 究级天王 [荣誉]
信息:坛主标志 该用户目前离线
来自:未填 align=absmiddle
发贴:1239 贴 查找所有我发的帖子
积分:244
货币:5814 阳光币
注册时间:2008/12/31
 查看会员个人资料资料 将其加入好友列表好友 发短信息消息 引用回复这个贴子引用直接回复贴子回复

[二次开发] display message dialog


#include <stdio.h>
#include <string.h>

#include <uf.h>
#include <uf_ui.h>
#include <uf_object_types.h>

#define UF_CALL(X) (report_error( __FILE__, __LINE__, #X, (X)))

static int report_error( char *file, int line, char *call, int irc)
{
   if (irc)
   {
       char err[133],
            msg[133];

       sprintf(msg, "*** ERROR code %d at line %d in %s:n+++ ",
           irc, line, file);
       UF_get_fail_message(irc, err);

   /*  NOTE:  UF_print_syslog is new in V18 */

       UF_print_syslog(msg, FALSE);
       UF_print_syslog(err, FALSE);
       UF_print_syslog("n", FALSE);
       UF_print_syslog(call, FALSE);
       UF_print_syslog(";n", FALSE);

       if (!UF_UI_open_listing_window())
       {
           UF_UI_write_listing_window(msg);
           UF_UI_write_listing_window(err);
           UF_UI_write_listing_window("n");
           UF_UI_write_listing_window(call);
           UF_UI_write_listing_window(";n");
       }
   }

   return(irc);
}

#define WRITE_D(X) (write_integer_to_listing_window(#X, X))

static void write_integer_to_listing_window(char *title, int n)
{
   char
       msg[MAX_LINE_SIZE+1];

   UF_CALL(UF_UI_open_listing_window());
   sprintf(msg, "%s = %dn", title, n);
   UF_CALL(UF_UI_write_listing_window(msg));
}

static void do_it(void)
{
   int
       response = 0;
   char
       *messages[3] = { "Message One", "Message Two", "Message Three" };
     
   UF_UI_message_buttons_t
       buttons;
           
   buttons.button1 = TRUE; /* OK button */
   buttons.button2 = TRUE; /* BACK button */
   buttons.button3 = TRUE; /* CANCEL button */
   
   buttons.label1 = "MY_OK";
   buttons.label2 = "MY_BACK"
   buttons.label3 = NULL;   /* will use the default value */

   buttons.response1 = 2;
   buttons.response2 = 4;
   buttons.response3 = 6;
           
   UF_CALL( UF_UI_message_dialog( "My Dialog Title"
                                  UF_UI_MESSAGE_INFORMATION,
                                  messages, 3, FALSE,
                                  &buttons, &response ));

   WRITE_D( response );
}

/*ARGSUSED*/
void ufusr(char *param, int *retcode, int paramLen)
{
   if (UF_CALL(UF_initialize())) return;
   do_it();
   UF_terminate();
}

int ufusr_ask_unload(void)
{
   return (UF_UNLOAD_IMMEDIATELY);
}


修改贴子编辑 |  发表于 2009/10/15/08:37  |  1 层 

发表一个新主题 回复贴子 推荐给朋友 可打印版本 文章模式 
论坛跳转:


  快速回复  

文章内容:

HTML 代码不可用


BMB代码选项:
[img] - 开启
[flash] - 开启
[size] - 开启

上传附件[还可传0个]:
开启

最大字节: 200000 字节
最少发帖: 20 篇

标题:


  [使用 Ctrl+Enter 直接提交贴子]

你的用户名  你的密码: 忘了密码?

阳光精品论坛 >> 『 CAD 专栏 』 >> [二次开发] display message dialog本主题已阅读1531次,回复0



本论坛言论纯属发表者个人意见,与 阳光精品论坛 立场无关 联系我们
Powered by BMForum v5.0 Skin by Bob Shen