| 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 "../../include/pdfwindow/PDFWindow.h" | 7 #include "../../include/pdfwindow/PDFWindow.h" | 
| 8 #include "../../include/pdfwindow/PWL_Wnd.h" | 8 #include "../../include/pdfwindow/PWL_Wnd.h" | 
| 9 #include "../../include/pdfwindow/PWL_ListCtrl.h" | 9 #include "../../include/pdfwindow/PWL_ListCtrl.h" | 
| 10 #include "../../include/pdfwindow/PWL_IconList.h" | 10 #include "../../include/pdfwindow/PWL_IconList.h" | 
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 185                 sInfo.fContentMin = rcScroll.bottom; | 185                 sInfo.fContentMin = rcScroll.bottom; | 
| 186                 sInfo.fContentMax = rcScroll.top; | 186                 sInfo.fContentMax = rcScroll.top; | 
| 187                 sInfo.fPlateWidth = GetClientRect().Height(); | 187                 sInfo.fPlateWidth = GetClientRect().Height(); | 
| 188                 sInfo.fSmallStep = 13.0f; | 188                 sInfo.fSmallStep = 13.0f; | 
| 189                 sInfo.fBigStep = sInfo.fPlateWidth; | 189                 sInfo.fBigStep = sInfo.fPlateWidth; | 
| 190 | 190 | 
| 191                 pParent->OnNotify(this, PNM_SETSCROLLINFO, SBT_VSCROLL, (FX_INTP
     TR)&sInfo); | 191                 pParent->OnNotify(this, PNM_SETSCROLLINFO, SBT_VSCROLL, (FX_INTP
     TR)&sInfo); | 
| 192         } | 192         } | 
| 193 } | 193 } | 
| 194 | 194 | 
| 195 FX_BOOL»CPWL_IconList_Content::OnLButtonDown(const CPDF_Point & point) | 195 FX_BOOL»CPWL_IconList_Content::OnLButtonDown(const CPDF_Point & point, FX_DWORD 
     nFlag) | 
| 196 { | 196 { | 
| 197         SetFocus(); | 197         SetFocus(); | 
| 198 | 198 | 
| 199         SetCapture(); | 199         SetCapture(); | 
| 200         m_bMouseDown = TRUE; | 200         m_bMouseDown = TRUE; | 
| 201 | 201 | 
| 202         FX_INT32 nItemIndex = FindItemIndex(point); | 202         FX_INT32 nItemIndex = FindItemIndex(point); | 
| 203         SetSelect(nItemIndex); | 203         SetSelect(nItemIndex); | 
| 204         ScrollToItem(nItemIndex); | 204         ScrollToItem(nItemIndex); | 
| 205 | 205 | 
| 206         return TRUE; | 206         return TRUE; | 
| 207 } | 207 } | 
| 208 | 208 | 
| 209 FX_BOOL»CPWL_IconList_Content::OnLButtonUp(const CPDF_Point & point) | 209 FX_BOOL»CPWL_IconList_Content::OnLButtonUp(const CPDF_Point & point, FX_DWORD nF
     lag) | 
| 210 { | 210 { | 
| 211         m_bMouseDown = FALSE; | 211         m_bMouseDown = FALSE; | 
| 212         ReleaseCapture(); | 212         ReleaseCapture(); | 
| 213 | 213 | 
| 214         return TRUE; | 214         return TRUE; | 
| 215 } | 215 } | 
| 216 | 216 | 
| 217 FX_BOOL CPWL_IconList_Content::OnMouseMove(const CPDF_Point & point) | 217 FX_BOOL CPWL_IconList_Content::OnMouseMove(const CPDF_Point & point, FX_DWORD nF
     lag) | 
