本文整理汇总了C++中IFWL_Widget::SetDelegate方法的典型用法代码示例。如果您正苦于以下问题:C++ IFWL_Widget::SetDelegate方法的具体用法?C++ IFWL_Widget::SetDelegate怎么用?C++ IFWL_Widget::SetDelegate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IFWL_Widget
的用法示例。
在下文中一共展示了IFWL_Widget::SetDelegate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DrawChild
void CFWL_WidgetMgrDelegate::DrawChild(IFWL_Widget* parent,
const CFX_RectF& rtClip,
CFX_Graphics* pGraphics,
const CFX_Matrix* pMatrix) {
if (!parent)
return;
FX_BOOL bFormDisable = m_pWidgetMgr->IsFormDisabled();
IFWL_Widget* pNextChild = m_pWidgetMgr->GetFirstChildWidget(parent);
while (pNextChild) {
IFWL_Widget* child = pNextChild;
pNextChild = m_pWidgetMgr->GetNextSiblingWidget(child);
if (child->GetStates() & FWL_WGTSTATE_Invisible)
continue;
CFX_RectF rtWidget;
child->GetWidgetRect(rtWidget);
if (rtWidget.IsEmpty())
continue;
CFX_Matrix widgetMatrix;
CFX_RectF clipBounds(rtWidget);
if (!bFormDisable)
child->GetMatrix(widgetMatrix, TRUE);
if (pMatrix)
widgetMatrix.Concat(*pMatrix);
if (!bFormDisable) {
widgetMatrix.TransformPoint(clipBounds.left, clipBounds.top);
clipBounds.Intersect(rtClip);
if (clipBounds.IsEmpty())
continue;
pGraphics->SaveGraphState();
pGraphics->SetClipRect(clipBounds);
}
widgetMatrix.Translate(rtWidget.left, rtWidget.top, TRUE);
IFWL_WidgetDelegate* pDelegate = child->SetDelegate(nullptr);
if (pDelegate) {
if (m_pWidgetMgr->IsFormDisabled() ||
IsNeedRepaint(child, &widgetMatrix, rtClip)) {
pDelegate->OnDrawWidget(pGraphics, &widgetMatrix);
}
}
if (!bFormDisable)
pGraphics->RestoreGraphState();
DrawChild(child, clipBounds, pGraphics,
bFormDisable ? &widgetMatrix : pMatrix);
child = m_pWidgetMgr->GetNextSiblingWidget(child);
}
}
示例2: OnProcessMessage
int32_t CFWL_DateTimeEditImpDelegate::OnProcessMessage(CFWL_Message* pMessage) {
if (m_pOwner->m_pWidgetMgr->IsFormDisabled()) {
return DisForm_OnProcessMessage(pMessage);
}
FX_DWORD dwHashCode = pMessage->GetClassID();
if (dwHashCode == FWL_MSGHASH_SetFocus ||
dwHashCode == FWL_MSGHASH_KillFocus) {
IFWL_Widget* pOuter = m_pOwner->GetOuter();
IFWL_WidgetDelegate* pDelegate = pOuter->SetDelegate(NULL);
pDelegate->OnProcessMessage(pMessage);
}
return 1;
}
示例3: SetFocus
FX_BOOL CFWL_NoteDriver::SetFocus(IFWL_Widget* pFocus, FX_BOOL bNotify) {
if (m_pFocus == pFocus) {
return TRUE;
}
IFWL_Widget* pPrev = m_pFocus;
m_pFocus = pFocus;
if (pPrev) {
CFWL_MsgKillFocus ms;
ms.m_pDstTarget = pPrev;
ms.m_pSrcTarget = pPrev;
if (bNotify) {
ms.m_dwExtend = 1;
}
IFWL_WidgetDelegate* pDelegate = pPrev->SetDelegate(NULL);
if (pDelegate) {
pDelegate->OnProcessMessage(&ms);
}
}
if (pFocus) {
IFWL_Widget* pWidget =
FWL_GetWidgetMgr()->GetWidget(pFocus, FWL_WGTRELATION_SystemForm);
CFWL_FormImp* pForm =
pWidget ? static_cast<CFWL_FormImp*>(pWidget->GetImpl()) : nullptr;
if (pForm) {
CFWL_WidgetImp* pNewFocus =
static_cast<CFWL_WidgetImp*>(pFocus->GetImpl());
pForm->SetSubFocus(pNewFocus);
}
CFWL_MsgSetFocus ms;
ms.m_pDstTarget = pFocus;
if (bNotify) {
ms.m_dwExtend = 1;
}
IFWL_WidgetDelegate* pDelegate = pFocus->SetDelegate(NULL);
if (pDelegate) {
pDelegate->OnProcessMessage(&ms);
}
}
return TRUE;
}