#include "wx/bmpbuttn.h"
+#include "gdk/gdk.h"
+#include "gtk/gtk.h"
+
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class wxBitmapButton;
+//-----------------------------------------------------------------------------
+// idle system
+//-----------------------------------------------------------------------------
+
+extern void wxapp_install_idle_handler();
+extern bool g_isIdle;
+
//-----------------------------------------------------------------------------
// data
//-----------------------------------------------------------------------------
static void gtk_bmpbutton_clicked_callback( GtkWidget *WXUNUSED(widget), wxBitmapButton *button )
{
+ if (g_isIdle) wxapp_install_idle_handler();
+
if (!button->HasVMT()) return;
if (g_blockEventsOnDrag) return;
long style, const wxValidator& validator, const wxString &name )
{
m_needParent = TRUE;
+ m_acceptsFocus = TRUE;
wxSize newSize = size;
void wxBitmapButton::SetDefault()
{
-/*
GTK_WIDGET_SET_FLAGS( m_widget, GTK_CAN_DEFAULT );
gtk_widget_grab_default( m_widget );
-*/
+
+ SetSize( m_x, m_y, m_width, m_height );
}
void wxBitmapButton::SetLabel( const wxString &label )
{
- wxCHECK_RET( m_widget != NULL, "invalid button" );
+ wxCHECK_RET( m_widget != NULL, _T("invalid button") );
wxControl::SetLabel( label );
}
wxString wxBitmapButton::GetLabel() const
{
- wxCHECK_MSG( m_widget != NULL, "", "invalid button" );
+ wxCHECK_MSG( m_widget != NULL, _T(""), _T("invalid button") );
return wxControl::GetLabel();
}
void wxBitmapButton::SetBitmap()
{
- wxCHECK_RET( m_widget != NULL, "invalid button" );
+ wxCHECK_RET( m_widget != NULL, _T("invalid button") );
wxBitmap the_one;
void wxBitmapButton::SetBitmapDisabled( const wxBitmap& bitmap )
{
- wxCHECK_RET( m_widget != NULL, "invalid button" );
+ wxCHECK_RET( m_widget != NULL, _T("invalid button") );
if ( ! m_disabled.Ok() ) return;
m_disabled = bitmap;
void wxBitmapButton::SetBitmapFocus( const wxBitmap& bitmap )
{
- wxCHECK_RET( m_widget != NULL, "invalid button" );
+ wxCHECK_RET( m_widget != NULL, _T("invalid button") );
if ( ! m_focus.Ok() ) return;
m_focus = bitmap;
void wxBitmapButton::SetBitmapLabel( const wxBitmap& bitmap )
{
- wxCHECK_RET( m_widget != NULL, "invalid button" );
+ wxCHECK_RET( m_widget != NULL, _T("invalid button") );
if (!m_bitmap.Ok()) return;
m_bitmap = bitmap;
void wxBitmapButton::SetBitmapSelected( const wxBitmap& bitmap )
{
- wxCHECK_RET( m_widget != NULL, "invalid button" );
+ wxCHECK_RET( m_widget != NULL, _T("invalid button") );
if ( ! m_selected.Ok() ) return;
m_selected = bitmap;