Now even wxRadioButton works
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1196 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
72fd19a1fb
commit
f5d29b396f
@ -67,6 +67,7 @@ class wxRadioButton: public wxControl
|
||||
void ApplyWidgetStyle();
|
||||
|
||||
bool m_blockFirstEvent;
|
||||
GtkWidget* m_theOtherRadioButtton;
|
||||
};
|
||||
|
||||
#endif // __GTKRADIOBUTTONH__
|
||||
|
@ -67,6 +67,7 @@ class wxRadioButton: public wxControl
|
||||
void ApplyWidgetStyle();
|
||||
|
||||
bool m_blockFirstEvent;
|
||||
GtkWidget* m_theOtherRadioButtton;
|
||||
};
|
||||
|
||||
#endif // __GTKRADIOBUTTONH__
|
||||
|
@ -197,6 +197,9 @@ const int ID_RADIOBOX_SEL_STR = 162;
|
||||
const int ID_RADIOBOX_FONT = 163;
|
||||
const int ID_RADIOBOX_ENABLE = 164;
|
||||
|
||||
const int ID_RADIOBUTTON_1 = 166;
|
||||
const int ID_RADIOBUTTON_2 = 167;
|
||||
|
||||
const int ID_SET_FONT = 170;
|
||||
|
||||
const int ID_GAUGE = 180;
|
||||
@ -376,6 +379,9 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) :
|
||||
m_fontButton->SetForegroundColour("blue");
|
||||
(void)new wxButton( panel, ID_RADIOBOX_FONT, "Set Italic font", wxPoint(340,80), wxSize(140,30) );
|
||||
(void)new wxCheckBox( panel, ID_RADIOBOX_ENABLE, "Disable", wxPoint(340,130), wxSize(140,30) );
|
||||
wxRadioButton *rb = new wxRadioButton( panel, ID_RADIOBUTTON_1, "Radiobutton1", wxPoint(210,170), wxSize(110,30) );
|
||||
rb->SetValue( FALSE );
|
||||
(void)new wxRadioButton( panel, ID_RADIOBUTTON_2, "Radiobutton2", wxPoint(340,170), wxSize(110,30) );
|
||||
m_notebook->AddPage(panel, "wxRadioBox", FALSE, Image_Radio);
|
||||
|
||||
panel = new wxPanel(m_notebook);
|
||||
|
@ -63,6 +63,11 @@ bool wxRadioButton::Create( wxWindow *parent, wxWindowID id, const wxString& lab
|
||||
|
||||
m_widget = gtk_radio_button_new_with_label( (GSList *) NULL, label );
|
||||
|
||||
m_theOtherRadioButtton =
|
||||
gtk_radio_button_new_with_label(
|
||||
gtk_radio_button_group( GTK_RADIO_BUTTON(m_widget) ),
|
||||
"button2" );
|
||||
|
||||
SetLabel(label);
|
||||
|
||||
m_blockFirstEvent = FALSE;
|
||||
@ -104,7 +109,10 @@ void wxRadioButton::SetValue( bool val )
|
||||
|
||||
m_blockFirstEvent = TRUE;
|
||||
|
||||
gtk_toggle_button_set_state( GTK_TOGGLE_BUTTON(m_widget), val );
|
||||
if (val)
|
||||
gtk_toggle_button_set_state( GTK_TOGGLE_BUTTON(m_widget), TRUE );
|
||||
else
|
||||
gtk_toggle_button_set_state( GTK_TOGGLE_BUTTON(m_theOtherRadioButtton), TRUE );
|
||||
}
|
||||
|
||||
bool wxRadioButton::GetValue(void) const
|
||||
|
@ -63,6 +63,11 @@ bool wxRadioButton::Create( wxWindow *parent, wxWindowID id, const wxString& lab
|
||||
|
||||
m_widget = gtk_radio_button_new_with_label( (GSList *) NULL, label );
|
||||
|
||||
m_theOtherRadioButtton =
|
||||
gtk_radio_button_new_with_label(
|
||||
gtk_radio_button_group( GTK_RADIO_BUTTON(m_widget) ),
|
||||
"button2" );
|
||||
|
||||
SetLabel(label);
|
||||
|
||||
m_blockFirstEvent = FALSE;
|
||||
@ -104,7 +109,10 @@ void wxRadioButton::SetValue( bool val )
|
||||
|
||||
m_blockFirstEvent = TRUE;
|
||||
|
||||
gtk_toggle_button_set_state( GTK_TOGGLE_BUTTON(m_widget), val );
|
||||
if (val)
|
||||
gtk_toggle_button_set_state( GTK_TOGGLE_BUTTON(m_widget), TRUE );
|
||||
else
|
||||
gtk_toggle_button_set_state( GTK_TOGGLE_BUTTON(m_theOtherRadioButtton), TRUE );
|
||||
}
|
||||
|
||||
bool wxRadioButton::GetValue(void) const
|
||||
|
Loading…
Reference in New Issue
Block a user