+ (void)initialize
{
static BOOL initialized = NO;
- if (!initialized)
- {
+ if (!initialized)
+ {
initialized = YES;
wxOSXCocoaClassAddWXMethods( self );
}
{
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];
[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];
[v setSelectable: NO];
[v setBezeled:NO];
[v setBordered:NO];
-
+
NSLineBreakMode linebreak = NSLineBreakByWordWrapping;
if ( ((wxStaticText*)wxpeer)->IsEllipsized() )
{
else if (style & wxST_ELLIPSIZE_START )
linebreak = NSLineBreakByTruncatingHead;
}
- else
+ else
{
[[v cell] setWraps:YES];
}
-
+
wxWidgetCocoaImpl* c = new wxStaticTextCocoaImpl( wxpeer, v, linebreak );
return c;
}