NSButton.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. ///////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/cocoa/NSButton.h
  3. // Purpose: wxCocoaNSButton class
  4. // Author: David Elliott
  5. // Modified by:
  6. // Created: 2002/12/09
  7. // Copyright: (c) 2002-2004 David Elliott
  8. // Licence: wxWindows licence
  9. ///////////////////////////////////////////////////////////////////////////////
  10. #ifndef _WX_COCOA_NSBUTTON_H__
  11. #define _WX_COCOA_NSBUTTON_H__
  12. #include "wx/hashmap.h"
  13. #include "wx/cocoa/ObjcAssociate.h"
  14. #include "wx/cocoa/ObjcRef.h"
  15. WX_DECLARE_OBJC_HASHMAP(NSButton);
  16. class wxCocoaNSButton
  17. {
  18. WX_DECLARE_OBJC_INTERFACE_HASHMAP(NSButton);
  19. public:
  20. void AssociateNSButton(WX_NSButton cocoaNSButton);
  21. void DisassociateNSButton(WX_NSButton cocoaNSButton)
  22. {
  23. if(cocoaNSButton)
  24. sm_cocoaHash.erase(cocoaNSButton);
  25. }
  26. virtual void Cocoa_wxNSButtonAction(void) = 0;
  27. virtual ~wxCocoaNSButton() { }
  28. protected:
  29. static const wxObjcAutoRefFromAlloc<struct objc_object*> sm_cocoaTarget;
  30. };
  31. #endif // _WX_COCOA_NSBUTTON_H__