- Rect bounds = wxMacGetBoundsForControl( this , pos , size ) ;
- wxMacCFStringHolder str(m_label,m_font.GetEncoding() ) ;
- m_peer = new wxMacControl() ;
- verify_noerr(CreateStaticTextControl(MAC_WXHWND(parent->MacGetTopLevelWindowRef()),&bounds, str ,
- NULL , m_peer->GetControlRefAddr() ) ) ;
+ Rect bounds = wxMacGetBoundsForControl( this, pos, size );
+ wxMacCFStringHolder str( m_label, m_font.GetEncoding() );
+
+ m_peer = new wxMacControl( this );
+ OSStatus err = CreateStaticTextControl(
+ MAC_WXHWND(parent->MacGetTopLevelWindowRef()),
+ &bounds, str, NULL, m_peer->GetControlRefAddr() );
+ verify_noerr( err );
+
+ if ( ( style & wxST_DOTS_END ) || ( style & wxST_DOTS_MIDDLE ) )
+ {
+ TruncCode tCode = truncEnd;
+ if ( style & wxST_DOTS_MIDDLE )
+ tCode = truncMiddle;
+
+ err = m_peer->SetData( kControlStaticTextTruncTag, tCode );
+ err = m_peer->SetData( kControlStaticTextIsMultilineTag, (Boolean)0 );
+ }