zoukankan      html  css  js  c++  java
  • ActiveX control view HTML format files in X++

    ActiveX control view HTML format files in X++

    remark by Jimmy July 2th 2010

     

    LoadHtmlFile method

     

    boolean loadHtmlFile()
    {
        container   con;
    
        URL URL;
        ;
        element.lockWindowUpdate(true);
        if (docuRef.docuValue().File)
        {
            //file in database
            DocuFileWatchDog::create(); //update old files
    
            URL = DocuActionFile::saveTempFile(docuRef);
            htmlView.navigate(URL);
    
            DocuOpenFile::add(docuRef, URL);
            curUrl = URL;
            DocuFileWatchDog::createDelayed(); //ensure that watchdog is started
        }
        else
        {
            URL = docuRef.completeFilename();
            con = WinAPI::findFirstFile(URL);
            if (!conpeek(con, 2) && conpeek(con, 1) == -1)
                return false;
    
            htmlView.navigate(URL);
            curUrl = URL;
        }
    
        return true;
       element.lockWindowUpdate(false);
    }
    
    

    saveTempFile method

    static public Filename saveTempFile(DocuRef docuRef, boolean internetCache = true)
    {
        BinData     binData;
        Filename    filename;
        FilePath    filePath;
        str endSlash(str _str)
        {
            return (strscan(_str, '\\',strlen(_str),-1)) ? _str : _str + '\\';
        }
    ;
        binData = new BinData();
        binData.setData(docuRef.docuValue().file);
    
        filePath = endSlash(internetCache ? WinAPI::getFolderPath(#CSIDL_INTERNET_CACHE) : xInfo::directory(DirectoryType::Temp));
        filename = docuRef.completeFilename(filePath);
    
        binData.saveFile(filename);
    
        return  filename;
    }
    

     

    completeFilename method

     

    display Filename completeFilename(FilePath path = this.path())
    {
        ;
        if (this.docuType().TypeGroup == DocuTypeGroup::Note)
        {
            return '';
        }
    
        return path + this.docuValue().fileName();
    }
    
    

  • 相关阅读:
    师弟大喜之日,送上一幅对联 求横批
    漫画:Google 走了
    产品研发流程改进
    Outlook2010 Bug 一则
    Android 手机用户版本比例
    CDMA 短信中心号码
    UIM卡 PIN 码特点
    [Accessibility] Missing contentDescription attribute on image
    java打印函数的调用堆栈
    android中解析Json
  • 原文地址:https://www.cnblogs.com/Fandyx/p/1769654.html
Copyright © 2011-2022 走看看