]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/stattext.cpp
Fixed display issues for Panther now that wxTextCtrl has been fixed there.
[wxWidgets.git] / src / mac / carbon / stattext.cpp
index f4757d19d7c223c2b853c4ac0779efdf3f3f55f1..93998884fd35770a7015131c7fa47181a7d1ef13 100644 (file)
@@ -51,7 +51,7 @@ bool wxStaticText::Create(wxWindow *parent, wxWindowID id,
     wxMacCFStringHolder str(m_label,m_font.GetEncoding() ) ;
     m_peer = new wxMacControl() ;
     verify_noerr(CreateStaticTextControl(MAC_WXHWND(parent->MacGetTopLevelWindowRef()),&bounds, str , 
-        NULL , *m_peer ) ) ;  
+        NULL , m_peer->GetControlRefAddr() ) ) ;  
 
     MacPostControlCreate(pos,size) ;
 
@@ -61,8 +61,7 @@ bool wxStaticText::Create(wxWindow *parent, wxWindowID id,
 wxSize wxStaticText::DoGetBestSize() const
 {
     ControlFontStyleRec controlFont ;
-    Size outSize ;
-    verify_noerr( GetControlData( *m_peer , kControlEntireControl , kControlFontStyleTag , sizeof(controlFont) , &controlFont , &outSize ) ) ;
+    verify_noerr( m_peer->GetData<ControlFontStyleRec>(kControlEntireControl , kControlFontStyleTag , &controlFont ) ) ;
     
     Point bounds ;
     SInt16 baseline ;
@@ -89,13 +88,12 @@ void wxStaticText::SetLabel(const wxString& st )
     
     wxMacCFStringHolder str(m_label,m_font.GetEncoding() ) ;
     CFStringRef ref = str ;
-    SetControlData( *m_peer, kControlEntireControl , kControlStaticTextCFStringTag, sizeof( CFStringRef ),
-               &ref );
+    verify_noerr( m_peer->SetData<CFStringRef>(kControlEntireControl , kControlStaticTextCFStringTag, ref ) ) ;
 
     if ( !(GetWindowStyle() & wxST_NO_AUTORESIZE) )
     {
+        InvalidateBestSize();
         SetSize( GetBestSize() ) ;
-        SetSizeHints(GetSize());
     }
 
     Update() ;
@@ -109,8 +107,8 @@ bool wxStaticText::SetFont(const wxFont& font)
        {
            if ( !(GetWindowStyle() & wxST_NO_AUTORESIZE) )
             {
+                InvalidateBestSize();
                SetSize( GetBestSize() );
-                SetSizeHints(GetSize());
             }
        }