CBlueUI  
C++ 跨平台跨框架的数据可视化工具
载入中...
搜索中...
未找到
多语言支持

§. 1. Python

  • 模块下载
  • 测试脚本例子。 pyCBlueUI.pyd放在同级目录下。demo已包含下面的脚本
    # -*- coding: utf-8 -*-
    import os
    import time
    import sys
    import platform
    import argparse
    import subprocess
    import shutil
    import random
    import pyCBlueUI # 这是导入CBlueUI for Python 扩展模块。
    #python事件处理函数
    def do_something() :
    #获得控件对象
    ui_title = pyCBlueUI.FindControl("title", None)
    #更新文本
    ui_title.ShellAttribute("text", " this is form python code")
    #刷新控件
    ui_title.Refresh()
    return 1
    # main
    if __name__=="__main__":
    os.system('')
    cur_dir = os.path.abspath('.')
    cur_dir = cur_dir.replace('\\','/')
    #初始化CBlueUI系统
    pyCBlueUI.InitializeUISystem()
    #控件管理器
    manager = pyCBlueUI.UIManager()
    #宿主窗口
    dlg = pyCBlueUI.WindowPlatform()
    dlg.CreatePlatform(None, "PyCBlueUI Demo", pyCBlueUI.WIDGET_VISIBLE | pyCBlueUI.WIDGET_RESIZABLE, 0,0,100,100)
    #将窗口管理器和宿主窗口连接
    dlg.InitPlatformAdapter(manager)
    #全局资源文件
    res_file = os.path.join(cur_dir, "image_def.xml")
    pyCBlueUI.XmlBuilder.ApplyResourceWithFile(res_file, pyCBlueUI.Format_Auto)
    #主界面解析
    main_xml_file = os.path.join(cur_dir, "Install.xml")
    build_tool = pyCBlueUI.XmlBuilder()
    build_tool.LoadUIFileA(main_xml_file, manager, None)
    #窗口居中
    dlg.CenterWindow()
    #获得控件对象
    ui_desk = pyCBlueUI.FindControl("btnInstall", None)
    if ui_desk != None:
    str_ids = ui_desk.VarName()
    # 为控件绑定事件函数
    ui_desk.BindAction(do_something)
    dlg.DoModal(False)
    cur_time = time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(time.time()))
    print("\033[33m** test pyCBlueUI with pybind11 finished. update time:{}\033[0m".format(cur_time))

  • 效果展示 demo中使用python更改窗口左上角的标题文本

§. 2. WebAssembly

  • WebAssembly 代码在不同平台上能够以接近本地速度运行。
  • 模块下载
    • cblueui-for-wasm-20250619.zip
    • 将文件解压之后,得到下图所示文件。将这些文件拷贝到你自己的web服务根目录中。即可访问。
    • 官方同样提供在线效果预览。 在线例子中加载资源时间大约为5分钟左右(小型服务器传输带宽有限) WebAssembly在线例子:CBlueUI Example For WebAssembly

§. 3. 其它语言-积极适配中

  • 计划中。请耐心等候。感谢您的持续关注。
鄂公网安备42018502007752 鄂ICP备2024082886
Copyright © 2025 · CBlueStudio 版权所有