//-----------------------------------------------------------------------------
// data
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// data
//-----------------------------------------------------------------------------
wxCommandEvent event(wxEVT_COMMAND_CHOICE_SELECTED, choice->GetId() );
event.SetInt( choice->GetSelection() );
wxCommandEvent event(wxEVT_COMMAND_CHOICE_SELECTED, choice->GetId() );
event.SetInt( choice->GetSelection() );
PreCreation( parent, id, pos, size, style, name );
PreCreation( parent, id, pos, size, style, name );
GtkWidget *item = gtk_menu_item_new_with_label( choices[i] );
gtk_menu_append( GTK_MENU(menu), item );
GtkWidget *item = gtk_menu_item_new_with_label( choices[i] );
gtk_menu_append( GTK_MENU(menu), item );
GTK_SIGNAL_FUNC(gtk_choice_clicked_callback), (gpointer*)this );
}
gtk_option_menu_set_menu( GTK_OPTION_MENU(m_widget), menu );
GTK_SIGNAL_FUNC(gtk_choice_clicked_callback), (gpointer*)this );
}
gtk_option_menu_set_menu( GTK_OPTION_MENU(m_widget), menu );
m_parent->AddChild( this );
(m_parent->m_insertCallback)( m_parent, this );
m_parent->AddChild( this );
(m_parent->m_insertCallback)( m_parent, this );
SetBackgroundColour( parent->GetBackgroundColour() );
SetForegroundColour( parent->GetForegroundColour() );
SetBackgroundColour( parent->GetBackgroundColour() );
SetForegroundColour( parent->GetForegroundColour() );
}
void wxChoice::AppendCommon( const wxString &item )
{
wxCHECK_RET( m_widget != NULL, "invalid choice" );
}
void wxChoice::AppendCommon( const wxString &item )
{
wxCHECK_RET( m_widget != NULL, "invalid choice" );
GtkWidget *menu = gtk_option_menu_get_menu( GTK_OPTION_MENU(m_widget) );
GtkWidget *menu_item = gtk_menu_item_new_with_label( item );
GtkWidget *menu = gtk_option_menu_get_menu( GTK_OPTION_MENU(m_widget) );
GtkWidget *menu_item = gtk_menu_item_new_with_label( item );
- if (clientData)
- m_clientDataList.Append( (wxObject*) new wxVoidClientData( clientData ) );
- else
- m_clientDataList.Append( (wxObject*)NULL );
-
+ m_clientDataList.Append( (wxObject*) clientData );
+ m_clientObjectList.Append( (wxObject*) NULL );
+
AppendCommon( item );
}
void wxChoice::SetClientData( int n, void* clientData )
{
wxCHECK_RET( m_widget != NULL, "invalid combobox" );
AppendCommon( item );
}
void wxChoice::SetClientData( int n, void* clientData )
{
wxCHECK_RET( m_widget != NULL, "invalid combobox" );
}
void* wxChoice::GetClientData( int n )
{
wxCHECK_MSG( m_widget != NULL, NULL, "invalid combobox" );
}
void* wxChoice::GetClientData( int n )
{
wxCHECK_MSG( m_widget != NULL, NULL, "invalid combobox" );
}
void wxChoice::SetClientObject( int n, wxClientData* clientData )
{
wxCHECK_RET( m_widget != NULL, "invalid combobox" );
}
void wxChoice::SetClientObject( int n, wxClientData* clientData )
{
wxCHECK_RET( m_widget != NULL, "invalid combobox" );
- wxCHECK_MSG( m_widget != NULL, (wxClientData*)NULL, "invalid combobox" );
-
- wxNode *node = m_clientDataList.Nth( n );
+ wxCHECK_MSG( m_widget != NULL, (wxClientData*) NULL, "invalid combobox" );
+
+ wxNode *node = m_clientObjectList.Nth( n );
gtk_option_menu_remove_menu( GTK_OPTION_MENU(m_widget) );
GtkWidget *menu = gtk_menu_new();
gtk_option_menu_set_menu( GTK_OPTION_MENU(m_widget), menu );
gtk_option_menu_remove_menu( GTK_OPTION_MENU(m_widget) );
GtkWidget *menu = gtk_menu_new();
gtk_option_menu_set_menu( GTK_OPTION_MENU(m_widget), menu );
// If you read this code once and you think you understand
// it, then you are very wrong. Robert Roebling.
// If you read this code once and you think you understand
// it, then you are very wrong. Robert Roebling.
GtkMenuShell *menu_shell = GTK_MENU_SHELL( gtk_option_menu_get_menu( GTK_OPTION_MENU(m_widget) ) );
int count = 0;
GList *child = menu_shell->children;
GtkMenuShell *menu_shell = GTK_MENU_SHELL( gtk_option_menu_get_menu( GTK_OPTION_MENU(m_widget) ) );
int count = 0;
GList *child = menu_shell->children;
GtkLabel *label = (GtkLabel *) NULL;
if (bin->child) label = GTK_LABEL(bin->child);
if (!label) label = GTK_LABEL( GTK_BUTTON(m_widget)->child );
GtkLabel *label = (GtkLabel *) NULL;
if (bin->child) label = GTK_LABEL(bin->child);
if (!label) label = GTK_LABEL( GTK_BUTTON(m_widget)->child );
GtkLabel *label = (GtkLabel *) NULL;
if (bin->child) label = GTK_LABEL(bin->child);
if (!label) label = GTK_LABEL( GTK_BUTTON(m_widget)->child );
GtkLabel *label = (GtkLabel *) NULL;
if (bin->child) label = GTK_LABEL(bin->child);
if (!label) label = GTK_LABEL( GTK_BUTTON(m_widget)->child );
wxCHECK_MSG( m_widget != NULL, "", "invalid choice" );
GtkLabel *label = GTK_LABEL( GTK_BUTTON(m_widget)->child );
wxCHECK_MSG( m_widget != NULL, "", "invalid choice" );
GtkLabel *label = GTK_LABEL( GTK_BUTTON(m_widget)->child );
gtk_widget_set_style( m_widget, m_widgetStyle );
gtk_widget_set_style( GTK_WIDGET( menu_shell ), m_widgetStyle );
gtk_widget_set_style( m_widget, m_widgetStyle );
gtk_widget_set_style( GTK_WIDGET( menu_shell ), m_widgetStyle );
GList *child = menu_shell->children;
while (child)
{
gtk_widget_set_style( GTK_WIDGET( child->data ), m_widgetStyle );
GList *child = menu_shell->children;
while (child)
{
gtk_widget_set_style( GTK_WIDGET( child->data ), m_widgetStyle );
GtkBin *bin = GTK_BIN( child->data );
GtkWidget *label = (GtkWidget *) NULL;
if (bin->child) label = bin->child;
if (!label) label = GTK_BUTTON(m_widget)->child;
GtkBin *bin = GTK_BIN( child->data );
GtkWidget *label = (GtkWidget *) NULL;
if (bin->child) label = bin->child;
if (!label) label = GTK_BUTTON(m_widget)->child;