]> git.saurik.com Git - wxWidgets.git/commitdiff
Override CocoaSetEnabled() to call -[NSControl setEnabled:]
authorDavid Elliott <dfe@tgwbd.org>
Tue, 19 Aug 2003 14:49:28 +0000 (14:49 +0000)
committerDavid Elliott <dfe@tgwbd.org>
Tue, 19 Aug 2003 14:49:28 +0000 (14:49 +0000)
Do NOT forget to override this in subclasses which use a Cocoa view
not derived from NSControl.  Crashes will result.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23016 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/cocoa/control.h
src/cocoa/control.mm

index 38ee55e2ed202c94f24cbcfae51f25be3ef25e5c..153e6e15552d6e3cfeceb553213e38fb20a3fb02 100644 (file)
@@ -59,6 +59,8 @@ public:
     // Calls the callback and appropriate event handlers
     bool ProcessCommand(wxCommandEvent& event);
 
+    // Enables the control
+    virtual void CocoaSetEnabled(bool enable);
 protected:
     virtual wxSize DoGetBestSize() const;
 };
index c316891f963393737c4ca2ecb475d67350ecce94..fac6d2831dd111b861155505822a880ac9f37217 100644 (file)
@@ -71,3 +71,8 @@ bool wxControl::ProcessCommand(wxCommandEvent& event)
     return GetEventHandler()->ProcessEvent(event);
 }
 
+void wxControl::CocoaSetEnabled(bool enable)
+{
+    [GetNSControl() setEnabled: enable];
+}
+