本文整理汇总了C++中CItemInfo::GetControlType方法的典型用法代码示例。如果您正苦于以下问题:C++ CItemInfo::GetControlType方法的具体用法?C++ CItemInfo::GetControlType怎么用?C++ CItemInfo::GetControlType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CItemInfo
的用法示例。
在下文中一共展示了CItemInfo::GetControlType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnControlLButtonDown
//override called when OnLButtondown
void CMySuperGrid::OnControlLButtonDown(UINT nFlags, CPoint point, LVHITTESTINFO& ht)
{
//now I am sure I added a combobox some where, so check for this control
CTreeItem*pSelItem = GetTreeItem(ht.iItem);
if(pSelItem!=NULL)
{
CItemInfo* pInfo = GetData(pSelItem);
CItemInfo::CONTROLTYPE ctrlType;
if(pInfo->GetControlType(ht.iSubItem-1, ctrlType))
{
if(ctrlType==pInfo->CONTROLTYPE::combobox)
{
CStringList* list=NULL;
pInfo->GetListData(ht.iSubItem-1, list);
CComboBox * pList = ShowList(ht.iItem, ht.iSubItem, list);
}
}
/*
else //activate default edit control
CSuperGridCtrl::OnControlLButtonDown(nFlags, point, ht);
*/
}
}
示例2: OnVkReturn
BOOL CMySuperGrid::OnVkReturn()
{
BOOL bResult=FALSE;
int iItem = GetNextItem( -1, LVNI_ALL | LVNI_SELECTED);
if( GetCurSubItem() != -1 && iItem != -1)
{
CTreeItem*pSelItem = GetTreeItem(iItem);
if(pSelItem!=NULL)
{
CHeaderCtrl* pHeader = (CHeaderCtrl*)GetDlgItem(0);
int iSubItem = Header_OrderToIndex(pHeader->m_hWnd, GetCurSubItem());
CItemInfo* pInfo = GetData(pSelItem);
CItemInfo::CONTROLTYPE ctrlType;
if(pInfo->GetControlType(iSubItem-1, ctrlType))
{
switch(ctrlType)
{
/*put in your own control here*/
case pInfo->CONTROLTYPE::datecontrol:break;
case pInfo->CONTROLTYPE::spinbutton:break;
case pInfo->CONTROLTYPE::dropdownlistviewwhatevercontrol:break;
case pInfo->CONTROLTYPE::combobox:
{
CStringList* list=NULL;
pInfo->GetListData(iSubItem-1, list);
CComboBox * pList = ShowList(iItem, iSubItem, list);
bResult=TRUE; //I'll handle it from here
}break;
default:break;
}
}
}
}
return bResult;
}