wxSpinCtrl no longer emits event when changed programmatically.
Some GUI thread things and tests, Change for borders around cmposite controls. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5173 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -178,7 +178,7 @@ void wxapp_install_thread_wakeup()
|
||||
{
|
||||
if (wxTheApp->m_wakeUpTimerTag) return;
|
||||
|
||||
wxTheApp->m_wakeUpTimerTag = gtk_timeout_add( 500, wxapp_wakeup_timerout_callback, (gpointer) NULL );
|
||||
wxTheApp->m_wakeUpTimerTag = gtk_timeout_add( 50, wxapp_wakeup_timerout_callback, (gpointer) NULL );
|
||||
}
|
||||
|
||||
void wxapp_uninstall_thread_wakeup()
|
||||
|
@@ -101,11 +101,7 @@ bool wxSpinCtrl::Create(wxWindow *parent, wxWindowID id,
|
||||
gtk_spin_button_set_wrap( GTK_SPIN_BUTTON(m_widget),
|
||||
(int)(m_windowStyle & wxSP_WRAP) );
|
||||
|
||||
gtk_signal_connect( GTK_OBJECT (m_adjust),
|
||||
"value_changed",
|
||||
(GtkSignalFunc) gtk_spinctrl_callback,
|
||||
(gpointer) this );
|
||||
|
||||
GtkEnableEvents();
|
||||
m_parent->DoAddChild( this );
|
||||
|
||||
PostCreation();
|
||||
@@ -119,6 +115,22 @@ bool wxSpinCtrl::Create(wxWindow *parent, wxWindowID id,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void wxSpinCtrl::GtkDisableEvents()
|
||||
{
|
||||
gtk_signal_disconnect_by_func( GTK_OBJECT(m_adjust),
|
||||
GTK_SIGNAL_FUNC(gtk_spinctrl_callback),
|
||||
(gpointer) this );
|
||||
|
||||
}
|
||||
|
||||
void wxSpinCtrl::GtkEnableEvents()
|
||||
{
|
||||
gtk_signal_connect( GTK_OBJECT (m_adjust),
|
||||
"value_changed",
|
||||
GTK_SIGNAL_FUNC(gtk_spinctrl_callback),
|
||||
(gpointer) this );
|
||||
}
|
||||
|
||||
int wxSpinCtrl::GetMin() const
|
||||
{
|
||||
wxCHECK_MSG( (m_widget != NULL), 0, wxT("invalid spin button") );
|
||||
@@ -153,7 +165,9 @@ void wxSpinCtrl::SetValue( const wxString& value )
|
||||
else
|
||||
{
|
||||
// invalid number - set text as is (wxMSW compatible)
|
||||
GtkDisableEvents();
|
||||
gtk_entry_set_text( GTK_ENTRY(m_widget), value.mbc_str() );
|
||||
GtkEnableEvents();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -167,7 +181,9 @@ void wxSpinCtrl::SetValue( int value )
|
||||
|
||||
m_adjust->value = fpos;
|
||||
|
||||
GtkDisableEvents();
|
||||
gtk_signal_emit_by_name( GTK_OBJECT(m_adjust), "value_changed" );
|
||||
GtkEnableEvents();
|
||||
}
|
||||
|
||||
void wxSpinCtrl::SetRange(int minVal, int maxVal)
|
||||
|
@@ -327,7 +327,7 @@ static void draw_frame( GtkWidget *widget, wxWindow *win )
|
||||
GTK_STATE_NORMAL,
|
||||
GTK_SHADOW_OUT,
|
||||
dx, dy,
|
||||
win->m_width-dw, win->m_height-dh );
|
||||
widget->allocation.width-dw, widget->allocation.height-dh );
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -338,7 +338,7 @@ static void draw_frame( GtkWidget *widget, wxWindow *win )
|
||||
GTK_STATE_NORMAL,
|
||||
GTK_SHADOW_IN,
|
||||
dx, dy,
|
||||
win->m_width-dw, win->m_height-dh );
|
||||
widget->allocation.width-dw, widget->allocation.height-dh );
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -349,7 +349,7 @@ static void draw_frame( GtkWidget *widget, wxWindow *win )
|
||||
gdk_gc_set_foreground( gc, &widget->style->black );
|
||||
gdk_draw_rectangle( widget->window, gc, FALSE,
|
||||
dx, dy,
|
||||
win->m_width-dw-1, win->m_height-dh-1 );
|
||||
widget->allocation.width-dw-1, widget->allocation.height-dh-1 );
|
||||
gdk_gc_unref( gc );
|
||||
return;
|
||||
}
|
||||
|
Reference in New Issue
Block a user