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 // Id: $Id: anybutton.h 67066 2011-02-27 12:48:30Z VZ $
7 // Copyright: (c) 1998 Robert Roebling
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_GTK_ANYBUTTON_H_
12 #define _WX_GTK_ANYBUTTON_H_
14 //-----------------------------------------------------------------------------
16 //-----------------------------------------------------------------------------
18 class WXDLLIMPEXP_CORE wxAnyButton
: public wxAnyButtonBase
27 virtual bool Enable( bool enable
= true );
32 static wxVisualAttributes
33 GetClassDefaultAttributes(wxWindowVariant variant
= wxWINDOW_VARIANT_NORMAL
);
35 // called from GTK callbacks: they update the button state and call
37 void GTKMouseEnters();
38 void GTKMouseLeaves();
43 virtual GdkWindow
*GTKGetWindow(wxArrayGdkWindows
& windows
) const;
45 virtual wxBitmap
DoGetBitmap(State which
) const;
46 virtual void DoSetBitmap(const wxBitmap
& bitmap
, State which
);
47 virtual void DoSetBitmapPosition(wxDirection dir
);
50 typedef wxAnyButtonBase base_type
;
52 // focus event handler: calls GTKUpdateBitmap()
53 void GTKOnFocus(wxFocusEvent
& event
);
55 // update the bitmap to correspond to the current button state
56 void GTKUpdateBitmap();
58 // return the current button state from m_isXXX flags (which means that it
59 // might not correspond to the real current state as e.g. m_isCurrent will
60 // never be true if we don't have a valid current bitmap)
61 State
GTKGetCurrentState() const;
63 // show the given bitmap (must be valid)
64 void GTKDoShowBitmap(const wxBitmap
& bitmap
);
67 // the bitmaps for the different state of the buttons, all of them may be
68 // invalid and the button only shows a bitmap at all if State_Normal bitmap
70 wxBitmap m_bitmaps
[State_Max
];
72 // true iff mouse is currently over the button
75 // true iff the button is in pressed state
78 wxDECLARE_NO_COPY_CLASS(wxAnyButton
);
81 #endif // _WX_GTK_ANYBUTTON_H_