本文整理汇总了C++中CControlBase::GetDisable方法的典型用法代码示例。如果您正苦于以下问题:C++ CControlBase::GetDisable方法的具体用法?C++ CControlBase::GetDisable怎么用?C++ CControlBase::GetDisable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CControlBase
的用法示例。
在下文中一共展示了CControlBase::GetDisable方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetNextFocusableControl
// 获取下一个可以获取焦点的子控件
CControlBase* CDlgPopup::GetNextFocusableControl()
{
BOOL bStartSearch = FALSE;
// 先按照焦点控件查找一次
for (int i = 0; i < (int)m_vecControl.size(); i++)
{
CControlBase* pControlBase = m_vecControl.at(i);
if (pControlBase && pControlBase->GetVisible() && !pControlBase->GetDisable() && bStartSearch && pControlBase->IsTabStop())
{
return pControlBase;
}else
if (pControlBase && (pControlBase == m_pFocusControl))
{
bStartSearch = TRUE;
}
}
// 再遍历子控件查找
if(m_pFocusControl == NULL)
{
bStartSearch = TRUE;
}
for (int i = 0; i < (int)m_vecControl.size(); i++)
{
CControlBase* pControlBase = m_vecControl.at(i);
if(m_pControl == NULL)
{
m_pControl = pControlBase;
}
if (pControlBase && pControlBase->GetVisible() && !pControlBase->GetDisable() && bStartSearch && pControlBase->IsTabStop())
{
return pControlBase;
}else
if (pControlBase && (pControlBase == m_pControl))
{
// 查找子控件
pControlBase = pControlBase->GetNextFocusableControl(m_pFocusControl);
if(pControlBase != NULL)
{
return pControlBase;
}
//bStartSearch = TRUE;
}
}
return NULL;
}
示例2: GetPrevFocusableControl
// 获取上一个可以获取焦点的子控件
CControlBase* CControlBase::GetPrevFocusableControl(CControlBase* pFocusControl)
{
BOOL bStartSearch = FALSE;
// 先按照焦点控件查找一次
for (int i = m_vecControl.size()-1; i >= 0; i--)
{
CControlBase* pControlBase = m_vecControl.at(i);
if (pControlBase && pControlBase->GetVisible() && !pControlBase->GetDisable() && bStartSearch && pControlBase->IsTabStop())
{
return pControlBase;
}else
if (pControlBase && (pControlBase == pFocusControl))
{
bStartSearch = TRUE;
}
}
// 再遍历子控件查找
if(m_pControl == NULL)
{
bStartSearch = TRUE;
}
for (int i = m_vecControl.size()-1; i >= 0; i--)
{
CControlBase* pControlBase = m_vecControl.at(i);
if(m_pControl == NULL)
{
m_pControl = pControlBase;
}
if (pControlBase && pControlBase->GetVisible() && !pControlBase->GetDisable() && bStartSearch && pControlBase->IsTabStop())
{
return pControlBase;
}else
if (pControlBase && (pControlBase == m_pControl))
{
// 查找子控件
pControlBase = pControlBase->GetPrevFocusableControl(pFocusControl);
if(pControlBase != NULL)
{
return pControlBase;
}
}
}
return NULL;
}
示例3: OnLButtonDown
// 鼠标左键按下事件处理
BOOL CControlBase::OnLButtonDown(UINT nFlags, CPoint point)
{
if(!m_bIsVisible || !m_bRresponse) return false;
// 保存原始的鼠标位置,并进行位置变换
CPoint oldPoint = point;
OnMousePointChange(point);
m_bMouseDown = m_rc.PtInRect(point);
// 查找鼠标是否在某个内部控件位置,如果是的话就更新当前子控件(按照反向顺序查找,因为定义在后面的控件是优先级更高的)
// 找到第一个符合条件的就结束查找
for (int i = m_vecControl.size()-1; i >= 0; i--)
{
CControlBase * pControlBase = m_vecControl.at(i);
if (pControlBase && pControlBase->PtInRect(point))
{
if(pControlBase->GetVisible() && !pControlBase->GetDisable() && pControlBase->GetRresponse())
{
m_pControl = pControlBase;
break;
}
}
}
if(m_pControl != NULL)
{
// 如果是控件内置滚动条子控件,则不进行位置变换,因为滚动条位置是不需要变换的
UINT uControlID = m_pControl->GetControlID();
if((SCROLL_V == uControlID) || (SCROLL_H == uControlID))
{
point = oldPoint;
}
if(m_pControl->OnLButtonDown(nFlags, point))
{
return true;
}
}
else
{
// 切换对话框中的当前焦点控件(暂不处理Popup窗口的切换)
CDlgBase* pDlg = GetParentDialog(FALSE);
if(pDlg)
{
pDlg->SetFocusControl(this);
}
// 发送鼠标左键按下DUI消息
if(m_bDuiMsgMouseLDown && m_rc.PtInRect(point))
{
SendMessage(MSG_MOUSE_LDOWN, (WPARAM)nFlags, (LPARAM)(&point));
}
return OnControlLButtonDown(nFlags, point);
}
return false;
}
示例4: OnLButtonDown
// 鼠标左键事件处理
BOOL CControlBase::OnLButtonDown(UINT nFlags, CPoint point)
{
if(!m_bIsVisible || !m_bRresponse) return false;
OnMousePointChange(point);
m_bMouseDown = m_rc.PtInRect(point);
// 查找鼠标是否在某个内部控件位置,如果是的话就更新当前子控件
for (size_t i = 0; i < m_vecControl.size(); i++)
{
CControlBase * pControlBase = m_vecControl.at(i);
if (pControlBase && pControlBase->PtInRect(point))
{
if(pControlBase->GetVisible() && !pControlBase->GetDisable() && pControlBase->GetRresponse())
{
m_pControl = pControlBase;
}
}
}
if(m_pControl != NULL)
{
if(m_pControl->OnLButtonDown(nFlags, point))
{
return true;
}
}
else
{
// 切换对话框中的当前焦点控件(暂不处理Popup窗口的切换)
CDlgBase* pDlg = GetParentDialog(FALSE);
if(pDlg)
{
pDlg->SetFocusControl(this);
}
return OnControlLButtonDown(nFlags, point);
}
return false;
}
示例5: GetFocusControl
// 获取当前焦点控件
CControlBase* CControlBase::GetFocusControl(CControlBase* pFocusControl)
{
for (int i = m_vecControl.size()-1; i >= 0; i--)
{
CControlBase* pControlBase = m_vecControl.at(i);
if (pControlBase && pControlBase->GetVisible() && !pControlBase->GetDisable() && (pControlBase == pFocusControl) && pControlBase->IsTabStop())
{
return pControlBase;
}else
if (pControlBase && (pControlBase == m_pControl))
{
// 查找子控件
pControlBase = pControlBase->GetFocusControl(pFocusControl);
if(pControlBase != NULL)
{
return pControlBase;
}
}
}
return NULL;
}
示例6: GetGroupValue
// 获取所在Radio组选择的控件的值
CString CMenuItem::GetGroupValue()
{
CDuiObject* pParentObj = GetParent();
if(pParentObj == NULL)
{
return _T("");
}
vector<CControlBase*>* pvecControl = NULL;
if(pParentObj->IsClass(_T("dlg")))
{
CDlgBase* pDlg = static_cast<CDlgBase*>(pParentObj);
pvecControl = pDlg->GetControls();
}else
if(pParentObj->IsClass(_T("popup")))
{
CDlgPopup* pDlg = static_cast<CDlgPopup*>(pParentObj);
pvecControl = pDlg->GetControls();
}else
{
CControlBase* pControlBase = static_cast<CControlBase*>(pParentObj);
pvecControl = pControlBase->GetControls();
}
if(pvecControl == NULL)
{
return _T("");
}
for(int i=0; i<(int)pvecControl->size(); i++)
{
CControlBase* pControlBase = pvecControl->at(i);
if(pControlBase->IsClass(CMenuItem::GetClassName()) && pControlBase->GetVisible() && !pControlBase->GetDisable())
{
CMenuItem* pControl = static_cast<CMenuItem*>(pControlBase);
if((pControl->GetGroupName() == m_strGroupName) && pControl->GetCheck())
{
return pControl->GetValue();
}
}
}
return _T("");
}
示例7: ResetGroupCheck
// 刷新父控件下面所有同一个组的RadioButton控件的状态
BOOL CMenuItem::ResetGroupCheck()
{
CDuiObject* pParentObj = GetParent();
if(pParentObj == NULL)
{
return FALSE;
}
vector<CControlBase*>* pvecControl = NULL;
if(pParentObj->IsClass(_T("dlg")))
{
CDlgBase* pDlg = static_cast<CDlgBase*>(pParentObj);
pvecControl = pDlg->GetControls();
}else
if(pParentObj->IsClass(_T("popup")))
{
CDlgPopup* pDlg = static_cast<CDlgPopup*>(pParentObj);
pvecControl = pDlg->GetControls();
}else
{
CControlBase* pControlBase = static_cast<CControlBase*>(pParentObj);
pvecControl = pControlBase->GetControls();
}
if(pvecControl == NULL)
{
return FALSE;
}
for(int i=0; i<(int)pvecControl->size(); i++)
{
CControlBase* pControlBase = pvecControl->at(i);
if(pControlBase->IsClass(CMenuItem::GetClassName()) && pControlBase->GetVisible() && !pControlBase->GetDisable())
{
CMenuItem* pControl = static_cast<CMenuItem*>(pControlBase);
if((pControl->GetGroupName() == m_strGroupName) && (pControl != this))
{
// 重置控件状态
pControl->SetControlCheck(FALSE);
}
}
}
return TRUE;
}