Add wxTE_{RIGHT,CENTER} support for multiline wxTextCtrl in wxOSX
Just use -[NSTextView setAlignment]. Closes #13702.
This commit is contained in:
committed by
Vadim Zeitlin
parent
165842423c
commit
d45ba8ce62
@@ -192,3 +192,4 @@ wxOSX/Cocoa:
|
|||||||
events (Igor Korot).
|
events (Igor Korot).
|
||||||
- Implement strike-through support in wxFont (Igor Korot).
|
- Implement strike-through support in wxFont (Igor Korot).
|
||||||
- Provide native implementation of wxStandardPaths (Tobias Taschner).
|
- Provide native implementation of wxStandardPaths (Tobias Taschner).
|
||||||
|
- Add wxTE_{RIGHT,CENTER} support for multiline wxTextCtrl (Andreas Falkenhahn).
|
||||||
|
@@ -62,7 +62,7 @@ private:
|
|||||||
class wxNSTextViewControl : public wxWidgetCocoaImpl, public wxTextWidgetImpl
|
class wxNSTextViewControl : public wxWidgetCocoaImpl, public wxTextWidgetImpl
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxNSTextViewControl( wxTextCtrl *wxPeer, WXWidget w );
|
wxNSTextViewControl( wxTextCtrl *wxPeer, WXWidget w, long style );
|
||||||
virtual ~wxNSTextViewControl();
|
virtual ~wxNSTextViewControl();
|
||||||
|
|
||||||
virtual void insertText(NSString* text, WXWidget slf, void *_cmd);
|
virtual void insertText(NSString* text, WXWidget slf, void *_cmd);
|
||||||
|
@@ -561,7 +561,7 @@ NSView* wxMacEditHelper::ms_viewCurrentlyEdited = nil;
|
|||||||
|
|
||||||
// wxNSTextViewControl
|
// wxNSTextViewControl
|
||||||
|
|
||||||
wxNSTextViewControl::wxNSTextViewControl( wxTextCtrl *wxPeer, WXWidget w )
|
wxNSTextViewControl::wxNSTextViewControl( wxTextCtrl *wxPeer, WXWidget w, long style )
|
||||||
: wxWidgetCocoaImpl(wxPeer, w),
|
: wxWidgetCocoaImpl(wxPeer, w),
|
||||||
wxTextWidgetImpl(wxPeer)
|
wxTextWidgetImpl(wxPeer)
|
||||||
{
|
{
|
||||||
@@ -581,6 +581,15 @@ wxNSTextViewControl::wxNSTextViewControl( wxTextCtrl *wxPeer, WXWidget w )
|
|||||||
[tv setHorizontallyResizable:NO];
|
[tv setHorizontallyResizable:NO];
|
||||||
[tv setAutoresizingMask:NSViewWidthSizable];
|
[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) )
|
if ( !wxPeer->HasFlag(wxTE_RICH | wxTE_RICH2) )
|
||||||
{
|
{
|
||||||
[tv setRichText:NO];
|
[tv setRichText:NO];
|
||||||
@@ -1064,7 +1073,7 @@ wxWidgetImplType* wxWidgetImpl::CreateTextControl( wxTextCtrl* wxpeer,
|
|||||||
{
|
{
|
||||||
wxNSTextScrollView* v = nil;
|
wxNSTextScrollView* v = nil;
|
||||||
v = [[wxNSTextScrollView alloc] initWithFrame:r];
|
v = [[wxNSTextScrollView alloc] initWithFrame:r];
|
||||||
c = new wxNSTextViewControl( wxpeer, v );
|
c = new wxNSTextViewControl( wxpeer, v, style );
|
||||||
c->SetNeedsFocusRect( true );
|
c->SetNeedsFocusRect( true );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Reference in New Issue
Block a user