本文整理汇总了C++中Control::AcceptTransition方法的典型用法代码示例。如果您正苦于以下问题:C++ Control::AcceptTransition方法的具体用法?C++ Control::AcceptTransition怎么用?C++ Control::AcceptTransition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Control
的用法示例。
在下文中一共展示了Control::AcceptTransition方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ControlShow
Error Panel::ControlShow(const string &oTarget, bool bSet, bool &bShow)
{
Pos oPos;
Rect oRect;
Error eRet;
Control *pControl;
ControlMapIterator i;
pair<ControlMapIterator, ControlMapIterator> keyRange
= m_oControlMap.equal_range(oTarget);
for (i = keyRange.first; i != keyRange.second; i++)
{
pControl = (*i).second;
eRet = pControl->Show(bSet, bShow);
m_pWindow->GetMousePos(oPos);
m_pWindow->GetWindowPosition(oRect);
oPos.x -= oRect.x1;
oPos.y -= oRect.y1;
if (bSet && bShow && pControl->PosInControl(oPos))
pControl->AcceptTransition(CT_MouseEnter);
}
return kError_NoErr;
}
示例2: HandleMouseLButtonUp
void Window::HandleMouseLButtonUp(Pos &oScreenPos)
{
Control *pControl;
Pos oPos;
Rect oRect;
IncUsageRef();
GetWindowPosition(oRect);
oPos.x = oScreenPos.x - oRect.x1;
oPos.y = oScreenPos.y - oRect.y1;
if (m_bWindowMove)
{
m_bWindowMove = false;
#ifndef HAVE_GTK
CaptureMouse(false);
#endif
DecUsageRef();
return;
}
m_bLButtonDown = false;
m_pMouseDownControl = NULL;
if (m_pCaptureControl)
{
m_pCaptureControl->AcceptTransition(CT_MouseLButtonUp, &oPos);
DecUsageRef();
return;
}
pControl = ControlFromPos(oPos);
if (pControl)
{
pControl->AcceptTransition(CT_MouseLButtonUp, &oPos);
DecUsageRef();
return;
}
DecUsageRef();
return;
}
示例3: HandleMouseLButtonDown
void Window::HandleMouseLButtonDown(Pos &oScreenPos)
{
Control *pControl;
Rect oRect;
Pos oPos;
IncUsageRef();
GetWindowPosition(oRect);
oPos.x = oScreenPos.x - oRect.x1;
oPos.y = oScreenPos.y - oRect.y1;
if (m_pCaptureControl)
{
m_pCaptureControl->AcceptTransition(CT_MouseLButtonDown, &oPos);
DecUsageRef();
return;
}
pControl = ControlFromPos(oPos);
if (pControl && pControl->UseToDragWindow())
pControl = NULL;
if (pControl)
{
m_bLButtonDown = true;
if (m_pMouseInControl != pControl) {
if (m_pMouseInControl)
m_pMouseInControl->AcceptTransition(CT_MouseLeave);
m_pMouseInControl = pControl;
m_pMouseInControl->AcceptTransition(CT_MouseEnter);
}
m_pMouseDownControl = pControl;
pControl->AcceptTransition(CT_MouseLButtonDown, &oPos);
DecUsageRef();
return;
}
#ifdef __QNX__
DecUsageRef();
return;
#endif
m_bWindowMove = true;
#ifndef HAVE_GTK
CaptureMouse(true);
#endif
GetWindowPosition(m_oMoveStart);
m_pCanvas->GetBackgroundRect(oRect);
m_oMoveStart.x2 = m_oMoveStart.x1 + oRect.Width();
m_oMoveStart.y2 = m_oMoveStart.y1 + oRect.Height();
m_oMovePos = oScreenPos;
if (IsError(GetDesktopSize(m_iDesktopWidth, m_iDesktopHeight)))
m_iDesktopWidth = m_iDesktopHeight = 0;
DecUsageRef();
return;
}
示例4: HandleMouseMove
void Window::HandleMouseMove(Pos &oScreenPos)
{
Control *pControl;
Pos oPos;
Rect oRect;
IncUsageRef();
if (m_bWindowMove)
{
Rect oActualPos;
m_oMoveStart.x1 += (oScreenPos.x - m_oMovePos.x);
m_oMoveStart.x2 += (oScreenPos.x - m_oMovePos.x);
m_oMoveStart.y1 += (oScreenPos.y - m_oMovePos.y);
m_oMoveStart.y2 += (oScreenPos.y - m_oMovePos.y);
oActualPos = m_oMoveStart;
if (m_iDesktopWidth > 0 && m_iDesktopHeight > 0)
{
if ((oActualPos.x1 >= 0 && oActualPos.x1 < iDesktopSnapAmount) ||
(oActualPos.x1 < 0 && oActualPos.x1 > -iDesktopSnapAmount))
{
oActualPos.x2 -= oActualPos.x1;
oActualPos.x1 = 0;
}
if ((oActualPos.y1 >= 0 && oActualPos.y1 < iDesktopSnapAmount) ||
(oActualPos.y1 < 0 && oActualPos.y1 > -iDesktopSnapAmount))
{
oActualPos.y2 -= oActualPos.y1;
oActualPos.y1 = 0;
}
if ((oActualPos.x2 < m_iDesktopWidth &&
oActualPos.x2 >= m_iDesktopWidth - iDesktopSnapAmount) ||
(oActualPos.x2 > m_iDesktopWidth &&
oActualPos.x2 <= m_iDesktopWidth + iDesktopSnapAmount))
{
oActualPos.x1 += m_iDesktopWidth - oActualPos.x2;
oActualPos.x2 = m_iDesktopWidth;
}
if ((oActualPos.y2 < m_iDesktopHeight &&
oActualPos.y2 >= m_iDesktopHeight - iDesktopSnapAmount) ||
(oActualPos.y2 > m_iDesktopHeight &&
oActualPos.y2 <= m_iDesktopHeight + iDesktopSnapAmount))
{
oActualPos.y1 += m_iDesktopHeight - oActualPos.y2;
oActualPos.y2 = m_iDesktopHeight;
}
}
m_oMovePos = oScreenPos;
SetWindowPosition(oActualPos);
DecUsageRef();
return;
}
if (m_bLButtonDown && !LButtonDown())
{
m_bLButtonDown = false;
m_pMouseDownControl = NULL;
}
GetWindowPosition(oRect);
oPos.x = oScreenPos.x - oRect.x1;
oPos.y = oScreenPos.y - oRect.y1;
if (m_pCaptureControl)
{
m_pCaptureControl->AcceptTransition(CT_MouseMove, &oPos);
DecUsageRef();
return;
}
pControl = ControlFromPos(oPos);
if (pControl)
{
if (m_pMouseDownControl && m_pMouseInControl &&
m_pMouseDownControl != pControl)
{
m_pMouseInControl->AcceptTransition(CT_MouseLeave);
m_pMouseInControl = NULL;
}
else
if (m_pMouseDownControl && m_pMouseInControl == NULL &&
m_pMouseDownControl == pControl)
{
m_pMouseInControl = m_pMouseDownControl;
m_pMouseInControl->AcceptTransition(CT_MouseEnter);
m_pMouseInControl->AcceptTransition(CT_MouseLButtonDown);
}
else
if (!m_bLButtonDown)
{
if (m_pMouseInControl && m_pMouseInControl != pControl)
{
m_pMouseInControl->AcceptTransition(CT_MouseLeave);
m_pMouseInControl = pControl;
m_pMouseInControl->AcceptTransition(CT_MouseEnter);
//.........这里部分代码省略.........