| 218 { | 218 { | 
| 219         if (m_bMouseDown) | 219         if (m_bMouseDown) | 
| 220         { | 220         { | 
| 221                 FX_INT32 nItemIndex = FindItemIndex(point); | 221                 FX_INT32 nItemIndex = FindItemIndex(point); | 
| 222                 SetSelect(nItemIndex); | 222                 SetSelect(nItemIndex); | 
| 223                 ScrollToItem(nItemIndex); | 223                 ScrollToItem(nItemIndex); | 
| 224         } | 224         } | 
| 225 | 225 | 
| 226         return TRUE; | 226         return TRUE; | 
| 227 } | 227 } | 
| 228 | 228 | 
| 229 FX_BOOL»CPWL_IconList_Content::OnKeyDown(FX_WORD nChar) | 229 FX_BOOL»CPWL_IconList_Content::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag) | 
| 230 { | 230 { | 
| 231         switch (nChar) | 231         switch (nChar) | 
| 232         { | 232         { | 
| 233         case FWL_VKEY_Up: | 233         case FWL_VKEY_Up: | 
| 234                 if (m_nSelectIndex > 0) | 234                 if (m_nSelectIndex > 0) | 
| 235                 { | 235                 { | 
| 236                         FX_INT32 nItemIndex = m_nSelectIndex - 1; | 236                         FX_INT32 nItemIndex = m_nSelectIndex - 1; | 
| 237                         SetSelect(nItemIndex); | 237                         SetSelect(nItemIndex); | 
| 238                         ScrollToItem(nItemIndex); | 238                         ScrollToItem(nItemIndex); | 
| 239                 } | 239                 } | 
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 545 CFX_WideString CPWL_IconList::GetListString(FX_INT32 nItemIndex) const | 545 CFX_WideString CPWL_IconList::GetListString(FX_INT32 nItemIndex) const | 
| 546 { | 546 { | 
| 547         return m_pListContent->GetListString(nItemIndex); | 547         return m_pListContent->GetListString(nItemIndex); | 
| 548 } | 548 } | 
| 549 | 549 | 
| 550 void CPWL_IconList::SetIconFillColor(const CPWL_Color& color) | 550 void CPWL_IconList::SetIconFillColor(const CPWL_Color& color) | 
| 551 { | 551 { | 
| 552         m_pListContent->SetIconFillColor(color); | 552         m_pListContent->SetIconFillColor(color); | 
| 553 } | 553 } | 
| 554 | 554 | 
| 555 FX_BOOL»CPWL_IconList::OnMouseWheel(short zDelta, const CPDF_Point & point) | 555 FX_BOOL»CPWL_IconList::OnMouseWheel(short zDelta, const CPDF_Point & point, FX_D
     WORD nFlag) | 
| 556 { | 556 { | 
| 557         CPDF_Point ptScroll = m_pListContent->GetScrollPos(); | 557         CPDF_Point ptScroll = m_pListContent->GetScrollPos(); | 
| 558         CPDF_Rect rcScroll = m_pListContent->GetScrollArea(); | 558         CPDF_Rect rcScroll = m_pListContent->GetScrollArea(); | 
| 559         CPDF_Rect rcContents = m_pListContent->GetClientRect(); | 559         CPDF_Rect rcContents = m_pListContent->GetClientRect(); | 
| 560 | 560 | 
| 561         if (rcScroll.top - rcScroll.bottom > rcContents.Height()) | 561         if (rcScroll.top - rcScroll.bottom > rcContents.Height()) | 
| 562         { | 562         { | 
| 563                 CPDF_Point ptNew = ptScroll; | 563                 CPDF_Point ptNew = ptScroll; | 
| 564 | 564 | 
| 565                 if (zDelta > 0) | 565                 if (zDelta > 0) | 
| (...skipping 17 matching lines...) Expand all  Loading... | 
| 583                         if (CPWL_ScrollBar* pScrollBar = this->GetVScrollBar()) | 583                         if (CPWL_ScrollBar* pScrollBar = this->GetVScrollBar()) | 
| 584                                 pScrollBar->OnNotify(this, PNM_SETSCROLLPOS, SBT
     _VSCROLL, (FX_INTPTR)&ptNew.y); | 584                                 pScrollBar->OnNotify(this, PNM_SETSCROLLPOS, SBT
     _VSCROLL, (FX_INTPTR)&ptNew.y); | 
| 585 | 585 | 
| 586                         return TRUE; | 586                         return TRUE; | 
| 587                 } | 587                 } | 
| 588         } | 588         } | 
| 589 | 589 | 
| 590         return FALSE; | 590         return FALSE; | 
| 591 } | 591 } | 
| 592 | 592 | 
| OLD | NEW | 
|---|