X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d8207702d1cf580a7200114abd52f186b4b9a4f3..396f0e3dd40f898a0e5bb98b587f1483234168ce:/src/osx/cocoa/stattext.mm diff --git a/src/osx/cocoa/stattext.mm b/src/osx/cocoa/stattext.mm index da93c8ac63..42e5c85254 100644 --- a/src/osx/cocoa/stattext.mm +++ b/src/osx/cocoa/stattext.mm @@ -29,7 +29,6 @@ @interface wxNSStaticTextView : NSTextField { - wxWidgetCocoaImpl* impl; } @end @@ -38,8 +37,8 @@ + (void)initialize { static BOOL initialized = NO; - if (!initialized) - { + if (!initialized) + { initialized = YES; wxOSXCocoaClassAddWXMethods( self ); } @@ -54,9 +53,9 @@ public: { m_lineBreak = lineBreak; } - - virtual void SetLabel(const wxString& title, wxFontEncoding encoding) - { + + virtual void SetLabel(const wxString& title, wxFontEncoding encoding) + { wxNSStaticTextView* v = (wxNSStaticTextView*)GetWXWidget(); wxWindow* wxpeer = GetWXPeer(); NSCell* cell = [v cell]; @@ -69,7 +68,7 @@ public: [paragraphStyle setAlignment: NSCenterTextAlignment]; else if (style & wxALIGN_RIGHT) [paragraphStyle setAlignment: NSRightTextAlignment]; - + NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:paragraphStyle, NSParagraphStyleAttributeName, nil]; NSAttributedString *attrstring = [[NSAttributedString alloc] initWithString:text.AsNSString() attributes:dict]; [cell setAttributedStringValue:attrstring]; @@ -102,7 +101,7 @@ wxWidgetImplType* wxWidgetImpl::CreateStaticText( wxWindowMac* wxpeer, [v setSelectable: NO]; [v setBezeled:NO]; [v setBordered:NO]; - + NSLineBreakMode linebreak = NSLineBreakByWordWrapping; if ( ((wxStaticText*)wxpeer)->IsEllipsized() ) { @@ -113,11 +112,11 @@ wxWidgetImplType* wxWidgetImpl::CreateStaticText( wxWindowMac* wxpeer, else if (style & wxST_ELLIPSIZE_START ) linebreak = NSLineBreakByTruncatingHead; } - else + else { [[v cell] setWraps:YES]; } - + wxWidgetCocoaImpl* c = new wxStaticTextCocoaImpl( wxpeer, v, linebreak ); return c; }