本文整理汇总了C++中CControlUI::IsEnabled方法的典型用法代码示例。如果您正苦于以下问题:C++ CControlUI::IsEnabled方法的具体用法?C++ CControlUI::IsEnabled怎么用?C++ CControlUI::IsEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CControlUI
的用法示例。
在下文中一共展示了CControlUI::IsEnabled方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SelectItem
bool CDropDownUI::SelectItem(int iIndex)
{
if( iIndex == m_iCurSel ) return true;
if( m_iCurSel >= 0 ) {
CControlUI* pControl = static_cast<CControlUI*>(m_items[m_iCurSel]);
IListItemUI* pListItem = static_cast<IListItemUI*>(pControl->GetInterface(_T("ListItem")));
if( pListItem != NULL ) pListItem->Select(false);
m_iCurSel = -1;
}
if( m_items.GetSize() == 0 ) return false;
if( iIndex < 0 ) iIndex = 0;
if( iIndex >= m_items.GetSize() ) iIndex = m_items.GetSize() - 1;
CControlUI* pControl = static_cast<CControlUI*>(m_items[iIndex]);
if( !pControl->IsVisible() ) return false;
if( !pControl->IsEnabled() ) return false;
IListItemUI* pListItem = static_cast<IListItemUI*>(pControl->GetInterface(_T("ListItem")));
if( pListItem == NULL ) return false;
m_iCurSel = iIndex;
pControl->SetFocus();
pListItem->Select(true);
if( m_pManager != NULL ) m_pManager->SendNotify(pControl, _T("itemclick"));
if( m_pManager != NULL ) m_pManager->SendNotify(this, _T("itemselect"));
Invalidate();
return true;
}
示例2: SelectItem
bool CListUI::SelectItem(int iIndex)
{
if( iIndex == m_iCurSel ) return true;
// We should first unselect the currently selected item
if( m_iCurSel >= 0 ) {
CControlUI* pControl = GetItem(m_iCurSel);
if( pControl != NULL ) {
IListItemUI* pListItem = static_cast<IListItemUI*>(pControl->GetInterface(_T("ListItem")));
if( pListItem != NULL ) pListItem->Select(false);
}
}
// Now figure out if the control can be selected
// TODO: Redo old selected if failure
CControlUI* pControl = GetItem(iIndex);
if( pControl == NULL ) return false;
if( !pControl->IsVisible() ) return false;
if( !pControl->IsEnabled() ) return false;
IListItemUI* pListItem = static_cast<IListItemUI*>(pControl->GetInterface(_T("ListItem")));
if( pListItem == NULL ) return false;
m_iCurSel = iIndex;
if( !pListItem->Select(true) ) {
m_iCurSel = -1;
return false;
}
pControl->SetFocus();
if( m_pManager != NULL ) {
m_pManager->SendNotify(pControl, _T("itemclick"));
m_pManager->SendNotify(this, _T("itemselect"));
}
Invalidate();
return true;
}
示例3: SelectItem
bool CComboUI::SelectItem(int iIndex, bool bTakeFocus)
{
if( iIndex == m_iCurSel ) return true;
int iOldSel = m_iCurSel;
if( m_iCurSel >= 0 ) {
CControlUI* pControl = static_cast<CControlUI*>(m_items[m_iCurSel]);
if( !pControl ) return false;
IListItemUI* pListItem = static_cast<IListItemUI*>(pControl->GetInterface(_T("ListItem")));
if( pListItem != NULL ) pListItem->Select(false);
m_iCurSel = -1;
}
if( iIndex < 0 ) return false;
if( m_items.GetSize() == 0 ) return false;
if( iIndex >= m_items.GetSize() ) iIndex = m_items.GetSize() - 1;
CControlUI* pControl = static_cast<CControlUI*>(m_items[iIndex]);
if( !pControl || !pControl->IsEnabled() ) return false;
IListItemUI* pListItem = static_cast<IListItemUI*>(pControl->GetInterface(_T("ListItem")));
if( pListItem == NULL ) return false;
m_iCurSel = iIndex;
if( m_pWindow != NULL || bTakeFocus ) pControl->SetFocus();
pListItem->Select(true);
if( m_pManager != NULL ) m_pManager->SendNotify(this, DUI_MSGTYPE_ITEMSELECT, m_iCurSel, iOldSel);
Invalidate();
return true;
}
示例4: ViCbIsEnabled
// bool ViCbIsEnabled(VApiHandle hWnd)
SQInteger ViCbIsEnabled(HSQUIRRELVM v)
{
SQInteger nargs = sq_gettop(v);
SQInteger Handle = 0;
CControlUI* pCtrl = NULL;
SQBool bRet = FALSE;
if (!v || 1 + 1 != nargs) {goto _Exit_;}
if (OT_INTEGER != sq_gettype(v, 2)) {goto _Exit_;}
sq_getinteger(v, 2, &Handle);
pCtrl = QiHwHandleToCtrl(Handle);
if (!pCtrl) {goto _Exit_;}
bRet = pCtrl->IsEnabled();
_Exit_:
sq_pushbool(v, bRet);
return 1;
}