X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/11e59d47c05f2303ccfc07625b726ac7cb821881..6f36917bbffe00404ae6f653e876d57efc25a8ac:/src/os2/radiobox.cpp?ds=sidebyside diff --git a/src/os2/radiobox.cpp b/src/os2/radiobox.cpp index 6048148d4a..cf31c122fb 100644 --- a/src/os2/radiobox.cpp +++ b/src/os2/radiobox.cpp @@ -15,6 +15,8 @@ #ifndef WX_PRECOMP #include #include "wx/setup.h" + #include "wx/wxchar.h" + #include "wx/string.h" #include "wx/bitmap.h" #include "wx/brush.h" #include "wx/radiobox.h" @@ -22,9 +24,7 @@ #include "wx/os2/private.h" -#if !USE_SHARED_LIBRARY IMPLEMENT_DYNAMIC_CLASS(wxRadioBox, wxControl) -#endif // --------------------------------------------------------------------------- // private functions @@ -51,6 +51,21 @@ static s_wndprocRadioBtn = NULL; // wxRadioBox // --------------------------------------------------------------------------- +int wxRadioBox::GetCount() const +{ + return m_noItems; +} + +int wxRadioBox::GetColumnCount() const +{ + return GetNumHor(); +} + +int wxRadioBox::GetRowCount() const +{ + return GetNumVer(); +} + int wxRadioBox::GetNumVer() const { if ( m_windowStyle & wxRA_SPECIFY_ROWS ) @@ -143,14 +158,17 @@ bool wxRadioBox::Create(wxWindow *parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, int n, const wxString choices[], int majorDim, long style, +#if wxUSE_VALIDATORS const wxValidator& val, const wxString& name) +#endif { m_selectedButton = -1; m_noItems = n; SetName(name); +#if wxUSE_VALIDATORS SetValidator(val); - +#endif parent->AddChild(this); m_backgroundColour = parent->GetBackgroundColour(); m_foregroundColour = parent->GetForegroundColour(); @@ -278,6 +296,14 @@ wxRadioBox::~wxRadioBox() } +void wxRadioBox::SetString(int item, const wxString& label) +{ + wxCHECK_RET( item >= 0 && item < m_noItems, wxT("invalid radiobox index") ); + + m_radioWidth[item] = m_radioHeight[item] = -1; + ::WinSetWindowText((HWND)m_radioButtons[item], label.c_str()); +} + wxString wxRadioBox::GetLabel(int item) const { wxCHECK_MSG( item >= 0 && item < m_noItems, wxT(""), wxT("invalid radiobox index") );