| 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/fwl_formimp.h" | 7 #include "xfa/fwl/core/fwl_formimp.h" |
| 8 | 8 |
| 9 #include "xfa/fde/tto/fde_textout.h" | 9 #include "xfa/fde/tto/fde_textout.h" |
| 10 #include "xfa/fwl/basewidget/fwl_formproxyimp.h" | 10 #include "xfa/fwl/basewidget/fwl_formproxyimp.h" |
| 11 #include "xfa/fwl/core/cfwl_message.h" | 11 #include "xfa/fwl/core/cfwl_message.h" |
| 12 #include "xfa/fwl/core/cfwl_themebackground.h" | 12 #include "xfa/fwl/core/cfwl_themebackground.h" |
| 13 #include "xfa/fwl/core/cfwl_themepart.h" | 13 #include "xfa/fwl/core/cfwl_themepart.h" |
| 14 #include "xfa/fwl/core/cfwl_themetext.h" | 14 #include "xfa/fwl/core/cfwl_themetext.h" |
| 15 #include "xfa/fwl/core/fwl_appimp.h" | 15 #include "xfa/fwl/core/fwl_appimp.h" |
| 16 #include "xfa/fwl/core/fwl_noteimp.h" | 16 #include "xfa/fwl/core/fwl_noteimp.h" |
| 17 #include "xfa/fwl/core/fwl_widgetimp.h" | 17 #include "xfa/fwl/core/fwl_widgetimp.h" |
| 18 #include "xfa/fwl/core/fwl_widgetmgrimp.h" | 18 #include "xfa/fwl/core/fwl_widgetmgrimp.h" |
| 19 #include "xfa/fwl/core/ifwl_adapterwidgetmgr.h" | 19 #include "xfa/fwl/core/ifwl_adapterwidgetmgr.h" |
| 20 #include "xfa/fwl/core/ifwl_app.h" | 20 #include "xfa/fwl/core/ifwl_app.h" |
| 21 #include "xfa/fwl/core/ifwl_themeprovider.h" | 21 #include "xfa/fwl/core/ifwl_themeprovider.h" |
| 22 #include "xfa/fwl/theme/cfwl_widgettp.h" | 22 #include "xfa/fwl/theme/cfwl_widgettp.h" |
| 23 | 23 |
| 24 #define FWL_SYSBTNSIZE 21 | 24 namespace { |
| 25 #define FWL_SYSBTNMARGIN 5 | 25 |
| 26 #define FWL_SYSBTNSPAN 2 | 26 const int kSystemButtonSize = 21; |
| 27 const int kSystemButtonMargin = 5; |
| 28 const int kSystemButtonSpan = 2; |
| 29 |
| 30 } // namespace |
| 27 | 31 |
| 28 namespace { | 32 namespace { |
| 29 | 33 |
| 30 const uint8_t kCornerEnlarge = 10; | 34 const uint8_t kCornerEnlarge = 10; |
| 31 | 35 |
| 32 } // namespace | 36 } // namespace |
| 33 | 37 |
| 34 // static | 38 // static |
| 35 IFWL_Form* IFWL_Form::CreateFormProxy(CFWL_WidgetImpProperties& properties, | 39 IFWL_Form* IFWL_Form::CreateFormProxy(CFWL_WidgetImpProperties& properties, |
| 36 CFX_WideString* classname, | 40 CFX_WideString* classname, |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 FWL_WidgetHit CFWL_FormImp::HitTest(FX_FLOAT fx, FX_FLOAT fy) { | 204 FWL_WidgetHit CFWL_FormImp::HitTest(FX_FLOAT fx, FX_FLOAT fy) { |
| 201 GetAvailableTheme(); | 205 GetAvailableTheme(); |
| 202 if (m_pCloseBox && m_pCloseBox->m_rtBtn.Contains(fx, fy)) | 206 if (m_pCloseBox && m_pCloseBox->m_rtBtn.Contains(fx, fy)) |
| 203 return FWL_WidgetHit::CloseBox; | 207 return FWL_WidgetHit::CloseBox; |
| 204 if (m_pMaxBox && m_pMaxBox->m_rtBtn.Contains(fx, fy)) | 208 if (m_pMaxBox && m_pMaxBox->m_rtBtn.Contains(fx, fy)) |
| 205 return FWL_WidgetHit::MaxBox; | 209 return FWL_WidgetHit::MaxBox; |
| 206 if (m_pMinBox && m_pMinBox->m_rtBtn.Contains(fx, fy)) | 210 if (m_pMinBox && m_pMinBox->m_rtBtn.Contains(fx, fy)) |
| 207 return FWL_WidgetHit::MinBox; | 211 return FWL_WidgetHit::MinBox; |
| 208 CFX_RectF rtCap; | 212 CFX_RectF rtCap; |
| 209 rtCap.Set(m_rtCaption.left + m_fCYBorder, m_rtCaption.top + m_fCXBorder, | 213 rtCap.Set(m_rtCaption.left + m_fCYBorder, m_rtCaption.top + m_fCXBorder, |
| 210 m_rtCaption.width - FWL_SYSBTNSIZE * m_iSysBox - 2 * m_fCYBorder, | 214 m_rtCaption.width - kSystemButtonSize * m_iSysBox - 2 * m_fCYBorder, |
| 211 m_rtCaption.height - m_fCXBorder); | 215 m_rtCaption.height - m_fCXBorder); |
| 212 if (rtCap.Contains(fx, fy)) | 216 if (rtCap.Contains(fx, fy)) |
| 213 return FWL_WidgetHit::Titlebar; | 217 return FWL_WidgetHit::Titlebar; |
| 214 if ((m_pProperties->m_dwStyles & FWL_WGTSTYLE_Border) && | 218 if ((m_pProperties->m_dwStyles & FWL_WGTSTYLE_Border) && |
| 215 (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_FRM_Resize)) { | 219 (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_FRM_Resize)) { |
| 216 FX_FLOAT fWidth = m_rtRelative.width - 2 * (m_fCYBorder + kCornerEnlarge); | 220 FX_FLOAT fWidth = m_rtRelative.width - 2 * (m_fCYBorder + kCornerEnlarge); |
| 217 FX_FLOAT fHeight = m_rtRelative.height - 2 * (m_fCXBorder + kCornerEnlarge); | 221 FX_FLOAT fHeight = m_rtRelative.height - 2 * (m_fCXBorder + kCornerEnlarge); |
| 218 CFX_RectF rt; | 222 CFX_RectF rt; |
| 219 rt.Set(0, m_fCXBorder + kCornerEnlarge, m_fCYBorder, fHeight); | 223 rt.Set(0, m_fCXBorder + kCornerEnlarge, m_fCYBorder, fHeight); |
| 220 if (rt.Contains(fx, fy)) | 224 if (rt.Contains(fx, fy)) |
| (...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 647 m_iSysBox = 0; | 651 m_iSysBox = 0; |
| 648 if (m_pProperties->m_dwStyles & FWL_WGTSTYLE_CloseBox) { | 652 if (m_pProperties->m_dwStyles & FWL_WGTSTYLE_CloseBox) { |
| 649 m_pCloseBox = new CFWL_SysBtn; | 653 m_pCloseBox = new CFWL_SysBtn; |
| 650 if (m_bCustomizeLayout) { | 654 if (m_bCustomizeLayout) { |
| 651 CFWL_ThemeBackground param; | 655 CFWL_ThemeBackground param; |
| 652 param.m_pWidget = m_pInterface; | 656 param.m_pWidget = m_pInterface; |
| 653 param.m_iPart = CFWL_Part::CloseBox; | 657 param.m_iPart = CFWL_Part::CloseBox; |
| 654 pTheme->GetPartRect(¶m, m_pCloseBox->m_rtBtn); | 658 pTheme->GetPartRect(¶m, m_pCloseBox->m_rtBtn); |
| 655 } else { | 659 } else { |
| 656 m_pCloseBox->m_rtBtn.Set( | 660 m_pCloseBox->m_rtBtn.Set( |
| 657 m_rtRelative.right() - FWL_SYSBTNMARGIN - FWL_SYSBTNSIZE, | 661 m_rtRelative.right() - kSystemButtonMargin - kSystemButtonSize, |
| 658 FWL_SYSBTNMARGIN, FWL_SYSBTNSIZE, FWL_SYSBTNSIZE); | 662 kSystemButtonMargin, kSystemButtonSize, kSystemButtonSize); |
| 659 } | 663 } |
| 660 m_iSysBox++; | 664 m_iSysBox++; |
| 661 } | 665 } |
| 662 if (m_pProperties->m_dwStyles & FWL_WGTSTYLE_MaximizeBox) { | 666 if (m_pProperties->m_dwStyles & FWL_WGTSTYLE_MaximizeBox) { |
| 663 m_pMaxBox = new CFWL_SysBtn; | 667 m_pMaxBox = new CFWL_SysBtn; |
| 664 if (m_bCustomizeLayout) { | 668 if (m_bCustomizeLayout) { |
| 665 CFWL_ThemeBackground param; | 669 CFWL_ThemeBackground param; |
| 666 param.m_pWidget = m_pInterface; | 670 param.m_pWidget = m_pInterface; |
| 667 param.m_iPart = CFWL_Part::MaximizeBox; | 671 param.m_iPart = CFWL_Part::MaximizeBox; |
| 668 pTheme->GetPartRect(¶m, m_pMaxBox->m_rtBtn); | 672 pTheme->GetPartRect(¶m, m_pMaxBox->m_rtBtn); |
| 669 } else { | 673 } else { |
| 670 if (m_pCloseBox) { | 674 if (m_pCloseBox) { |
| 671 m_pMaxBox->m_rtBtn.Set( | 675 m_pMaxBox->m_rtBtn.Set( |
| 672 m_pCloseBox->m_rtBtn.left - FWL_SYSBTNSPAN - FWL_SYSBTNSIZE, | 676 m_pCloseBox->m_rtBtn.left - kSystemButtonSpan - kSystemButtonSize, |
| 673 m_pCloseBox->m_rtBtn.top, FWL_SYSBTNSIZE, FWL_SYSBTNSIZE); | 677 m_pCloseBox->m_rtBtn.top, kSystemButtonSize, kSystemButtonSize); |
| 674 } else { | 678 } else { |
| 675 m_pMaxBox->m_rtBtn.Set( | 679 m_pMaxBox->m_rtBtn.Set( |
| 676 m_rtRelative.right() - FWL_SYSBTNMARGIN - FWL_SYSBTNSIZE, | 680 m_rtRelative.right() - kSystemButtonMargin - kSystemButtonSize, |
| 677 FWL_SYSBTNMARGIN, FWL_SYSBTNSIZE, FWL_SYSBTNSIZE); | 681 kSystemButtonMargin, kSystemButtonSize, kSystemButtonSize); |
| 678 } | 682 } |
| 679 } | 683 } |
| 680 m_iSysBox++; | 684 m_iSysBox++; |
| 681 } | 685 } |
| 682 if (m_pProperties->m_dwStyles & FWL_WGTSTYLE_MinimizeBox) { | 686 if (m_pProperties->m_dwStyles & FWL_WGTSTYLE_MinimizeBox) { |
| 683 m_pMinBox = new CFWL_SysBtn; | 687 m_pMinBox = new CFWL_SysBtn; |
| 684 if (m_bCustomizeLayout) { | 688 if (m_bCustomizeLayout) { |
| 685 CFWL_ThemeBackground param; | 689 CFWL_ThemeBackground param; |
| 686 param.m_pWidget = m_pInterface; | 690 param.m_pWidget = m_pInterface; |
| 687 param.m_iPart = CFWL_Part::MinimizeBox; | 691 param.m_iPart = CFWL_Part::MinimizeBox; |
| 688 pTheme->GetPartRect(¶m, m_pMinBox->m_rtBtn); | 692 pTheme->GetPartRect(¶m, m_pMinBox->m_rtBtn); |
| 689 } else { | 693 } else { |
| 690 if (m_pMaxBox) { | 694 if (m_pMaxBox) { |
| 691 m_pMinBox->m_rtBtn.Set( | 695 m_pMinBox->m_rtBtn.Set( |
| 692 m_pMaxBox->m_rtBtn.left - FWL_SYSBTNSPAN - FWL_SYSBTNSIZE, | 696 m_pMaxBox->m_rtBtn.left - kSystemButtonSpan - kSystemButtonSize, |
| 693 m_pMaxBox->m_rtBtn.top, FWL_SYSBTNSIZE, FWL_SYSBTNSIZE); | 697 m_pMaxBox->m_rtBtn.top, kSystemButtonSize, kSystemButtonSize); |
| 694 } else if (m_pCloseBox) { | 698 } else if (m_pCloseBox) { |
| 695 m_pMinBox->m_rtBtn.Set( | 699 m_pMinBox->m_rtBtn.Set( |
| 696 m_pCloseBox->m_rtBtn.left - FWL_SYSBTNSPAN - FWL_SYSBTNSIZE, | 700 m_pCloseBox->m_rtBtn.left - kSystemButtonSpan - kSystemButtonSize, |
| 697 m_pCloseBox->m_rtBtn.top, FWL_SYSBTNSIZE, FWL_SYSBTNSIZE); | 701 m_pCloseBox->m_rtBtn.top, kSystemButtonSize, kSystemButtonSize); |
| 698 } else { | 702 } else { |
| 699 m_pMinBox->m_rtBtn.Set( | 703 m_pMinBox->m_rtBtn.Set( |
| 700 m_rtRelative.right() - FWL_SYSBTNMARGIN - FWL_SYSBTNSIZE, | 704 m_rtRelative.right() - kSystemButtonMargin - kSystemButtonSize, |
| 701 FWL_SYSBTNMARGIN, FWL_SYSBTNSIZE, FWL_SYSBTNSIZE); | 705 kSystemButtonMargin, kSystemButtonSize, kSystemButtonSize); |
| 702 } | 706 } |
| 703 } | 707 } |
| 704 m_iSysBox++; | 708 m_iSysBox++; |
| 705 } | 709 } |
| 706 IFWL_FormDP* pData = | 710 IFWL_FormDP* pData = |
| 707 static_cast<IFWL_FormDP*>(m_pProperties->m_pDataProvider); | 711 static_cast<IFWL_FormDP*>(m_pProperties->m_pDataProvider); |
| 708 if (m_pProperties->m_dwStyles & FWL_WGTSTYLE_Icon && | 712 if (m_pProperties->m_dwStyles & FWL_WGTSTYLE_Icon && |
| 709 pData->GetIcon(m_pInterface, FALSE)) { | 713 pData->GetIcon(m_pInterface, FALSE)) { |
| 710 if (m_bCustomizeLayout) { | 714 if (m_bCustomizeLayout) { |
| 711 CFWL_ThemeBackground param; | 715 CFWL_ThemeBackground param; |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 905 if (pDelegate) | 909 if (pDelegate) |
| 906 pDelegate->OnProcessMessage(&ms); | 910 pDelegate->OnProcessMessage(&ms); |
| 907 } | 911 } |
| 908 } | 912 } |
| 909 m_pOwner->Repaint(&m_pOwner->m_rtRelative); | 913 m_pOwner->Repaint(&m_pOwner->m_rtRelative); |
| 910 break; | 914 break; |
| 911 } | 915 } |
| 912 case CFWL_MessageType::Mouse: { | 916 case CFWL_MessageType::Mouse: { |
| 913 CFWL_MsgMouse* pMsg = static_cast<CFWL_MsgMouse*>(pMessage); | 917 CFWL_MsgMouse* pMsg = static_cast<CFWL_MsgMouse*>(pMessage); |
| 914 switch (pMsg->m_dwCmd) { | 918 switch (pMsg->m_dwCmd) { |
| 915 case FWL_MSGMOUSECMD_LButtonDown: { | 919 case FWL_MouseCommand::LeftButtonDown: { |
| 916 OnLButtonDown(pMsg); | 920 OnLButtonDown(pMsg); |
| 917 break; | 921 break; |
| 918 } | 922 } |
| 919 case FWL_MSGMOUSECMD_LButtonUp: { | 923 case FWL_MouseCommand::LeftButtonUp: { |
| 920 OnLButtonUp(pMsg); | 924 OnLButtonUp(pMsg); |
| 921 break; | 925 break; |
| 922 } | 926 } |
| 923 case FWL_MSGMOUSECMD_MouseMove: { | 927 case FWL_MouseCommand::Move: { |
| 924 OnMouseMove(pMsg); | 928 OnMouseMove(pMsg); |
| 925 break; | 929 break; |
| 926 } | 930 } |
| 927 case FWL_MSGMOUSECMD_MouseHover: { | 931 case FWL_MouseCommand::Hover: { |
| 928 OnMouseHover(pMsg); | 932 OnMouseHover(pMsg); |
| 929 break; | 933 break; |
| 930 } | 934 } |
| 931 case FWL_MSGMOUSECMD_MouseLeave: { | 935 case FWL_MouseCommand::Leave: { |
| 932 OnMouseLeave(pMsg); | 936 OnMouseLeave(pMsg); |
| 933 break; | 937 break; |
| 934 } | 938 } |
| 935 case FWL_MSGMOUSECMD_LButtonDblClk: { | 939 case FWL_MouseCommand::LeftButtonDblClk: { |
| 936 OnLButtonDblClk(pMsg); | 940 OnLButtonDblClk(pMsg); |
| 937 break; | 941 break; |
| 938 } | 942 } |
| 943 default: |
| 944 break; |
| 939 } | 945 } |
| 940 break; | 946 break; |
| 941 } | 947 } |
| 942 case CFWL_MessageType::Size: { | 948 case CFWL_MessageType::Size: { |
| 943 CFWL_WidgetMgr* pWidgetMgr = | 949 CFWL_WidgetMgr* pWidgetMgr = |
| 944 static_cast<CFWL_WidgetMgr*>(FWL_GetWidgetMgr()); | 950 static_cast<CFWL_WidgetMgr*>(FWL_GetWidgetMgr()); |
| 945 if (!pWidgetMgr) | 951 if (!pWidgetMgr) |
| 946 return 0; | 952 return 0; |
| 947 | 953 |
| 948 pWidgetMgr->AddRedrawCounts(m_pOwner->m_pInterface); | 954 pWidgetMgr->AddRedrawCounts(m_pOwner->m_pInterface); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 989 } | 995 } |
| 990 void CFWL_FormImpDelegate::OnLButtonDown(CFWL_MsgMouse* pMsg) { | 996 void CFWL_FormImpDelegate::OnLButtonDown(CFWL_MsgMouse* pMsg) { |
| 991 m_pOwner->SetGrab(TRUE); | 997 m_pOwner->SetGrab(TRUE); |
| 992 m_pOwner->m_bLButtonDown = TRUE; | 998 m_pOwner->m_bLButtonDown = TRUE; |
| 993 m_pOwner->m_eResizeType = FORM_RESIZETYPE_None; | 999 m_pOwner->m_eResizeType = FORM_RESIZETYPE_None; |
| 994 CFWL_SysBtn* pPressBtn = m_pOwner->GetSysBtnAtPoint(pMsg->m_fx, pMsg->m_fy); | 1000 CFWL_SysBtn* pPressBtn = m_pOwner->GetSysBtnAtPoint(pMsg->m_fx, pMsg->m_fy); |
| 995 m_pOwner->m_iCaptureBtn = m_pOwner->GetSysBtnIndex(pPressBtn); | 1001 m_pOwner->m_iCaptureBtn = m_pOwner->GetSysBtnIndex(pPressBtn); |
| 996 CFX_RectF rtCap; | 1002 CFX_RectF rtCap; |
| 997 rtCap.Set(m_pOwner->m_rtCaption.left + m_pOwner->m_fCYBorder, | 1003 rtCap.Set(m_pOwner->m_rtCaption.left + m_pOwner->m_fCYBorder, |
| 998 m_pOwner->m_rtCaption.top + m_pOwner->m_fCXBorder, | 1004 m_pOwner->m_rtCaption.top + m_pOwner->m_fCXBorder, |
| 999 m_pOwner->m_rtCaption.width - FWL_SYSBTNSIZE * m_pOwner->m_iSysBox - | 1005 m_pOwner->m_rtCaption.width - |
| 1006 kSystemButtonSize * m_pOwner->m_iSysBox - |
| 1000 2 * m_pOwner->m_fCYBorder, | 1007 2 * m_pOwner->m_fCYBorder, |
| 1001 m_pOwner->m_rtCaption.height - m_pOwner->m_fCXBorder); | 1008 m_pOwner->m_rtCaption.height - m_pOwner->m_fCXBorder); |
| 1002 if (pPressBtn) { | 1009 if (pPressBtn) { |
| 1003 pPressBtn->SetPressed(); | 1010 pPressBtn->SetPressed(); |
| 1004 m_pOwner->Repaint(&pPressBtn->m_rtBtn); | 1011 m_pOwner->Repaint(&pPressBtn->m_rtBtn); |
| 1005 } else if (rtCap.Contains(pMsg->m_fx, pMsg->m_fy)) { | 1012 } else if (rtCap.Contains(pMsg->m_fx, pMsg->m_fy)) { |
| 1006 m_pOwner->m_eResizeType = FORM_RESIZETYPE_Cap; | 1013 m_pOwner->m_eResizeType = FORM_RESIZETYPE_Cap; |
| 1007 } else if ((m_pOwner->m_pProperties->m_dwStyles & FWL_WGTSTYLE_Border) && | 1014 } else if ((m_pOwner->m_pProperties->m_dwStyles & FWL_WGTSTYLE_Border) && |
| 1008 (m_pOwner->m_pProperties->m_dwStyleExes & | 1015 (m_pOwner->m_pProperties->m_dwStyleExes & |
| 1009 FWL_STYLEEXT_FRM_Resize) && | 1016 FWL_STYLEEXT_FRM_Resize) && |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1114 } | 1121 } |
| 1115 void CFWL_FormImpDelegate::OnMouseHover(CFWL_MsgMouse* pMsg) { | 1122 void CFWL_FormImpDelegate::OnMouseHover(CFWL_MsgMouse* pMsg) { |
| 1116 m_pOwner->SetCursor(pMsg->m_fx, pMsg->m_fy); | 1123 m_pOwner->SetCursor(pMsg->m_fx, pMsg->m_fy); |
| 1117 } | 1124 } |
| 1118 void CFWL_FormImpDelegate::OnMouseLeave(CFWL_MsgMouse* pMsg) { | 1125 void CFWL_FormImpDelegate::OnMouseLeave(CFWL_MsgMouse* pMsg) { |
| 1119 CFWL_SysBtn* pHover = m_pOwner->GetSysBtnByState(FWL_SYSBUTTONSTATE_Hover); | 1126 CFWL_SysBtn* pHover = m_pOwner->GetSysBtnByState(FWL_SYSBUTTONSTATE_Hover); |
| 1120 if (pHover) { | 1127 if (pHover) { |
| 1121 pHover->SetNormal(); | 1128 pHover->SetNormal(); |
| 1122 m_pOwner->Repaint(&pHover->m_rtBtn); | 1129 m_pOwner->Repaint(&pHover->m_rtBtn); |
| 1123 } | 1130 } |
| 1124 if (pMsg->m_dwCmd == FWL_MSGMOUSECMD_MouseLeave && | 1131 if (pMsg->m_dwCmd == FWL_MouseCommand::Leave && !m_pOwner->m_bLButtonDown) { |
| 1125 !m_pOwner->m_bLButtonDown) { | |
| 1126 m_pOwner->SetCursor(pMsg->m_fx, pMsg->m_fy); | 1132 m_pOwner->SetCursor(pMsg->m_fx, pMsg->m_fy); |
| 1127 } | 1133 } |
| 1128 } | 1134 } |
| 1129 void CFWL_FormImpDelegate::OnLButtonDblClk(CFWL_MsgMouse* pMsg) { | 1135 void CFWL_FormImpDelegate::OnLButtonDblClk(CFWL_MsgMouse* pMsg) { |
| 1130 if ((m_pOwner->m_pProperties->m_dwStyleExes & FWL_STYLEEXT_FRM_Resize) && | 1136 if ((m_pOwner->m_pProperties->m_dwStyleExes & FWL_STYLEEXT_FRM_Resize) && |
| 1131 m_pOwner->HitTest(pMsg->m_fx, pMsg->m_fy) == FWL_WidgetHit::Titlebar) { | 1137 m_pOwner->HitTest(pMsg->m_fx, pMsg->m_fy) == FWL_WidgetHit::Titlebar) { |
| 1132 if (m_pOwner->m_bMaximized) { | 1138 if (m_pOwner->m_bMaximized) { |
| 1133 m_pOwner->SetWidgetRect(m_pOwner->m_rtRestore); | 1139 m_pOwner->SetWidgetRect(m_pOwner->m_rtRestore); |
| 1134 } else { | 1140 } else { |
| 1135 m_pOwner->SetWorkAreaRect(); | 1141 m_pOwner->SetWorkAreaRect(); |
| 1136 } | 1142 } |
| 1137 m_pOwner->Update(); | 1143 m_pOwner->Update(); |
| 1138 m_pOwner->m_bMaximized = !m_pOwner->m_bMaximized; | 1144 m_pOwner->m_bMaximized = !m_pOwner->m_bMaximized; |
| 1139 } | 1145 } |
| 1140 } | 1146 } |
| 1141 void CFWL_FormImpDelegate::OnWindowMove(CFWL_MsgWindowMove* pMsg) { | 1147 void CFWL_FormImpDelegate::OnWindowMove(CFWL_MsgWindowMove* pMsg) { |
| 1142 m_pOwner->m_pProperties->m_rtWidget.left = pMsg->m_fx; | 1148 m_pOwner->m_pProperties->m_rtWidget.left = pMsg->m_fx; |
| 1143 m_pOwner->m_pProperties->m_rtWidget.top = pMsg->m_fy; | 1149 m_pOwner->m_pProperties->m_rtWidget.top = pMsg->m_fy; |
| 1144 } | 1150 } |
| 1145 void CFWL_FormImpDelegate::OnClose(CFWL_MsgClose* pMsg) { | 1151 void CFWL_FormImpDelegate::OnClose(CFWL_MsgClose* pMsg) { |
| 1146 CFWL_EvtClose eClose; | 1152 CFWL_EvtClose eClose; |
| 1147 eClose.m_pSrcTarget = m_pOwner->m_pInterface; | 1153 eClose.m_pSrcTarget = m_pOwner->m_pInterface; |
| 1148 m_pOwner->DispatchEvent(&eClose); | 1154 m_pOwner->DispatchEvent(&eClose); |
| 1149 } | 1155 } |
| OLD | NEW |