當前位置: 首頁>>代碼示例>>C++>>正文


C++ GetItemIndex函數代碼示例

本文整理匯總了C++中GetItemIndex函數的典型用法代碼示例。如果您正苦於以下問題:C++ GetItemIndex函數的具體用法?C++ GetItemIndex怎麽用?C++ GetItemIndex使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了GetItemIndex函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: GetItemIndex

BOOL CDropListBox::Expand(PLIST_ITEM pItem)
{
	int i, nPos, nParentPos = GetItemIndex(pItem);
	ASSERT(nParentPos >= 0);
	if(nParentPos < 0 || pItem->GetChildCount() <= 0)
	{
		return FALSE;
	}
	for(i = pItem->GetChildCount() - 1; i >= 0; i--)
	{
		PLIST_ITEM pChild = pItem->GetChildAt(i);
		ASSERT(pChild);

		nPos = GetItemIndex(pChild);
		//already in the listbox
		if(nPos >= 0)
		{
			continue;
		}
		
		InsertListItem(nParentPos + 1, pChild);
	}

	pItem->state &= ~ACBIS_COLLAPSED;
	return TRUE;
}
開發者ID:killbug2004,項目名稱:cosps,代碼行數:26,代碼來源:DropListBox.cpp

示例2: Plugin_Redraw

void WINAPI duListBox::OnMouseLDown(POINT pt)
{
	if (m_pHotItem != m_pSelItem)
	{
		ListBoxItem *pTemp = m_pSelItem;
		m_pSelItem = m_pHotItem;
		Plugin_Redraw(this, TRUE);

		int nOldSelItemIndex = GetItemIndex(pTemp);
		int nNewSelItemIndex = GetItemIndex(m_pHotItem);
		NotifyUser(DUM_LBSELCHANGED, (WPARAM)nOldSelItemIndex, (LPARAM)nNewSelItemIndex);
	}
}
開發者ID:blueantst,項目名稱:dulib,代碼行數:13,代碼來源:duListBox.cpp

示例3: __HasItem

bool CPythonPlayer::__HasItem(DWORD dwItemID)
{
	for (int i = 0; i < c_Inventory_Count; ++i)
	{
		if (dwItemID == GetItemIndex(TItemPos (INVENTORY, i)))
			return true;
	}
	for (int i = 0; i < c_DragonSoul_Inventory_Count; ++i)
	{
		if (dwItemID == GetItemIndex(TItemPos (DRAGON_SOUL_INVENTORY, i)))
			return true;
	}

	return false;
}
開發者ID:adi97ida,項目名稱:Client,代碼行數:15,代碼來源:PythonPlayerSkill.cpp

示例4: wxASSERT

void CQueueViewBase::RefreshItem(const CQueueItem* pItem)
{
	wxASSERT(pItem);
	int index = GetItemIndex(pItem);

	wxListCtrl::RefreshItem(index);
}
開發者ID:idgaf,項目名稱:FileZilla3,代碼行數:7,代碼來源:queue.cpp

示例5: GetItemIndex

bool TabBox::Remove(Control* pControl)
{
	if( pControl == NULL) return false;

	int index = GetItemIndex(pControl);
	bool ret = Box::Remove(pControl);
	if( !ret ) return false;

	if( m_iCurSel == index)	{
		if( GetCount() > 0 ) {
			m_iCurSel=0;
			if (!IsFadeSwitch()) {
				GetItemAt(m_iCurSel)->SetVisible(true);
			}

			pControl->SetMouseEnabled(true);
			if (Box* box = dynamic_cast<Box*>(pControl)) {
				box->SetMouseChildEnabled(true);
			}
			pControl->SetAlpha(255);
		}
		else
			m_iCurSel=-1;

		ArrangeAncestor();
	}
	else if( m_iCurSel > index ) {
		m_iCurSel -= 1;
	}

	return ret;
}
開發者ID:arlen7772gg,項目名稱:NIM_Duilib_Framework,代碼行數:32,代碼來源:TabBox.cpp

示例6: GetItemIndex

void CFX_ListCtrl::OnMouseMove(const CPDF_Point & point,FX_BOOL bShift,FX_BOOL bCtrl)
{
	int32_t nHitIndex = GetItemIndex(point);

	if (IsMultipleSel())
	{
		if (bCtrl)
		{
			if (m_bCtrlSel)
				m_aSelItems.Add(m_nFootIndex,nHitIndex);
			else
				m_aSelItems.Sub(m_nFootIndex,nHitIndex);

			SelectItems();
		}
		else
		{
			m_aSelItems.DeselectAll();
			m_aSelItems.Add(m_nFootIndex,nHitIndex);
			SelectItems();
		}

		SetCaret(nHitIndex);
	}
	else
	{
		SetSingleSelect(nHitIndex);
	}

	if (!IsItemVisible(nHitIndex))
		ScrollToListItem(nHitIndex);
}
開發者ID:abbro-ca,項目名稱:pdfium,代碼行數:32,代碼來源:fxet_list.cpp

示例7: SetItemSelected

