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_widgetmgrimp.h" | 7 #include "xfa/fwl/core/fwl_widgetmgrimp.h" |
8 | 8 |
9 #include "xfa/fwl/core/cfwl_message.h" | 9 #include "xfa/fwl/core/cfwl_message.h" |
10 #include "xfa/fwl/core/fwl_appimp.h" | 10 #include "xfa/fwl/core/fwl_appimp.h" |
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
464 while (pChild) | 464 while (pChild) |
465 pChild = GetWidget(pChild, FWL_WGTRELATION_NextSibling); | 465 pChild = GetWidget(pChild, FWL_WGTRELATION_NextSibling); |
466 return iRet; | 466 return iRet; |
467 } | 467 } |
468 IFWL_Widget* CFWL_WidgetMgr::GetSiblingRadioButton(IFWL_Widget* pWidget, | 468 IFWL_Widget* CFWL_WidgetMgr::GetSiblingRadioButton(IFWL_Widget* pWidget, |
469 FX_BOOL bNext) { | 469 FX_BOOL bNext) { |
470 return nullptr; | 470 return nullptr; |
471 } | 471 } |
472 IFWL_Widget* CFWL_WidgetMgr::GetRadioButtonGroupHeader( | 472 IFWL_Widget* CFWL_WidgetMgr::GetRadioButtonGroupHeader( |
473 IFWL_Widget* pRadioButton) { | 473 IFWL_Widget* pRadioButton) { |
474 if (pRadioButton->GetStyles() & FWL_WGTSTYLE_Group) { | |
475 return pRadioButton; | |
476 } | |
477 IFWL_Widget* pNext = pRadioButton; | 474 IFWL_Widget* pNext = pRadioButton; |
478 while ((pNext = GetSiblingRadioButton(pNext, FALSE)) != NULL) { | 475 while (pNext) { |
479 if (pNext->GetStyles() & FWL_WGTSTYLE_Group) { | 476 if (pNext->GetStyles() & FWL_WGTSTYLE_Group) |
480 return pNext; | 477 return pNext; |
481 } | 478 pNext = GetSiblingRadioButton(pNext, FALSE); |
482 } | 479 } |
483 pNext = GetWidget(pRadioButton, FWL_WGTRELATION_LastSibling); | 480 pNext = GetWidget(pRadioButton, FWL_WGTRELATION_LastSibling); |
484 while ((pNext = GetSiblingRadioButton(pNext, FALSE)) && pNext && | 481 while ((pNext = GetSiblingRadioButton(pNext, FALSE)) != nullptr && |
485 pNext != pRadioButton) { | 482 pNext != pRadioButton) { |
486 if (pNext->GetStyles() & FWL_WGTSTYLE_Group) { | 483 if (pNext->GetStyles() & FWL_WGTSTYLE_Group) |
487 return pNext; | 484 return pNext; |
488 } | |
489 } | 485 } |
490 pNext = GetWidget(pRadioButton, FWL_WGTRELATION_FirstSibling); | 486 pNext = GetWidget(pRadioButton, FWL_WGTRELATION_FirstSibling); |
491 return GetSiblingRadioButton(pNext, TRUE); | 487 return GetSiblingRadioButton(pNext, TRUE); |
492 } | 488 } |
493 void CFWL_WidgetMgr::GetSameGroupRadioButton( | 489 void CFWL_WidgetMgr::GetSameGroupRadioButton( |
494 IFWL_Widget* pRadioButton, | 490 IFWL_Widget* pRadioButton, |
495 CFX_ArrayTemplate<IFWL_Widget*>& group) { | 491 CFX_ArrayTemplate<IFWL_Widget*>& group) { |
496 IFWL_Widget* pFirst = GetWidget(pRadioButton, FWL_WGTRELATION_FirstSibling); | 492 IFWL_Widget* pFirst = GetWidget(pRadioButton, FWL_WGTRELATION_FirstSibling); |
497 if (!pFirst) { | 493 if (!pFirst) { |
498 pFirst = pRadioButton; | 494 pFirst = pRadioButton; |
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
896 temp.Deflate(50, 50); | 892 temp.Deflate(50, 50); |
897 if (!temp.Contains(r)) | 893 if (!temp.Contains(r)) |
898 return FALSE; | 894 return FALSE; |
899 | 895 |
900 pItem->bOutsideChanged = FALSE; | 896 pItem->bOutsideChanged = FALSE; |
901 } | 897 } |
902 #endif | 898 #endif |
903 | 899 |
904 return pItem->iRedrawCounter == 0; | 900 return pItem->iRedrawCounter == 0; |
905 } | 901 } |
OLD | NEW |