zoukankan      html  css  js  c++  java
  • 动态添加图片控件例子

    void addPicBox()

    {

        FormWindowControl           c;

        QueryRun                    qr;

        DocuRef         tmpDocuRef;

        Image           tmpImage;

        int             i = 1;

        int             j, maxControl;

        container       tmpBitmap,picCon;

        nj_ItemPhotoTable   nj_ItemPhotoTable,ItemPhotoTable;

        DocuImgs       curDocuimgs;

        ;

        element.lock();

        maxControl = groupPics.controlCount(); //获取groupPics的控件数量

        picCon = connull();

        Select FirstOnly ItemPhotoTable Where ItemPhotoTable.ItemId == Pictorical.ItemId

            &&  ItemPhotoTable.Color == Pictorical.Color;

        qr = this.initQuery(ItemPhotoTable);

        while (qr.next())

        {

            if(qr.changed(tableNum(Docuimgs)))

            {

             curDocuimgs = qr.get(tablenum(Docuimgs));

            }

            tmpDocuRef = qr.get(tablenum(DocuRef));

            tmpBitmap = curDocuimgs.Image;

            if (connull() == tmpBitmap)

                continue;

            tmpImage = new Image();

            if (i > maxControl) //如果groupPics中已有windows控件

                {

                c = groupPics.addControl(FormControlType::Image, "RunTimeControl");

                c.labelPosition(1);

                c.labelAlignment(2);

                c.imagemode(2);

                controlCon += [c.id()];

                }

            else

                c = this.control(conpeek(controlCon,i));//获取这个控件

            c.visible(true);

            c.label(strfmt('%1', tmpDocuRef.Nj_PhotoView));// 图片类型(角度、平面、侧面。。。)

            tmpImage.setData(tmpBitmap);

            c.image(tmpImage);

            picCon += [c.id(), tmpDocuRef.RecId];

            i++;

            }

        for (j = i; j<=maxControl; j++)  //将多余的控件隐藏

            {

            c = this.control(conpeek(controlCon, j));

            c.visible(false);

            }

        this.controlMethodOverload(true);

        element.unLock();

        element.redraw();

    }

  • 相关阅读:
    Ubuntu换源
    如何查看已购买的office密钥
    python的模块放在哪里
    centos7不能启动网卡报No suitable device found for this connection错误
    搭建邮件服务器 使用Postfix与Dovecot
    SSH远程免密码的密钥登录服务(Linux,Linux)
    SSH服务搭建、账号密码登录远程Linux虚拟机、基于密钥的安全验证(Windows_Xshell,Linux)
    apache基础,apache环境搭建,apache的3种使用方式(IP、端口、域名)
    Linux vsftpd服务配置以及三种验证方式以及常见错误解决办法
    使用DHCP动态管理主机地址
  • 原文地址:https://www.cnblogs.com/perock/p/2119169.html
Copyright © 2011-2022 走看看