X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e90c1d2a19361551eb07778280f22be3e759cf64..2e1a688e3e9c6c265620e4f05d579077367e9fdb:/src/gtk1/checkbox.cpp diff --git a/src/gtk1/checkbox.cpp b/src/gtk1/checkbox.cpp index a7763349d2..060c3a127c 100644 --- a/src/gtk1/checkbox.cpp +++ b/src/gtk1/checkbox.cpp @@ -30,7 +30,8 @@ extern bool g_isIdle; // data //----------------------------------------------------------------------------- -extern bool g_blockEventsOnDrag; +extern bool g_blockEventsOnDrag; +extern wxCursor g_globalCursor; //----------------------------------------------------------------------------- // "clicked" @@ -75,7 +76,7 @@ bool wxCheckBox::Create(wxWindow *parent, if (!PreCreation( parent, pos, size ) || !CreateBase( parent, id, pos, size, style, validator, name )) { - wxFAIL_MSG( T("wxCheckBox creation failed") ); + wxFAIL_MSG( wxT("wxCheckBox creation failed") ); return FALSE; } @@ -136,7 +137,7 @@ bool wxCheckBox::Create(wxWindow *parent, void wxCheckBox::SetValue( bool state ) { - wxCHECK_RET( m_widgetCheckbox != NULL, T("invalid checkbox") ); + wxCHECK_RET( m_widgetCheckbox != NULL, wxT("invalid checkbox") ); if (state == GetValue()) return; @@ -155,14 +156,14 @@ void wxCheckBox::SetValue( bool state ) bool wxCheckBox::GetValue() const { - wxCHECK_MSG( m_widgetCheckbox != NULL, FALSE, T("invalid checkbox") ); + wxCHECK_MSG( m_widgetCheckbox != NULL, FALSE, wxT("invalid checkbox") ); return GTK_TOGGLE_BUTTON(m_widgetCheckbox)->active; } void wxCheckBox::SetLabel( const wxString& label ) { - wxCHECK_RET( m_widgetLabel != NULL, T("invalid checkbox") ); + wxCHECK_RET( m_widgetLabel != NULL, wxT("invalid checkbox") ); wxControl::SetLabel( label ); @@ -186,4 +187,27 @@ void wxCheckBox::ApplyWidgetStyle() gtk_widget_set_style( m_widgetLabel, m_widgetStyle ); } +bool wxCheckBox::IsOwnGtkWindow( GdkWindow *window ) +{ + return (window == GTK_TOGGLE_BUTTON(m_widget)->event_window); +} + +void wxCheckBox::OnInternalIdle() +{ + wxCursor cursor = m_cursor; + if (g_globalCursor.Ok()) cursor = g_globalCursor; + + if (GTK_TOGGLE_BUTTON(m_widget)->event_window && cursor.Ok()) + { + /* I now set the cursor the anew in every OnInternalIdle call + as setting the cursor in a parent window also effects the + windows above so that checking for the current cursor is + not possible. */ + + gdk_window_set_cursor( GTK_TOGGLE_BUTTON(m_widget)->event_window, cursor.GetCursor() ); + } + + UpdateWindowUI(); +} + #endif