From 59d61f1645a1a015a9b88096fea021a2be0ac775 Mon Sep 17 00:00:00 2001 From: David Elliott Date: Wed, 8 Aug 2007 04:27:44 +0000 Subject: [PATCH] Merged 47955 from trunk: Translate the wxALIGN flags to the Cocoa alignment type in wxStaticText::Create Copyright 2007 Software 2000 Ltd. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@47956 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/cocoa/stattext.mm | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/cocoa/stattext.mm b/src/cocoa/stattext.mm index 8fc1b823df..6470799b58 100644 --- a/src/cocoa/stattext.mm +++ b/src/cocoa/stattext.mm @@ -50,6 +50,15 @@ bool wxStaticText::Create(wxWindow *parent, wxWindowID winid, [GetNSTextField() setEditable: NO]; [GetNSTextField() setDrawsBackground: NO]; + NSTextAlignment alignStyle; + if (style & wxALIGN_RIGHT) + alignStyle = NSRightTextAlignment; + else if (style & wxALIGN_CENTRE) + alignStyle = NSCenterTextAlignment; + else // default to wxALIGN_LEFT because it is 0 and can't be tested + alignStyle = NSLeftTextAlignment; + [GetNSControl() setAlignment:(NSTextAlignment)alignStyle]; + [GetNSControl() sizeToFit]; // Round-up to next integer size NSRect nsrect = [m_cocoaNSView frame];