void cUIMenu::TrySelect( cUIControl * Ctrl, bool Up ) {
	if ( mItems.size() ) {
		if ( !Ctrl->IsType( UI_TYPE_SEPARATOR ) ) {
			SetItemSelected( Ctrl );
		} else {
			Uint32 Index = GetItemIndex( Ctrl );

			if ( Index != eeINDEX_NOT_FOUND ) {
				if ( Up ) {
					if ( Index > 0 ) {
						for ( Int32 i = (Int32)Index - 1; i >= 0; i-- ) {
							if ( !mItems[i]->IsType( UI_TYPE_SEPARATOR ) ) {
								SetItemSelected( mItems[i] );
								return;
							}
						}
					}

					SetItemSelected( mItems[ mItems.size() ] );
				} else {
					for ( Uint32 i = Index + 1; i < mItems.size(); i++ ) {
						if ( !mItems[i]->IsType( UI_TYPE_SEPARATOR ) ) {
							SetItemSelected( mItems[i] );
							return;
						}
					}

					SetItemSelected( mItems[0] );
				}
			}
		}
	}
}
開發者ID:dogtwelve,項目名稱:eepp,代碼行數:33,代碼來源:cuimenu.cpp

示例8: GetItemIndex

	BOOL CTabLayoutUI::Remove(CControlUI* pControl)
	{
		if( pControl == NULL) return FALSE;

		int index = GetItemIndex(pControl);
		BOOL ret = CContainerUI::Remove(pControl);
		if( !ret ) return FALSE;

		if( m_iCurSel == index)
		{
			if( GetCount() > 0 )
			{
				m_iCurSel=0;
				GetItemAt(m_iCurSel)->SetVisible(TRUE);
			}
			else
				m_iCurSel=-1;
			NeedParentUpdate();
		}
		else if( m_iCurSel > index )
		{
			m_iCurSel -= 1;
		}

		return ret;
	}
開發者ID:deathmemory,項目名稱:zhaigj,代碼行數:26,代碼來源:UITabLayout.cpp

示例9: GetItemIndex

	bool CTabLayoutUI::Remove(CControlUI* pControl)
	{
		if (pControl == NULL) return false;

		int index = GetItemIndex(pControl);
		bool ret = CContainerUI::Remove(pControl);
		if( !ret ) return false;

		if (m_nCurSel == index)
		{
			if (GetCount() > 0)
			{
				m_nCurSel=0;
				GetItemAt(m_nCurSel)->SetVisible(true);
			}
			else m_nCurSel=-1;
			NeedParentUpdate();
		}
		else if (m_nCurSel > index)
		{
			m_nCurSel -= 1;
		}

		return ret;
	}
開發者ID:Zhuguoping,項目名稱:ui,代碼行數:25,代碼來源:UITabLayout.cpp

示例10: GetItemIndex

void WINAPI duListBox::OnMouseHover(POINT pt)
{
	if (m_pHotItem)
	{
		int nHotItemIndex = GetItemIndex(m_pHotItem);
		NotifyUser(DUM_LBHOVER, (WPARAM)nHotItemIndex, NULL);
	}
}
開發者ID:blueantst,項目名稱:dulib,代碼行數:8,代碼來源:duListBox.cpp

示例11: GetItemIndex

int32_t CFX_ListCtrl::GetTopItem() const {
  int32_t nItemIndex = GetItemIndex(GetBTPoint());

  if (!IsItemVisible(nItemIndex) && IsItemVisible(nItemIndex + 1))
    nItemIndex += 1;

  return nItemIndex;
}
開發者ID:MIPS,項目名稱:external-pdfium,代碼行數:8,代碼來源:fxet_list.cpp

示例12: SelectItem

	bool CTabLayoutUI::SelectItem(CControlUI* pControl, bool bTriggerEvent)
	{
		int iIndex=GetItemIndex(pControl);
		if (iIndex==-1)
			return false;
		else
			return SelectItem(iIndex, bTriggerEvent);
	}
開發者ID:CharZhou,項目名稱:duilib,代碼行數:8,代碼來源:UITabLayout.cpp

示例13: SelectItem

	BOOL CTabLayoutUI::SelectItem( CControlUI* pControl )
	{
		int iIndex=GetItemIndex(pControl);
		if (iIndex==-1)
			return FALSE;
		else
			return SelectItem(iIndex);
	}
開發者ID:deathmemory,項目名稱:zhaigj,代碼行數:8,代碼來源:UITabLayout.cpp

示例14: GetItemIndex

// 設置tab頁的可見性(根據tab名字)
void CDuiTabCtrl::SetItemVisible(CString strTabName, BOOL bVisible)
{
	int nItem = GetItemIndex(strTabName);
	if(nItem != -1)
	{
		SetItemVisible(nItem, bVisible);
	}
}
開發者ID:anchowee,項目名稱:DuiVision,代碼行數:9,代碼來源:DuiTab.cpp

示例15: GetItemIndex

void CFeedIcoItemListCtrl::RemoveFeed(CRssFeed & feed)
{
	int nIndex = GetItemIndex(&feed);

	m_stringMatcher.RemoveItem((void*)&feed);

	RemoveItemforMap(feed, nIndex);

	DeleteItem(nIndex);
}
開發者ID:techpub,項目名稱:archive-code,代碼行數:10,代碼來源:FeedIcoItemListCtrl.cpp


注:本文中的GetItemIndex函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。