X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/043ad13ffe29c618fbf07689f643a383be0b0045..a31e87879e56c3d4dc7a2b40842bdef9e407adcb:/src/msw/radiobox.cpp diff --git a/src/msw/radiobox.cpp b/src/msw/radiobox.cpp index 7f811c9216..053da03797 100644 --- a/src/msw/radiobox.cpp +++ b/src/msw/radiobox.cpp @@ -4,7 +4,6 @@ // Author: Julian Smart // Modified by: // Created: 04/01/98 -// RCS-ID: $Id$ // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -444,6 +443,25 @@ void wxRadioBox::SetFocus() } } +bool wxRadioBox::CanBeFocused() const +{ + // If the control itself is hidden or disabled, no need to check anything + // else. + if ( !wxStaticBox::CanBeFocused() ) + return false; + + // Otherwise, check if we have any buttons that can be focused. + for ( size_t item = 0; item < m_radioButtons->GetCount(); item++ ) + { + if ( IsItemEnabled(item) && IsItemShown(item) ) + return true; + } + + // We didn't find any items that can accept focus, so neither can we as a + // whole accept it. + return false; +} + // Enable a specific button bool wxRadioBox::Enable(unsigned int item, bool enable) {