Exemple #1
0
void SListBox::LoadItemAttribute(pugi::xml_node xmlNode, LPLBITEM pItem)
{
    pItem->nImage=xmlNode.attribute(L"icon").as_int(pItem->nImage);
    pItem->lParam=xmlNode.attribute(L"data").as_uint(pItem->lParam);
    SStringW strText = tr(GETSTRING(xmlNode.attribute(L"text").value()));
    pItem->strText =  S_CW2T(strText);
}
Exemple #2
0
    LRESULT SSkinGif::OnAttrSrc( const SStringW &strValue,BOOL bLoading )
    {
        SStringTList strLst;
        size_t nSegs=ParseResID(S_CW2T(strValue),strLst);
        LPBYTE pBuf=NULL;
        size_t szBuf=0;

        if(nSegs == 2)
        {
            szBuf=GETRESPROVIDER->GetRawBufferSize(strLst[0],strLst[1]);
            if(szBuf)
            {
                pBuf=new BYTE[szBuf];
                GETRESPROVIDER->GetRawBuffer(strLst[0],strLst[1],pBuf,szBuf);
            }
        }else
        {//自动从GIF资源类型里查找资源
            szBuf=GETRESPROVIDER->GetRawBufferSize(_T("gif"),strLst[0]);
            if(szBuf)
            {
                pBuf=new BYTE[szBuf];
                GETRESPROVIDER->GetRawBuffer(_T("gif"),strLst[0],pBuf,szBuf);
            }
        }
        if(pBuf)
        {
            LoadFromMemory(pBuf,szBuf);
            delete []pBuf;
        }
        return S_OK;
    }
