X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e421922f90186d0619a806d277a0a2182e61b5fb..de9a407728e5f47ed416365da9c07798ad0b0b26:/src/common/radiocmn.cpp diff --git a/src/common/radiocmn.cpp b/src/common/radiocmn.cpp index 2c91443928..47f15e5b2c 100644 --- a/src/common/radiocmn.cpp +++ b/src/common/radiocmn.cpp @@ -6,7 +6,7 @@ // Created: 03.06.01 // RCS-ID: $Id$ // Copyright: (c) 2001 Vadim Zeitlin -// License: wxWindows license +// License: wxWindows licence /////////////////////////////////////////////////////////////////////////////// // ============================================================================ @@ -17,7 +17,7 @@ // headers // ---------------------------------------------------------------------------- -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "radioboxbase.h" #endif @@ -38,6 +38,18 @@ // implementation // ============================================================================ +int wxRadioBoxBase::FindString(const wxString& s) const +{ + int count = GetCount(); + for ( int n = 0; n < count; n++ ) + { + if ( GetString(n) == s ) + return n; + } + + return wxNOT_FOUND; +} + int wxRadioBoxBase::GetNextItem(int item, wxDirection dir, long style) const { int count = GetCount(), @@ -98,7 +110,7 @@ int wxRadioBoxBase::GetNextItem(int item, wxDirection dir, long style) const default: wxFAIL_MSG( _T("unexpected wxDirection value") ); - return -1; + return wxNOT_FOUND; } // ensure that the item is in range [0..count) @@ -134,5 +146,38 @@ int wxRadioBoxBase::GetNextItem(int item, wxDirection dir, long style) const return item; } +#if WXWIN_COMPATIBILITY_2_4 + +// these functions are deprecated and don't do anything +int wxRadioBoxBase::GetNumberOfRowsOrCols() const +{ + return 1; +} + +void wxRadioBoxBase::SetNumberOfRowsOrCols(int WXUNUSED(n)) +{ +} + +#endif // WXWIN_COMPATIBILITY_2_4 + +#if WXWIN_COMPATIBILITY_2_2 + +int wxRadioBoxBase::Number() const +{ + return GetCount(); +} + +wxString wxRadioBoxBase::GetLabel(int n) const +{ + return GetString(n); +} + +void wxRadioBoxBase::SetLabel(int n, const wxString& label) +{ + SetString(n, label); +} + +#endif // WXWIN_COMPATIBILITY_2_2 + #endif // wxUSE_RADIOBOX