Support precompiled headers
[wxWidgets.git] / src / cocoa / gauge.mm
1 /////////////////////////////////////////////////////////////////////////////
2 // Name:        cocoa/gauge.mm
3 // Purpose:     wxGauge
4 // Author:      David Elliott
5 // Modified by:
6 // Created:     2003/07/15
7 // RCS-ID:      $Id$
8 // Copyright:   (c) 2003 David Elliott
9 // Licence:     wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #include "wx/wxprec.h"
13 #if wxUSE_GAUGE
14
15 #ifndef WX_PRECOMP
16     #include "wx/app.h"
17     #include "wx/gauge.h"
18 #endif //WX_PRECOMP
19
20 #import <AppKit/NSProgressIndicator.h>
21
22 IMPLEMENT_DYNAMIC_CLASS(wxGauge, wxControl)
23 BEGIN_EVENT_TABLE(wxGauge, wxGaugeBase)
24 END_EVENT_TABLE()
25 // WX_IMPLEMENT_COCOA_OWNER(wxGauge,NSProgressIndicator,NSView,NSView)
26
27 bool wxGauge::Create(wxWindow *parent, wxWindowID winid, int range,
28             const wxPoint& pos, const wxSize& size, long style,
29             const wxValidator& validator, const wxString& name)
30 {
31     if(!CreateControl(parent,winid,pos,size,style,validator,name))
32         return false;
33     SetNSView([[NSProgressIndicator alloc] initWithFrame: MakeDefaultNSRect(size)]);
34     [m_cocoaNSView release];
35     if(m_parent)
36         m_parent->CocoaAddChild(this);
37     SetInitialFrameRect(pos,size);
38
39     return true;
40 }
41
42 wxGauge::~wxGauge()
43 {
44 }
45
46 #endif // wxUSE_GAUGE