Exemple #3
0
bool SColorParser::ParseValue(const SStringW & strValue, COLORREF & value)
{
	int r = 255, g = 255, b = 255, a = 255;
    int nSeg=0;
    SStringW strValueL = strValue;
    strValueL.MakeLower();
    if(strValueL.Left(1)==L"#")
    {
        nSeg = swscanf(strValueL,L"#%02x%02x%02x%02x",&r,&g,&b,&a);
    }else if(strValueL.Left(4).CompareNoCase(L"rgba")==0)
    {
        nSeg = swscanf(strValueL,L"rgba(%d,%d,%d,%d)",&r,&g,&b,&a);                
    }else if(strValueL.Left(3).CompareNoCase(L"rgb")==0)
    {
        nSeg = swscanf(strValueL,L"rgb(%d,%d,%d)",&r,&g,&b);                
    }
    if(nSeg!=3 && nSeg != 4)
    {
        SASSERT_FMT(FALSE,TEXT("ParseColor Failed with [%s]"),S_CW2T(strValue));
        return false;
    }else
    {
        value = RGBA(r,g,b,a);
        return true;
    }
}
Exemple #4
0
void CFolderHander::OnBtnFileTypes(EventArgs *pEvt)
{
    SWindow *pBtn = sobj_cast<SWindow>(pEvt->sender);
    CRect rcBtn = pBtn->GetWindowRect();
    HWND hWnd = pBtn->GetContainer()->GetHostHwnd();
    ::ClientToScreen(hWnd,(LPPOINT)&rcBtn);
    ::ClientToScreen(hWnd,(LPPOINT)&rcBtn+1);

    SMenu menu;
    menu.LoadMenu(_T("menu_filetype"),_T("xml"));
    for(int i=0;i<(int)m_lstLangExts.GetCount();i++)
    {
        SStringW strDesc = m_lstLangExts[i].strLang+L":"+m_lstLangExts[i].strExts;
        menu.InsertMenu(i,MF_BYPOSITION,i+10,S_CW2T(strDesc),-1);
    }

    int id = menu.TrackPopupMenu(TPM_RIGHTALIGN|TPM_RETURNCMD,rcBtn.right,rcBtn.bottom,hWnd);
    if(id!=0)
    {
        id-=10;
        SEdit *pEdit = m_pFolderRoot->FindChildByName2<SEdit>(L"edit_filetypes");
        SASSERT(pEdit);
        if(pEdit->GetWindowTextLength()!=0)
        {
            pEdit->SetSel((DWORD)-1);
            pEdit->ReplaceSel(L";");            
        }
        pEdit->SetSel((DWORD)-1);
        pEdit->ReplaceSel(m_lstLangExts[id].strExts);
    }
}
Exemple #5
0
BOOL SApplication::Init( LPCTSTR pszName ,LPCTSTR pszType)
{
    SASSERT(m_RenderFactory);

    pugi::xml_document xmlDoc;
    if(!LOADXML(xmlDoc,pszName,pszType)) return FALSE;
    pugi::xml_node root=xmlDoc.child(L"UIDEF");
    if(!root) return FALSE;

    //set default font
    pugi::xml_node xmlFont;
    xmlFont=root.child(L"font");
    if(xmlFont)
    {
        int nSize=xmlFont.attribute(L"size").as_int(12);
        BYTE byCharset=(BYTE)xmlFont.attribute(L"charset").as_int(DEFAULT_CHARSET);
        SFontPool::getSingleton().SetDefaultFont(S_CW2T(xmlFont.attribute(L"face").value()),nSize,byCharset);
    }
    
    SStringPool::getSingleton().Init(root.child(L"string"));
    SNamedID::getSingleton().Init(root.child(L"id"));

    SSkinPool *pSkinPool = new SSkinPool;
    pSkinPool->LoadSkins(root.child(L"skin"));
    SSkinPoolMgr::getSingletonPtr()->PushSkinPool(pSkinPool);
    pSkinPool->Release();
    
    SStylePool *pStylePool = new SStylePool;
    pStylePool->Init(root.child(L"style"));
    SStylePoolMgr::getSingleton().PushStylePool(pStylePool);
    pStylePool->Release();
    
    SObjDefAttr::getSingleton().Init(root.child(L"objattr"));
    return TRUE;
}
Exemple #6
0
IFontPtr SFontPool::GetFont( const SStringW & strFont )
{
    FONTSTYLE fntStyle(0);
    fntStyle.byCharset = DEFAULT_CHARSET;
    
    SStringT strFace;                                         
    SStringT attr=S_CW2T(strFont);                           
    attr.MakeLower();                                         
    int nPosBegin=attr.Find(KFontFace);                     
    if(nPosBegin!=-1)                                         
    {                                                         
        nPosBegin+=LEN_FACE;                                             
        int nPosEnd=attr.Find(_T(";"),nPosBegin);
        if(nPosEnd==-1) nPosEnd=attr.Find(_T(","),nPosBegin);
        if(nPosEnd==-1) nPosEnd=attr.GetLength();
        strFace=attr.Mid(nPosBegin,nPosEnd-nPosBegin);
    }                                                         
    nPosBegin=attr.Find(KFontBold);                         
    if(nPosBegin!=-1)                                         
    {                                                         
        fntStyle.fBold=attr.Mid(nPosBegin+LEN_BOLD,1)!=KAttrFalse;                   
    }                                                         
    nPosBegin=attr.Find(KFontUnderline);                    
    if(nPosBegin!=-1)                                         
    {                                                         
        fntStyle.fUnderline=attr.Mid(nPosBegin+LEN_UNDERLINE,1)!=KAttrFalse;             
    }                                                         
    nPosBegin=attr.Find(KFontItalic);                       
    if(nPosBegin!=-1)                                         
    {                                                         
        fntStyle.fItalic=attr.Mid(nPosBegin+LEN_ITALIC,1)!=KAttrFalse;                 
    }                                                         
    nPosBegin=attr.Find(KFontStrike);                       
    if(nPosBegin!=-1)                                         
    {                                                         
        fntStyle.fStrike=attr.Mid(nPosBegin+LEN_STRIKE,1)!=KAttrFalse;                 
    }                                                         
    nPosBegin=attr.Find(KFontAdding);                       
    if(nPosBegin!=-1)                                         
    {                                                         
        fntStyle.cSize=(short)_ttoi((LPCTSTR)attr+nPosBegin+LEN_ADDING);           
    }else
    {
        nPosBegin=attr.Find(KFontSize);
        if(nPosBegin != -1)
        {
            fntStyle.cSize=(short)_ttoi((LPCTSTR)attr+nPosBegin+LEN_SIZE);
            fntStyle.fAbsSize=1;       
        }                       
    }
    
    //允许定义字符集
    nPosBegin = attr.Find(KFontCharset);
    if(nPosBegin!=-1)
    {
        fntStyle.byCharset = (BYTE)_ttoi((LPCTSTR)attr+nPosBegin+LEN_CHARSET);
    }
    return GetFont(fntStyle, strFace);
}
Exemple #7
0
 IBitmap * SResProviderMgr::LoadImage2(const SStringW & strImgID)
 {
     SStringT strImgID2 = S_CW2T(strImgID);
     SStringTList strLst;
     int nSegs = ParseResID(strImgID2,strLst);
     if(nSegs == 2) return LoadImage(strLst[0],strLst[1]);
     else return NULL;
 }
