/////////////////////////////////////////////////////////////////////////////
-// Name: wx/gtk1/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
// 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/gtk1/private.h"
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
if (style & wxNO_BORDER)
gtk_button_set_relief( GTK_BUTTON(m_widget), GTK_RELIEF_NONE );
- if (m_bitmap.Ok())
+ if (m_bitmap.IsOk())
{
OnSetBitmap();
}
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);
{
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
{
wxSize best;
- if (m_bitmap.Ok())
+ if (m_bitmap.IsOk())
{
int border = HasFlag(wxNO_BORDER) ? 4 : 10;
best.x = m_bitmap.GetWidth()+border;
{
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
}
#endif // wxUSE_TOGGLEBTN
-