]> git.saurik.com Git - wxWidgets.git/blame - src/cocoa/NSControl.mm
Add wxControlWithItems::SendSelectionChangedEvent() helper.
[wxWidgets.git] / src / cocoa / NSControl.mm
CommitLineData
fb896a32 1/////////////////////////////////////////////////////////////////////////////
80fdcdb9 2// Name: src/cocoa/NSControl.mm
fb896a32
DE
3// Purpose: wxCocoaNSControl
4// Author: David Elliott
5// Modified by:
6// Created: 2003/02/15
2903e699 7// RCS-ID: $Id$
fb896a32 8// Copyright: (c) 2003 David Elliott
526954c5 9// Licence: wxWindows licence
fb896a32
DE
10/////////////////////////////////////////////////////////////////////////////
11
12// ============================================================================
13// declarations
14// ============================================================================
15
16// ----------------------------------------------------------------------------
17// headers
18// ----------------------------------------------------------------------------
19
20#include "wx/wxprec.h"
21#ifndef WX_PRECOMP
e0c691d1 22 #include "wx/log.h"
fb896a32
DE
23#endif // WX_PRECOMP
24
a24aa427 25#include "wx/cocoa/objc/objc_uniquifying.h"
7be6187f 26#include "wx/cocoa/ObjcRef.h"
fb896a32
DE
27#include "wx/cocoa/NSControl.h"
28
e0c691d1
DE
29#import <Foundation/NSObject.h>
30
31// ============================================================================
32// @class wxNSControlTarget
33// ============================================================================
34@interface wxNSControlTarget : NSObject
35{
36}
37
38- (void)wxNSControlAction: (id)sender;
39@end //interface wxNSControlTarget
a24aa427 40WX_DECLARE_GET_OBJC_CLASS(wxNSControlTarget,NSObject)
e0c691d1
DE
41
42@implementation wxNSControlTarget : NSObject
43
44- (void)wxNSControlAction: (id)sender
45{
48580976 46 wxLogTrace(wxTRACE_COCOA,wxT("wxNSControlAction"));
e0c691d1 47 wxCocoaNSControl *wxcontrol = wxCocoaNSControl::GetFromCocoa(sender);
2b030203 48 wxCHECK_RET(wxcontrol,wxT("wxNSControlAction received but no wxCocoaNSControl exists!"));
e0c691d1
DE
49 wxcontrol->CocoaTarget_action();
50}
51
52@end //implementation wxNSControlTarget
a24aa427 53WX_IMPLEMENT_GET_OBJC_CLASS(wxNSControlTarget,NSObject)
e0c691d1
DE
54
55// ============================================================================
56// wxNSControl
57// ============================================================================
fb896a32
DE
58WX_IMPLEMENT_OBJC_INTERFACE(NSControl)
59
7be6187f
DE
60// New CF-retained observer (this should have been using wxObjcAutoRefFromAlloc to begin with)
61wxObjcAutoRefFromAlloc<wxNSControlTarget*> s_cocoaNSControlTarget = [[WX_GET_OBJC_CLASS(wxNSControlTarget) alloc] init];
62// For compatibility with old code
63struct objc_object *wxCocoaNSControl::sm_cocoaTarget = s_cocoaNSControlTarget;
e0c691d1 64