]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk/bmpbuttn.h
1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Robert Roebling
6 // Copyright: (c) 1998 Robert Roebling
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
11 #ifndef __BMPBUTTONH__
12 #define __BMPBUTTONH__
22 #include "wx/object.h"
24 #include "wx/control.h"
25 #include "wx/bitmap.h"
26 #include "wx/button.h"
28 //-----------------------------------------------------------------------------
30 //-----------------------------------------------------------------------------
34 //-----------------------------------------------------------------------------
36 //-----------------------------------------------------------------------------
38 extern const wxChar
*wxButtonNameStr
;
40 //-----------------------------------------------------------------------------
42 //-----------------------------------------------------------------------------
44 class wxBitmapButton
: public wxButton
48 inline wxBitmapButton( wxWindow
*parent
, wxWindowID id
, const wxBitmap
& bitmap
,
49 const wxPoint
& pos
= wxDefaultPosition
,
50 const wxSize
& size
= wxDefaultSize
, long style
= wxBU_AUTODRAW
,
51 const wxValidator
& validator
= wxDefaultValidator
,
52 const wxString
& name
= wxButtonNameStr
)
54 Create(parent
, id
, bitmap
, pos
, size
, style
, validator
, name
);
56 bool Create( wxWindow
*parent
, wxWindowID id
, const wxBitmap
& bitmap
,
57 const wxPoint
& pos
= wxDefaultPosition
,
58 const wxSize
& size
= wxDefaultSize
, long style
= wxBU_AUTODRAW
,
59 const wxValidator
& validator
= wxDefaultValidator
,
60 const wxString
& name
= wxButtonNameStr
);
61 virtual void SetDefault();
63 void SetLabel( const wxString
&label
);
64 wxString
GetLabel() const;
65 virtual void SetLabel( const wxBitmap
& bitmap
) { SetBitmapLabel(bitmap
); }
67 wxBitmap
& GetBitmapDisabled() const { return (wxBitmap
&) m_disabled
; }
68 wxBitmap
& GetBitmapFocus() const { return (wxBitmap
&) m_focus
; }
69 wxBitmap
& GetBitmapLabel() const { return (wxBitmap
&) m_bitmap
; }
70 wxBitmap
& GetBitmapSelected() const { return (wxBitmap
&) m_selected
; }
72 void SetBitmapDisabled( const wxBitmap
& bitmap
);
73 void SetBitmapFocus( const wxBitmap
& bitmap
);
74 void SetBitmapLabel( const wxBitmap
& bitmap
);
75 void SetBitmapSelected( const wxBitmap
& bitmap
);
77 void SetMargins(int x
, int y
) { m_marginX
= x
; m_marginY
= y
; }
78 int GetMarginX() const { return m_marginX
; }
79 int GetMarginY() const { return m_marginY
; }
81 virtual bool Enable(bool enable
);
91 void ApplyWidgetStyle();
105 DECLARE_DYNAMIC_CLASS(wxBitmapButton
)
110 #endif // __BMPBUTTONH__