X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9d522606d0a1dfd22bcdc1a386b3dca01fa985e3..fae763d0883dbc84142ee272b7d1bb1fe04f354b:/src/gtk/textctrl.cpp?ds=sidebyside diff --git a/src/gtk/textctrl.cpp b/src/gtk/textctrl.cpp index f37ca3d41e..a2ad1509bb 100644 --- a/src/gtk/textctrl.cpp +++ b/src/gtk/textctrl.cpp @@ -424,6 +424,26 @@ bool wxTextCtrl::Create( wxWindow *parent, #endif } +#ifdef __WXGTK20__ + if (multi_line) + { + if (style & wxTE_RIGHT) + gtk_text_view_set_justification( GTK_TEXT_VIEW(m_text), GTK_JUSTIFY_RIGHT ); + else if (style & wxTE_CENTRE) + gtk_text_view_set_justification( GTK_TEXT_VIEW(m_text), GTK_JUSTIFY_CENTER ); + // Left justify (alignment) is the default and we don't need to apply GTK_JUSTIFY_LEFT + } + // gtk_entry_set_alignment was introduced in gtk+-2.3.5 +#if GTK_CHECK_VERSION(2, 3, 5) + else + { + if (style & wxTE_RIGHT) + gtk_entry_set_alignment( GTK_ENTRY(m_text), 1.0 ); + else if (style & wxTE_CENTRE) + gtk_entry_set_alignment( GTK_ENTRY(m_text), 0.5 ); + } +#endif // gtk+-2.3.5 +#endif // __WXGTK20__ // We want to be notified about text changes. #ifdef __WXGTK20__ @@ -543,7 +563,7 @@ void wxTextCtrl::SetValue( const wxString &value ) } // GRG, Jun/2000: Changed this after a lot of discussion in - // the lists. wxWindows 2.2 will have a set of flags to + // the lists. wxWidgets 2.2 will have a set of flags to // customize this behaviour. SetInsertionPoint(0); @@ -1517,15 +1537,8 @@ bool wxTextCtrl::SetStyle( long start, long end, const wxTextAttr& style ) void wxTextCtrl::ApplyWidgetStyle() { -// if (m_windowStyle & wxTE_MULTILINE) -// { -// // how ? -// } -// else - { - SetWidgetStyle(); - gtk_widget_set_style( m_text, m_widgetStyle ); - } + SetWidgetStyle(); + gtk_widget_set_style( m_text, m_widgetStyle ); } void wxTextCtrl::OnCut(wxCommandEvent& WXUNUSED(event))