| OLD | NEW |
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | 6 |
| 7 #include "xfa/fwl/basewidget/fwl_tooltipctrlimp.h" | 7 #include "xfa/fwl/basewidget/fwl_tooltipctrlimp.h" |
| 8 | 8 |
| 9 #include "xfa/fde/tto/fde_textout.h" | 9 #include "xfa/fde/tto/fde_textout.h" |
| 10 #include "xfa/fwl/basewidget/ifwl_tooltip.h" | 10 #include "xfa/fwl/basewidget/ifwl_tooltip.h" |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 if (m_hTimerHide) { | 218 if (m_hTimerHide) { |
| 219 FWL_StopTimer(m_hTimerHide); | 219 FWL_StopTimer(m_hTimerHide); |
| 220 m_hTimerHide = NULL; | 220 m_hTimerHide = NULL; |
| 221 } | 221 } |
| 222 if (m_hTimerShow) { | 222 if (m_hTimerShow) { |
| 223 FWL_StopTimer(m_hTimerShow); | 223 FWL_StopTimer(m_hTimerShow); |
| 224 m_hTimerShow = NULL; | 224 m_hTimerShow = NULL; |
| 225 } | 225 } |
| 226 return TRUE; | 226 return TRUE; |
| 227 } | 227 } |
| 228 FWL_ERR CFWL_ToolTipImp::SetStates(uint32_t dwStates, FX_BOOL bSet) { | 228 |
| 229 void CFWL_ToolTipImp::SetStates(uint32_t dwStates, FX_BOOL bSet) { |
| 229 if ((dwStates & FWL_WGTSTATE_Invisible) && !bSet) { | 230 if ((dwStates & FWL_WGTSTATE_Invisible) && !bSet) { |
| 230 IFWL_ToolTipDP* pData = | 231 IFWL_ToolTipDP* pData = |
| 231 static_cast<IFWL_ToolTipDP*>(m_pProperties->m_pDataProvider); | 232 static_cast<IFWL_ToolTipDP*>(m_pProperties->m_pDataProvider); |
| 232 int32_t nAutoPopDelay = pData->GetAutoPopDelay(m_pInterface); | 233 int32_t nAutoPopDelay = pData->GetAutoPopDelay(m_pInterface); |
| 233 m_hTimerHide = FWL_StartTimer(&m_TimerHide, nAutoPopDelay, FALSE); | 234 m_hTimerHide = FWL_StartTimer(&m_TimerHide, nAutoPopDelay, FALSE); |
| 234 } | 235 } |
| 235 return CFWL_WidgetImp::SetStates(dwStates, bSet); | 236 CFWL_WidgetImp::SetStates(dwStates, bSet); |
| 236 } | 237 } |
| 238 |
| 237 void CFWL_ToolTipImp::RefreshToolTipPos() { | 239 void CFWL_ToolTipImp::RefreshToolTipPos() { |
| 238 if ((m_pProperties->m_dwStyleExes & FWL_STYLEEXT_TTP_NoAnchor) == 0) { | 240 if ((m_pProperties->m_dwStyleExes & FWL_STYLEEXT_TTP_NoAnchor) == 0) { |
| 239 CFX_RectF rtPopup; | 241 CFX_RectF rtPopup; |
| 240 CFX_RectF rtWidget(m_pProperties->m_rtWidget); | 242 CFX_RectF rtWidget(m_pProperties->m_rtWidget); |
| 241 CFX_RectF rtAnchor(m_rtAnchor); | 243 CFX_RectF rtAnchor(m_rtAnchor); |
| 242 rtPopup.Set(0, 0, 0, 0); | 244 rtPopup.Set(0, 0, 0, 0); |
| 243 FX_FLOAT fx = rtAnchor.Center().x + 20; | 245 FX_FLOAT fx = rtAnchor.Center().x + 20; |
| 244 FX_FLOAT fy = rtAnchor.Center().y + 20; | 246 FX_FLOAT fy = rtAnchor.Center().y + 20; |
| 245 rtPopup.Set(fx, fy, rtWidget.Width(), rtWidget.Height()); | 247 rtPopup.Set(fx, fy, rtWidget.Width(), rtWidget.Height()); |
| 246 FX_FLOAT fScreenWidth = 0; | 248 FX_FLOAT fScreenWidth = 0; |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 int32_t CFWL_ToolTipImpDelegate::OnProcessMessage(CFWL_Message* pMessage) { | 289 int32_t CFWL_ToolTipImpDelegate::OnProcessMessage(CFWL_Message* pMessage) { |
| 288 return CFWL_WidgetImpDelegate::OnProcessMessage(pMessage); | 290 return CFWL_WidgetImpDelegate::OnProcessMessage(pMessage); |
| 289 } | 291 } |
| 290 FWL_ERR CFWL_ToolTipImpDelegate::OnProcessEvent(CFWL_Event* pEvent) { | 292 FWL_ERR CFWL_ToolTipImpDelegate::OnProcessEvent(CFWL_Event* pEvent) { |
| 291 return FWL_ERR_Succeeded; | 293 return FWL_ERR_Succeeded; |
| 292 } | 294 } |
| 293 FWL_ERR CFWL_ToolTipImpDelegate::OnDrawWidget(CFX_Graphics* pGraphics, | 295 FWL_ERR CFWL_ToolTipImpDelegate::OnDrawWidget(CFX_Graphics* pGraphics, |
| 294 const CFX_Matrix* pMatrix) { | 296 const CFX_Matrix* pMatrix) { |
| 295 return m_pOwner->DrawWidget(pGraphics, pMatrix); | 297 return m_pOwner->DrawWidget(pGraphics, pMatrix); |
| 296 } | 298 } |
| OLD | NEW |