zoukankan      html  css  js  c++  java
  • VC MakeUp 操作XML

    VC6.0,MFC

    链接地址:/Files/pbreak/Markup.rar

    代码示例:

     

    代码
    void CTestView::OnDraw(CDC* pDC)
    {
        CDocument* pDoc = GetDocument();
        CMarkup xml;
        
    if!xml.Load(theApp.m_sAppPath + _T("\\config.xml")) )
            
    return;
        CFont font;
        SetBkMode(pDC->m_hDC,TRANSPARENT);
        font.CreatePointFont(110,"宋体",NULL);
        CFont *pOldFont = pDC->SelectObject(&font);
        
        CString currentString = _T(""),heightString = _T(""),colorString = _T("");
        
    int posX = 10 , posY = 5;
        CSize sizeofdata;
        
    //加载页面数据
        while ( xml.FindChildElem(m_sheet) )
        {
            xml.IntoElem();
            
    while (xml.FindChildElem("LINE"))
            {
                posX = 10;
                xml.IntoElem();
                heightString = xml.GetAttrib(_T("HEIGHT"));
                
    int height = atoi(heightString); 
                posY += height;
                colorString = xml.GetAttrib(_T("COLOR"));
                
    while (xml.FindChildElem("TEXT"))
                {
                   currentString = xml.GetChildData();
                   pDC->TextOut(posX ,posY,currentString);
                   sizeofdata = pDC->GetTextExtent(currentString);
                   posX +=  sizeofdata.cx;
                }
                posY += sizeofdata.cy;
                xml.OutOfElem();
            }
        }
    }
  • 相关阅读:
    redis 3 通用指令
    查看表索引
    truncate的用法
    Java(0)_ 安装jdk
    Java(9)_ 集合(3)
    Java(10)_File&递归&字节流
    Java(8)_ 集合(2)
    Appium+python的单元测试框架unittest(3)——discover
    Appium+python的单元测试框架unittest(2)——fixtures
    爬楼梯
  • 原文地址:https://www.cnblogs.com/pbreak/p/1855449.html
Copyright © 2011-2022 走看看