Fillid in many more missing functions (such as Enable())
There are still things to fix when compiling sockets .. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@687 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -55,14 +55,8 @@ LIB_CPP_SRC=\
|
||||
common/validate.cpp \
|
||||
common/valtext.cpp \
|
||||
common/wxexpr.cpp \
|
||||
common/tokenzr.cpp \
|
||||
common/socket.cpp \
|
||||
common/sckaddr.cpp \
|
||||
common/protocol.cpp \
|
||||
common/url.cpp \
|
||||
common/http.cpp \
|
||||
common/ftp.cpp \
|
||||
common/sckfile.cpp \
|
||||
common/sckipc.cpp \
|
||||
\
|
||||
gtk/accel.cpp \
|
||||
|
@@ -89,6 +89,14 @@ bool wxCheckBox::GetValue(void) const
|
||||
return tb->active;
|
||||
}
|
||||
|
||||
void wxCheckBox::Enable( bool enable )
|
||||
{
|
||||
wxControl::Enable( enable );
|
||||
GtkButton *bin = GTK_BUTTON( m_widget );
|
||||
GtkWidget *label = bin->child;
|
||||
gtk_widget_set_sensitive( label, enable );
|
||||
}
|
||||
|
||||
void wxCheckBox::SetFont( const wxFont &font )
|
||||
{
|
||||
if (((wxFont*)&font)->Ok())
|
||||
|
@@ -177,7 +177,12 @@ void wxRadioBox::SetSelection( int n )
|
||||
{
|
||||
GSList *item = gtk_radio_button_group( m_radio );
|
||||
item = g_slist_nth( item, g_slist_length(item)-n-1 );
|
||||
if (!item) return;
|
||||
|
||||
if (!item)
|
||||
{
|
||||
wxFAIL_MSG( "wxRadioBox wrong index" );
|
||||
return;
|
||||
}
|
||||
|
||||
GtkToggleButton *button = GTK_TOGGLE_BUTTON( item->data );
|
||||
|
||||
@@ -205,28 +210,46 @@ wxString wxRadioBox::GetString( int n ) const
|
||||
GSList *item = gtk_radio_button_group( m_radio );
|
||||
|
||||
item = g_slist_nth( item, g_slist_length(item)-n-1 );
|
||||
if (!item) return "";
|
||||
|
||||
GtkToggleButton *button = GTK_TOGGLE_BUTTON( item->data );
|
||||
if (!item)
|
||||
{
|
||||
wxFAIL_MSG( "wxRadioBox wrong index" );
|
||||
return "";
|
||||
}
|
||||
|
||||
GtkLabel *label = GTK_LABEL( GTK_BUTTON(button)->child );
|
||||
GtkButton *button = GTK_BUTTON( item->data );
|
||||
GtkLabel *label = GTK_LABEL( button->child );
|
||||
|
||||
return wxString( label->label );
|
||||
}
|
||||
|
||||
wxString wxRadioBox::GetLabel(void) const
|
||||
wxString wxRadioBox::GetLabel( int item ) const
|
||||
{
|
||||
return wxControl::GetLabel();
|
||||
return GetString( item );
|
||||
}
|
||||
|
||||
void wxRadioBox::SetLabel( const wxString& WXUNUSED(label) )
|
||||
void wxRadioBox::SetLabel( const wxString& label )
|
||||
{
|
||||
wxFAIL_MSG("wxRadioBox::SetLabel not implemented.");
|
||||
wxControl::SetLabel( label );
|
||||
GtkFrame *frame = GTK_FRAME( m_widget );
|
||||
gtk_frame_set_label( frame, wxControl::GetLabel() );
|
||||
}
|
||||
|
||||
void wxRadioBox::SetLabel( int WXUNUSED(item), const wxString& WXUNUSED(label) )
|
||||
void wxRadioBox::SetLabel( int item, const wxString& label )
|
||||
{
|
||||
wxFAIL_MSG("wxRadioBox::SetLabel not implemented.");
|
||||
GSList *list = gtk_radio_button_group( m_radio );
|
||||
list = g_slist_nth( list, g_slist_length(list)-item-1 );
|
||||
|
||||
if (!list)
|
||||
{
|
||||
wxFAIL_MSG( "wxRadioBox wrong index" );
|
||||
return;
|
||||
}
|
||||
|
||||
GtkButton *button = GTK_BUTTON( list->data );
|
||||
GtkLabel *g_label = GTK_LABEL( button->child );
|
||||
|
||||
gtk_label_set( g_label, label );
|
||||
}
|
||||
|
||||
void wxRadioBox::SetLabel( int WXUNUSED(item), wxBitmap *WXUNUSED(bitmap) )
|
||||
@@ -234,25 +257,56 @@ void wxRadioBox::SetLabel( int WXUNUSED(item), wxBitmap *WXUNUSED(bitmap) )
|
||||
wxFAIL_MSG("wxRadioBox::SetLabel not implemented.");
|
||||
}
|
||||
|
||||
wxString wxRadioBox::GetLabel( int WXUNUSED(item) ) const
|
||||
void wxRadioBox::Enable( bool enable )
|
||||
{
|
||||
wxFAIL_MSG("wxRadioBox::GetLabel not implemented.");
|
||||
return "";
|
||||
wxControl::Enable( enable );
|
||||
|
||||
GSList *item = gtk_radio_button_group( m_radio );
|
||||
while (item)
|
||||
{
|
||||
GtkButton *button = GTK_BUTTON( item->data );
|
||||
GtkWidget *label = button->child;
|
||||
gtk_widget_set_sensitive( GTK_WIDGET(button), enable );
|
||||
gtk_widget_set_sensitive( label, enable );
|
||||
item = item->next;
|
||||
}
|
||||
}
|
||||
|
||||
void wxRadioBox::Enable( bool WXUNUSED(enable) )
|
||||
void wxRadioBox::Enable( int item, bool enable )
|
||||
{
|
||||
wxFAIL_MSG("wxRadioBox::Enable not implemented.");
|
||||
GSList *list = gtk_radio_button_group( m_radio );
|
||||
list = g_slist_nth( list, g_slist_length(list)-item-1 );
|
||||
|
||||
if (!list)
|
||||
{
|
||||
wxFAIL_MSG( "wxRadioBox wrong index" );
|
||||
return;
|
||||
}
|
||||
|
||||
GtkButton *button = GTK_BUTTON( list->data );
|
||||
|
||||
GtkWidget *label = button->child;
|
||||
gtk_widget_set_sensitive( GTK_WIDGET(button), enable );
|
||||
gtk_widget_set_sensitive( label, enable );
|
||||
}
|
||||
|
||||
void wxRadioBox::Enable( int WXUNUSED(item), bool WXUNUSED(enable) )
|
||||
void wxRadioBox::Show( int item, bool show )
|
||||
{
|
||||
wxFAIL_MSG("wxRadioBox::Enable not implemented.");
|
||||
}
|
||||
GSList *list = gtk_radio_button_group( m_radio );
|
||||
list = g_slist_nth( list, g_slist_length(list)-item-1 );
|
||||
|
||||
if (!list)
|
||||
{
|
||||
wxFAIL_MSG( "wxRadioBox wrong index" );
|
||||
return;
|
||||
}
|
||||
|
||||
GtkWidget *button = GTK_WIDGET( list->data );
|
||||
|
||||
void wxRadioBox::Show( int WXUNUSED(item), bool WXUNUSED(show) )
|
||||
{
|
||||
wxFAIL_MSG("wxRadioBox::Show not implemented.");
|
||||
if (show)
|
||||
gtk_widget_show( button );
|
||||
else
|
||||
gtk_widget_hide( button );
|
||||
}
|
||||
|
||||
wxString wxRadioBox::GetStringSelection(void) const
|
||||
|
@@ -86,6 +86,14 @@ bool wxRadioButton::GetValue(void) const
|
||||
return GTK_TOGGLE_BUTTON(m_widget)->active;
|
||||
}
|
||||
|
||||
void wxRadioButton::Enable( bool enable )
|
||||
{
|
||||
wxControl::Enable( enable );
|
||||
GtkButton *bin = GTK_BUTTON( m_widget );
|
||||
GtkWidget *label = bin->child;
|
||||
gtk_widget_set_sensitive( label, enable );
|
||||
}
|
||||
|
||||
void wxRadioButton::SetFont( const wxFont &font )
|
||||
{
|
||||
if (((wxFont*)&font)->Ok())
|
||||
|
@@ -48,3 +48,10 @@ bool wxStaticBox::Create( wxWindow *parent, wxWindowID id, const wxString &label
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void wxStaticBox::SetLabel( const wxString &label )
|
||||
{
|
||||
wxControl::SetLabel( label );
|
||||
GtkFrame *frame = GTK_FRAME( m_widget );
|
||||
gtk_frame_set_label( frame, GetLabel() );
|
||||
}
|
||||
|
@@ -89,6 +89,14 @@ bool wxCheckBox::GetValue(void) const
|
||||
return tb->active;
|
||||
}
|
||||
|
||||
void wxCheckBox::Enable( bool enable )
|
||||
{
|
||||
wxControl::Enable( enable );
|
||||
GtkButton *bin = GTK_BUTTON( m_widget );
|
||||
GtkWidget *label = bin->child;
|
||||
gtk_widget_set_sensitive( label, enable );
|
||||
}
|
||||
|
||||
void wxCheckBox::SetFont( const wxFont &font )
|
||||
{
|
||||
if (((wxFont*)&font)->Ok())
|
||||
|
@@ -177,7 +177,12 @@ void wxRadioBox::SetSelection( int n )
|
||||
{
|
||||
GSList *item = gtk_radio_button_group( m_radio );
|
||||
item = g_slist_nth( item, g_slist_length(item)-n-1 );
|
||||
if (!item) return;
|
||||
|
||||
if (!item)
|
||||
{
|
||||
wxFAIL_MSG( "wxRadioBox wrong index" );
|
||||
return;
|
||||
}
|
||||
|
||||
GtkToggleButton *button = GTK_TOGGLE_BUTTON( item->data );
|
||||
|
||||
@@ -205,28 +210,46 @@ wxString wxRadioBox::GetString( int n ) const
|
||||
GSList *item = gtk_radio_button_group( m_radio );
|
||||
|
||||
item = g_slist_nth( item, g_slist_length(item)-n-1 );
|
||||
if (!item) return "";
|
||||
|
||||
GtkToggleButton *button = GTK_TOGGLE_BUTTON( item->data );
|
||||
if (!item)
|
||||
{
|
||||
wxFAIL_MSG( "wxRadioBox wrong index" );
|
||||
return "";
|
||||
}
|
||||
|
||||
GtkLabel *label = GTK_LABEL( GTK_BUTTON(button)->child );
|
||||
GtkButton *button = GTK_BUTTON( item->data );
|
||||
GtkLabel *label = GTK_LABEL( button->child );
|
||||
|
||||
return wxString( label->label );
|
||||
}
|
||||
|
||||
wxString wxRadioBox::GetLabel(void) const
|
||||
wxString wxRadioBox::GetLabel( int item ) const
|
||||
{
|
||||
return wxControl::GetLabel();
|
||||
return GetString( item );
|
||||
}
|
||||
|
||||
void wxRadioBox::SetLabel( const wxString& WXUNUSED(label) )
|
||||
void wxRadioBox::SetLabel( const wxString& label )
|
||||
{
|
||||
wxFAIL_MSG("wxRadioBox::SetLabel not implemented.");
|
||||
wxControl::SetLabel( label );
|
||||
GtkFrame *frame = GTK_FRAME( m_widget );
|
||||
gtk_frame_set_label( frame, wxControl::GetLabel() );
|
||||
}
|
||||
|
||||
void wxRadioBox::SetLabel( int WXUNUSED(item), const wxString& WXUNUSED(label) )
|
||||
void wxRadioBox::SetLabel( int item, const wxString& label )
|
||||
{
|
||||
wxFAIL_MSG("wxRadioBox::SetLabel not implemented.");
|
||||
GSList *list = gtk_radio_button_group( m_radio );
|
||||
list = g_slist_nth( list, g_slist_length(list)-item-1 );
|
||||
|
||||
if (!list)
|
||||
{
|
||||
wxFAIL_MSG( "wxRadioBox wrong index" );
|
||||
return;
|
||||
}
|
||||
|
||||
GtkButton *button = GTK_BUTTON( list->data );
|
||||
GtkLabel *g_label = GTK_LABEL( button->child );
|
||||
|
||||
gtk_label_set( g_label, label );
|
||||
}
|
||||
|
||||
void wxRadioBox::SetLabel( int WXUNUSED(item), wxBitmap *WXUNUSED(bitmap) )
|
||||
@@ -234,25 +257,56 @@ void wxRadioBox::SetLabel( int WXUNUSED(item), wxBitmap *WXUNUSED(bitmap) )
|
||||
wxFAIL_MSG("wxRadioBox::SetLabel not implemented.");
|
||||
}
|
||||
|
||||
wxString wxRadioBox::GetLabel( int WXUNUSED(item) ) const
|
||||
void wxRadioBox::Enable( bool enable )
|
||||
{
|
||||
wxFAIL_MSG("wxRadioBox::GetLabel not implemented.");
|
||||
return "";
|
||||
wxControl::Enable( enable );
|
||||
|
||||
GSList *item = gtk_radio_button_group( m_radio );
|
||||
while (item)
|
||||
{
|
||||
GtkButton *button = GTK_BUTTON( item->data );
|
||||
GtkWidget *label = button->child;
|
||||
gtk_widget_set_sensitive( GTK_WIDGET(button), enable );
|
||||
gtk_widget_set_sensitive( label, enable );
|
||||
item = item->next;
|
||||
}
|
||||
}
|
||||
|
||||
void wxRadioBox::Enable( bool WXUNUSED(enable) )
|
||||
void wxRadioBox::Enable( int item, bool enable )
|
||||
{
|
||||
wxFAIL_MSG("wxRadioBox::Enable not implemented.");
|
||||
GSList *list = gtk_radio_button_group( m_radio );
|
||||
list = g_slist_nth( list, g_slist_length(list)-item-1 );
|
||||
|
||||
if (!list)
|
||||
{
|
||||
wxFAIL_MSG( "wxRadioBox wrong index" );
|
||||
return;
|
||||
}
|
||||
|
||||
GtkButton *button = GTK_BUTTON( list->data );
|
||||
|
||||
GtkWidget *label = button->child;
|
||||
gtk_widget_set_sensitive( GTK_WIDGET(button), enable );
|
||||
gtk_widget_set_sensitive( label, enable );
|
||||
}
|
||||
|
||||
void wxRadioBox::Enable( int WXUNUSED(item), bool WXUNUSED(enable) )
|
||||
void wxRadioBox::Show( int item, bool show )
|
||||
{
|
||||
wxFAIL_MSG("wxRadioBox::Enable not implemented.");
|
||||
}
|
||||
GSList *list = gtk_radio_button_group( m_radio );
|
||||
list = g_slist_nth( list, g_slist_length(list)-item-1 );
|
||||
|
||||
if (!list)
|
||||
{
|
||||
wxFAIL_MSG( "wxRadioBox wrong index" );
|
||||
return;
|
||||
}
|
||||
|
||||
GtkWidget *button = GTK_WIDGET( list->data );
|
||||
|
||||
void wxRadioBox::Show( int WXUNUSED(item), bool WXUNUSED(show) )
|
||||
{
|
||||
wxFAIL_MSG("wxRadioBox::Show not implemented.");
|
||||
if (show)
|
||||
gtk_widget_show( button );
|
||||
else
|
||||
gtk_widget_hide( button );
|
||||
}
|
||||
|
||||
wxString wxRadioBox::GetStringSelection(void) const
|
||||
|
@@ -86,6 +86,14 @@ bool wxRadioButton::GetValue(void) const
|
||||
return GTK_TOGGLE_BUTTON(m_widget)->active;
|
||||
}
|
||||
|
||||
void wxRadioButton::Enable( bool enable )
|
||||
{
|
||||
wxControl::Enable( enable );
|
||||
GtkButton *bin = GTK_BUTTON( m_widget );
|
||||
GtkWidget *label = bin->child;
|
||||
gtk_widget_set_sensitive( label, enable );
|
||||
}
|
||||
|
||||
void wxRadioButton::SetFont( const wxFont &font )
|
||||
{
|
||||
if (((wxFont*)&font)->Ok())
|
||||
|
@@ -48,3 +48,10 @@ bool wxStaticBox::Create( wxWindow *parent, wxWindowID id, const wxString &label
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void wxStaticBox::SetLabel( const wxString &label )
|
||||
{
|
||||
wxControl::SetLabel( label );
|
||||
GtkFrame *frame = GTK_FRAME( m_widget );
|
||||
gtk_frame_set_label( frame, GetLabel() );
|
||||
}
|
||||
|
Reference in New Issue
Block a user