Exemple #8
0
HRESULT SButton::OnAttrAccel( SStringW strAccel,BOOL bLoading )
{
    SStringT strAccelT=S_CW2T(strAccel);
    m_accel=CAccelerator::TranslateAccelKey(strAccelT);
    if(m_accel)
    {
        CAccelerator acc(m_accel);
        GetContainer()->GetAcceleratorMgr()->RegisterAccelerator(acc,this);
        return S_OK;
    }
    return S_FALSE;
}
Exemple #9
0
void SMenu::InitMenuItemData(SMenuItemInfo & itemInfo, const SStringW & strTextW)
{
    itemInfo.strText=S_CW2T(TR(strTextW,m_menuAttr.m_strTrCtx));

    //查找快捷键
    int iHotKey = strTextW.Find(L"&");
    if(iHotKey != -1 && iHotKey < strTextW.GetLength()-1)
    {
        itemInfo.vHotKey = tolower(strTextW[iHotKey+1]);
    }else
    {
        itemInfo.vHotKey = 0;
    }
}
Exemple #10
0
BOOL CMainDlg::InitIndexList(LPCTSTR pszIndexFile)
{
	xml_document xmlDoc;
	if(!xmlDoc.load_file(pszIndexFile)) return FALSE;

	xml_node xmlNode=xmlDoc.child(L"resource");

	SListCtrl * pListFile=FindChildByName2<SListCtrl >(L"prj_list_file");

	pListFile->DeleteAllItems();

	m_strInitFile=_T("xml\\init.xml");

    int iItem=0;
    xml_node xmlType = xmlNode.first_child();
    while(xmlType)
    {
        SStringT strType=S_CW2T(xmlType.name());
        xml_node xmlFile = xmlType.child(L"file");
        while(xmlFile)
        {
            pListFile->InsertItem(iItem,strType);
            pListFile->SetSubItemText(iItem,1,S_CW2T(xmlFile.attribute(L"name").value()));
            pListFile->SetSubItemText(iItem,2,S_CW2T(xmlFile.attribute(L"path").value()));
            iItem++;
            xmlFile = xmlFile.next_sibling(L"file");
        }
        xmlType = xmlType.next_sibling();
    }
    
    xml_node xmlInit = xmlType.child(L"uidef");
    if(xmlInit)
    {
        m_strInitFile=S_CW2T(xmlInit.first_child().attribute(L"file").value());
    }
	return TRUE;
}
Exemple #11
0
 HICON SResProviderMgr::LoadIcon2(const SStringW & strIconID)
 {
     SStringT strIconID2 = S_CW2T(strIconID);
     SStringTList strLst;
     int nSegs = ParseResID(strIconID2,strLst);
     if(nSegs == 2)
     {
         int cx = _ttoi(strLst[1]);
         return LoadIcon(strLst[0],cx,cx);
     }
     else 
     {
         return LoadIcon(strLst[0]);
     }
 }
