]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/cocoa/stattext.mm
adding 10.4 build compatibility for osx cocoa, see #10361
[wxWidgets.git] / src / osx / cocoa / stattext.mm
index f35aebba813be85b83d37de2aef2b9fe50df97f9..c1ed173666796aeb08f9e6fbca90a63a283c343b 100644 (file)
@@ -23,9 +23,6 @@
     #include "wx/settings.h"
 #endif // WX_PRECOMP
 
-#include "wx/notebook.h"
-#include "wx/tabctrl.h"
-
 #include "wx/osx/private.h"
 
 #include <stdio.h>
@@ -92,63 +89,22 @@ wxSize wxStaticText::DoGetBestSize() const
           to allow correct dynamic ellipsizing of the label
 */
 
-@interface wxNSTextField : NSTextField
-{
-    wxWidgetImpl* m_impl;
-}
-
-- (void)setImplementation: (wxWidgetImpl *) theImplementation;
-- (wxWidgetImpl*) implementation;
-- (BOOL) isFlipped;
-
-@end
-
-@implementation wxNSTextField
-
-- (void)setImplementation: (wxWidgetImpl *) theImplementation
-{
-    m_impl = theImplementation;
-}
-
-- (wxWidgetImpl*) implementation
-{
-    return m_impl;
-}
-
-- (BOOL) isFlipped
-{
-    return YES;
-}
-
-// use our common calls
-- (void) setTitle:(NSString *) title
-{
-    [self setStringValue: title];
-}
-
-@end
-
-
-wxWidgetImplType* wxWidgetImpl::CreateStaticText( wxWindowMac* wxpeer, 
-                                    wxWindowMac* parent, 
-                                    wxWindowID id, 
+wxWidgetImplType* wxWidgetImpl::CreateStaticText( wxWindowMac* wxpeer,
+                                    wxWindowMac* parent,
+                                    wxWindowID id,
                                     const wxString& label,
-                                    const wxPoint& pos, 
+                                    const wxPoint& pos,
                                     const wxSize& size,
-                                    long style, 
-                                    long extraStyle) 
+                                    long style,
+                                    long extraStyle)
 {
-    NSView* sv = (wxpeer->GetParent()->GetHandle() );
-    
-    NSRect r = wxToNSRect( sv, wxRect( pos, size) );
-    // Rect bounds = wxMacGetBoundsForControl( wxpeer, pos , size ) ;
+    NSRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ;
     wxNSTextField* v = [[wxNSTextField alloc] initWithFrame:r];
-    [sv addSubview:v];
 
     [v setBezeled:NO];
     [v setEditable:NO];
     [v setDrawsBackground:NO];
-    
+
     wxWidgetCocoaImpl* c = new wxWidgetCocoaImpl( wxpeer, v );
     [v setImplementation:c];
     return c;