]> git.saurik.com Git - wxWidgets.git/blame - include/wx/cocoa/button.h
Code cleaning: whitespaces, -1/wxID_ANY/wxDefaultCoord, TRUE/true, FALSE/false, ...
[wxWidgets.git] / include / wx / cocoa / button.h
CommitLineData
fb896a32
DE
1/////////////////////////////////////////////////////////////////////////////
2// Name: wx/cocoa/button.h
3// Purpose: wxButton class
4// Author: David Elliott
5// Modified by:
6// Created: 2002/12/29
7// RCS-ID: $Id:
8// Copyright: (c) 2002 David Elliott
65571936 9// Licence: wxWindows licence
fb896a32
DE
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef __WX_COCOA_BUTTON_H__
13#define __WX_COCOA_BUTTON_H__
14
15#include "wx/cocoa/NSButton.h"
16
17// ========================================================================
18// wxButton
19// ========================================================================
20class WXDLLEXPORT wxButton : public wxButtonBase, protected wxCocoaNSButton
21{
22 DECLARE_DYNAMIC_CLASS(wxButton)
23 DECLARE_EVENT_TABLE()
24 WX_DECLARE_COCOA_OWNER(NSButton,NSControl,NSView)
25// ------------------------------------------------------------------------
26// initialization
27// ------------------------------------------------------------------------
28public:
29 wxButton() { }
30 wxButton(wxWindow *parent, wxWindowID winid,
31 const wxString& label,
32 const wxPoint& pos = wxDefaultPosition,
33 const wxSize& size = wxDefaultSize, long style = 0,
34 const wxValidator& validator = wxDefaultValidator,
35 const wxString& name = wxButtonNameStr)
36 {
37 Create(parent, winid, label, pos, size, style, validator, name);
38 }
401e3b6e 39
b9974b84 40 wxButton(wxWindow *parent, wxWindowID winid, wxStockItemID stock,
401e3b6e
VS
41 const wxString& descriptiveLabel = wxEmptyString,
42 const wxPoint& pos = wxDefaultPosition,
43 long style = 0,
44 const wxValidator& validator = wxDefaultValidator,
45 const wxString& name = wxButtonNameStr)
46 {
b9974b84 47 Create(parent, winid, stock, descriptiveLabel, pos, style, validator, name);
401e3b6e 48 }
fb896a32
DE
49
50 bool Create(wxWindow *parent, wxWindowID winid,
51 const wxString& label,
52 const wxPoint& pos = wxDefaultPosition,
53 const wxSize& size = wxDefaultSize, long style = 0,
54 const wxValidator& validator = wxDefaultValidator,
55 const wxString& name = wxButtonNameStr);
401e3b6e 56
b9974b84 57 bool Create(wxWindow *parent, wxWindowID winid, wxStockItemID stock,
401e3b6e
VS
58 const wxString& descriptiveLabel = wxEmptyString,
59 const wxPoint& pos = wxDefaultPosition,
60 long style = 0,
61 const wxValidator& validator = wxDefaultValidator,
62 const wxString& name = wxButtonNameStr)
63 {
b9974b84 64 return CreateStock(parent, winid, stock, descriptiveLabel,
401e3b6e
VS
65 pos, style, validator, name);
66 }
67
fb896a32
DE
68 virtual ~wxButton();
69
70// ------------------------------------------------------------------------
71// Cocoa callbacks
72// ------------------------------------------------------------------------
73protected:
74 virtual void Cocoa_wxNSButtonAction(void);
75// ------------------------------------------------------------------------
76// Implementation
77// ------------------------------------------------------------------------
78public:
ce319b6d
DE
79 wxString GetLabel() const;
80 void SetLabel(const wxString& label);
fb896a32
DE
81};
82
83#endif // __WX_COCOA_BUTTON_H__