Exemple #12
0
void CFolderHander::InitDir( const SStringW & strDir,BOOL bInput/*=FALSE */)
{
    DWORD attr = GetFileAttributesW(strDir);
    if(attr==INVALID_FILE_ATTRIBUTES) return ;
    if((attr & FILE_ATTRIBUTE_DIRECTORY) == 0) return;
    if(strDir == m_strDir) return;

    if(!bInput)
    {
        m_pFolderRoot->FindChildByName(L"edit_dir")->SetWindowText(S_CW2T(strDir));
    }
    m_strDir = strDir;
    m_pDirTree->RemoveAllItems();
    HSTREEITEM hRoot = m_pDirTree->InsertItem(_T("root"),0,1);
    InitDirTree(hRoot,m_strDir);
    m_pDirTree->SetCheckState(hRoot,TRUE);
}
Exemple #13
0
	BOOL SComboBox::CreateListBox( pugi::xml_node xmlNode )
	{
		SASSERT(xmlNode);
		//创建列表控件
		pugi::xml_node listStyle = xmlNode.child(L"listStyle");
		SStringW strListClass = listStyle.attribute(L"wndclass").as_string(SListBox::GetClassName());
		m_pListBox=sobj_cast<SListBox>(SApplication::getSingleton().CreateWindowByName(strListClass));
		SASSERT(m_pListBox);

		m_pListBox->SetContainer(GetContainer());
		m_pListBox->InitFromXml(listStyle);
		m_pListBox->SetAttribute(L"pos", L"0,0,-0,-0", TRUE);
		m_pListBox->SetAttribute(L"hotTrack",L"1",TRUE);
		m_pListBox->SetOwner(this);    //chain notify message to combobox
		m_pListBox->SetID(IDC_DROPDOWN_LIST);
        m_pListBox->SSendMessage(UM_SETSCALE, GetScale());

		//初始化列表数据
		pugi::xml_node xmlNode_Items=xmlNode.child(L"items");
		if(xmlNode_Items)
		{
			pugi::xml_node xmlNode_Item=xmlNode_Items.child(L"item");
			while(xmlNode_Item)
			{

				SStringW strText=xmlNode_Item.attribute(L"text").value();
				int iIcon=xmlNode_Item.attribute(L"icon").as_int(0);
				LPARAM lParam=xmlNode_Item.attribute(L"data").as_int(0);
				m_pListBox->AddString(S_CW2T(strText),iIcon,lParam);
				xmlNode_Item=xmlNode_Item.next_sibling(L"item");
			}
		}

		if(m_iInitSel!=-1)
		{
			SetCurSel(m_iInitSel);
		}
		return TRUE;
	}
