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 "../../../foxitlib.h" | 7 #include "../../../foxitlib.h" |
8 #include "../core/include/fwl_targetimp.h" | 8 #include "../core/include/fwl_targetimp.h" |
9 #include "../core/include/fwl_noteimp.h" | 9 #include "../core/include/fwl_noteimp.h" |
10 #include "../core/include/fwl_widgetimp.h" | 10 #include "../core/include/fwl_widgetimp.h" |
11 #include "../core/include/fwl_panelimp.h" | 11 #include "../core/include/fwl_panelimp.h" |
12 #include "../core/include/fwl_formimp.h" | 12 #include "../core/include/fwl_formimp.h" |
13 #include "include/fwl_tooltipctrlimp.h" | 13 #include "include/fwl_tooltipctrlimp.h" |
14 IFWL_ToolTip* IFWL_ToolTip::Create() { | 14 IFWL_ToolTip* IFWL_ToolTip::Create() { |
15 return new IFWL_ToolTip; | 15 return new IFWL_ToolTip; |
16 } | 16 } |
17 FWL_ERR IFWL_ToolTip::Initialize(IFWL_Widget* pOuter) { | 17 FWL_ERR IFWL_ToolTip::Initialize(IFWL_Widget* pOuter) { |
18 m_pImpl = new CFWL_ToolTipImp(pOuter); | 18 CFWL_ToolTipImp* pToolTipImpl = new CFWL_ToolTipImp(pOuter); |
19 ((CFWL_ToolTipImp*)m_pImpl)->SetInterface(this); | 19 SetImpl(pToolTipImpl); |
20 return ((CFWL_ToolTipImp*)m_pImpl)->Initialize(); | 20 pToolTipImpl->SetInterface(this); |
| 21 return pToolTipImpl->Initialize(); |
21 } | 22 } |
22 FWL_ERR IFWL_ToolTip::Initialize(const CFWL_WidgetImpProperties& properties, | 23 FWL_ERR IFWL_ToolTip::Initialize(const CFWL_WidgetImpProperties& properties, |
23 IFWL_Widget* pOuter) { | 24 IFWL_Widget* pOuter) { |
24 m_pImpl = new CFWL_ToolTipImp(properties, pOuter); | 25 CFWL_ToolTipImp* pToolTipImpl = new CFWL_ToolTipImp(properties, pOuter); |
25 ((CFWL_ToolTipImp*)m_pImpl)->SetInterface(this); | 26 SetImpl(pToolTipImpl); |
26 return ((CFWL_ToolTipImp*)m_pImpl)->Initialize(); | 27 pToolTipImpl->SetInterface(this); |
| 28 return pToolTipImpl->Initialize(); |
27 } | 29 } |
28 FWL_ERR IFWL_ToolTip::SetAnchor(const CFX_RectF& rtAnchor) { | 30 FWL_ERR IFWL_ToolTip::SetAnchor(const CFX_RectF& rtAnchor) { |
29 return ((CFWL_ToolTipImp*)m_pImpl)->SetAnchor(rtAnchor); | 31 return static_cast<CFWL_ToolTipImp*>(GetImpl())->SetAnchor(rtAnchor); |
30 } | 32 } |
31 FWL_ERR IFWL_ToolTip::Show() { | 33 FWL_ERR IFWL_ToolTip::Show() { |
32 return ((CFWL_ToolTipImp*)m_pImpl)->Show(); | 34 return static_cast<CFWL_ToolTipImp*>(GetImpl())->Show(); |
33 } | 35 } |
34 FWL_ERR IFWL_ToolTip::Hide() { | 36 FWL_ERR IFWL_ToolTip::Hide() { |
35 return ((CFWL_ToolTipImp*)m_pImpl)->Hide(); | 37 return static_cast<CFWL_ToolTipImp*>(GetImpl())->Hide(); |
36 } | 38 } |
37 IFWL_ToolTip::IFWL_ToolTip() { | 39 IFWL_ToolTip::IFWL_ToolTip() { |
38 m_pImpl = NULL; | |
39 } | |
40 IFWL_ToolTip::~IFWL_ToolTip() { | |
41 if (m_pImpl) { | |
42 delete (CFWL_ToolTipImp*)m_pImpl; | |
43 m_pImpl = NULL; | |
44 } | |
45 } | 40 } |
46 CFWL_ToolTipImp::CFWL_ToolTipImp(IFWL_Widget* pOuter) | 41 CFWL_ToolTipImp::CFWL_ToolTipImp(IFWL_Widget* pOuter) |
47 : CFWL_FormImp(pOuter), | 42 : CFWL_FormImp(pOuter), |
48 m_bBtnDown(FALSE), | 43 m_bBtnDown(FALSE), |
49 m_dwTTOStyles(FDE_TTOSTYLE_SingleLine), | 44 m_dwTTOStyles(FDE_TTOSTYLE_SingleLine), |
50 m_iTTOAlign(FDE_TTOALIGNMENT_Center), | 45 m_iTTOAlign(FDE_TTOALIGNMENT_Center), |
51 m_hTimerShow(NULL), | 46 m_hTimerShow(NULL), |
52 m_hTimerHide(NULL), | 47 m_hTimerHide(NULL), |
53 m_pTimer(NULL) { | 48 m_pTimer(NULL) { |
54 m_rtClient.Set(0, 0, 0, 0); | 49 m_rtClient.Set(0, 0, 0, 0); |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 int32_t CFWL_ToolTipImpDelegate::OnProcessMessage(CFWL_Message* pMessage) { | 300 int32_t CFWL_ToolTipImpDelegate::OnProcessMessage(CFWL_Message* pMessage) { |
306 return CFWL_WidgetImpDelegate::OnProcessMessage(pMessage); | 301 return CFWL_WidgetImpDelegate::OnProcessMessage(pMessage); |
307 } | 302 } |
308 FWL_ERR CFWL_ToolTipImpDelegate::OnProcessEvent(CFWL_Event* pEvent) { | 303 FWL_ERR CFWL_ToolTipImpDelegate::OnProcessEvent(CFWL_Event* pEvent) { |
309 return FWL_ERR_Succeeded; | 304 return FWL_ERR_Succeeded; |
310 } | 305 } |
311 FWL_ERR CFWL_ToolTipImpDelegate::OnDrawWidget(CFX_Graphics* pGraphics, | 306 FWL_ERR CFWL_ToolTipImpDelegate::OnDrawWidget(CFX_Graphics* pGraphics, |
312 const CFX_Matrix* pMatrix) { | 307 const CFX_Matrix* pMatrix) { |
313 return m_pOwner->DrawWidget(pGraphics, pMatrix); | 308 return m_pOwner->DrawWidget(pGraphics, pMatrix); |
314 } | 309 } |
OLD | NEW |