adapted to new sending for radiobutton events for unselecting too
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10387 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -38,12 +38,15 @@ END_EVENT_TABLE()
|
|||||||
|
|
||||||
void wxRadioBox::OnRadioButton( wxCommandEvent &outer )
|
void wxRadioBox::OnRadioButton( wxCommandEvent &outer )
|
||||||
{
|
{
|
||||||
|
if ( outer.IsChecked() )
|
||||||
|
{
|
||||||
wxCommandEvent event(wxEVT_COMMAND_RADIOBOX_SELECTED, m_windowId);
|
wxCommandEvent event(wxEVT_COMMAND_RADIOBOX_SELECTED, m_windowId);
|
||||||
int i = GetSelection() ;
|
int i = GetSelection() ;
|
||||||
event.SetInt( i );
|
event.SetInt( i );
|
||||||
event.SetString( GetString( i ) );
|
event.SetString( GetString( i ) );
|
||||||
event.SetEventObject( this );
|
event.SetEventObject( this );
|
||||||
ProcessCommand(event);
|
ProcessCommand(event);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
wxRadioBox::wxRadioBox()
|
wxRadioBox::wxRadioBox()
|
||||||
|
|||||||
@@ -71,7 +71,6 @@ void wxRadioButton::SetValue(bool val)
|
|||||||
return ;
|
return ;
|
||||||
|
|
||||||
::SetControlValue( m_macControl , val ) ;
|
::SetControlValue( m_macControl , val ) ;
|
||||||
Refresh() ;
|
|
||||||
if (val)
|
if (val)
|
||||||
{
|
{
|
||||||
cycle=this->NextInCycle();
|
cycle=this->NextInCycle();
|
||||||
@@ -82,6 +81,10 @@ void wxRadioButton::SetValue(bool val)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
wxCommandEvent event(wxEVT_COMMAND_RADIOBUTTON_SELECTED, m_windowId );
|
||||||
|
event.SetEventObject(this);
|
||||||
|
event.SetInt( GetValue() );
|
||||||
|
ProcessCommand(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxRadioButton::GetValue() const
|
bool wxRadioButton::GetValue() const
|
||||||
@@ -98,10 +101,6 @@ void wxRadioButton::Command (wxCommandEvent & event)
|
|||||||
void wxRadioButton::MacHandleControlClick( ControlHandle control , SInt16 controlpart )
|
void wxRadioButton::MacHandleControlClick( ControlHandle control , SInt16 controlpart )
|
||||||
{
|
{
|
||||||
SetValue(true) ;
|
SetValue(true) ;
|
||||||
wxCommandEvent event(wxEVT_COMMAND_RADIOBUTTON_SELECTED, m_windowId );
|
|
||||||
event.SetEventObject(this);
|
|
||||||
event.SetInt( GetValue() );
|
|
||||||
ProcessCommand(event);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
wxRadioButton *wxRadioButton::AddInCycle(wxRadioButton *cycle)
|
wxRadioButton *wxRadioButton::AddInCycle(wxRadioButton *cycle)
|
||||||
|
|||||||
@@ -38,12 +38,15 @@ END_EVENT_TABLE()
|
|||||||
|
|
||||||
void wxRadioBox::OnRadioButton( wxCommandEvent &outer )
|
void wxRadioBox::OnRadioButton( wxCommandEvent &outer )
|
||||||
{
|
{
|
||||||
|
if ( outer.IsChecked() )
|
||||||
|
{
|
||||||
wxCommandEvent event(wxEVT_COMMAND_RADIOBOX_SELECTED, m_windowId);
|
wxCommandEvent event(wxEVT_COMMAND_RADIOBOX_SELECTED, m_windowId);
|
||||||
int i = GetSelection() ;
|
int i = GetSelection() ;
|
||||||
event.SetInt( i );
|
event.SetInt( i );
|
||||||
event.SetString( GetString( i ) );
|
event.SetString( GetString( i ) );
|
||||||
event.SetEventObject( this );
|
event.SetEventObject( this );
|
||||||
ProcessCommand(event);
|
ProcessCommand(event);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
wxRadioBox::wxRadioBox()
|
wxRadioBox::wxRadioBox()
|
||||||
|
|||||||
@@ -71,7 +71,6 @@ void wxRadioButton::SetValue(bool val)
|
|||||||
return ;
|
return ;
|
||||||
|
|
||||||
::SetControlValue( m_macControl , val ) ;
|
::SetControlValue( m_macControl , val ) ;
|
||||||
Refresh() ;
|
|
||||||
if (val)
|
if (val)
|
||||||
{
|
{
|
||||||
cycle=this->NextInCycle();
|
cycle=this->NextInCycle();
|
||||||
@@ -82,6 +81,10 @@ void wxRadioButton::SetValue(bool val)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
wxCommandEvent event(wxEVT_COMMAND_RADIOBUTTON_SELECTED, m_windowId );
|
||||||
|
event.SetEventObject(this);
|
||||||
|
event.SetInt( GetValue() );
|
||||||
|
ProcessCommand(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxRadioButton::GetValue() const
|
bool wxRadioButton::GetValue() const
|
||||||
@@ -98,10 +101,6 @@ void wxRadioButton::Command (wxCommandEvent & event)
|
|||||||
void wxRadioButton::MacHandleControlClick( ControlHandle control , SInt16 controlpart )
|
void wxRadioButton::MacHandleControlClick( ControlHandle control , SInt16 controlpart )
|
||||||
{
|
{
|
||||||
SetValue(true) ;
|
SetValue(true) ;
|
||||||
wxCommandEvent event(wxEVT_COMMAND_RADIOBUTTON_SELECTED, m_windowId );
|
|
||||||
event.SetEventObject(this);
|
|
||||||
event.SetInt( GetValue() );
|
|
||||||
ProcessCommand(event);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
wxRadioButton *wxRadioButton::AddInCycle(wxRadioButton *cycle)
|
wxRadioButton *wxRadioButton::AddInCycle(wxRadioButton *cycle)
|
||||||
|
|||||||
Reference in New Issue
Block a user