gtk_value_changed(GtkSpinButton* spinbutton, wxSpinCtrl* win)
{
win->m_pos = int(gtk_spin_button_get_value(spinbutton));
- if (!win->m_hasVMT || g_blockEventsOnDrag || win->m_blockScrollEvent)
+ if (!win->m_hasVMT || g_blockEventsOnDrag)
return;
wxCommandEvent event( wxEVT_COMMAND_SPINCTRL_UPDATED, win->GetId());
// values in range 5..50 is then, ummm, quite challenging (hint: you can't
// enter 1!) (VZ)
event.SetInt(win->m_pos);
- win->GetEventHandler()->ProcessEvent( event );
+ win->HandleWindowEvent( event );
}
}
static void
gtk_changed(GtkSpinButton* spinbutton, wxSpinCtrl* win)
{
- if (!win->m_hasVMT || win->m_blockScrollEvent)
+ if (!win->m_hasVMT)
return;
wxCommandEvent event( wxEVT_COMMAND_TEXT_UPDATED, win->GetId() );
// see above
event.SetInt(win->m_pos);
- win->GetEventHandler()->ProcessEvent( event );
+ win->HandleWindowEvent( event );
}
}
}
m_widget = gtk_spin_button_new_with_range(min, max, 1);
- gtk_spin_button_set_value((GtkSpinButton*)m_widget, initial);
- m_pos = int(gtk_spin_button_get_value((GtkSpinButton*)m_widget));
+ gtk_spin_button_set_value( GTK_SPIN_BUTTON(m_widget), initial);
+ m_pos = (int) gtk_spin_button_get_value( GTK_SPIN_BUTTON(m_widget));
gtk_spin_button_set_wrap( GTK_SPIN_BUTTON(m_widget),
(int)(m_windowStyle & wxSP_WRAP) );
wxCHECK_MSG( (m_widget != NULL), 0, wxT("invalid spin button") );
double min;
- gtk_spin_button_get_range((GtkSpinButton*)m_widget, &min, NULL);
+ gtk_spin_button_get_range( GTK_SPIN_BUTTON(m_widget), &min, NULL);
return int(min);
}
wxCHECK_MSG( (m_widget != NULL), 0, wxT("invalid spin button") );
double max;
- gtk_spin_button_get_range((GtkSpinButton*)m_widget, NULL, &max);
+ gtk_spin_button_get_range( GTK_SPIN_BUTTON(m_widget), NULL, &max);
return int(max);
}
GtkDisableEvents();
gtk_spin_button_update( GTK_SPIN_BUTTON(m_widget) );
+ wx_const_cast(wxSpinCtrl*, this)->m_pos =
+ int(gtk_spin_button_get_value(GTK_SPIN_BUTTON(m_widget)));
GtkEnableEvents();
return m_pos;
wxCHECK_RET( (m_widget != NULL), wxT("invalid spin button") );
GtkDisableEvents();
- gtk_spin_button_set_value((GtkSpinButton*)m_widget, value);
+ gtk_spin_button_set_value( GTK_SPIN_BUTTON(m_widget), value);
+ m_pos = (int) gtk_spin_button_get_value( GTK_SPIN_BUTTON(m_widget));
GtkEnableEvents();
}
wxCHECK_RET( (m_widget != NULL), wxT("invalid spin button") );
GtkDisableEvents();
- gtk_spin_button_set_range((GtkSpinButton*)m_widget, minVal, maxVal);
+ gtk_spin_button_set_range( GTK_SPIN_BUTTON(m_widget), minVal, maxVal);
+ m_pos = int(gtk_spin_button_get_value(GTK_SPIN_BUTTON(m_widget)));
GtkEnableEvents();
}
{
g_signal_handlers_block_by_func( m_widget,
(gpointer)gtk_value_changed, (void*) this);
-
+
g_signal_handlers_block_by_func(m_widget,
(gpointer)gtk_changed, (void*) this);
}
{
g_signal_handlers_unblock_by_func(m_widget,
(gpointer)gtk_value_changed, (void*) this);
-
+
g_signal_handlers_unblock_by_func(m_widget,
(gpointer)gtk_changed, (void*) this);
}
GtkSpinButton *gsb = GTK_SPIN_BUTTON(m_widget);
wxString val = wxGTK_CONV_BACK( gtk_entry_get_text( &gsb->entry ) );
evt.SetString( val );
- if (GetEventHandler()->ProcessEvent(evt)) return;
+ if (HandleWindowEvent(evt)) return;
}
event.Skip();