• 初遇Citymaker (十六)


    弹窗控制器

    • 调用
    • let config={
    • url: "C:\\Program Files (x86)\\CityMaker 7\\CityMaker SDK\\Samples\\JS\\beginner\\HTMLWindow\\Introdution.html"
    • }
    • cw5.popUtils.popHtml(config);
    • popUtils

    ```javascirpt
    import { cw5 } from "../index.js";
    export const popUtils= {};
    let labelArr={};
    //弹出HTML
    popUtils.popHtml=function(obj) {
    let wp = cw5.__g.htmlWindow.createWindowParam();
    wp.filePath = obj.url
    wp.sizeX = obj.sizeX||630;
    wp.sizeY = obj.sizeY||370;
    wp.offsetX = obj.offsetX||182;
    wp.offsetY = obj.offsetY||180;
    wp.hastitle =obj.hastitle||false;
    wp.round = obj.round||50;
    wp.winId =obj.winId|| 1;
    wp.minButtonVisible=obj.minButtonVisible||false;
    wp.transparence =obj.transparence|| 200;
    wp.isPopupWindow =obj.isPopupWindow|| false;
    wp.hideOnClick = obj.hideOnClick||false
    wp.resizable=obj.resizable||false
    cw5.__g.htmlWindow.setWindowParam(wp);
    }

    popUtils.closeHTML=function(winId){
    cw5.__g.htmlWindow.deletePopupWindow(winId)
    }

    //弹出标签
    popUtils.popLabel=function(contentObj,obj) {
    // 创建一个TableLabel
    let length= Object.getOwnPropertyNames(contentObj).length;
    let tableLabel = cw5.__g.objectManager.createTableLabel(length, 2, cw5.rootId);
    // 设定表头文字
    tableLabel.titleText =obj.title||"";
    let index=0;
    for (var prop in contentObj) {
    tableLabel.setRecord(index, 0,prop);
    tableLabel.setRecord(index, 1, contentObj[prop]);
    index++
    }

    let position = cw5.__g.new_Vector3;
    let point = cw5.__g.geometryFactory.createPoint(gviVertexAttribute.gviVertexAttributeZ);
    //标牌的位置
    position.set(obj.x, obj.y, obj.z);
    point.position = position;
    tableLabel.position = point;

    // 列宽度
    // tableLabel.setColumnWidth(0, obj.keyWidth||80);
    // tableLabel.setColumnWidth(1, obj.valueWidth||80);

    // 表的边框颜色
    if(obj.borderColor!=null){
    tableLabel.borderColor =obj.borderColor;
    }
    else {
    tableLabel.borderColor =cw5.innerUtils.getColor(1,"#111e42")
    }

    // 表的边框的宽度
    if(obj.borderWidth!=null){
    tableLabel.borderWidth =obj.borderWidth;
    }
    else {
    tableLabel.borderWidth =2
    }

    // 表的背景色
    if(obj.tableColor!=null){

  • 相关阅读:
    一天搞懂深度学习--深度学习简介
    Ubuntu16.04下安装Hive
    Ubuntu16.04下安装Hadoop
    Hive入门学习--HIve简介
    循环神经网络(RNN)--学习笔记
    如何使用GitHub
    python pandas import 失败
    Azure ARM VM内部关机了,但门户却显示虚拟机还在处在“正在运行”的状态
    Exchange 2010 与 RMS(集成权限管理服务)集成
    统计 Exchange 2010 时间段收发邮件总量
  • 原文地址:https://www.cnblogs.com/haibalai/p/15837880.html
Copyright © 2020-2023  润新知