HasMultipleSelection() is clearer than handling style bits

This commit is contained in:
Bill Su 2023-12-13 18:26:19 -05:00
parent cfc5bc6ff2
commit bdfeb19d19

View file

@ -380,7 +380,7 @@ bool wxGenericValidator::TransferToWindow()
else if (m_pInt)
{
wxCHECK_MSG(
!(pControl->GetWindowStyle() & (wxLB_MULTIPLE || wxLB_EXTENDED)),
!pControl->HasMultipleSelection(),
false,
"multi-select control requires wxArrayInt"
);
@ -414,7 +414,7 @@ bool wxGenericValidator::TransferToWindow()
else if (m_pInt)
{
wxCHECK_MSG(
!(pControl->GetWindowStyle() & (wxLB_MULTIPLE || wxLB_EXTENDED)),
!pControl->HasMultipleSelection(),
false,
"multi-select control requires wxArrayInt"
);
@ -679,7 +679,7 @@ bool wxGenericValidator::TransferFromWindow()
else if (m_pInt)
{
wxCHECK_MSG(
!(pControl->GetWindowStyle()& (wxLB_MULTIPLE || wxLB_EXTENDED)),
!pControl->HasMultipleSelection(),
false,
"multi-select control requires wxArrayInt"
);
@ -723,7 +723,7 @@ bool wxGenericValidator::TransferFromWindow()
else if (m_pInt)
{
wxCHECK_MSG(
!(pControl->GetWindowStyle() & (wxLB_MULTIPLE || wxLB_EXTENDED)),
!pControl->HasMultipleSelection(),
false,
"multi-select control requires wxArrayInt"
);