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

  • 相关阅读:
    反编译
    字符编码集格式
    BZOJ 1032 [JSOI2007]祖码Zuma
    2015-7-21 模板练习
    2015-7-20 模板练习
    BZOJ 1028 [JSOI2007]麻将
    BZOJ 1027 [JSOI2007]合金
    BZOJ 1026 [SCOI2009]windy数
    BZOJ 1025 [SCOI2009]游戏
    COJ 2024 仙境传奇(五)——一个天才的觉醒 素数筛
  • 原文地址:https://www.cnblogs.com/Fandyx/p/1769654.html
Copyright © 2011-2022 走看看