-#include <gtk/gtk.h>
-
-//-----------------------------------------------------------------------------
-// classes
-//-----------------------------------------------------------------------------
-
-class wxBitmapButton;
-
-//-----------------------------------------------------------------------------
-// data
-//-----------------------------------------------------------------------------
-
-extern bool g_blockEventsOnDrag;
-
-//-----------------------------------------------------------------------------
-// "clicked"
-//-----------------------------------------------------------------------------
-
-extern "C" {
-static void gtk_bmpbutton_clicked_callback( GtkWidget *WXUNUSED(widget), wxBitmapButton *button )
-{
- if (!button->m_hasVMT) return;
- if (g_blockEventsOnDrag) return;
-
- wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, button->GetId());
- event.SetEventObject(button);
- button->HandleWindowEvent(event);
-}
-}
-
-//-----------------------------------------------------------------------------
-// "enter"
-//-----------------------------------------------------------------------------
-
-extern "C" {
-static void gtk_bmpbutton_enter_callback( GtkWidget *WXUNUSED(widget), wxBitmapButton *button )
-{
- if (!button->m_hasVMT) return;
- if (g_blockEventsOnDrag) return;
-
- button->GTKMouseEnters();
-}
-}
-
-//-----------------------------------------------------------------------------
-// "leave"
-//-----------------------------------------------------------------------------
-
-extern "C" {
-static void gtk_bmpbutton_leave_callback( GtkWidget *WXUNUSED(widget), wxBitmapButton *button )
-{
- if (!button->m_hasVMT) return;
- if (g_blockEventsOnDrag) return;
-
- button->GTKMouseLeaves();
-}
-}
-
-//-----------------------------------------------------------------------------
-// "pressed"
-//-----------------------------------------------------------------------------
-
-extern "C" {
-static void gtk_bmpbutton_press_callback( GtkWidget *WXUNUSED(widget), wxBitmapButton *button )
-{
- if (!button->m_hasVMT) return;
- if (g_blockEventsOnDrag) return;
-
- button->GTKPressed();
-}
-}
-
-//-----------------------------------------------------------------------------
-// "released"
-//-----------------------------------------------------------------------------
-
-extern "C" {
-static void gtk_bmpbutton_release_callback( GtkWidget *WXUNUSED(widget), wxBitmapButton *button )
-{
- if (!button->m_hasVMT) return;
- if (g_blockEventsOnDrag) return;
-
- button->GTKReleased();
-}
-}
-
-//-----------------------------------------------------------------------------
-// wxBitmapButton
-//-----------------------------------------------------------------------------
-
-IMPLEMENT_DYNAMIC_CLASS(wxBitmapButton,wxButton)
-
-BEGIN_EVENT_TABLE(wxBitmapButton, wxButton)
- EVT_SET_FOCUS(wxBitmapButton::OnFocusChange)
- EVT_KILL_FOCUS(wxBitmapButton::OnFocusChange)
-END_EVENT_TABLE()
-
-
-void wxBitmapButton::Init()
-{
- m_mouseHovers =
- m_isPressed = false;
-}
-
-bool wxBitmapButton::Create( wxWindow *parent,
- wxWindowID id,
- const wxBitmap& bitmap,
- const wxPoint& pos,
- const wxSize& size,
- long style,
- const wxValidator& validator,
- const wxString &name )
-{
- if (!PreCreation( parent, pos, size ) ||
- !CreateBase( parent, id, pos, size, style, validator, name ))
- {
- wxFAIL_MSG( wxT("wxBitmapButton creation failed") );