1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/msw/anybutton.h
3 // Purpose: wxAnyButton class
4 // Author: Julian Smart
5 // Created: 1997-02-01 (extracted from button.h)
6 // RCS-ID: $Id: anybutton.h 67065 2011-02-27 12:48:26Z VZ $
7 // Copyright: (c) Julian Smart
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_MSW_ANYBUTTON_H_
12 #define _WX_MSW_ANYBUTTON_H_
14 // ----------------------------------------------------------------------------
15 // Common button functionality
16 // ----------------------------------------------------------------------------
18 class WXDLLIMPEXP_CORE wxAnyButton
: public wxAnyButtonBase
26 #endif // wxUSE_MARKUP
29 virtual ~wxAnyButton();
31 // overridden base class methods
32 virtual void SetLabel(const wxString
& label
);
33 virtual bool SetBackgroundColour(const wxColour
&colour
);
34 virtual bool SetForegroundColour(const wxColour
&colour
);
36 // implementation from now on
37 virtual WXLRESULT
MSWWindowProc(WXUINT nMsg
, WXWPARAM wParam
, WXLPARAM lParam
);
39 virtual bool MSWOnDraw(WXDRAWITEMSTRUCT
*item
);
40 virtual State
GetNormalState() const { return State_Normal
; }
42 // returns true if the platform should explicitly apply a theme border
43 virtual bool CanApplyThemeBorder() const { return false; }
46 // usually overridden base class virtuals
47 virtual wxSize
DoGetBestSize() const;
49 virtual wxBitmap
DoGetBitmap(State which
) const;
50 virtual void DoSetBitmap(const wxBitmap
& bitmap
, State which
);
51 virtual wxSize
DoGetBitmapMargins() const;
52 virtual void DoSetBitmapMargins(wxCoord x
, wxCoord y
);
53 virtual void DoSetBitmapPosition(wxDirection dir
);
56 virtual bool DoSetLabelMarkup(const wxString
& markup
);
57 #endif // wxUSE_MARKUP
59 // Increases the passed in size to account for the button image.
61 // Should only be called if we do have a button, i.e. if m_imageData is
63 void AdjustForBitmapSize(wxSize
& size
) const;
65 class wxButtonImageData
*m_imageData
;
68 class wxMarkupText
*m_markupText
;
69 #endif // wxUSE_MARKUP
71 // Switches button into owner-drawn mode: this is used if we need to draw
72 // something not supported by the native control, such as using non default
73 // colours or a bitmap on pre-XP systems.
74 void MakeOwnerDrawn();
75 bool IsOwnerDrawn() const;
78 wxDECLARE_NO_COPY_CLASS(wxAnyButton
);
81 #endif // _WX_MSW_ANYBUTTON_H_