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();
    }
    
    

  • 相关阅读:
    189. go学习1
    [Access][Microsoft][ODBC 驱动程序管理器] 无效的字符串或缓冲区长度 Invalid string or buffer length
    聊聊我对 GraphQL 的一些认知
    gin 源码阅读(2)
    gin 源码阅读(1)
    自动化测试感悟——感悟10条
    Python转exe神器pyinstaller
    在用Python时遇到的坑
    Python BeautifulSoup库 常用方法
    DCDC反馈电路串联的电阻
  • 原文地址:https://www.cnblogs.com/Fandyx/p/1769654.html
Copyright © 2011-2022 走看看