1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/gtk/anybutton.h
3 // Purpose: wxGTK wxAnyButton class declaration
4 // Author: Robert Roebling
5 // Created: 1998-05-20 (extracted from button.h)
6 // Copyright: (c) 1998 Robert Roebling
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
10 #ifndef _WX_GTK_ANYBUTTON_H_
11 #define _WX_GTK_ANYBUTTON_H_
13 //-----------------------------------------------------------------------------
15 //-----------------------------------------------------------------------------
17 class WXDLLIMPEXP_CORE wxAnyButton
: public wxAnyButtonBase
26 virtual bool Enable( bool enable
= true );
31 static wxVisualAttributes
32 GetClassDefaultAttributes(wxWindowVariant variant
= wxWINDOW_VARIANT_NORMAL
);
34 // called from GTK callbacks: they update the button state and call
36 void GTKMouseEnters();
37 void GTKMouseLeaves();
42 virtual GdkWindow
*GTKGetWindow(wxArrayGdkWindows
& windows
) const;
44 virtual wxBitmap
DoGetBitmap(State which
) const;
45 virtual void DoSetBitmap(const wxBitmap
& bitmap
, State which
);
46 virtual void DoSetBitmapPosition(wxDirection dir
);
49 typedef wxAnyButtonBase base_type
;
51 // focus event handler: calls GTKUpdateBitmap()
52 void GTKOnFocus(wxFocusEvent
& event
);
54 // update the bitmap to correspond to the current button state
55 void GTKUpdateBitmap();
57 // return the current button state from m_isXXX flags (which means that it
58 // might not correspond to the real current state as e.g. m_isCurrent will
59 // never be true if we don't have a valid current bitmap)
60 State
GTKGetCurrentState() const;
62 // show the given bitmap (must be valid)
63 void GTKDoShowBitmap(const wxBitmap
& bitmap
);
66 // the bitmaps for the different state of the buttons, all of them may be
67 // invalid and the button only shows a bitmap at all if State_Normal bitmap
69 wxBitmap m_bitmaps
[State_Max
];
71 // true iff mouse is currently over the button
74 // true iff the button is in pressed state
77 wxDECLARE_NO_COPY_CLASS(wxAnyButton
);
80 #endif // _WX_GTK_ANYBUTTON_H_