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/ifwl_listbox.h" | 7 #include "xfa/fwl/core/ifwl_listbox.h" |
8 | 8 |
9 #include "third_party/base/ptr_util.h" | 9 #include "third_party/base/ptr_util.h" |
10 #include "xfa/fde/tto/fde_textout.h" | 10 #include "xfa/fde/tto/fde_textout.h" |
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
503 CFX_RectF rtItem; | 503 CFX_RectF rtItem; |
504 pData->GetItemRect(this, pItem, rtItem); | 504 pData->GetItemRect(this, pItem, rtItem); |
505 rtItem.Offset(m_rtConent.left - fPosX, m_rtConent.top - fPosY); | 505 rtItem.Offset(m_rtConent.left - fPosX, m_rtConent.top - fPosY); |
506 if (rtItem.bottom() < m_rtConent.top) | 506 if (rtItem.bottom() < m_rtConent.top) |
507 continue; | 507 continue; |
508 if (rtItem.top >= m_rtConent.bottom()) | 508 if (rtItem.top >= m_rtConent.bottom()) |
509 break; | 509 break; |
510 if (bMultiCol && rtItem.left > m_rtConent.right()) | 510 if (bMultiCol && rtItem.left > m_rtConent.right()) |
511 break; | 511 break; |
512 | 512 |
513 if (GetStylesEx() & FWL_STYLEEXT_LTB_OwnerDraw) { | 513 if (!(GetStylesEx() & FWL_STYLEEXT_LTB_OwnerDraw)) |
514 CFWL_EvtLtbDrawItem ev; | |
515 ev.m_pSrcTarget = this; | |
516 ev.m_pGraphics = pGraphics; | |
517 ev.m_matrix = *pMatrix; | |
518 ev.m_index = i; | |
519 ev.m_rect = rtItem; | |
520 DispatchEvent(&ev); | |
521 } else { | |
522 DrawItem(pGraphics, pTheme, pItem, i, rtItem, pMatrix); | 514 DrawItem(pGraphics, pTheme, pItem, i, rtItem, pMatrix); |
523 } | |
524 } | 515 } |
525 } | 516 } |
526 | 517 |
527 void IFWL_ListBox::DrawItem(CFX_Graphics* pGraphics, | 518 void IFWL_ListBox::DrawItem(CFX_Graphics* pGraphics, |
528 IFWL_ThemeProvider* pTheme, | 519 IFWL_ThemeProvider* pTheme, |
529 CFWL_ListItem* pItem, | 520 CFWL_ListItem* pItem, |
530 int32_t Index, | 521 int32_t Index, |
531 const CFX_RectF& rtItem, | 522 const CFX_RectF& rtItem, |
532 const CFX_Matrix* pMatrix) { | 523 const CFX_Matrix* pMatrix) { |
533 IFWL_ListBoxDP* pData = | 524 IFWL_ListBoxDP* pData = |
(...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1105 Repaint(&m_rtClient); | 1096 Repaint(&m_rtClient); |
1106 } | 1097 } |
1107 return true; | 1098 return true; |
1108 } | 1099 } |
1109 | 1100 |
1110 void IFWL_ListBox::DispatchSelChangedEv() { | 1101 void IFWL_ListBox::DispatchSelChangedEv() { |
1111 CFWL_EvtLtbSelChanged ev; | 1102 CFWL_EvtLtbSelChanged ev; |
1112 ev.m_pSrcTarget = this; | 1103 ev.m_pSrcTarget = this; |
1113 DispatchEvent(&ev); | 1104 DispatchEvent(&ev); |
1114 } | 1105 } |
OLD | NEW |