X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/aa61d3525370a9b9fa8c797d9b7f89d96994db5f..cc4d5638c66a409e421420ed7110917755a66788:/src/univ/radiobox.cpp diff --git a/src/univ/radiobox.cpp b/src/univ/radiobox.cpp index b51b63aecb..9b1855cc04 100644 --- a/src/univ/radiobox.cpp +++ b/src/univ/radiobox.cpp @@ -4,7 +4,6 @@ // Author: Vadim Zeitlin // Modified by: // Created: 11.09.00 -// RCS-ID: $Id$ // Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com) // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -25,9 +24,10 @@ #if wxUSE_RADIOBOX +#include "wx/radiobox.h" + #ifndef WX_PRECOMP #include "wx/dcclient.h" - #include "wx/radiobox.h" #include "wx/radiobut.h" #include "wx/validate.h" #include "wx/arrstr.h" @@ -62,7 +62,7 @@ public: virtual bool ProcessEvent(wxEvent& event) { // we intercept the command events from radio buttons - if ( event.GetEventType() == wxEVT_COMMAND_RADIOBUTTON_SELECTED ) + if ( event.GetEventType() == wxEVT_RADIOBUTTON ) { m_radio->OnRadioButton(event); } @@ -146,20 +146,20 @@ bool wxRadioBox::Create(wxWindow *parent, if ( !(style & (wxRA_LEFTTORIGHT | wxRA_TOPTOBOTTOM)) ) { // horizontal radiobox use left to right layout - if ( style & wxRA_HORIZONTAL ) + if ( style & wxRA_SPECIFY_COLS ) { style |= wxRA_LEFTTORIGHT; } - else if ( style & wxRA_VERTICAL ) + else if ( style & wxRA_SPECIFY_ROWS ) { style |= wxRA_TOPTOBOTTOM; } else { - wxFAIL_MSG( _T("you must specify wxRA_XXX style!") ); + wxFAIL_MSG( wxT("you must specify wxRA_XXX style!") ); // use default - style = wxRA_HORIZONTAL | wxRA_LEFTTORIGHT; + style = wxRA_SPECIFY_COLS | wxRA_LEFTTORIGHT; } } @@ -238,7 +238,7 @@ void wxRadioBox::Append(int count, const wxString *choices) void wxRadioBox::SetSelection(int n) { - wxCHECK_RET( IsValid(n), _T("invalid index in wxRadioBox::SetSelection") ); + wxCHECK_RET( IsValid(n), wxT("invalid index in wxRadioBox::SetSelection") ); m_selection = n; @@ -258,9 +258,9 @@ int wxRadioBox::GetSelection() const void wxRadioBox::SendRadioEvent() { - wxCHECK_RET( m_selection != -1, _T("no active radio button") ); + wxCHECK_RET( m_selection != -1, wxT("no active radio button") ); - wxCommandEvent event(wxEVT_COMMAND_RADIOBOX_SELECTED, GetId()); + wxCommandEvent event(wxEVT_RADIOBOX, GetId()); InitCommandEvent(event); event.SetInt(m_selection); event.SetString(GetString(m_selection)); @@ -271,7 +271,7 @@ void wxRadioBox::SendRadioEvent() void wxRadioBox::OnRadioButton(wxEvent& event) { int n = m_buttons.Index((wxRadioButton *)event.GetEventObject()); - wxCHECK_RET( n != wxNOT_FOUND, _T("click from alien radio button") ); + wxCHECK_RET( n != wxNOT_FOUND, wxT("click from alien radio button") ); m_selection = n; @@ -285,42 +285,42 @@ void wxRadioBox::OnRadioButton(wxEvent& event) wxString wxRadioBox::GetString(unsigned int n) const { wxCHECK_MSG( IsValid(n), wxEmptyString, - _T("invalid index in wxRadioBox::GetString") ); + wxT("invalid index in wxRadioBox::GetString") ); return m_buttons[n]->GetLabel(); } void wxRadioBox::SetString(unsigned int n, const wxString& label) { - wxCHECK_RET( IsValid(n), _T("invalid index in wxRadioBox::SetString") ); + wxCHECK_RET( IsValid(n), wxT("invalid index in wxRadioBox::SetString") ); m_buttons[n]->SetLabel(label); } bool wxRadioBox::Enable(unsigned int n, bool enable) { - wxCHECK_MSG( IsValid(n), false, _T("invalid index in wxRadioBox::Enable") ); + wxCHECK_MSG( IsValid(n), false, wxT("invalid index in wxRadioBox::Enable") ); return m_buttons[n]->Enable(enable); } bool wxRadioBox::IsItemEnabled(unsigned int n) const { - wxCHECK_MSG( IsValid(n), false, _T("invalid index in wxRadioBox::IsItemEnabled") ); + wxCHECK_MSG( IsValid(n), false, wxT("invalid index in wxRadioBox::IsItemEnabled") ); return m_buttons[n]->IsEnabled(); } bool wxRadioBox::Show(unsigned int n, bool show) { - wxCHECK_MSG( IsValid(n), false, _T("invalid index in wxRadioBox::Show") ); + wxCHECK_MSG( IsValid(n), false, wxT("invalid index in wxRadioBox::Show") ); return m_buttons[n]->Show(show); } bool wxRadioBox::IsItemShown(unsigned int n) const { - wxCHECK_MSG( IsValid(n), false, _T("invalid index in wxRadioBox::IsItemShown") ); + wxCHECK_MSG( IsValid(n), false, wxT("invalid index in wxRadioBox::IsItemShown") ); return m_buttons[n]->IsShown(); }