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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 m_iTTOAlign(FDE_TTOALIGNMENT_Center), | 50 m_iTTOAlign(FDE_TTOALIGNMENT_Center), |
51 m_hTimerShow(NULL), | 51 m_hTimerShow(NULL), |
52 m_hTimerHide(NULL), | 52 m_hTimerHide(NULL), |
53 m_pTimer(NULL) { | 53 m_pTimer(NULL) { |
54 m_rtClient.Set(0, 0, 0, 0); | 54 m_rtClient.Set(0, 0, 0, 0); |
55 m_rtCaption.Set(0, 0, 0, 0); | 55 m_rtCaption.Set(0, 0, 0, 0); |
56 m_rtAnchor.Set(0, 0, 0, 0); | 56 m_rtAnchor.Set(0, 0, 0, 0); |
57 m_TimerShow.m_pToolTip = this; | 57 m_TimerShow.m_pToolTip = this; |
58 m_TimerHide.m_pToolTip = this; | 58 m_TimerHide.m_pToolTip = this; |
59 } | 59 } |
| 60 |
60 CFWL_ToolTipImp::~CFWL_ToolTipImp() { | 61 CFWL_ToolTipImp::~CFWL_ToolTipImp() { |
61 if (m_pTimer) { | 62 if (m_pTimer) { |
62 delete m_pTimer; | 63 delete m_pTimer; |
63 m_pTimer = NULL; | 64 m_pTimer = NULL; |
64 } | 65 } |
65 } | 66 } |
| 67 |
66 FWL_Error CFWL_ToolTipImp::GetClassName(CFX_WideString& wsClass) const { | 68 FWL_Error CFWL_ToolTipImp::GetClassName(CFX_WideString& wsClass) const { |
67 wsClass = FWL_CLASS_ToolTip; | 69 wsClass = FWL_CLASS_ToolTip; |
68 return FWL_Error::Succeeded; | 70 return FWL_Error::Succeeded; |
69 } | 71 } |
70 uint32_t CFWL_ToolTipImp::GetClassID() const { | 72 |
71 return FWL_CLASSHASH_ToolTip; | 73 FWL_Type CFWL_ToolTipImp::GetClassID() const { |
| 74 return FWL_Type::ToolTip; |
72 } | 75 } |
| 76 |
73 FWL_Error CFWL_ToolTipImp::Initialize() { | 77 FWL_Error CFWL_ToolTipImp::Initialize() { |
74 m_pProperties->m_dwStyles |= FWL_WGTSTYLE_Popup; | 78 m_pProperties->m_dwStyles |= FWL_WGTSTYLE_Popup; |
75 m_pProperties->m_dwStyles &= ~FWL_WGTSTYLE_Child; | 79 m_pProperties->m_dwStyles &= ~FWL_WGTSTYLE_Child; |
76 if (CFWL_WidgetImp::Initialize() != FWL_Error::Succeeded) | 80 if (CFWL_WidgetImp::Initialize() != FWL_Error::Succeeded) |
77 return FWL_Error::Indefinite; | 81 return FWL_Error::Indefinite; |
| 82 |
78 m_pDelegate = new CFWL_ToolTipImpDelegate(this); | 83 m_pDelegate = new CFWL_ToolTipImpDelegate(this); |
79 return FWL_Error::Succeeded; | 84 return FWL_Error::Succeeded; |
80 } | 85 } |
| 86 |
81 FWL_Error CFWL_ToolTipImp::Finalize() { | 87 FWL_Error CFWL_ToolTipImp::Finalize() { |
82 delete m_pDelegate; | 88 delete m_pDelegate; |
83 m_pDelegate = nullptr; | 89 m_pDelegate = nullptr; |
84 return CFWL_WidgetImp::Finalize(); | 90 return CFWL_WidgetImp::Finalize(); |
85 } | 91 } |
86 FWL_Error CFWL_ToolTipImp::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) { | 92 FWL_Error CFWL_ToolTipImp::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) { |
87 if (bAutoSize) { | 93 if (bAutoSize) { |
88 rect.Set(0, 0, 0, 0); | 94 rect.Set(0, 0, 0, 0); |
89 if (m_pProperties->m_pThemeProvider == NULL) { | 95 if (m_pProperties->m_pThemeProvider == NULL) { |
90 m_pProperties->m_pThemeProvider = GetAvailableTheme(); | 96 m_pProperties->m_pThemeProvider = GetAvailableTheme(); |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 void CFWL_ToolTipImpDelegate::OnProcessMessage(CFWL_Message* pMessage) { | 301 void CFWL_ToolTipImpDelegate::OnProcessMessage(CFWL_Message* pMessage) { |
296 CFWL_WidgetImpDelegate::OnProcessMessage(pMessage); | 302 CFWL_WidgetImpDelegate::OnProcessMessage(pMessage); |
297 } | 303 } |
298 | 304 |
299 void CFWL_ToolTipImpDelegate::OnProcessEvent(CFWL_Event* pEvent) {} | 305 void CFWL_ToolTipImpDelegate::OnProcessEvent(CFWL_Event* pEvent) {} |
300 | 306 |
301 void CFWL_ToolTipImpDelegate::OnDrawWidget(CFX_Graphics* pGraphics, | 307 void CFWL_ToolTipImpDelegate::OnDrawWidget(CFX_Graphics* pGraphics, |
302 const CFX_Matrix* pMatrix) { | 308 const CFX_Matrix* pMatrix) { |
303 m_pOwner->DrawWidget(pGraphics, pMatrix); | 309 m_pOwner->DrawWidget(pGraphics, pMatrix); |
304 } | 310 } |
OLD | NEW |