1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxButton class
4 // Author: Stefan Csomor
8 // Copyright: (c) Stefan Csomor
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_OSX_BUTTON_H_
13 #define _WX_OSX_BUTTON_H_
15 #include "wx/control.h"
16 #include "wx/gdicmn.h"
19 class WXDLLIMPEXP_CORE wxButton
: public wxButtonBase
23 wxButton(wxWindow
*parent
,
25 const wxString
& label
= wxEmptyString
,
26 const wxPoint
& pos
= wxDefaultPosition
,
27 const wxSize
& size
= wxDefaultSize
,
29 const wxValidator
& validator
= wxDefaultValidator
,
30 const wxString
& name
= wxButtonNameStr
)
32 Create(parent
, id
, label
, pos
, size
, style
, validator
, name
);
35 bool Create(wxWindow
*parent
,
37 const wxString
& label
= wxEmptyString
,
38 const wxPoint
& pos
= wxDefaultPosition
,
39 const wxSize
& size
= wxDefaultSize
,
41 const wxValidator
& validator
= wxDefaultValidator
,
42 const wxString
& name
= wxButtonNameStr
);
44 static wxSize
GetDefaultSize();
46 virtual void SetLabel(const wxString
& label
);
47 virtual wxWindow
*SetDefault();
48 virtual void Command(wxCommandEvent
& event
);
50 // osx specific event handling common for all osx-ports
52 virtual bool OSXHandleClicked( double timestampsec
);
55 virtual wxSize
DoGetBestSize() const ;
57 void OnEnterWindow( wxMouseEvent
& event
);
58 void OnLeaveWindow( wxMouseEvent
& event
);
60 virtual wxBitmap
DoGetBitmap(State which
) const;
61 virtual void DoSetBitmap(const wxBitmap
& bitmap
, State which
);
62 virtual void DoSetBitmapPosition(wxDirection dir
);
64 virtual void DoSetBitmapMargins(int x
, int y
)
71 #if wxUSE_MARKUP && wxOSX_USE_COCOA
72 virtual bool DoSetLabelMarkup(const wxString
& markup
);
73 #endif // wxUSE_MARKUP && wxOSX_USE_COCOA
76 // the margins around the bitmap
80 // the bitmaps for the different state of the buttons, all of them may be
81 // invalid and the button only shows a bitmap at all if State_Normal bitmap
83 wxBitmap m_bitmaps
[State_Max
];
85 DECLARE_DYNAMIC_CLASS(wxButton
)
89 // OS X specific class, not part of public wx API
90 class WXDLLIMPEXP_CORE wxDisclosureTriangle
: public wxControl
93 wxDisclosureTriangle(wxWindow
*parent
,
95 const wxString
& label
= wxEmptyString
,
96 const wxPoint
& pos
= wxDefaultPosition
,
97 const wxSize
& size
= wxDefaultSize
,
98 long style
= wxBORDER_NONE
,
99 const wxValidator
& validator
= wxDefaultValidator
,
100 const wxString
& name
= wxButtonNameStr
)
102 Create(parent
, id
, label
, pos
, size
, style
, validator
, name
);
105 bool Create(wxWindow
*parent
,
107 const wxString
& label
= wxEmptyString
,
108 const wxPoint
& pos
= wxDefaultPosition
,
109 const wxSize
& size
= wxDefaultSize
,
110 long style
= wxBORDER_NONE
,
111 const wxValidator
& validator
= wxDefaultValidator
,
112 const wxString
& name
= wxButtonNameStr
);
114 void SetOpen( bool open
);
117 // osx specific event handling common for all osx-ports
119 virtual bool OSXHandleClicked( double timestampsec
);
122 virtual wxSize
DoGetBestSize() const ;
125 #endif // _WX_OSX_BUTTON_H_