Exemple #14
0
void CFolderHander::InitDirTree(HSTREEITEM hTreeItem,const SStringW & strPath)
{
    WIN32_FIND_DATAW fd;
    SStringW strFind = strPath + L"\\*.*";
    HANDLE hFind=FindFirstFileW(strFind,&fd);
    if(hFind != INVALID_HANDLE_VALUE)
    {
        while(FindNextFileW(hFind,&fd))
        {
            if(fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY
                && !(fd.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN))
            {
                SStringW strName= fd.cFileName;
                if(strName != L"." && strName != L"..")
                {
                    HSTREEITEM hItem = m_pDirTree->InsertItem(S_CW2T(strName),0,1,hTreeItem);
                    InitDirTree(hItem,strPath + L"\\" + strName);
                }
            }
        }
        FindClose(hFind);
    }
}
Exemple #15
0
    BOOL SMessageBoxImpl::OnInitDialog( HWND wnd, LPARAM lInitParam )
    {
        pugi::xml_node uiRoot=s_xmlMsgTemplate.child(L"SOUI");
        
        InitFromXml(uiRoot);
        UINT uType = s_MsgBoxInfo.uType&0x0F;

        STabCtrl *pBtnSwitch= FindChildByName2<STabCtrl>(NAME_MSGBOX_BTNSWITCH);
        SASSERT(pBtnSwitch);
        pBtnSwitch->SetCurSel(g_msgBtnText[uType].nBtns-1);
        SWindow *pBtnPanel=pBtnSwitch->GetItem(g_msgBtnText[uType].nBtns-1);
        SASSERT(pBtnPanel);
        
        pugi::xml_node nodeBtnTxt = s_xmlMsgTemplate.child(L"SOUI").child(L"buttonText");
        for(int i=0; i<g_msgBtnText[uType].nBtns; i++)
        {
            SWindow *pBtn=pBtnPanel->FindChildByName(g_wcsNameOfBtns[i]);
            int nID =  g_msgBtnText[uType].btnInfo[i].uBtnID;
            pBtn->SetID(nID);
            
            SStringT strText = OnGetButtonText(nID);
            if(strText.IsEmpty())
            {
                const wchar_t *pBtnText = g_msgBtnText[uType].btnInfo[i].szText;
                //先从模板中的buttonText节点里查按钮的文字
                pugi::xml_node nodeTxt = nodeBtnTxt.child(pBtnText);
                if(nodeTxt) pBtnText=nodeTxt.text().get();
                //从翻译引擎中翻译
                strText = S_CW2T(TR(pBtnText,GetTranslatorContext()));    
            }
            pBtn->SetWindowText(strText);
        }
        
        const wchar_t *pszFrameAttr=uiRoot.attribute(L"frameSize").value();
        CRect rcFrame;
        swscanf(pszFrameAttr,L"%d,%d,%d,%d",&rcFrame.left,&rcFrame.top,&rcFrame.right,&rcFrame.bottom);
        CSize szMin;
        const wchar_t *pszMinAttr=uiRoot.attribute(L"minSize").value();
        swscanf(pszMinAttr,L"%d,%d",&szMin.cx,&szMin.cy);

        SWindow * pTitle= FindChildByName(NAME_MSGBOX_TITLE);
        SASSERT(pTitle);
        pTitle->SetWindowText(S_CW2T(TR(s_MsgBoxInfo.pszCaption?S_CT2W(s_MsgBoxInfo.pszCaption):L"prompt",GetTranslatorContext())));

        SWindow * pMsg= FindChildByName(NAME_MSGBOX_TEXT);
        SASSERT(pMsg);
        pMsg->SetWindowText(S_CW2T(TR(S_CT2W(s_MsgBoxInfo.pszText),GetTranslatorContext())));

        OnSetIcon(s_MsgBoxInfo.uType);
        pMsg->GetRoot()->UpdateLayout();
        
        CSize szText = pMsg->GetDesiredSize(NULL);

        CRect rcText = pMsg->GetWindowRect();//获取msg的左边位置
        
        CSize szWnd;
        szWnd.cx=max(szMin.cx,rcText.left + szText.cx + rcFrame.right);
        szWnd.cy=max(szMin.cy,rcFrame.top + szText.cy + rcFrame.bottom);
        
        SetWindowPos(0,0,0,szWnd.cx,szWnd.cy,SWP_NOMOVE|SWP_NOACTIVATE|SWP_NOZORDER);   
        pMsg->GetRoot()->UpdateLayout();
        //将msg text的上下位置设置成和parent相同。
        rcText = pMsg->GetWindowRect();
        CRect rcTextParent = pMsg->GetParent()->GetWindowRect();
        rcText.top = rcTextParent.top;
        rcText.bottom = rcTextParent.bottom;
        pMsg->Move(rcText);
        
        CenterWindow();
        return 0;
    }
