X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/91af089567c5e13a408f1c529f6830d12cdc6c4e..64ea838d8f4d1853b7d850db93ee565e901d099a:/src/gtk1/tglbtn.cpp?ds=sidebyside diff --git a/src/gtk1/tglbtn.cpp b/src/gtk1/tglbtn.cpp index cf8a289b9e..286f3fc478 100644 --- a/src/gtk1/tglbtn.cpp +++ b/src/gtk1/tglbtn.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: wx/gtk/tglbtn.cpp +// Name: src/gtk1/tglbtn.cpp // Purpose: Definition of the wxToggleButton class, which implements a // toggle button under wxGTK. // Author: John Norris, minor changes by Axel Schlueter @@ -7,18 +7,21 @@ // Created: 08.02.01 // RCS-ID: $Id$ // Copyright: (c) 2000 Johnny C. Norris II -// License: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" +#if wxUSE_TOGGLEBTN + #include "wx/tglbtn.h" -#include "wx/button.h" -#if wxUSE_TOGGLEBTN +#ifndef WX_PRECOMP + #include "wx/button.h" +#endif -#include "wx/gtk/private.h" +#include "wx/gtk1/private.h" extern void wxapp_install_idle_handler(); extern bool g_isIdle; @@ -40,11 +43,11 @@ static void gtk_togglebutton_clicked_callback(GtkWidget *WXUNUSED(widget), wxTog wxCommandEvent event(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, cb->GetId()); event.SetInt(cb->GetValue()); event.SetEventObject(cb); - cb->GetEventHandler()->ProcessEvent(event); + cb->HandleWindowEvent(event); } } -DEFINE_EVENT_TYPE(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED) +wxDEFINE_EVENT( wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEvent ); // ------------------------------------------------------------------------ // wxToggleBitmapButton @@ -78,7 +81,7 @@ bool wxToggleBitmapButton::Create(wxWindow *parent, wxWindowID id, if (style & wxNO_BORDER) gtk_button_set_relief( GTK_BUTTON(m_widget), GTK_RELIEF_NONE ); - if (m_bitmap.Ok()) + if (m_bitmap.IsOk()) { OnSetBitmap(); } @@ -131,9 +134,9 @@ void wxToggleBitmapButton::SetLabel(const wxBitmap& label) void wxToggleBitmapButton::OnSetBitmap() { - if (!m_bitmap.Ok()) return; + if (!m_bitmap.IsOk()) return; - GdkBitmap *mask = (GdkBitmap *) NULL; + GdkBitmap *mask = NULL; if (m_bitmap.GetMask()) mask = m_bitmap.GetMask()->GetBitmap(); GtkWidget *child = BUTTON_CHILD(m_widget); @@ -176,11 +179,11 @@ void wxToggleBitmapButton::OnInternalIdle() { wxCursor cursor = m_cursor; - if (g_globalCursor.Ok()) + if (g_globalCursor.IsOk()) cursor = g_globalCursor; GdkWindow *win = TOGGLE_BUTTON_EVENT_WIN(m_widget); - if ( win && cursor.Ok() ) + if ( win && cursor.IsOk() ) { /* I now set the cursor the anew in every OnInternalIdle call as setting the cursor in a parent window also effects the @@ -200,7 +203,7 @@ wxSize wxToggleBitmapButton::DoGetBestSize() const { wxSize best; - if (m_bitmap.Ok()) + if (m_bitmap.IsOk()) { int border = HasFlag(wxNO_BORDER) ? 4 : 10; best.x = m_bitmap.GetWidth()+border; @@ -317,11 +320,11 @@ void wxToggleButton::OnInternalIdle() { wxCursor cursor = m_cursor; - if (g_globalCursor.Ok()) + if (g_globalCursor.IsOk()) cursor = g_globalCursor; GdkWindow *win = TOGGLE_BUTTON_EVENT_WIN(m_widget); - if ( win && cursor.Ok() ) + if ( win && cursor.IsOk() ) { /* I now set the cursor the anew in every OnInternalIdle call as setting the cursor in a parent window also effects the @@ -358,4 +361,3 @@ wxToggleButton::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant)) } #endif // wxUSE_TOGGLEBTN -