Add wxTE_{RIGHT,CENTER} support for multiline wxTextCtrl in wxOSX
Just use -[NSTextView setAlignment].
Closes #13702.
(cherry picked from commit d45ba8ce62
)
This commit is contained in:
committed by
Dimitri Schoolwerth
parent
66ac3e863f
commit
49d52abb4e
@@ -662,6 +662,7 @@ wxOSX:
|
||||
- Fix custom paper support (tijsv).
|
||||
- Return false from wxSound::Create()/IsOk() if the file doesn't exist.
|
||||
- Fix scrolling behaviour of wxSearchCtrl (John Roberts).
|
||||
- Add wxTE_{RIGHT,CENTER} support for multiline wxTextCtrl (Andreas Falkenhahn).
|
||||
|
||||
|
||||
3.0.2: (released 2014-10-06)
|
||||
|
@@ -62,7 +62,7 @@ private:
|
||||
class wxNSTextViewControl : public wxWidgetCocoaImpl, public wxTextWidgetImpl
|
||||
{
|
||||
public:
|
||||
wxNSTextViewControl( wxTextCtrl *wxPeer, WXWidget w );
|
||||
wxNSTextViewControl( wxTextCtrl *wxPeer, WXWidget w, long style );
|
||||
virtual ~wxNSTextViewControl();
|
||||
|
||||
virtual wxString GetStringValue() const ;
|
||||
|
@@ -561,7 +561,7 @@ NSView* wxMacEditHelper::ms_viewCurrentlyEdited = nil;
|
||||
|
||||
// wxNSTextViewControl
|
||||
|
||||
wxNSTextViewControl::wxNSTextViewControl( wxTextCtrl *wxPeer, WXWidget w )
|
||||
wxNSTextViewControl::wxNSTextViewControl( wxTextCtrl *wxPeer, WXWidget w, long style )
|
||||
: wxWidgetCocoaImpl(wxPeer, w),
|
||||
wxTextWidgetImpl(wxPeer)
|
||||
{
|
||||
@@ -581,6 +581,15 @@ wxNSTextViewControl::wxNSTextViewControl( wxTextCtrl *wxPeer, WXWidget w )
|
||||
[tv setHorizontallyResizable:NO];
|
||||
[tv setAutoresizingMask:NSViewWidthSizable];
|
||||
|
||||
if ( style & wxTE_RIGHT)
|
||||
{
|
||||
[tv setAlignment:NSRightTextAlignment];
|
||||
}
|
||||
else if ( style & wxTE_CENTRE)
|
||||
{
|
||||
[tv setAlignment:NSCenterTextAlignment];
|
||||
}
|
||||
|
||||
if ( !wxPeer->HasFlag(wxTE_RICH | wxTE_RICH2) )
|
||||
{
|
||||
[tv setRichText:NO];
|
||||
@@ -1055,7 +1064,7 @@ wxWidgetImplType* wxWidgetImpl::CreateTextControl( wxTextCtrl* wxpeer,
|
||||
{
|
||||
wxNSTextScrollView* v = nil;
|
||||
v = [[wxNSTextScrollView alloc] initWithFrame:r];
|
||||
c = new wxNSTextViewControl( wxpeer, v );
|
||||
c = new wxNSTextViewControl( wxpeer, v, style );
|
||||
c->SetNeedsFocusRect( true );
|
||||
}
|
||||
else
|
||||
|
Reference in New Issue
Block a user