void CCodeLineCounterHandler::OnBtnGo()
{
    if(m_strDir.IsEmpty())
    {
        SMessageBox(m_pPageRoot->GetContainer()->GetHostHwnd(),_T("没有指定扫描目录"),_T("错误"),MB_OK|MB_ICONSTOP);
        return;
    }
    SStringT strTypes = m_pPageRoot->FindChildByName(L"edit_filetypes")->GetWindowText();
    SStringWList lstTypes;
    SplitString(S_CT2W(strTypes),L';',lstTypes);
    CODECFGMAP cfg;
    for(UINT i=0;i<lstTypes.GetCount();i++)
    {
        CODECFGMAP::CPair *pPair = m_mapCodeCfg.Lookup(lstTypes[i]);
        if(!pPair) continue;
        cfg[lstTypes[i]] = pPair->m_value;
    }
    if(cfg.IsEmpty())
    {
        SMessageBox(m_pPageRoot->GetContainer()->GetHostHwnd(),_T("没有指定文件类型或者类型无效"),_T("错误"),MB_OK|MB_ICONSTOP);
        return;
    }

    //获得文件列表,计每个目标文件的文件大小
    HSTREEITEM hRoot = m_pDirTree->GetRootItem();
    SList<FILEINFO> lstFileInfo;
    int nDirs = 1;
    DWORD szAll = EnumFileInfo(cfg,m_strDir,hRoot,lstFileInfo,nDirs);
    if(lstFileInfo.GetCount() == 0)
    {
        SMessageBox(m_pPageRoot->GetContainer()->GetHostHwnd(),_T("指定的目录下没有找到满足条件的文件类型"),_T("提示"),MB_OK|MB_ICONINFORMATION);
        return;
    }

    //SWindow *pPageResult = m_pPageRoot->FindChildByName(L"page_dir");   
    SSplitWnd_Row *pSplitTree = m_pPageRoot->FindChildByName2<SSplitWnd_Row>(L"split_tree");
    pSplitTree->ShowPane(1);

    SProgress *pProgBar = pSplitTree->FindChildByName2<SProgress>(L"prog_run");
    pProgBar->SetRange(0,szAll);
    pProgBar->SetValue(0);

    CLineInfo lineInfoAll;

    SMap<SStringW,CLineInfo> mapLineInfo;
    for(UINT i=0;i<lstTypes.GetCount();i++)
    {
        mapLineInfo[lstTypes[i]] = CLineInfo();
    }

    //统计代码行
    DWORD dwProg = 0;
    SPOSITION pos = lstFileInfo.GetHeadPosition();
    while(pos)
    {
        FILEINFO fi = lstFileInfo.GetNext(pos);

        CLineInfo lineInfo;
        CountCodeLines(S_CW2T(fi.strFileName),fi.cfg,lineInfo.nCodeLines,lineInfo.nRemarkLines,lineInfo.nBlankLines);
        lineInfoAll += lineInfo;
        mapLineInfo[fi.cfg.strExt] += lineInfo;

        dwProg += fi.dwSize;
        pProgBar->SetValue(dwProg);
        pProgBar->UpdateWindow();
    }

    pSplitTree->HidePane(1);
    STabCtrl *pTab = m_pPageRoot->FindChildByName2<STabCtrl>(L"tab_codeline");
    pTab->SetCurSel(1);
    SWindow *pWndRes = pTab->GetPage(_T("page_result"),FALSE);
    pWndRes->FindChildByName(L"txt_folders")->SetWindowText(SStringT().Format(_T("%d"),nDirs));
    pWndRes->FindChildByName(L"txt_files")->SetWindowText(SStringT().Format(_T("%d"),lstFileInfo.GetCount()));
    pWndRes->FindChildByName(L"txt_codelines")->SetWindowText(SStringT().Format(_T("%d"),lineInfoAll.nCodeLines));
    pWndRes->FindChildByName(L"txt_blanklines")->SetWindowText(SStringT().Format(_T("%d"),lineInfoAll.nBlankLines));
    pWndRes->FindChildByName(L"txt_remarklines")->SetWindowText(SStringT().Format(_T("%d"),lineInfoAll.nRemarkLines));

    SListCtrl *plstReport = pWndRes->FindChildByName2<SListCtrl>(L"lst_linecounter_report");
    plstReport->DeleteAllItems();
    for(UINT i=0;i<lstTypes.GetCount();i++)
    {
        CCodeConfig codeCfg = cfg[lstTypes[i]];
        CLineInfo lineInfo = mapLineInfo[lstTypes[i]];

        plstReport->InsertItem(i,S_CW2T(codeCfg.strType));
        plstReport->SetSubItemText(i,1,S_CW2T(codeCfg.strExt));
        plstReport->SetSubItemText(i,2,SStringT().Format(_T("%d"),lineInfo.nCodeLines));
        plstReport->SetSubItemText(i,3,SStringT().Format(_T("%d"),lineInfo.nBlankLines));
        plstReport->SetSubItemText(i,4,SStringT().Format(_T("%d"),lineInfo.nRemarkLines));
    }
}
Exemple #17
0
void CMainDlg::InitSkinList()
{
	SListCtrl * pListSkin=FindChildByName2<SListCtrl >(L"prj_list_skin");

	ClearSkinList();

	//加载skin
	xml_document xmlInit;
	if(xmlInit.load_file(m_strPrjPath+m_strInitFile))
	{
		xml_node xmlNode=xmlInit.first_child().child(L"skin");
		if(xmlNode)
		{
			int iItem=0;
			xmlNode=xmlNode.first_child();
			while(xmlNode)
			{
				SkinInfo *pSkinInfo=new SkinInfo;
				pSkinInfo->strType=S_CW2T(xmlNode.name());
				pSkinInfo->strName=S_CW2T(xmlNode.attribute(L"name").value());
				pSkinInfo->strSrc=S_CW2T(xmlNode.attribute(L"src").value());

				if(pSkinInfo->strType==_T("imglist"))
				{
					pSkinInfo->bTile=xmlNode.attribute(L"tile").as_bool(false);
					pSkinInfo->bVertical=xmlNode.attribute(L"vertical").as_bool(false);
					pSkinInfo->nState=xmlNode.attribute(L"states").as_int(1);
				}

				if(pSkinInfo->strType==_T("imgframe"))
				{
					pSkinInfo->bTile=xmlNode.attribute(L"tile").as_bool(false);
					pSkinInfo->bVertical=xmlNode.attribute(L"vertical").as_bool(false);
					pSkinInfo->nState=xmlNode.attribute(L"states").as_int(1);

					pSkinInfo->rcMargin.left=xmlNode.attribute(L"left").as_int(0);
					pSkinInfo->rcMargin.right=xmlNode.attribute(L"right").as_int(-1);
					pSkinInfo->rcMargin.top=xmlNode.attribute(L"top").as_int(0);
					pSkinInfo->rcMargin.bottom=xmlNode.attribute(L"bottom").as_int(-1);
					if(pSkinInfo->rcMargin.right == -1) pSkinInfo->rcMargin.right=pSkinInfo->rcMargin.left;
					if(pSkinInfo->rcMargin.bottom == -1) pSkinInfo->rcMargin.bottom=pSkinInfo->rcMargin.top;
				}

				if(pSkinInfo->strType==_T("button"))
				{
					pSkinInfo->crBorder=Hex2Color(xmlNode.attribute(L"border").value(),0);
					pSkinInfo->crUp[0]=Hex2Color(xmlNode.attribute(L"bgup").value(),0);
					pSkinInfo->crUp[1]=Hex2Color(xmlNode.attribute(L"bguphover").value(),0);
					pSkinInfo->crUp[2]=Hex2Color(xmlNode.attribute(L"bguppush").value(),0);
					pSkinInfo->crUp[3]=Hex2Color(xmlNode.attribute(L"bgupdisable").value(),0);
					pSkinInfo->crDown[0]=Hex2Color(xmlNode.attribute(L"bgdown").value(),0);
					pSkinInfo->crDown[1]=Hex2Color(xmlNode.attribute(L"bgdownhover").value(),0);
					pSkinInfo->crDown[2]=Hex2Color(xmlNode.attribute(L"bgdownpush").value(),0);
					pSkinInfo->crDown[3]=Hex2Color(xmlNode.attribute(L"bgdowndisable").value(),0);
				}
				
				if(pSkinInfo->strType==_T("gradation"))
				{
					pSkinInfo->cr1=Hex2Color(xmlNode.attribute(L"from").value(),0);
					pSkinInfo->cr2=Hex2Color(xmlNode.attribute(L"to").value(),0);
					pSkinInfo->dir=wcscmp(L"vert",xmlNode.attribute(L"dir").value())==0;
				}

				pListSkin->InsertItem(iItem,pSkinInfo->strType);
				pListSkin->SetSubItemText(iItem,1,pSkinInfo->strName);
				pListSkin->SetSubItemText(iItem,2,pSkinInfo->strSrc);

				pListSkin->SetItemData(iItem,(DWORD)pSkinInfo);

				iItem++;
				xmlNode=xmlNode.next_sibling();
			}
		}
	}
}