本文整理汇总了C++中GetItemByIndex函数的典型用法代码示例。如果您正苦于以下问题:C++ GetItemByIndex函数的具体用法?C++ GetItemByIndex怎么用?C++ GetItemByIndex使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetItemByIndex函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: TRACEST
void InfoProviderFactory::SaveSettings()
{
TRACEST(_T("InfoProviderFactory::SaveSettings."));
if (m_pAppSettings != NULL)
{
INT idx = 0;
IInfoProvider* ip = GetItemByIndex(idx);
while (ip != NULL)
{
LPCTSTR ipName = ip->GetModuleInfo(IInfoProvider::IPI_Name);
IConfigurable::SettingInfo setting;
INT setIdx = 0;
while (ip->GetSettingInfo(setIdx, setting))
{
if (setting.type == IConfigurable::COVT_LPCTSTR)
m_pAppSettings->Write(ipName, setting.name, ip->GetLPCTSTRSetting(setIdx));
else
m_pAppSettings->Write(ipName, setting.name, ip->GetIntSetting(setIdx));
setIdx++;
}
idx++;
ip = GetItemByIndex(idx);
}
}
}
开发者ID:KurzedMetal,项目名称:Jaangle,代码行数:26,代码来源:InfoProviderFactory.cpp
示例2: entArmor
/* ================== */
int
entArmor(edict_t * ent)
{
gitem_t *item;
int index , iCells, iArmor;
int power_armor_type;
power_armor_type = PowerArmorType(ent);
if (power_armor_type) {
iCells = ent->client->pers.inventory[ITEM_INDEX(FindItem("cells"))];
if (iCells == 0) { /* ran out of cells for power armor */
ent->flags &= ~FL_POWER_ARMOR;
power_armor_type = 0;;
}
}
index = ArmorIndex(ent);
if (power_armor_type && (!index || (level.framenum & 8)))
iArmor = iCells;
else if (index) {
item = GetItemByIndex(index);
iArmor = ent->client->pers.inventory[index];
} else
iArmor = 0;
return iArmor;
}
开发者ID:ZwS,项目名称:qudos,代码行数:27,代码来源:p_hud.c
示例3: GetItemByIndex
BOOL CSkinTabCtrl::SetItemBack(int nIndex, LPCTSTR lpNormal,
LPCTSTR lpHighlight, LPCTSTR lpDown, CONST LPRECT lprcNinePart)
{
CSkinTabCtrlItem * lpItem = GetItemByIndex(nIndex);
if (NULL == lpItem)
return FALSE;
RenderEngine->RemoveImage(lpItem->m_lpBgImgN);
RenderEngine->RemoveImage(lpItem->m_lpBgImgH);
RenderEngine->RemoveImage(lpItem->m_lpBgImgD);
lpItem->m_lpBgImgN = RenderEngine->GetImage(lpNormal);
lpItem->m_lpBgImgH = RenderEngine->GetImage(lpHighlight);
lpItem->m_lpBgImgD = RenderEngine->GetImage(lpDown);
if (lpItem->m_lpBgImgN != NULL)
lpItem->m_lpBgImgN->SetNinePart(lprcNinePart);
if (lpItem->m_lpBgImgH != NULL)
lpItem->m_lpBgImgH->SetNinePart(lprcNinePart);
if (lpItem->m_lpBgImgD != NULL)
lpItem->m_lpBgImgD->SetNinePart(lprcNinePart);
if ((lpNormal != NULL && NULL == lpItem->m_lpBgImgN) ||
(lpHighlight != NULL && NULL == lpItem->m_lpBgImgH) ||
(lpDown != NULL && NULL == lpItem->m_lpBgImgD))
return FALSE;
else
return TRUE;
}
开发者ID:HuugY,项目名称:MFC_Project,代码行数:31,代码来源:SkinTabCtrl.cpp
示例4: NS_ENSURE_ARG_POINTER
NS_IMETHODIMP
nsXFormsSelectableAccessible::IsChildSelected(PRInt32 aIndex,
PRBool *aIsSelected)
{
NS_ENSURE_ARG_POINTER(aIsSelected);
*aIsSelected = PR_FALSE;
nsCOMPtr<nsIDOMNode> item = GetItemByIndex(&aIndex);
if (!item)
return NS_OK;
nsresult rv;
if (mIsSelect1Element) {
nsCOMPtr<nsIDOMNode> selitem;
rv = sXFormsService->GetSelectedItemForSelect1(mDOMNode,
getter_AddRefs(selitem));
NS_ENSURE_SUCCESS(rv, rv);
if (selitem == item)
*aIsSelected = PR_TRUE;
return NS_OK;
}
return sXFormsService->IsSelectItemSelected(mDOMNode, item, aIsSelected);
}
开发者ID:MozillaOnline,项目名称:gecko-dev,代码行数:25,代码来源:nsXFormsAccessible.cpp
示例5: if
nsIContent*
nsXFormsSelectableAccessible::GetItemByIndex(PRUint32* aIndex,
nsAccessible* aAccessible)
{
nsAccessible* accessible = aAccessible ? aAccessible : this;
PRInt32 childCount = accessible->GetChildCount();
for (PRInt32 childIdx = 0; childIdx < childCount; childIdx++) {
nsAccessible *child = accessible->GetChildAt(childIdx);
nsIContent* childContent = child->GetContent();
nsINodeInfo *nodeInfo = childContent->NodeInfo();
if (nodeInfo->NamespaceEquals(NS_LITERAL_STRING(NS_NAMESPACE_XFORMS))) {
if (nodeInfo->Equals(nsAccessibilityAtoms::item)) {
if (!*aIndex)
return childContent;
--*aIndex;
} else if (nodeInfo->Equals(nsAccessibilityAtoms::choices)) {
nsIContent* itemContent = GetItemByIndex(aIndex, child);
if (itemContent)
return itemContent;
}
}
}
return nsnull;
}
开发者ID:gorakhargosh,项目名称:mozilla-central,代码行数:26,代码来源:nsXFormsAccessible.cpp
示例6: GetItemByIndex
/***********************************************************************************
**
** RegroupItem
**
***********************************************************************************/
void TreeViewModel::RegroupItem(INT32 pos)
{
TreeViewModelItem* item = GetItemByIndex(pos);
if (!GetTreeModelGrouping() || !GetTreeModelGrouping()->HasGrouping() || !item)
return;
while(item->GetParentItem() && !item->GetParentItem()->IsHeader())
item = item->GetParentItem();
TreeViewModelItem* parent = static_cast<TreeViewModelItem*>(GetTreeModelGrouping()->GetGroupHeader(GetTreeModelGrouping()->GetGroupForItem(item)));
// Don't regroup in some cases, to avoid "thread jumping" (DSK-350587) '
// eg when a thread must move to another group because an item in the thread was removed (painful to understand what's happening for the user)
// the thread will be in the correct group when the whole tree is regrouped
if (parent && parent->GetID() < item->GetParentItem()->GetID())
return;
if(parent && parent != item->GetParentItem())
{
if (!parent->IsOpen() && (IsEmptyGroup(parent) || m_view->GetSelectedItemPos() == pos))
{
m_view->OpenItemRecursively(parent->GetIndex(), TRUE, FALSE);
}
Move(item->GetIndex(), parent->GetIndex(), -1);
if (GetSortListener())
ResortItem(item->GetIndex());
}
}
开发者ID:prestocore,项目名称:browser,代码行数:35,代码来源:TreeViewModel.cpp
示例7: GetItemByIndex
BOOL CSkinToolBar::SetItemRightBgPic(int nIndex, LPCTSTR lpHighlight,
LPCTSTR lpDown, CONST LPRECT lprcNinePart)
{
CSkinToolBarItem * lpItem = GetItemByIndex(nIndex);
if (NULL == lpItem)
return FALSE;
RenderEngine->RemoveImage(lpItem->m_lpRightH);
RenderEngine->RemoveImage(lpItem->m_lpRightD);
lpItem->m_lpRightH = RenderEngine->GetImage(lpHighlight);
lpItem->m_lpRightD = RenderEngine->GetImage(lpDown);
if (lpItem->m_lpRightH != NULL)
lpItem->m_lpRightH->SetNinePart(lprcNinePart);
if (lpItem->m_lpRightD != NULL)
lpItem->m_lpRightD->SetNinePart(lprcNinePart);
if ((lpHighlight != NULL && NULL == lpItem->m_lpRightH) ||
(lpDown != NULL && NULL == lpItem->m_lpRightD))
return FALSE;
else
return TRUE;
}
开发者ID:HuugY,项目名称:MFC_Project,代码行数:25,代码来源:SkinToolBar.cpp
示例8: GetItemByIndex
// Returns the number value an the give array index
double JSON::GetArrayNumber(int index)
{
if (Type == JSON_Array)
{
JSON* number = GetItemByIndex(index);
return number ? number->dValue : 0.0;
}
return 0;
}
开发者ID:ArthurTorrente,项目名称:4A_Anim_Numerique_Genetic_Algorithm,代码行数:11,代码来源:OVR_JSON.cpp
示例9: HitTest
void CSkinToolBar::OnLButtonUp(UINT nFlags, CPoint point)
{
HWND hWnd = ::GetCapture();
if (m_hWnd == hWnd)
::ReleaseCapture();
int nIndex = HitTest(point);
BOOL bClicked;
if (nIndex != -1 && nIndex == m_nPressIndex)
bClicked = TRUE;
else
bClicked = FALSE;
if (m_nPressIndex != -1)
{
m_nPressIndex = -1;
Invalidate(FALSE);
}
if (bClicked)
{
CSkinToolBarItem * lpItem = GetItemByIndex(nIndex);
if (lpItem != NULL)
{
CRect rcItem;
GetItemRectByIndex(m_nPressIndex, rcItem);
CRect rcLeft, rcRight;
BOOL bClickLorR = FALSE;
if (lpItem->m_dwStyle & STBI_STYLE_DROPDOWN ||
lpItem->m_dwStyle & STBI_STYLE_WHOLEDROPDOWN)
{
rcLeft = rcItem;
rcLeft.right = rcLeft.left + lpItem->m_nLeftWidth;
rcRight = rcItem;
rcRight.left += lpItem->m_nLeftWidth;
rcRight.right = rcRight.left + lpItem->m_nRightWidth;
if (rcLeft.PtInRect(point))
bClickLorR = TRUE;
if (rcRight.PtInRect(point))
bClickLorR = FALSE;
}
if ((!(lpItem->m_dwStyle & STBI_STYLE_WHOLEDROPDOWN))
|| (lpItem->m_dwStyle & STBI_STYLE_DROPDOWN && bClickLorR && bClickLorR == m_bPressLorR))
::SendMessage(::GetParent(m_hWnd), WM_COMMAND, MAKEWPARAM(lpItem->m_nID, BN_CLICKED), 0);
}
}
__super::OnLButtonUp(nFlags, point);
}
开发者ID:HuugY,项目名称:MFC_Project,代码行数:55,代码来源:SkinToolBar.cpp
示例10: while
IInfoProvider* InfoProviderFactory::CreateInfoProviderByService(IInfoProvider::ServiceEnum service)
{
INT idx = 0;
IInfoProvider* pIP = NULL;
while ((pIP = GetItemByIndex(idx)) != NULL)
{
if (pIP->CanHandle(service))
return CreateInfoProviderByUniqueID(pIP->GetModuleInfo(IInfoProvider::IPI_UniqueID));
idx++;
}
return NULL;
}
开发者ID:KurzedMetal,项目名称:Jaangle,代码行数:12,代码来源:InfoProviderFactory.cpp
示例11: SetFocus
void CSkinTabCtrl::OnLButtonDown(UINT nFlags, CPoint point)
{
SetFocus();
int nIndex = HitTest(point);
if (nIndex != -1)
{
if (nIndex != m_nSelIndex)
{
m_nSelIndex = nIndex;
Invalidate(FALSE);
NMHDR nmhdr = {m_hWnd, GetDlgCtrlID(), TCN_SELCHANGE};
::SendMessage(::GetParent(m_hWnd), WM_NOTIFY, GetDlgCtrlID(), (LPARAM)&nmhdr);
}
else
{
CSkinTabCtrlItem * lpItem = GetItemByIndex(nIndex);
if (lpItem != NULL && lpItem->m_dwStyle & STCI_STYLE_DROPDOWN)
{
CRect rcItem;
GetItemRectByIndex(nIndex, rcItem);
CRect rcArrow;
rcArrow.left = rcItem.left+lpItem->m_nLeftWidth;
rcArrow.right = rcArrow.left + lpItem->m_nRightWidth;
rcArrow.top = rcItem.top;
rcArrow.bottom = rcItem.bottom;
if (rcArrow.PtInRect(point))
m_bPressArrow = TRUE;
else
m_bPressArrow = FALSE;
if (m_bPressArrow)
{
Invalidate(FALSE);
NMHDR nmhdr = {0};
nmhdr.hwndFrom = m_hWnd;
nmhdr.idFrom = GetDlgCtrlID();
nmhdr.code = TCN_DROPDOWN;
::SendMessage(::GetParent(m_hWnd), WM_NOTIFY, GetDlgCtrlID(), (LPARAM)&nmhdr);
m_bPressArrow = FALSE;
Invalidate(FALSE);
}
}
}
}
__super::OnLButtonDown(nFlags, point);
}
开发者ID:HuugY,项目名称:MFC_Project,代码行数:53,代码来源:SkinTabCtrl.cpp
示例12: GetItemByIndex
NS_IMETHODIMP
nsXFormsSelectableAccessible::AddChildToSelection(PRInt32 aIndex)
{
nsCOMPtr<nsIDOMNode> item = GetItemByIndex(&aIndex);
if (!item)
return NS_OK;
if (mIsSelect1Element)
return sXFormsService->SetSelectedItemForSelect1(mDOMNode, item);
return sXFormsService->AddItemToSelectionForSelect(mDOMNode, item);
}
开发者ID:MozillaOnline,项目名称:gecko-dev,代码行数:12,代码来源:nsXFormsAccessible.cpp
示例13: TrackMouseLeave
void CSkinTabCtrl::OnMouseMove(UINT nFlags, CPoint point)
{
if (!m_bMouseTracking)
{
TrackMouseLeave(GetSafeHwnd());
m_bMouseTracking = TRUE;
}
int nIndex;
nIndex = HitTest(point);
if (nIndex != -1)
{
CSkinTabCtrlItem * lpItem = GetItemByIndex(nIndex);
if (lpItem != NULL)
{
CRect rcItem;
GetItemRectByIndex(nIndex, rcItem);
if (nIndex != m_nHoverIndex && lpItem->m_strToolTipText.GetLength() > 0)
{
if (!m_ToolTipCtrl.GetSafeHwnd())
{
m_ToolTipCtrl.Create(this);
m_ToolTipCtrl.SetMaxTipWidth(200);
}
if (m_ToolTipCtrl.GetSafeHwnd())
{
if (m_ToolTipCtrl.GetToolCount() <= 0)
{
m_ToolTipCtrl.Activate(TRUE);
m_ToolTipCtrl.AddTool(this, lpItem->m_strToolTipText.GetBuffer(), &rcItem, 1);
}
else
{
m_ToolTipCtrl.Activate(TRUE);
m_ToolTipCtrl.UpdateTipText(lpItem->m_strToolTipText.GetBuffer(), this, 1);
m_ToolTipCtrl.SetToolRect(this, 1, &rcItem);
}
}
}
}
}
if (nIndex != m_nHoverIndex)
{
m_nHoverIndex = nIndex;
Invalidate();
}
__super::OnMouseMove(nFlags, point);
}
开发者ID:HuugY,项目名称:MFC_Project,代码行数:53,代码来源:SkinTabCtrl.cpp
示例14: GetItemByPath
void GroupsModel::OnFolderRenamed(UINT16 account_id, const OpStringC& old_path, const OpStringC& new_path)
{
if (account_id != m_account_id)
return;
INT32 pos = GetItemByPath(old_path);
if (pos == -1)
return;
GroupsModelItem* item = GetItemByIndex(pos);
item->SetPath(new_path);
item->Change();
}
开发者ID:prestocore,项目名称:browser,代码行数:13,代码来源:groupsmodel.cpp
示例15: switch
BOOL CChatSelector::OnCommand(WPARAM wParam, LPARAM lParam)
{
switch (wParam) {
case MP_DETAIL:{
const CChatItem* ci = GetItemByIndex(m_iContextIndex);
if (ci) {
CClientDetailDialog dialog(ci->client);
dialog.DoModal();
}
return TRUE;
}
case MP_ADDFRIEND:{
const CChatItem* ci = GetItemByIndex(m_iContextIndex);
if (ci) {
CFriend* fr = theApp.friendlist->SearchFriend(ci->client->GetUserHash(), 0, 0);
if (!fr)
theApp.friendlist->AddFriend(ci->client);
}
return TRUE;
}
case MP_REMOVEFRIEND:{
const CChatItem* ci = GetItemByIndex(m_iContextIndex);
if (ci) {
CFriend* fr = theApp.friendlist->SearchFriend(ci->client->GetUserHash(), 0, 0);
if (fr)
theApp.friendlist->RemoveFriend(fr);
}
return TRUE;
}
case MP_REMOVE:{
const CChatItem* ci = GetItemByIndex(m_iContextIndex);
if (ci)
EndSession(ci->client);
return TRUE;
}
}
return CClosableTabCtrl::OnCommand(wParam, lParam);
}
开发者ID:HackLinux,项目名称:eMule-Mirror,代码行数:38,代码来源:ChatSelector.cpp
示例16: GetAccessibleChildIndex
int TreeViewModel::GetAccessibleChildIndex(OpAccessibleItem* child)
{
int n = m_view->GetLineCount();
if (child == m_view->m_column_list_accessor)
return n;
for (int i = 0; i < n; i++)
{
if (GetItemByIndex(m_view->GetItemByLine(i)) == child)
return i;
}
return Accessibility::NoSuchChild;
}
开发者ID:prestocore,项目名称:browser,代码行数:14,代码来源:TreeViewModel.cpp
示例17: AddSuggestion
INT32 SpeedDialSuggestionsModel::AddSuggestion(const OpStringC &title, const OpStringC &url, const INT32 parent)
{
OpString actual_url, display_url;
actual_url.Set(url);
// Look up for the display url or redirect url if any
HotlistModelItem* bookmark = g_desktop_bookmark_manager->FindDefaultBookmarkByURL(url);
if (bookmark)
{
actual_url.Set(bookmark->GetUrl());
display_url.Set(bookmark->GetDisplayUrl());
}
//Removes duplicated URLs from the treeview list
if (parent == -1)
{
SpeedDialSuggestionsModelItem *item;
for (INT32 index = 0; index < GetItemCount() && (item = GetItemByIndex(index)); index++)
{
if (item->GetURL().Compare(actual_url) == 0 || item->GetURL().Compare(display_url) == 0)
return -1;
}
}
// Don't add urls already in speed dial
if (g_speeddial_manager->SpeedDialExists(actual_url) || g_speeddial_manager->SpeedDialExists(display_url))
return -1;
for (UINT32 i = 0; i < ARRAY_SIZE(LIST_OF_BLACKLISTED_URLS); i++)
if (url == LIST_OF_BLACKLISTED_URLS[i])
return -1;
SpeedDialSuggestionsModelItem* item = OP_NEW(SpeedDialSuggestionsModelItem, (SpeedDialSuggestionsModelItem::LINK_TYPE));
if (item)
{
if (OpStatus::IsSuccess(item->SetLinkData(title, actual_url, display_url)))
{
Image favico = g_favicon_manager->Get(url.CStr());
item->SetBitmap(favico);
INT32 idx = AddLast(item, parent);
if (idx != -1)
{
return idx;
}
}
OP_DELETE(item);
}
return -1;
}
开发者ID:prestocore,项目名称:browser,代码行数:49,代码来源:SpeedDialSuggestions.cpp
示例18: itemDOMNode
bool
nsXFormsSelectableAccessible::AddItemToSelection(PRUint32 aIndex)
{
nsCOMPtr<nsIDOMNode> itemDOMNode(do_QueryInterface(GetItemByIndex(&aIndex)));
if (!itemDOMNode)
return false;
nsCOMPtr<nsIDOMNode> DOMNode(do_QueryInterface(mContent));
if (mIsSelect1Element)
sXFormsService->SetSelectedItemForSelect1(DOMNode, itemDOMNode);
else
sXFormsService->AddItemToSelectionForSelect(DOMNode, itemDOMNode);
return true;
}
开发者ID:gorakhargosh,项目名称:mozilla-central,代码行数:15,代码来源:nsXFormsAccessible.cpp
示例19: GetItemCount
INT32 GroupsModel::GetItemByPath(const OpStringC& path)
{
INT32 count = GetItemCount();
for (int pos = 0; pos < count; pos++)
{
GroupsModelItem* item = GetItemByIndex(pos);
if (item && item->ComparePathI(path) == 0)
{
return pos;
}
}
return -1;
}
开发者ID:prestocore,项目名称:browser,代码行数:16,代码来源:groupsmodel.cpp
示例20: weapon_grenadelauncher_fire
void weapon_grenadelauncher_fire (edict_t *ent)
{
vec3_t offset;
vec3_t forward, right;
vec3_t start;
int damage;
float radius;
if(GetItemByIndex(ent->client->ammo_index)->tag == AMMO_GRENADES)
{
damage = 120;
}
else
{
damage = 300;
}
radius = damage+40;
if (is_quad)
damage *= 4;
VectorSet(offset, 8, 8, ent->viewheight-8);
AngleVectors (ent->client->v_angle, forward, right, NULL);
P_ProjectSource (ent->client, ent->s.origin, offset, forward, right, start);
VectorScale (forward, -2, ent->client->kick_origin);
ent->client->kick_angles[0] = -1;
fire_grenade (ent, start, forward, damage, 600, 2.5, radius);
gi.WriteByte (svc_muzzleflash);
gi.WriteShort (ent-g_edicts);
gi.WriteByte (MZ_GRENADE | is_silenced);
gi.multicast (ent->s.origin, MULTICAST_PVS);
ent->client->ps.gunframe++;
PlayerNoise(ent, start, PNOISE_WEAPON);
if (! ( (int)dmflags->value & DF_INFINITE_AMMO ) )
ent->client->pers.inventory[ent->client->ammo_index]--;
// play quad damage sound
playQuadSound(ent);
}
开发者ID:yquake2,项目名称:zaero,代码行数:45,代码来源:weapon.c
注:本文中的GetItemByIndex函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论