]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/cocoa/textctrl.mm
fix MSVC warnings about possibly uninitialized variables; some reindentation
[wxWidgets.git] / src / osx / cocoa / textctrl.mm
index 61b8506db852ed5e564e6a2bb110dee8a6c95d9d..a9898bf349644d93fa78c0873b17fdd2607d49fd 100644 (file)
 
 @implementation wxNSTextField
 
-WXCOCOAIMPL_COMMON_IMPLEMENTATION
++ (void)initialize
+{
+    static BOOL initialized = NO;
+    if (!initialized) 
+    {
+        initialized = YES;
+        wxOSXCocoaClassAddWXMethods( self );
+    }
+}
 
 - (id)initWithFrame:(NSRect)frame
 {
     [super initWithFrame:frame];
-    impl = NULL;
     [self setDelegate: self];
     [self setTarget: self];
 //    [self setAction: @selector(enterAction:)];
@@ -149,6 +156,7 @@ bool wxNSTextFieldControl::CanPaste() const
 
 void wxNSTextFieldControl::SetEditable(bool editable) 
 {
+    [(wxNSTextField*) m_osxView setEditable:editable];
 }
 
 void wxNSTextFieldControl::GetSelection( long* from, long* to) const 
@@ -189,7 +197,6 @@ wxWidgetImplType* wxWidgetImpl::CreateTextControl( wxTextCtrl* wxpeer,
     //[v setDrawsBackground:NO];
     
     wxWidgetCocoaImpl* c = new wxNSTextFieldControl( wxpeer, v );
-    [v setImplementation:c];
     return c;
 }