diff options
Diffstat (limited to 'fpdfsdk/src/pdfwindow/PWL_ComboBox.cpp')
-rw-r--r-- | fpdfsdk/src/pdfwindow/PWL_ComboBox.cpp | 65 |
1 files changed, 31 insertions, 34 deletions
diff --git a/fpdfsdk/src/pdfwindow/PWL_ComboBox.cpp b/fpdfsdk/src/pdfwindow/PWL_ComboBox.cpp index bdc6724f65..7582ae412b 100644 --- a/fpdfsdk/src/pdfwindow/PWL_ComboBox.cpp +++ b/fpdfsdk/src/pdfwindow/PWL_ComboBox.cpp @@ -20,8 +20,7 @@ #define IsFloatSmaller(fa, fb) ((fa) < (fb) && !IsFloatZero((fa) - (fb))) #define IsFloatEqual(fa, fb) IsFloatZero((fa) - (fb)) -FX_BOOL CPWL_CBListBox::OnLButtonUp(const CFX_FloatPoint& point, - FX_DWORD nFlag) { +FX_BOOL CPWL_CBListBox::OnLButtonUp(const CPDF_Point& point, FX_DWORD nFlag) { CPWL_Wnd::OnLButtonUp(point, nFlag); if (m_bMouseDown) { @@ -111,19 +110,19 @@ FX_BOOL CPWL_CBListBox::OnCharWithExit(FX_WORD nChar, void CPWL_CBButton::GetThisAppearanceStream(CFX_ByteTextBuf& sAppStream) { CPWL_Wnd::GetThisAppearanceStream(sAppStream); - CFX_FloatRect rectWnd = CPWL_Wnd::GetWindowRect(); + CPDF_Rect rectWnd = CPWL_Wnd::GetWindowRect(); if (IsVisible() && !rectWnd.IsEmpty()) { CFX_ByteTextBuf sButton; - CFX_FloatPoint ptCenter = GetCenterPoint(); + CPDF_Point ptCenter = GetCenterPoint(); - CFX_FloatPoint pt1(ptCenter.x - PWL_CBBUTTON_TRIANGLE_HALFLEN, - ptCenter.y + PWL_CBBUTTON_TRIANGLE_HALFLEN * 0.5f); - CFX_FloatPoint pt2(ptCenter.x + PWL_CBBUTTON_TRIANGLE_HALFLEN, - ptCenter.y + PWL_CBBUTTON_TRIANGLE_HALFLEN * 0.5f); - CFX_FloatPoint pt3(ptCenter.x, - ptCenter.y - PWL_CBBUTTON_TRIANGLE_HALFLEN * 0.5f); + CPDF_Point pt1(ptCenter.x - PWL_CBBUTTON_TRIANGLE_HALFLEN, + ptCenter.y + PWL_CBBUTTON_TRIANGLE_HALFLEN * 0.5f); + CPDF_Point pt2(ptCenter.x + PWL_CBBUTTON_TRIANGLE_HALFLEN, + ptCenter.y + PWL_CBBUTTON_TRIANGLE_HALFLEN * 0.5f); + CPDF_Point pt3(ptCenter.x, + ptCenter.y - PWL_CBBUTTON_TRIANGLE_HALFLEN * 0.5f); if (IsFloatBigger(rectWnd.right - rectWnd.left, PWL_CBBUTTON_TRIANGLE_HALFLEN * 2) && @@ -144,17 +143,17 @@ void CPWL_CBButton::DrawThisAppearance(CFX_RenderDevice* pDevice, CFX_Matrix* pUser2Device) { CPWL_Wnd::DrawThisAppearance(pDevice, pUser2Device); - CFX_FloatRect rectWnd = CPWL_Wnd::GetWindowRect(); + CPDF_Rect rectWnd = CPWL_Wnd::GetWindowRect(); if (IsVisible() && !rectWnd.IsEmpty()) { - CFX_FloatPoint ptCenter = GetCenterPoint(); + CPDF_Point ptCenter = GetCenterPoint(); - CFX_FloatPoint pt1(ptCenter.x - PWL_CBBUTTON_TRIANGLE_HALFLEN, - ptCenter.y + PWL_CBBUTTON_TRIANGLE_HALFLEN * 0.5f); - CFX_FloatPoint pt2(ptCenter.x + PWL_CBBUTTON_TRIANGLE_HALFLEN, - ptCenter.y + PWL_CBBUTTON_TRIANGLE_HALFLEN * 0.5f); - CFX_FloatPoint pt3(ptCenter.x, - ptCenter.y - PWL_CBBUTTON_TRIANGLE_HALFLEN * 0.5f); + CPDF_Point pt1(ptCenter.x - PWL_CBBUTTON_TRIANGLE_HALFLEN, + ptCenter.y + PWL_CBBUTTON_TRIANGLE_HALFLEN * 0.5f); + CPDF_Point pt2(ptCenter.x + PWL_CBBUTTON_TRIANGLE_HALFLEN, + ptCenter.y + PWL_CBBUTTON_TRIANGLE_HALFLEN * 0.5f); + CPDF_Point pt3(ptCenter.x, + ptCenter.y - PWL_CBBUTTON_TRIANGLE_HALFLEN * 0.5f); if (IsFloatBigger(rectWnd.right - rectWnd.left, PWL_CBBUTTON_TRIANGLE_HALFLEN * 2) && @@ -176,8 +175,7 @@ void CPWL_CBButton::DrawThisAppearance(CFX_RenderDevice* pDevice, } } -FX_BOOL CPWL_CBButton::OnLButtonDown(const CFX_FloatPoint& point, - FX_DWORD nFlag) { +FX_BOOL CPWL_CBButton::OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag) { CPWL_Wnd::OnLButtonDown(point, nFlag); SetCapture(); @@ -190,8 +188,7 @@ FX_BOOL CPWL_CBButton::OnLButtonDown(const CFX_FloatPoint& point, return TRUE; } -FX_BOOL CPWL_CBButton::OnLButtonUp(const CFX_FloatPoint& point, - FX_DWORD nFlag) { +FX_BOOL CPWL_CBButton::OnLButtonUp(const CPDF_Point& point, FX_DWORD nFlag) { CPWL_Wnd::OnLButtonUp(point, nFlag); ReleaseCapture(); @@ -300,7 +297,7 @@ void CPWL_ComboBox::CreateEdit(const PWL_CREATEPARAM& cp) { if (!HasFlag(PCBS_ALLOWCUSTOMTEXT)) ecp.dwFlags |= PWS_READONLY; - ecp.rcRectWnd = CFX_FloatRect(0, 0, 0, 0); + ecp.rcRectWnd = CPDF_Rect(0, 0, 0, 0); ecp.dwBorderWidth = 0; ecp.nBorderStyle = PBS_SOLID; @@ -336,7 +333,7 @@ void CPWL_ComboBox::CreateListBox(const PWL_CREATEPARAM& cp) { lcp.nBorderStyle = PBS_SOLID; lcp.dwBorderWidth = 1; lcp.eCursorType = FXCT_ARROW; - lcp.rcRectWnd = CFX_FloatRect(0, 0, 0, 0); + lcp.rcRectWnd = CPDF_Rect(0, 0, 0, 0); if (cp.dwFlags & PWS_AUTOFONTSIZE) lcp.fFontSize = PWLCB_DEFAULTFONTSIZE; @@ -354,13 +351,13 @@ void CPWL_ComboBox::CreateListBox(const PWL_CREATEPARAM& cp) { } void CPWL_ComboBox::RePosChildWnd() { - CFX_FloatRect rcClient = GetClientRect(); + CPDF_Rect rcClient = GetClientRect(); if (m_bPopup) { - CFX_FloatRect rclient = GetClientRect(); - CFX_FloatRect rcButton = rclient; - CFX_FloatRect rcEdit = rcClient; - CFX_FloatRect rcList = CPWL_Wnd::GetWindowRect(); + CPDF_Rect rclient = GetClientRect(); + CPDF_Rect rcButton = rclient; + CPDF_Rect rcEdit = rcClient; + CPDF_Rect rcList = CPWL_Wnd::GetWindowRect(); FX_FLOAT fOldWindowHeight = m_rcOldWindow.Height(); FX_FLOAT fOldClientHeight = fOldWindowHeight - GetBorderWidth() * 2; @@ -422,7 +419,7 @@ void CPWL_ComboBox::RePosChildWnd() { m_pList->ScrollToListItem(m_nSelectItem); } } else { - CFX_FloatRect rcButton = rcClient; + CPDF_Rect rcButton = rcClient; rcButton.left = rcButton.right - PWL_COMBOBOX_BUTTON_WIDTH; @@ -432,7 +429,7 @@ void CPWL_ComboBox::RePosChildWnd() { if (m_pButton) m_pButton->Move(rcButton, TRUE, FALSE); - CFX_FloatRect rcEdit = rcClient; + CPDF_Rect rcEdit = rcClient; rcEdit.right = rcButton.left - 1.0f; if (rcEdit.left < rcClient.left) @@ -454,8 +451,8 @@ void CPWL_ComboBox::SelectAll() { m_pEdit->SelectAll(); } -CFX_FloatRect CPWL_ComboBox::GetFocusRect() const { - return CFX_FloatRect(); +CPDF_Rect CPWL_ComboBox::GetFocusRect() const { + return CPDF_Rect(); } void CPWL_ComboBox::SetPopup(FX_BOOL bPopup) { @@ -488,7 +485,7 @@ void CPWL_ComboBox::SetPopup(FX_BOOL bPopup) { if (IsFloatBigger(fPopupRet, 0.0f)) { m_bPopup = bPopup; - CFX_FloatRect rcWindow = CPWL_Wnd::GetWindowRect(); + CPDF_Rect rcWindow = CPWL_Wnd::GetWindowRect(); m_rcOldWindow = rcWindow; switch (nWhere) { default: |