本文整理汇总了C++中GetItemAt函数的典型用法代码示例。如果您正苦于以下问题:C++ GetItemAt函数的具体用法?C++ GetItemAt怎么用?C++ GetItemAt使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetItemAt函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetItemAt
bool CTabLayoutUI::SelectItem(int iIndex)
{
if (iIndex < 0 || iIndex >= m_items.GetSize()) return false;
if (iIndex == m_iCurSel) return true;
int iOldSel = m_iCurSel;
m_iCurSel = iIndex;
for (int it = 0; it < m_items.GetSize(); it++) {
if (it == iIndex) {
GetItemAt(it)->SetVisible(true);
GetItemAt(it)->SetFocus();
SetPos(m_rcItem);
} else GetItemAt(it)->SetVisible(false);
}
NeedParentUpdate();
if (m_pManager != NULL) {
m_pManager->SetNextTabControl();
m_pManager->SendNotify(this, DUI_MSGTYPE_TABSELECT, m_iCurSel, iOldSel);
}
return true;
}
示例2: GetItemAt
bool CAnimationTabLayoutUI::SelectItem( int iIndex )
{
if( iIndex < 0 || iIndex >= m_items.GetSize() ) return false;
if( iIndex == m_iCurSel ) return true;
if( iIndex > m_iCurSel ) m_nPositiveDirection = -1;
if( iIndex < m_iCurSel ) m_nPositiveDirection = 1;
int iOldSel = m_iCurSel;
m_iCurSel = iIndex;
for( int it = 0; it < m_items.GetSize(); it++ ) {
if( it == iIndex ) {
GetItemAt(it)->SetVisible(true);
GetItemAt(it)->SetFocus();
m_bControlVisibleFlag = false;
m_pCurrentControl = static_cast<CControlUI*>(m_items[it]);
}
else GetItemAt(it)->SetVisible(false);
}
NeedParentUpdate();
if( NULL != m_pCurrentControl ) m_pCurrentControl->SetVisible( false );
AnimationSwitch();
if( m_pManager != NULL ) {
m_pManager->SetNextTabControl();
m_pManager->SendNotify(this, _T("tabselect"), m_iCurSel, iOldSel);
}
return true;
}
示例3: Activate
bool CMenuElementUI::Activate()
{
if (CListContainerElementUI::Activate() && m_bSelected)
{
if( m_pWindow ) return true;
bool hasSubMenu = false;
for (int i = 0; i < GetCount(); ++i)
{
if (GetItemAt(i)->GetInterface(kMenuElementUIInterfaceName) != NULL)
{
(static_cast<CMenuElementUI*>(GetItemAt(i)->GetInterface(kMenuElementUIInterfaceName)))->SetVisible(true);
(static_cast<CMenuElementUI*>(GetItemAt(i)->GetInterface(kMenuElementUIInterfaceName)))->SetInternVisible(true);
hasSubMenu = true;
}
}
if (hasSubMenu)
{
CreateMenuWnd();
}
else
{
ContextMenuParam param;
param.hWnd = m_pManager->GetPaintWindow();
param.wParam = 1;
param.lParam = (LPARAM)GetName().GetData();
s_context_menu_observer.RBroadcast(param);
}
return true;
}
return false;
}
示例4: DrawItemText
void CMenuElementUI::DoPaint(HDC hDC, const RECT& rcPaint)
{
if( !::IntersectRect(&m_rcPaint, &rcPaint, &m_rcItem) ) return;
CMenuElementUI::DrawItemBk(hDC, m_rcItem);
DrawItemText(hDC, m_rcItem);
for (int i = 0; i < GetCount(); ++i)
{
if (GetItemAt(i)->GetInterface(kMenuElementUIInterfaceName) == NULL)
GetItemAt(i)->DoPaint(hDC, rcPaint);
}
}
示例5: GetItemAt
bool CGroupsUI::SelectItem(int iIndex, bool bTakeFocus)
{
if( iIndex == m_iCurSel ) return true;
// We should first unselect the currently selected item
if( m_iCurSel >= 0 ) {
CControlUI* pControl = GetItemAt(m_iCurSel);
if( pControl != NULL) {
IListItemUI* pListItem = static_cast<IListItemUI*>(pControl->GetInterface(_T("ListItem")));
if( pListItem != NULL )
{
CListContainerElementUI* pFriendListItem = static_cast<CListContainerElementUI*>(pControl);
Node* node = (Node*)pControl->GetTag();
if ((pFriendListItem != NULL) && (node != NULL) && !node->folder())
{
// pFriendListItem->SetFixedHeight(kFriendListItemNormalHeight);
// CContainerUI* pOperatorPannel = static_cast<CContainerUI*>(paint_manager_.FindSubControlByName(pFriendListItem, kOperatorPannelControlName));
// if (pOperatorPannel != NULL)
// {
// pOperatorPannel->SetVisible(false);
// }
}
pListItem->Select(false);
}
}
m_iCurSel = -1;
}
if( iIndex < 0 )
return false;
if (!__super::SelectItem(iIndex, bTakeFocus))
return false;
CControlUI* pControl = GetItemAt(m_iCurSel);
if( pControl != NULL) {
CListContainerElementUI* pFriendListItem = static_cast<CListContainerElementUI*>(pControl);
Node* node = (Node*)pControl->GetTag();
if ((pFriendListItem != NULL) && (node != NULL) && !node->folder())
{
// pFriendListItem->SetFixedHeight(kFriendListItemSelectedHeight);
// CContainerUI* pOperatorPannel = static_cast<CContainerUI*>(paint_manager_.FindSubControlByName(pFriendListItem, kOperatorPannelControlName));
// if (pOperatorPannel != NULL)
// {
// pOperatorPannel->SetVisible(true);
// }
//pFriendListItem->SetBkImage()
}
}
return true;
}
示例6: SetItemCheckBox
//************************************
// 函数名称: SetItemCheckBox
// 返回类型: bool
// 参数信息: bool _Selected
// 参数信息: CTreeNodeUI * _TreeNode
// 函数说明:
//************************************
bool CTreeViewUI::SetItemCheckBox( bool _Selected,CTreeNodeUI* _TreeNode /*= NULL*/ )
{
if(_TreeNode)
{
if(_TreeNode->GetCountChild() > 0)
{
int nCount = _TreeNode->GetCountChild();
for(int nIndex = 0;nIndex < nCount;nIndex++)
{
CTreeNodeUI* pItem = _TreeNode->GetChildNode(nIndex);
pItem->GetCheckBox()->Selected(_Selected);
if(pItem->GetCountChild())
SetItemCheckBox(_Selected,pItem);
}
}
return true;
}
else
{
int nIndex = 0;
int nCount = GetCount();
while(nIndex < nCount)
{
CTreeNodeUI* pItem = (CTreeNodeUI*)GetItemAt(nIndex);
pItem->GetCheckBox()->Selected(_Selected);
if(pItem->GetCountChild())
SetItemCheckBox(_Selected,pItem);
nIndex++;
}
return true;
}
return false;
}
示例7: _stprintf_s
void CGroupsUI::SetChildVisible(Node* node, bool visible)
{
if (!node || node == root_node_)
return;
if (node->data().child_visible_ == visible)
return;
node->data().child_visible_ = visible;
TCHAR szBuf[MAX_PATH] = {0};
CDuiString html_text;
if (node->data().has_child_)
{
if (node->data().child_visible_)
html_text += level_expand_image_;
else
html_text += level_collapse_image_;
_stprintf_s(szBuf, MAX_PATH - 1, _T("<x %d>"), level_text_start_pos_);
html_text += szBuf;
html_text += node->data().text_;
CLabelUI* nick_name = static_cast<CLabelUI*>(paint_manager_.FindSubControlByName(node->data().list_elment_, kNickNameControlName));
if (nick_name != NULL)
{
nick_name->SetShowHtml(true);
nick_name->SetText(html_text);
}
}
if (!node->data().list_elment_->IsVisible())
return;
if (!node->has_children())
return;
Node* begin = node->child(0);
Node* end = node->get_last_child();
for (int i = begin->data().list_elment_->GetIndex(); i <= end->data().list_elment_->GetIndex(); ++i)
{
CControlUI* control = GetItemAt(i);
if (_tcsicmp(control->GetClass(), _T("ListContainerElementUI")) == 0)
{
if (visible)
{
Node* local_parent = ((Node*)control->GetTag())->parent();
if (local_parent->data().child_visible_ && local_parent->data().list_elment_->IsVisible())
{
control->SetVisible(true);
}
}
else
{
control->SetVisible(false);
}
}
}
}
示例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_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;
}
示例9: NS_IF_ADDREF
NS_IMETHODIMP
nsDOMAttributeMap::Item(PRUint32 aIndex, nsIDOMNode** aReturn)
{
nsresult rv;
NS_IF_ADDREF(*aReturn = GetItemAt(aIndex, &rv));
return rv;
}
示例10: 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;
}
示例11: notifier
already_AddRefed<nsISVGPoint>
DOMSVGPointList::RemoveItem(uint32_t aIndex, ErrorResult& aError)
{
if (IsAnimValList()) {
aError.Throw(NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR);
return nullptr;
}
if (aIndex >= LengthNoFlush()) {
aError.Throw(NS_ERROR_DOM_INDEX_SIZE_ERR);
return nullptr;
}
AutoChangePointListNotifier notifier(this);
// Now that we know we're removing, keep animVal list in sync as necessary.
// Do this *before* touching InternalList() so the removed item can get its
// internal value.
MaybeRemoveItemFromAnimValListAt(aIndex);
// We have to return the removed item, so get it, creating it if necessary:
RefPtr<nsISVGPoint> result = GetItemAt(aIndex);
// Notify the DOM item of removal *before* modifying the lists so that the
// DOM item can copy its *old* value:
mItems[aIndex]->RemovingFromList();
InternalList().RemoveItem(aIndex);
mItems.RemoveElementAt(aIndex);
UpdateListIndicesFromIndex(mItems, aIndex);
return result.forget();
}
示例12: SetItemExpand
//************************************
// 函数名称: SetItemExpand
// 返回类型: void
// 参数信息: bool _Expanded
// 参数信息: CTreeNodeUI * _TreeNode
// 函数说明:
//************************************
void CTreeViewUI::SetItemExpand( bool _Expanded,CTreeNodeUI* _TreeNode /*= NULL*/ )
{
if(_TreeNode)
{
if(_TreeNode->GetCountChild() > 0)
{
int nCount = _TreeNode->GetCountChild();
for(int nIndex = 0;nIndex < nCount;nIndex++)
{
CTreeNodeUI* pItem = _TreeNode->GetChildNode(nIndex);
pItem->SetVisible(_Expanded);
if(pItem->GetCountChild() && !pItem->GetFolderButton()->IsSelected())
SetItemExpand(_Expanded,pItem);
}
}
}
else
{
int nIndex = 0;
int nCount = GetCount();
while(nIndex < nCount)
{
CTreeNodeUI* pItem = (CTreeNodeUI*)GetItemAt(nIndex);
pItem->SetVisible(_Expanded);
if(pItem->GetCountChild() && !pItem->GetFolderButton()->IsSelected())
SetItemExpand(_Expanded,pItem);
nIndex++;
}
}
}
示例13: 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;
}
示例14: RemoveAt
//************************************
// 函数名称: RemoveAt
// 返回类型: bool
// 参数信息: int iIndex
// 函数说明: iIndex 索引以及下的所有节点将被一并移除
//************************************
bool CTreeViewUI::RemoveAt( int iIndex )
{
CTreeNodeUI* pItem = (CTreeNodeUI*)GetItemAt(iIndex);
if(pItem->GetCountChild())
Remove(pItem);
return true;
}
示例15: SetSelItemHotTextColor
//************************************
// 函数名称: SetSelItemHotTextColor
// 返回类型: void
// 参数信息: DWORD _dwSelHotItemTextColor
// 函数说明:
//************************************
void CTreeViewUI::SetSelItemHotTextColor( DWORD _dwSelHotItemTextColor )
{
for(int nIndex = 0;nIndex < GetCount();nIndex++){
CTreeNodeUI* pTreeNode = static_cast<CTreeNodeUI*>(GetItemAt(nIndex));
if(pTreeNode)
pTreeNode->SetSelItemHotTextColor(_dwSelHotItemTextColor);
}
}