| 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/core/ifwl_tooltip.h" | 7 #include "xfa/fwl/core/ifwl_tooltip.h" |
| 8 | 8 |
| 9 #include "xfa/fde/tto/fde_textout.h" | 9 #include "xfa/fde/tto/fde_textout.h" |
| 10 #include "xfa/fwl/core/cfwl_themebackground.h" | 10 #include "xfa/fwl/core/cfwl_themebackground.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 m_pTimerInfoHide(nullptr) { | 25 m_pTimerInfoHide(nullptr) { |
| 26 m_rtClient.Set(0, 0, 0, 0); | 26 m_rtClient.Set(0, 0, 0, 0); |
| 27 m_rtCaption.Set(0, 0, 0, 0); | 27 m_rtCaption.Set(0, 0, 0, 0); |
| 28 m_rtAnchor.Set(0, 0, 0, 0); | 28 m_rtAnchor.Set(0, 0, 0, 0); |
| 29 m_TimerShow.m_pToolTip = this; | 29 m_TimerShow.m_pToolTip = this; |
| 30 m_TimerHide.m_pToolTip = this; | 30 m_TimerHide.m_pToolTip = this; |
| 31 } | 31 } |
| 32 | 32 |
| 33 IFWL_ToolTip::~IFWL_ToolTip() {} | 33 IFWL_ToolTip::~IFWL_ToolTip() {} |
| 34 | 34 |
| 35 FWL_Error IFWL_ToolTip::GetClassName(CFX_WideString& wsClass) const { | |
| 36 wsClass = FWL_CLASS_ToolTip; | |
| 37 return FWL_Error::Succeeded; | |
| 38 } | |
| 39 | |
| 40 FWL_Type IFWL_ToolTip::GetClassID() const { | 35 FWL_Type IFWL_ToolTip::GetClassID() const { |
| 41 return FWL_Type::ToolTip; | 36 return FWL_Type::ToolTip; |
| 42 } | 37 } |
| 43 | 38 |
| 44 FWL_Error IFWL_ToolTip::Initialize() { | 39 FWL_Error IFWL_ToolTip::Initialize() { |
| 45 m_pProperties->m_dwStyles |= FWL_WGTSTYLE_Popup; | 40 m_pProperties->m_dwStyles |= FWL_WGTSTYLE_Popup; |
| 46 m_pProperties->m_dwStyles &= ~FWL_WGTSTYLE_Child; | 41 m_pProperties->m_dwStyles &= ~FWL_WGTSTYLE_Child; |
| 47 if (IFWL_Widget::Initialize() != FWL_Error::Succeeded) | 42 if (IFWL_Widget::Initialize() != FWL_Error::Succeeded) |
| 48 return FWL_Error::Indefinite; | 43 return FWL_Error::Indefinite; |
| 49 | 44 |
| 50 m_pDelegate = new CFWL_ToolTipImpDelegate(this); | 45 m_pDelegate = new CFWL_ToolTipImpDelegate(this); |
| 51 return FWL_Error::Succeeded; | 46 return FWL_Error::Succeeded; |
| 52 } | 47 } |
| 53 | 48 |
| 54 FWL_Error IFWL_ToolTip::Finalize() { | 49 void IFWL_ToolTip::Finalize() { |
| 55 delete m_pDelegate; | 50 delete m_pDelegate; |
| 56 m_pDelegate = nullptr; | 51 m_pDelegate = nullptr; |
| 57 return IFWL_Widget::Finalize(); | 52 IFWL_Widget::Finalize(); |
| 58 } | 53 } |
| 59 | 54 |
| 60 FWL_Error IFWL_ToolTip::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) { | 55 FWL_Error IFWL_ToolTip::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) { |
| 61 if (bAutoSize) { | 56 if (bAutoSize) { |
| 62 rect.Set(0, 0, 0, 0); | 57 rect.Set(0, 0, 0, 0); |
| 63 if (!m_pProperties->m_pThemeProvider) { | 58 if (!m_pProperties->m_pThemeProvider) { |
| 64 m_pProperties->m_pThemeProvider = GetAvailableTheme(); | 59 m_pProperties->m_pThemeProvider = GetAvailableTheme(); |
| 65 } | 60 } |
| 66 CFX_WideString wsCaption; | 61 CFX_WideString wsCaption; |
| 67 IFWL_ToolTipDP* pData = | 62 IFWL_ToolTipDP* pData = |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 void CFWL_ToolTipImpDelegate::OnProcessMessage(CFWL_Message* pMessage) { | 266 void CFWL_ToolTipImpDelegate::OnProcessMessage(CFWL_Message* pMessage) { |
| 272 CFWL_WidgetImpDelegate::OnProcessMessage(pMessage); | 267 CFWL_WidgetImpDelegate::OnProcessMessage(pMessage); |
| 273 } | 268 } |
| 274 | 269 |
| 275 void CFWL_ToolTipImpDelegate::OnProcessEvent(CFWL_Event* pEvent) {} | 270 void CFWL_ToolTipImpDelegate::OnProcessEvent(CFWL_Event* pEvent) {} |
| 276 | 271 |
| 277 void CFWL_ToolTipImpDelegate::OnDrawWidget(CFX_Graphics* pGraphics, | 272 void CFWL_ToolTipImpDelegate::OnDrawWidget(CFX_Graphics* pGraphics, |
| 278 const CFX_Matrix* pMatrix) { | 273 const CFX_Matrix* pMatrix) { |
| 279 m_pOwner->DrawWidget(pGraphics, pMatrix); | 274 m_pOwner->DrawWidget(pGraphics, pMatrix); |
| 280 } | 275 } |
| OLD | NEW |