Esempio n. 1
0
void YSongListItemUI::DoPaint(HDC hDC, const RECT& rcPaint)
{
	if( !::IntersectRect(&m_rcPaint, &rcPaint, &m_rcItem) ) return;
	ASSERT(GetOwner());

// 	spSongInfoT spSong = thePlayCenter->GetCurrentPlayingSong();
// 	int nCurPlayListLocalId = thePlayCenter->GetListIndex();
	spSongInfoT spSong = thePlayListMgr->GetCurSong();
	spPlayListInfoT spList = thePlayListMgr->GetCurList();
	if (spSong&&*spSong==*_spSongInfo&&spList&&spList->GetLocalId()==((CListUI*)GetOwner())->GetTag())
	{
		if (SongItemExpHeight != GetFixedHeight())
		{
			SetFixedHeight(SongItemExpHeight);
			_pNormalLayout->SetVisible(false);
			_pPushLayout->SetVisible(true);
			if (_spSongInfo)
			{
				_pPushDownLoad->SetVisible(!_spSongInfo->IsLocal());
				_pPushShare->SetVisible(!_spSongInfo->IsLocal());
			}
		}
		TListInfoUI* pInfo = m_pOwner->GetListInfo();
		if(pInfo)
		{
			DWORD dwSelBkColor = ((CListUI*)GetOwner())->GetSelectedItemBkColor();

			SetBkColor(dwSelBkColor);
		}
		ChangeIcon(thePlayer->GetStatus());
	}
	else
	{
		if (IsSelected() && ((CListUI*)GetOwner())->GetSelCount() == 1)
		{
			_pPushLayout->SetVisible(false);
			_pNormalLayout->SetVisible(true);
//			_pNorButtonMenu->SetVisible(true);

		}else
		{
			_pPushLayout->SetVisible(false);
			_pNormalLayout->SetVisible(true);
//			_pNorButtonMenu->SetVisible(false);
		}
		if(SongItemHeight != GetFixedHeight())
			SetFixedHeight(SongItemHeight);
		
		ChangeIcon(em_stop);
	}
	int nIndex = ((CListUI*)GetOwner())->GetItemIndex(this);
	_pNorLabelIndex->SetText(mci::ToString(nIndex+1));
	_pPushLabelIndex->SetText(mci::ToString(nIndex+1));

	

	__super::DoPaint(hDC,rcPaint);
}
Esempio n. 2
0
	void CMenuElementUI::SetLineType()
	{
		m_bDrawLine = true;
		if (GetFixedHeight() == 0 || GetFixedHeight() == ITEM_DEFAULT_HEIGHT )
			SetFixedHeight(DEFAULT_LINE_HEIGHT);

		SetMouseChildEnabled(false);
		SetMouseEnabled(false);
		SetEnabled(false);
	}
Esempio n. 3
0
	//************************************
	// 函数名称: CTreeNodeUI
	// 返回类型: 
	// 参数信息: CTreeNodeUI * _ParentNode
	// 函数说明: 
	//************************************
	CTreeNodeUI::CTreeNodeUI( CTreeNodeUI* _ParentNode /*= NULL*/ )
	{
		m_dwItemTextColor		= 0x00000000;
		m_dwItemHotTextColor	= 0;
		m_dwSelItemTextColor	= 0;
		m_dwSelItemHotTextColor	= 0;

		pTreeView		= NULL;
		m_bIsVisable	= true;
		m_bIsCheckBox	= false;
		pParentTreeNode	= NULL;

		pHoriz			= new CHorizontalLayoutUI();
		pFolderButton	= new CCheckBoxUI();
		pDottedLine		= new CLabelUI();
		pCheckBox		= new CCheckBoxUI();
		pItemButton		= new COptionUI();

		this->SetFixedHeight(18);
		//this->SetFixedWidth(250);
		pFolderButton->SetFixedWidth(GetFixedHeight());
		pDottedLine->SetFixedWidth(2);
		pCheckBox->SetFixedWidth(GetFixedHeight());
		pItemButton->SetAttribute(_T("align"),_T("left"));

		pDottedLine->SetVisible(false);
		pCheckBox->SetVisible(false);
		pItemButton->SetMouseEnabled(false);

		if(_ParentNode)
		{
			if (_tcsicmp(_ParentNode->GetClass(), _T("TreeNodeUI")) != 0)
				return;

			pDottedLine->SetVisible(_ParentNode->IsVisible());
			pDottedLine->SetFixedWidth(_ParentNode->GetDottedLine()->GetFixedWidth()+16);
			this->SetParentNode(_ParentNode);
		}

		pHoriz->Add(pDottedLine);
		pHoriz->Add(pFolderButton);
		pHoriz->Add(pCheckBox);
		pHoriz->Add(pItemButton);
		Add(pHoriz);
	}
Esempio n. 4
0
void CSysButtonUI::DoInit()
{
	m_pWnd = new CSysButtonWnd;
	m_pWnd->Init(this);
	SetEnabled(IsEnabled());
	SetVisible(IsVisible());
	SetFont(GetFont());
	SetText(GetText());
	::SetWindowPos(*m_pWnd,0,0,0,GetFixedWidth(),GetFixedHeight(),SWP_NOMOVE|SWP_NOZORDER);
}