#endif
#include "wx/spinbutt.h"
+
+#ifdef wxUSE_SPINBTN
+
#include "wx/utils.h"
#include <math.h>
#include "gdk/gdk.h"
#include "gtk/gtk.h"
+//-----------------------------------------------------------------------------
+// idle system
+//-----------------------------------------------------------------------------
+
+extern void wxapp_install_idle_handler();
+extern bool g_isIdle;
+
//-----------------------------------------------------------------------------
// data
//-----------------------------------------------------------------------------
static void gtk_spinbutt_callback( GtkWidget *WXUNUSED(widget), wxSpinButton *win )
{
- if (!win->HasVMT()) return;
+ if (g_isIdle) wxapp_install_idle_handler();
+
+ if (!win->m_hasVMT) return;
if (g_blockEventsOnDrag) return;
float diff = win->m_adjust->value - win->m_oldPos;
m_needParent = TRUE;
wxSize new_size = size;
- new_size.x = 16;
+ new_size.x = 15;
if (new_size.y == -1)
new_size.y = 30;
(GtkSignalFunc) gtk_spinbutt_callback,
(gpointer) this );
- m_parent->AddChild( this );
-
- (m_parent->m_insertCallback)( m_parent, this );
+ m_parent->DoAddChild( this );
PostCreation();
int wxSpinButton::GetMin() const
{
- wxCHECK_MSG( (m_widget != NULL), 0, "invalid spin button" );
+ wxCHECK_MSG( (m_widget != NULL), 0, _T("invalid spin button") );
return (int)ceil(m_adjust->lower);
}
int wxSpinButton::GetMax() const
{
- wxCHECK_MSG( (m_widget != NULL), 0, "invalid spin button" );
+ wxCHECK_MSG( (m_widget != NULL), 0, _T("invalid spin button") );
return (int)ceil(m_adjust->upper);
}
int wxSpinButton::GetValue() const
{
- wxCHECK_MSG( (m_widget != NULL), 0, "invalid spin button" );
+ wxCHECK_MSG( (m_widget != NULL), 0, _T("invalid spin button") );
return (int)ceil(m_adjust->value);
}
void wxSpinButton::SetValue( int value )
{
- wxCHECK_RET( (m_widget != NULL), "invalid spin button" );
+ wxCHECK_RET( (m_widget != NULL), _T("invalid spin button") );
float fpos = (float)value;
m_oldPos = fpos;
void wxSpinButton::SetRange(int minVal, int maxVal)
{
- wxCHECK_RET( (m_widget != NULL), "invalid spin button" );
+ wxCHECK_RET( (m_widget != NULL), _T("invalid spin button") );
float fmin = (float)minVal;
float fmax = (float)maxVal;
void wxSpinButton::OnSize( wxSizeEvent &WXUNUSED(event) )
{
- wxCHECK_RET( (m_widget != NULL), "invalid spin button" );
+ wxCHECK_RET( (m_widget != NULL), _T("invalid spin button") );
- m_width = 16;
+ m_width = 15;
gtk_widget_set_usize( m_widget, m_width, m_height );
}
{
}
-
+#endif
\ No newline at end of file