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 // Copyright: (c) Julian Smart
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
10 #ifndef _WX_MSW_ANYBUTTON_H_
11 #define _WX_MSW_ANYBUTTON_H_
13 // ----------------------------------------------------------------------------
14 // Common button functionality
15 // ----------------------------------------------------------------------------
17 class WXDLLIMPEXP_CORE wxAnyButton
: public wxAnyButtonBase
25 #endif // wxUSE_MARKUP
28 virtual ~wxAnyButton();
30 // overridden base class methods
31 virtual void SetLabel(const wxString
& label
);
32 virtual bool SetBackgroundColour(const wxColour
&colour
);
33 virtual bool SetForegroundColour(const wxColour
&colour
);
35 // implementation from now on
36 virtual WXLRESULT
MSWWindowProc(WXUINT nMsg
, WXWPARAM wParam
, WXLPARAM lParam
);
38 virtual bool MSWOnDraw(WXDRAWITEMSTRUCT
*item
);
39 virtual State
GetNormalState() const { return State_Normal
; }
41 // returns true if the platform should explicitly apply a theme border
42 virtual bool CanApplyThemeBorder() const { return false; }
45 // usually overridden base class virtuals
46 virtual wxSize
DoGetBestSize() const;
48 virtual wxBitmap
DoGetBitmap(State which
) const;
49 virtual void DoSetBitmap(const wxBitmap
& bitmap
, State which
);
50 virtual wxSize
DoGetBitmapMargins() const;
51 virtual void DoSetBitmapMargins(wxCoord x
, wxCoord y
);
52 virtual void DoSetBitmapPosition(wxDirection dir
);
55 virtual bool DoSetLabelMarkup(const wxString
& markup
);
56 #endif // wxUSE_MARKUP
58 // Increases the passed in size to account for the button image.
60 // Should only be called if we do have a button, i.e. if m_imageData is
62 void AdjustForBitmapSize(wxSize
& size
) const;
64 class wxButtonImageData
*m_imageData
;
67 class wxMarkupText
*m_markupText
;
68 #endif // wxUSE_MARKUP
70 // Switches button into owner-drawn mode: this is used if we need to draw
71 // something not supported by the native control, such as using non default
72 // colours or a bitmap on pre-XP systems.
73 void MakeOwnerDrawn();
74 bool IsOwnerDrawn() const;
77 wxDECLARE_NO_COPY_CLASS(wxAnyButton
);
80 #endif // _WX_MSW_ANYBUTTON_H_