本文整理汇总了C++中IFWL_Widget::GetParent方法的典型用法代码示例。如果您正苦于以下问题:C++ IFWL_Widget::GetParent方法的具体用法?C++ IFWL_Widget::GetParent怎么用?C++ IFWL_Widget::GetParent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IFWL_Widget
的用法示例。
在下文中一共展示了IFWL_Widget::GetParent方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DoMouseEx
FX_BOOL CFWL_NoteDriver::DoMouseEx(CFWL_MsgMouse* pMsg,
IFWL_Widget* pMessageForm) {
CFWL_WidgetMgr* pWidgetMgr = static_cast<CFWL_WidgetMgr*>(FWL_GetWidgetMgr());
if (!pWidgetMgr)
return FALSE;
IFWL_Widget* pTarget = NULL;
if (m_pGrab)
pTarget = m_pGrab;
if (!pTarget) {
pTarget =
pWidgetMgr->GetWidgetAtPoint(pMessageForm, pMsg->m_fx, pMsg->m_fy);
while (pTarget && pTarget->GetClassID() == FWL_CLASSHASH_Grid) {
pTarget = pTarget->GetParent();
}
}
if (pTarget) {
if (pMessageForm != pTarget) {
pMessageForm->TransformTo(pTarget, pMsg->m_fx, pMsg->m_fy);
}
}
if (!pTarget)
return FALSE;
pMsg->m_pDstTarget = pTarget;
return TRUE;
}
示例2: GetMatrix
void IFWL_Widget::GetMatrix(CFX_Matrix& matrix, bool bGlobal) {
if (!m_pProperties)
return;
if (!bGlobal) {
matrix.SetIdentity();
return;
}
IFWL_Widget* parent = GetParent();
CFX_ArrayTemplate<IFWL_Widget*> parents;
while (parent) {
parents.Add(parent);
parent = parent->GetParent();
}
matrix.SetIdentity();
CFX_Matrix ctmOnParent;
CFX_RectF rect;
int32_t count = parents.GetSize();
for (int32_t i = count - 2; i >= 0; i--) {
parent = parents.GetAt(i);
parent->GetMatrix(ctmOnParent, false);
parent->GetWidgetRect(rect);
matrix.Concat(ctmOnParent, true);
matrix.Translate(rect.left, rect.top, true);
}
CFX_Matrix m;
m.SetIdentity();
matrix.Concat(m, true);
parents.RemoveAll();
}
示例3: IsParent
bool IFWL_Widget::IsParent(IFWL_Widget* pParent) {
IFWL_Widget* pUpWidget = GetParent();
while (pUpWidget) {
if (pUpWidget == pParent)
return true;
pUpWidget = pUpWidget->GetParent();
}
return false;
}
示例4: DoWheel
FX_BOOL CFWL_NoteDriver::DoWheel(CFWL_MsgMouseWheel* pMsg,
IFWL_Widget* pMessageForm) {
CFWL_WidgetMgr* pWidgetMgr = static_cast<CFWL_WidgetMgr*>(FWL_GetWidgetMgr());
if (!pWidgetMgr)
return FALSE;
IFWL_Widget* pDst =
pWidgetMgr->GetWidgetAtPoint(pMessageForm, pMsg->m_fx, pMsg->m_fy);
if (!pDst)
return FALSE;
while (pDst && pDst->GetClassID() == FWL_CLASSHASH_Grid) {
pDst = pDst->GetParent();
}
pMessageForm->TransformTo(pDst, pMsg->m_fx, pMsg->m_fy);
pMsg->m_pDstTarget = pDst;
return TRUE;
}