X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f1c40652a0c2d6752c57df1b8aed22fae7e118dd..eda34276d67de1578a3ed3d727b595b1858a8547:/src/osx/cocoa/stattext.mm diff --git a/src/osx/cocoa/stattext.mm b/src/osx/cocoa/stattext.mm index 0ec3ff70c3..b9f812e308 100644 --- a/src/osx/cocoa/stattext.mm +++ b/src/osx/cocoa/stattext.mm @@ -38,8 +38,8 @@ + (void)initialize { static BOOL initialized = NO; - if (!initialized) - { + if (!initialized) + { initialized = YES; wxOSXCocoaClassAddWXMethods( self ); } @@ -54,13 +54,13 @@ 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]; - wxCFStringRef text( title , wxpeer->GetFont().GetEncoding() ); + wxCFStringRef text( title , encoding ); NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init]; [paragraphStyle setLineBreakMode:m_lineBreak]; @@ -69,7 +69,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]; @@ -86,13 +86,13 @@ wxSize wxStaticText::DoGetBestSize() const } wxWidgetImplType* wxWidgetImpl::CreateStaticText( wxWindowMac* wxpeer, - wxWindowMac* parent, - wxWindowID id, - const wxString& label, + wxWindowMac* WXUNUSED(parent), + wxWindowID WXUNUSED(id), + const wxString& WXUNUSED(label), const wxPoint& pos, const wxSize& size, long style, - long extraStyle) + long WXUNUSED(extraStyle)) { NSRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ; wxNSStaticTextView* v = [[wxNSStaticTextView alloc] initWithFrame:r]; @@ -102,7 +102,7 @@ wxWidgetImplType* wxWidgetImpl::CreateStaticText( wxWindowMac* wxpeer, [v setSelectable: NO]; [v setBezeled:NO]; [v setBordered:NO]; - + NSLineBreakMode linebreak = NSLineBreakByWordWrapping; if ( ((wxStaticText*)wxpeer)->IsEllipsized() ) { @@ -113,11 +113,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; }