Added original works and stubs to CVS repository
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@19676 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
62
src/cocoa/NSButton.mm
Normal file
62
src/cocoa/NSButton.mm
Normal file
@@ -0,0 +1,62 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: cocoa/NSButton.cpp
|
||||
// Purpose: wxCocoaNSButton
|
||||
// Author: David Elliott
|
||||
// Modified by:
|
||||
// Created: 2003/01/31
|
||||
// RCS-ID: $Id:
|
||||
// Copyright: (c) 2003 David Elliott
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// ============================================================================
|
||||
// declarations
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#include "wx/wxprec.h"
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/log.h"
|
||||
#endif // WX_PRECOMP
|
||||
|
||||
#include "wx/cocoa/NSButton.h"
|
||||
#import <AppKit/NSButton.h>
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// globals
|
||||
// ----------------------------------------------------------------------------
|
||||
WX_IMPLEMENT_OBJC_INTERFACE_HASHMAP(NSButton)
|
||||
|
||||
// ============================================================================
|
||||
// @class wxPoserNSButton
|
||||
// ============================================================================
|
||||
@interface wxPoserNSButton : NSButton
|
||||
{
|
||||
}
|
||||
|
||||
- (void)wxNSButtonAction: (id)sender;
|
||||
@end // wxPoserNSButton
|
||||
|
||||
WX_IMPLEMENT_POSER(wxPoserNSButton);
|
||||
|
||||
@implementation wxPoserNSButton : NSButton
|
||||
- (void)wxNSButtonAction: (id)sender
|
||||
{
|
||||
wxASSERT_MSG(self==sender,"Received wxNSButtonAction from another object");
|
||||
wxCocoaNSButton *button = wxCocoaNSButton::GetFromCocoa(self);
|
||||
wxCHECK_RET(button,"wxNSButtonAction received without associated wx object");
|
||||
button->Cocoa_wxNSButtonAction();
|
||||
}
|
||||
|
||||
@end // implementation wxPoserNSButton
|
||||
|
||||
void wxCocoaNSButton::AssociateNSButton(WX_NSButton cocoaNSButton)
|
||||
{
|
||||
sm_cocoaHash.insert(wxCocoaNSButtonHash::value_type(cocoaNSButton,this));
|
||||
[cocoaNSButton setTarget: cocoaNSButton];
|
||||
[cocoaNSButton setAction: @selector(wxNSButtonAction:)];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user