Index: xfa/src/fwl/src/core/fwl_formimp.cpp |
diff --git a/xfa/src/fwl/src/core/fwl_formimp.cpp b/xfa/src/fwl/src/core/fwl_formimp.cpp |
index ae450f353d6d7661e23848f1b0e95a5af2cad639..d98d9d9ce61869f0a8cb68b800661572dbf6c54a 100644 |
--- a/xfa/src/fwl/src/core/fwl_formimp.cpp |
+++ b/xfa/src/fwl/src/core/fwl_formimp.cpp |
@@ -648,78 +648,6 @@ void CFWL_FormImp::SetWorkAreaRect() { |
Repaint(&m_rtRelative); |
} |
void CFWL_FormImp::SetCursor(FX_FLOAT fx, FX_FLOAT fy) { |
- IFWL_AdapterNative* pNative = FWL_GetAdapterNative(); |
- IFWL_AdapterCursorMgr* pCursorMgr = pNative->GetCursorMgr(); |
- if (!pCursorMgr) |
- return; |
- FX_DWORD dwHitTest = HitTest(fx, fy); |
- switch (dwHitTest) { |
- case FWL_WGTHITTEST_Right: { |
- FWL_HCURSOR hCursor = pCursorMgr->GetSystemCursor(FWL_CURSORTYPE_SizeWE); |
- pCursorMgr->SetCursor(hCursor); |
- pCursorMgr->ShowCursor(TRUE); |
- m_eResizeType = FORM_RESIZETYPE_Right; |
- break; |
- } |
- case FWL_WGTHITTEST_Bottom: { |
- FWL_HCURSOR hCursor = pCursorMgr->GetSystemCursor(FWL_CURSORTYPE_SizeNS); |
- pCursorMgr->SetCursor(hCursor); |
- pCursorMgr->ShowCursor(TRUE); |
- m_eResizeType = FORM_RESIZETYPE_Bottom; |
- break; |
- } |
- case FWL_WGTHITTEST_Left: { |
- FWL_HCURSOR hCursor = pCursorMgr->GetSystemCursor(FWL_CURSORTYPE_SizeWE); |
- pCursorMgr->SetCursor(hCursor); |
- pCursorMgr->ShowCursor(TRUE); |
- m_eResizeType = FORM_RESIZETYPE_Left; |
- break; |
- } |
- case FWL_WGTHITTEST_Top: { |
- FWL_HCURSOR hCursor = pCursorMgr->GetSystemCursor(FWL_CURSORTYPE_SizeNS); |
- pCursorMgr->SetCursor(hCursor); |
- pCursorMgr->ShowCursor(TRUE); |
- m_eResizeType = FORM_RESIZETYPE_Top; |
- break; |
- } |
- case FWL_WGTHITTEST_LeftTop: { |
- FWL_HCURSOR hCursor = |
- pCursorMgr->GetSystemCursor(FWL_CURSORTYPE_SizeNWSE); |
- pCursorMgr->SetCursor(hCursor); |
- pCursorMgr->ShowCursor(TRUE); |
- m_eResizeType = FORM_RESIZETYPE_LeftTop; |
- break; |
- } |
- case FWL_WGTHITTEST_LeftBottom: { |
- FWL_HCURSOR hCursor = |
- pCursorMgr->GetSystemCursor(FWL_CURSORTYPE_SizeNESW); |
- pCursorMgr->SetCursor(hCursor); |
- pCursorMgr->ShowCursor(TRUE); |
- m_eResizeType = FORM_RESIZETYPE_LeftBottom; |
- break; |
- } |
- case FWL_WGTHITTEST_RightTop: { |
- FWL_HCURSOR hCursor = |
- pCursorMgr->GetSystemCursor(FWL_CURSORTYPE_SizeNESW); |
- pCursorMgr->SetCursor(hCursor); |
- pCursorMgr->ShowCursor(TRUE); |
- m_eResizeType = FORM_RESIZETYPE_RightTop; |
- break; |
- } |
- case FWL_WGTHITTEST_RightBottom: { |
- FWL_HCURSOR hCursor = |
- pCursorMgr->GetSystemCursor(FWL_CURSORTYPE_SizeNWSE); |
- pCursorMgr->SetCursor(hCursor); |
- pCursorMgr->ShowCursor(TRUE); |
- m_eResizeType = FORM_RESIZETYPE_RightBottom; |
- break; |
- } |
- default: { |
- FWL_HCURSOR hCursor = pCursorMgr->GetSystemCursor(FWL_CURSORTYPE_Arrow); |
- pCursorMgr->SetCursor(hCursor); |
- pCursorMgr->ShowCursor(TRUE); |
- } |
- } |
} |
void CFWL_FormImp::Layout() { |
GetRelativeRect(m_rtRelative); |
@@ -1144,195 +1072,7 @@ void CFWL_FormImpDelegate::OnLButtonUp(CFWL_MsgMouse* pMsg) { |
} |
} |
void CFWL_FormImpDelegate::OnMouseMove(CFWL_MsgMouse* pMsg) { |
- CFWL_WidgetMgr* pWidgetMgr = static_cast<CFWL_WidgetMgr*>(FWL_GetWidgetMgr()); |
if (m_pOwner->m_bLButtonDown) { |
- IFWL_AdapterNative* pNative = FWL_GetAdapterNative(); |
- IFWL_AdapterCursorMgr* pCursorMgr = pNative->GetCursorMgr(); |
- if (!pCursorMgr) |
- return; |
- CFWL_SysBtn* pPressedBtn = |
- m_pOwner->GetSysBtnByIndex(m_pOwner->m_iCaptureBtn); |
- FX_FLOAT fTop, fLeft, fWidth, fHeight; |
- fTop = m_pOwner->m_pProperties->m_rtWidget.top; |
- fLeft = m_pOwner->m_pProperties->m_rtWidget.left; |
- fWidth = m_pOwner->m_pProperties->m_rtWidget.width; |
- fHeight = m_pOwner->m_pProperties->m_rtWidget.height; |
- FX_FLOAT fWidthMax, fWidthMin, fHeightMax, fHeightMin; |
- if (m_pOwner->m_pContent) { |
- m_pOwner->GetContent()->GetMaxSize(fWidthMax, fHeightMax); |
- m_pOwner->GetContent()->GetMinSize(fWidthMin, fHeightMin); |
- } else { |
- fWidthMax = fHeightMax = 1024 * 4; |
- fWidthMin = fHeightMin = 0; |
- } |
- FX_BOOL bWidthlimit = (fWidthMin != 0 || fWidthMax != 0); |
- FX_BOOL bHeightlimit = (fHeightMin != 0 || fHeightMax != 0); |
- FX_BOOL bSizelimit = bWidthlimit || bHeightlimit; |
- if (fWidthMax != 0 || fHeightMax != 0 || fWidthMin != 0 || |
- fHeightMin != 0) { |
- bSizelimit = TRUE; |
- } |
- if (pPressedBtn) { |
- if (!pPressedBtn->m_rtBtn.Contains(pMsg->m_fx, pMsg->m_fy)) { |
- pPressedBtn->SetNormal(); |
- } else { |
- pPressedBtn->SetPressed(); |
- } |
- m_pOwner->Repaint(&pPressedBtn->m_rtBtn); |
- return; |
- } else if (m_pOwner->m_bMaximized) { |
- return; |
- } else if (m_pOwner->m_eResizeType == FORM_RESIZETYPE_Cap) { |
- m_pOwner->m_pProperties->m_rtWidget.Offset( |
- pMsg->m_fx - m_pOwner->m_InfoStart.m_ptStart.x, |
- pMsg->m_fy - m_pOwner->m_InfoStart.m_ptStart.y); |
- pWidgetMgr->SetWidgetPosition_Native( |
- m_pOwner->m_pInterface, m_pOwner->m_pProperties->m_rtWidget.left, |
- m_pOwner->m_pProperties->m_rtWidget.top); |
- return; |
- } else if (m_pOwner->m_eResizeType == FORM_RESIZETYPE_Right) { |
- FWL_HCURSOR hCursor = pCursorMgr->GetSystemCursor(FWL_CURSORTYPE_SizeWE); |
- pCursorMgr->SetCursor(hCursor); |
- pCursorMgr->ShowCursor(TRUE); |
- if (!bWidthlimit) { |
- fWidth += pMsg->m_fx - m_pOwner->m_InfoStart.m_ptStart.x; |
- m_pOwner->m_InfoStart.m_ptStart.x = pMsg->m_fx; |
- } else { |
- m_pOwner->DoWidthLimit(fLeft, fWidth, pMsg->m_fx, |
- m_pOwner->m_InfoStart.m_szStart.x - |
- m_pOwner->m_InfoStart.m_ptStart.x, |
- fWidthMin, fWidthMax, FALSE); |
- } |
- } else if (m_pOwner->m_eResizeType == FORM_RESIZETYPE_Left) { |
- FWL_HCURSOR hCursor = pCursorMgr->GetSystemCursor(FWL_CURSORTYPE_SizeWE); |
- pCursorMgr->SetCursor(hCursor); |
- pCursorMgr->ShowCursor(TRUE); |
- if (!bWidthlimit) { |
- fLeft -= m_pOwner->m_InfoStart.m_ptStart.x - pMsg->m_fx; |
- fWidth += m_pOwner->m_InfoStart.m_ptStart.x - pMsg->m_fx; |
- } else { |
- m_pOwner->DoWidthLimit(fLeft, fWidth, pMsg->m_fx, |
- m_pOwner->m_InfoStart.m_ptStart.x, fWidthMin, |
- fWidthMax, TRUE); |
- } |
- } else if (m_pOwner->m_eResizeType == FORM_RESIZETYPE_Bottom) { |
- FWL_HCURSOR hCursor = pCursorMgr->GetSystemCursor(FWL_CURSORTYPE_SizeNS); |
- pCursorMgr->SetCursor(hCursor); |
- pCursorMgr->ShowCursor(TRUE); |
- if (!bHeightlimit) { |
- fHeight += pMsg->m_fy - m_pOwner->m_InfoStart.m_ptStart.y; |
- m_pOwner->m_InfoStart.m_ptStart.y = pMsg->m_fy; |
- } else { |
- m_pOwner->DoHeightLimit(fTop, fHeight, pMsg->m_fy, |
- m_pOwner->m_InfoStart.m_szStart.y - |
- m_pOwner->m_InfoStart.m_ptStart.y, |
- fHeightMin, fHeightMax, FALSE); |
- } |
- } else if (m_pOwner->m_eResizeType == FORM_RESIZETYPE_Top) { |
- FWL_HCURSOR hCursor = pCursorMgr->GetSystemCursor(FWL_CURSORTYPE_SizeNS); |
- pCursorMgr->SetCursor(hCursor); |
- pCursorMgr->ShowCursor(TRUE); |
- if (!bHeightlimit) { |
- fTop += pMsg->m_fy - m_pOwner->m_InfoStart.m_ptStart.y; |
- fHeight -= pMsg->m_fy - m_pOwner->m_InfoStart.m_ptStart.y; |
- } else { |
- m_pOwner->DoHeightLimit(fTop, fHeight, pMsg->m_fy, |
- m_pOwner->m_InfoStart.m_ptStart.y, fHeightMin, |
- fHeightMax, TRUE); |
- } |
- } else if (m_pOwner->m_eResizeType == FORM_RESIZETYPE_LeftTop) { |
- FWL_HCURSOR hCursor = |
- pCursorMgr->GetSystemCursor(FWL_CURSORTYPE_SizeNWSE); |
- pCursorMgr->SetCursor(hCursor); |
- pCursorMgr->ShowCursor(TRUE); |
- if (!bSizelimit) { |
- fLeft -= m_pOwner->m_InfoStart.m_ptStart.x - pMsg->m_fx; |
- fTop += pMsg->m_fy - m_pOwner->m_InfoStart.m_ptStart.y; |
- fWidth += m_pOwner->m_InfoStart.m_ptStart.x - pMsg->m_fx; |
- fHeight -= pMsg->m_fy - m_pOwner->m_InfoStart.m_ptStart.y; |
- m_pOwner->m_InfoStart.m_ptStart.x = pMsg->m_fx; |
- m_pOwner->m_InfoStart.m_ptStart.y = pMsg->m_fy; |
- } else { |
- m_pOwner->DoWidthLimit(fLeft, fWidth, pMsg->m_fx, |
- m_pOwner->m_InfoStart.m_ptStart.x, fWidthMin, |
- fWidthMax, TRUE); |
- m_pOwner->DoHeightLimit(fTop, fHeight, pMsg->m_fy, |
- m_pOwner->m_InfoStart.m_ptStart.y, fHeightMin, |
- fHeightMax, TRUE); |
- } |
- } else if (m_pOwner->m_eResizeType == FORM_RESIZETYPE_LeftBottom) { |
- FWL_HCURSOR hCursor = |
- pCursorMgr->GetSystemCursor(FWL_CURSORTYPE_SizeNESW); |
- pCursorMgr->SetCursor(hCursor); |
- pCursorMgr->ShowCursor(TRUE); |
- if (!bSizelimit) { |
- fLeft -= m_pOwner->m_InfoStart.m_ptStart.x - pMsg->m_fx; |
- fWidth += m_pOwner->m_InfoStart.m_ptStart.x - pMsg->m_fx; |
- fHeight += pMsg->m_fy - m_pOwner->m_InfoStart.m_ptStart.y; |
- m_pOwner->m_InfoStart.m_ptStart.x = pMsg->m_fx; |
- m_pOwner->m_InfoStart.m_ptStart.y = pMsg->m_fy; |
- } else { |
- m_pOwner->DoWidthLimit(fLeft, fWidth, pMsg->m_fx, |
- m_pOwner->m_InfoStart.m_ptStart.x, fWidthMin, |
- fWidthMax, TRUE); |
- m_pOwner->DoHeightLimit(fTop, fHeight, pMsg->m_fy, |
- m_pOwner->m_InfoStart.m_szStart.y - |
- m_pOwner->m_InfoStart.m_ptStart.y, |
- fHeightMin, fHeightMax, FALSE); |
- } |
- } else if (m_pOwner->m_eResizeType == FORM_RESIZETYPE_RightTop) { |
- FWL_HCURSOR hCursor = |
- pCursorMgr->GetSystemCursor(FWL_CURSORTYPE_SizeNESW); |
- pCursorMgr->SetCursor(hCursor); |
- pCursorMgr->ShowCursor(TRUE); |
- if (!bSizelimit) { |
- fTop += pMsg->m_fy - m_pOwner->m_InfoStart.m_ptStart.y; |
- fWidth += pMsg->m_fx - m_pOwner->m_InfoStart.m_ptStart.x; |
- fHeight -= pMsg->m_fy - m_pOwner->m_InfoStart.m_ptStart.y; |
- m_pOwner->m_InfoStart.m_ptStart.x = pMsg->m_fx; |
- m_pOwner->m_InfoStart.m_ptStart.y = pMsg->m_fy; |
- } else { |
- m_pOwner->DoWidthLimit(fLeft, fWidth, pMsg->m_fx, |
- m_pOwner->m_InfoStart.m_szStart.x - |
- m_pOwner->m_InfoStart.m_ptStart.x, |
- fWidthMin, fWidthMax, FALSE); |
- m_pOwner->DoHeightLimit(fTop, fHeight, pMsg->m_fy, |
- m_pOwner->m_InfoStart.m_ptStart.y, fHeightMin, |
- fHeightMax, TRUE); |
- } |
- } else if (m_pOwner->m_eResizeType == FORM_RESIZETYPE_RightBottom) { |
- FWL_HCURSOR hCursor = |
- pCursorMgr->GetSystemCursor(FWL_CURSORTYPE_SizeNWSE); |
- pCursorMgr->SetCursor(hCursor); |
- pCursorMgr->ShowCursor(TRUE); |
- if (!bSizelimit) { |
- fWidth += pMsg->m_fx - m_pOwner->m_InfoStart.m_ptStart.x; |
- fHeight += pMsg->m_fy - m_pOwner->m_InfoStart.m_ptStart.y; |
- m_pOwner->m_InfoStart.m_ptStart.x = pMsg->m_fx; |
- m_pOwner->m_InfoStart.m_ptStart.y = pMsg->m_fy; |
- } else { |
- m_pOwner->DoWidthLimit(fLeft, fWidth, pMsg->m_fx, |
- m_pOwner->m_InfoStart.m_szStart.x - |
- m_pOwner->m_InfoStart.m_ptStart.x, |
- fWidthMin, fWidthMax, FALSE); |
- m_pOwner->DoHeightLimit(fTop, fHeight, pMsg->m_fy, |
- m_pOwner->m_InfoStart.m_szStart.y - |
- m_pOwner->m_InfoStart.m_ptStart.y, |
- fHeightMin, fHeightMax, FALSE); |
- } |
- } |
- if (m_pOwner->m_pContent) { |
- } |
- CFX_RectF rtForm; |
- rtForm.Set(fLeft, fTop, fWidth, fHeight); |
-#if (_FX_OS_ == _FX_MACOSX_) |
- m_pOwner->m_pProperties->m_rtWidget = rtForm; |
- m_pOwner->Update(); |
- m_pOwner->SetWidgetRect(rtForm); |
-#else |
- m_pOwner->SetWidgetRect(rtForm); |
- m_pOwner->Update(); |
-#endif |
return; |
} |
if ((m_pOwner->m_pProperties->m_dwStyles & FWL_WGTSTYLE_Border) && |