本文整理汇总了C++中UpdateControl函数的典型用法代码示例。如果您正苦于以下问题:C++ UpdateControl函数的具体用法?C++ UpdateControl怎么用?C++ UpdateControl使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了UpdateControl函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdateControl
BOOL CSelectBox::SetBitmap(UINT nResourceID, int nIndex, CString strType)
{
if(nIndex >= 0 && nIndex < (int)m_vecpImage.size())
{
Image *&pImage = m_vecpImage[nIndex];
if(pImage != NULL)
{
delete pImage;
pImage = NULL;
}
if(ImageFromIDResource(nResourceID, strType, pImage))
{
m_vecsizeImage[nIndex].SetSize(pImage->GetWidth(), pImage->GetHeight());
UpdateControl(true);
return true;
}
}
else if(nIndex == -1 && (int)m_vecpImage.size() < m_nXCount * m_nYCount)
{
Image *pImage = NULL;
if(ImageFromIDResource(nResourceID, strType, pImage))
{
CSize sizeImage(pImage->GetWidth(), pImage->GetHeight());
m_vecpImage.push_back(pImage);
m_vecsizeImage.push_back(sizeImage);
UpdateControl(true);
return true;
}
}
return false;
}
示例2: wxMouseEventHandler
void wxSFControlShape::SetControl(wxWindow *ctrl, bool fit)
{
if( m_pControl ) m_pControl->Reparent( m_pPrevParent );
m_pControl = ctrl;
if( m_pControl )
{
m_pPrevParent = ctrl->GetParent();
if( m_pParentManager )
{
wxSFShapeCanvas *pCanvas = ((wxSFDiagramManager*)m_pParentManager)->GetShapeCanvas();
// reparent GUI control if necessary
if( pCanvas && ( (wxWindow*)pCanvas != m_pPrevParent ) ) m_pControl->Reparent( (wxWindow*)pCanvas );
// redirect mouse events to the event sink for their delayed processing
m_pControl->Connect(wxEVT_LEFT_DOWN, wxMouseEventHandler(EventSink::_OnMouseButton), NULL, m_pEventSink);
m_pControl->Connect(wxEVT_RIGHT_DOWN, wxMouseEventHandler(EventSink::_OnMouseButton), NULL, m_pEventSink);
m_pControl->Connect(wxEVT_LEFT_UP, wxMouseEventHandler(EventSink::_OnMouseButton), NULL, m_pEventSink);
m_pControl->Connect(wxEVT_RIGHT_UP, wxMouseEventHandler(EventSink::_OnMouseButton), NULL, m_pEventSink);
m_pControl->Connect(wxEVT_LEFT_DCLICK, wxMouseEventHandler(EventSink::_OnMouseButton), NULL, m_pEventSink);
m_pControl->Connect(wxEVT_RIGHT_DCLICK, wxMouseEventHandler(EventSink::_OnMouseButton), NULL, m_pEventSink);
m_pControl->Connect(wxEVT_MOTION, wxMouseEventHandler(EventSink::_OnMouseMove), NULL, m_pEventSink);
m_pControl->Connect(wxEVT_KEY_DOWN, wxKeyEventHandler(EventSink::_OnKeyDown), NULL, m_pEventSink);
m_pControl->Connect(wxEVT_SIZE, wxSizeEventHandler(EventSink::_OnSize), NULL, m_pEventSink);
}
if( fit ) UpdateShape();
UpdateControl();
}
}
示例3: UpdateControl
void wxSFControlShape::OnHandle(wxSFShapeHandle& handle)
{
// call default handler
wxSFRectShape::OnHandle(handle);
UpdateControl();
}
示例4: SendMessage
BOOL CHideButton::OnControlLButtonUp(UINT nFlags, CPoint point)
{
enumButtonState buttonState = m_enButtonState;
if (!m_bIsDisable)
{
if(m_rcText.PtInRect(point))
{
if(m_enButtonState == enBSDown)
{
SendMessage(BUTTOM_UP, 0, 0);
}
m_enButtonState = enBSHover;
}
else
{
m_enButtonState = enBSNormal;
if(!m_rc.PtInRect(point))
{
m_bShowButton = false;
}
}
}
if(buttonState != m_enButtonState)
{
UpdateControl();
return true;
}
else
{
return false;
}
}
示例5: UpdateControl
BOOL CHideButton::OnControlMouseMove(UINT nFlags, CPoint point)
{
enumButtonState buttonState = m_enButtonState;
BOOL bOldShowBitton = m_bShowButton;
if (!m_bIsDisable && m_enButtonState != enBSDown)
{
if(m_rc.PtInRect(point))
{
m_bShowButton = true;
if(m_rcText.PtInRect(point))
{
m_enButtonState = enBSHover;
}
else
{
m_enButtonState = enBSNormal;
}
}
else
{
m_bShowButton = false;
m_enButtonState = enBSNormal;
}
}
if(buttonState != m_enButtonState || bOldShowBitton != m_bShowButton)
{
UpdateControl();
return true;
}
else
{
return false;
}
}
示例6: UpdateControl
BOOL CScrollV::OnControlLButtonUp(UINT nFlags, CPoint point)
{
if(!m_bShowScroll)
{
return FALSE;
}
enumButtonState buttonState = m_enButtonState;
if (!m_bIsDisable)
{
m_nDownTop = -1;
if(m_rcBlock.PtInRect(point))
{
m_enButtonState = enBSHover;
}
else
{
m_enButtonState = enBSNormal;
}
}
if(buttonState != m_enButtonState)
{
UpdateControl();
return true;
}
return false;
}
示例7: MoveRange
BOOL CScrollV::OnControlLButtonDown(UINT nFlags, CPoint point)
{
if(!m_bShowScroll)
{
return FALSE;
}
enumButtonState buttonState = m_enButtonState;
if (!m_bIsDisable)
{
if(m_rcBlock.PtInRect(point))
{
m_enButtonState = enBSDown;
m_nDownTop = point.y;
}
else
{
int nRangeHeight = m_rc.Height() - 40;
int nMove = m_nPageRange * nRangeHeight / m_nMaxRange;
return MoveRange(point.y < m_rcBlock.top ? -nMove : nMove);
}
}
if(buttonState != m_enButtonState)
{
UpdateControl();
return true;
}
return false;
}
示例8: SetTitle
// 设置Combo选择项的值
void CDuiComboBox::SetComboValue(CString strComboValue)
{
m_strComboValue = strComboValue;
// 设置下拉列表的选择项
if(m_pPopupList)
{
m_pPopupList->SetCurItem(strComboValue);
}
// 先设置一下编辑框内容为空,避免下拉列表为空时候未设置
SetTitle(_T(""));
// 设置编辑框内容
for (size_t i = 0; i < m_vecItem.size(); i++)
{
ComboListItem* pItem = &(m_vecItem.at(i));
if(pItem->strValue == strComboValue)
{
SetTitle(pItem->strName);
break;
}
}
UpdateControl();
}
示例9: UpdateControl
// 消息响应
LRESULT CDuiListCtrl::OnMessage(UINT uID, UINT Msg, WPARAM wParam, LPARAM lParam)
{
if((uID == SCROLL_V) && (Msg == MSG_SCROLL_CHANGE))
{
// 如果是滚动条的位置变更事件,则刷新显示
UpdateControl(true);
}else
if((uID == GetID()) && (Msg == MSG_BUTTON_DOWN) && (lParam != -1))
{
// 点击了行的某个链接
ListRowInfo* pRowInfo = GetItemInfo(wParam);
if(pRowInfo)
{
// 转换为MSG_BUTTON_UP消息,因为DuiSystem任务处理时候只处理MSG_BUTTON_UP消息
if((lParam == 0) && (!pRowInfo->strLinkAction1.IsEmpty()))
{
DuiSystem::AddDuiActionTask(uID, MSG_BUTTON_UP, wParam, lParam, GetName(), pRowInfo->strLinkAction1, GetParent());
}else
if((lParam == 1) && (!pRowInfo->strLinkAction2.IsEmpty()))
{
DuiSystem::AddDuiActionTask(uID, MSG_BUTTON_UP, wParam, lParam, GetName(), pRowInfo->strLinkAction2, GetParent());
}
}
}
return __super::OnMessage(uID, Msg, wParam, lParam);
}
示例10: UpdateControl
BOOL CDuiText::OnControlLButtonUp(UINT nFlags, CPoint point)
{
enumButtonState buttonState = m_enButtonState;
if (!m_bIsDisable)
{
if(m_rc.PtInRect(point))
{
if(m_enButtonState == enBSDown)
{
//ShellExecute(NULL, TEXT("open"), m_strLink, NULL,NULL,SW_NORMAL);
}
m_enButtonState = enBSHover;
}
else
{
m_enButtonState = enBSNormal;
}
}
if(buttonState != m_enButtonState)
{
UpdateControl();
return true;
}
return false;
}
示例11: ResetGroupCheck
BOOL CMenuItem::SetCheck(BOOL bCheck)
{
if(!m_bSelect) return false;
if (m_bIsDisable)
{
return m_bDown;
}
BOOL bDown = m_bDown;
m_bDown = bCheck;
if(m_bDown)
{
m_enButtonState = enBSDown;
}
else
{
m_enButtonState = enBSNormal;
}
if(m_bDown != bDown)
{
// 如果组名非空,说明是radiobutton组,则刷新同一个组下面其他radiobtn
if(!m_strGroupName.IsEmpty())
{
ResetGroupCheck();
}
UpdateControl();
}
return m_bDown;
}
示例12: UpdateControl
//选择改变
void CChessManual::OnLbnSelchangeManualList()
{
int nSelItem=m_ManualList.GetCurSel();
if ((nSelItem!=LB_ERR)&&((nSelItem+1)!=m_wChessStep))
{
//前进判断
if (nSelItem>=m_wChessStep)
{
tagChessManual * pChessManual=NULL;
for (WORD i=m_wChessStep;i<(nSelItem+1);i++)
{
pChessManual=&m_ChessManualInfo[i];
m_GameLogic.MoveChess(pChessManual->cbXSourceChessPos,pChessManual->cbYSourceChessPos,pChessManual->cbXTargetChessPos,pChessManual->cbYTargetChessPos);
}
}
else m_GameLogic.RegretChess(m_wChessStep-nSelItem-1);
//设置棋盘
m_wChessStep=(nSelItem+1);
m_ChessBorad.SetChessBorad(m_GameLogic.m_ChessBorad);
//设置选择
tagChessManual * pChessManual=&m_ChessManualInfo[m_wChessStep-1];
m_ChessBorad.SetChessFrame(pChessManual->cbXSourceChessPos,pChessManual->cbYSourceChessPos,pChessManual->cbXTargetChessPos,pChessManual->cbYTargetChessPos);
//更新控制
UpdateControl();
}
return;
}
示例13: MoveSplitPos
// 鼠标左键按下
BOOL CDuiLayout::OnControlLButtonDown(UINT nFlags, CPoint point)
{
enumButtonState buttonState = m_enButtonState;
if (!m_bIsDisable)
{
for(size_t i = 0; i < m_vecItemInfo.size(); i++)
{
LayoutItemInfo &itemInfo = m_vecItemInfo.at(i);
if(itemInfo.rcThumb.PtInRect(point))
{
// 如果在滚动块内,则记录鼠标位置
m_enButtonState = enBSDown;
m_nHoverSplit = i;
MoveSplitPos(i, point);
break;
}else
if(itemInfo.rcSplit.PtInRect(point))
{
// 如果在分隔线内,则记录鼠标位置
m_enButtonState = enBSDown;
m_nHoverSplit = i;
MoveSplitPos(i, point);
break;
}
}
}
if(buttonState != m_enButtonState)
{
UpdateControl();
return true;
}
return false;
}
示例14: MoveThumbPos
// 鼠标左键按下
BOOL CDuiSlider::OnControlLButtonDown(UINT nFlags, CPoint point)
{
enumButtonState buttonState = m_enButtonState;
if (!m_bIsDisable)
{
if(m_rcThumb.PtInRect(point))
{
// 如果在滚动块内,则记录鼠标位置
m_enButtonState = enBSDown;
MoveThumbPos(point);
}
else
{
// 不在滚动块内,则移动滚动块
MoveThumbPos(point);
}
}
if(buttonState != m_enButtonState)
{
UpdateControl();
return true;
}
return false;
}
示例15: UpdateControl
// 将指定的行滚动到可见范围
BOOL CDuiGridCtrl::EnsureVisible(int nRow, BOOL bPartialOK)
{
// 如果指定的行已经处于可见范围则直接返回
if((nRow >= m_nFirstViewRow) && (nRow <= m_nLastViewRow))
{
return TRUE;
}
CDuiScrollVertical* pScrollV = (CDuiScrollVertical*)m_pControScrollV;
if(nRow < m_nFirstViewRow)
{
pScrollV->SetScrollCurrentPos(nRow * m_nRowHeight);
}else
{
int nFirstRow = nRow - ((m_rc.Height() - m_nHeaderHeight) / m_nRowHeight) + 2;
if(nFirstRow < 0)
{
nFirstRow = 0;
}
pScrollV->SetScrollCurrentPos(nFirstRow * m_nRowHeight);
}
UpdateControl(true);
return TRUE;
}