コード例 #1
0
ファイル: UIOption.cpp プロジェクト: CharZhou/duilib
	void COptionUI::Selected(bool bSelected, bool bTriggerEvent)
	{
		if( m_bSelected == bSelected ) return;
		m_bSelected = bSelected;
		if( m_bSelected ) m_uButtonState |= UISTATE_SELECTED;
		else m_uButtonState &= ~UISTATE_SELECTED;

		if( m_pManager != NULL ) {
			if( !m_sGroupName.IsEmpty() ) {
				if( m_bSelected ) {
					CStdPtrArray* aOptionGroup = m_pManager->GetOptionGroup(m_sGroupName);
					for( int i = 0; i < aOptionGroup->GetSize(); i++ ) {
						COptionUI* pControl = static_cast<COptionUI*>(aOptionGroup->GetAt(i));
						if( pControl != this ) {
							pControl->Selected(false, bTriggerEvent);
						}
					}
					if (bTriggerEvent) m_pManager->SendNotify(this, DUI_MSGTYPE_SELECTCHANGED);
				}
			}
			else {
				if (bTriggerEvent) m_pManager->SendNotify(this, DUI_MSGTYPE_SELECTCHANGED);
			}
		}

		Invalidate();
	}
コード例 #2
0
ファイル: SysButton.cpp プロジェクト: asdlei00/duilib-1
void CSysOptionUI::Selected()
{
	if(!m_pWnd){
		m_bSelected = true;
		return;
	}

	if(IsSelected()) return;

	::SendMessage(*m_pWnd, BM_SETCHECK, BST_CHECKED, 0);

	if( m_pManager != NULL ) {
		if( !m_sGroupName.IsEmpty() ) {
			if( true ) {
				CStdPtrArray* aOptionGroup = m_pManager->GetOptionGroup(m_sGroupName);
				for( int i = 0; i < aOptionGroup->GetSize(); i++ ) {
					auto pControl = static_cast<CSysOptionUI*>(aOptionGroup->GetAt(i));
					if( pControl != this && pControl->m_pWnd) {
						::SendMessage(pControl->m_pWnd->GetHWND(), BM_SETCHECK, BST_UNCHECKED, 0);
					}
				}
				m_pManager->SendNotify(this, DUI_MSGTYPE_SELECTCHANGED);
			}
		}
		else {
			m_pManager->SendNotify(this, DUI_MSGTYPE_SELECTCHANGED);
		}
	}
}
コード例 #3
0
ファイル: UIBase.cpp プロジェクト: achellies/DimenBuilder
CStdPtrArray::CStdPtrArray(const CStdPtrArray& src) : m_ppVoid(NULL), m_nCount(0), m_nAllocated(0)
{
	for(int i=0; i<src.GetSize(); i++)
		Add(src.GetAt(i));
}