+void wxTextCtrl::GTKSetJustification()
+{
+ if ( IsMultiLine() )
+ {
+ GtkJustification just;
+ if ( HasFlag(wxTE_RIGHT) )
+ just = GTK_JUSTIFY_RIGHT;
+ else if ( HasFlag(wxTE_CENTRE) )
+ just = GTK_JUSTIFY_CENTER;
+ else // wxTE_LEFT == 0
+ just = GTK_JUSTIFY_LEFT;
+
+ gtk_text_view_set_justification(GTK_TEXT_VIEW(m_text), just);
+ }
+ else // single line
+ {
+ gfloat align;
+ if ( HasFlag(wxTE_RIGHT) )
+ align = 1.0;
+ else if ( HasFlag(wxTE_CENTRE) )
+ align = 0.5;
+ else // single line
+ align = 0.0;
+
+ gtk_entry_set_alignment(GTK_ENTRY(m_text), align);
+ }
+}
+
+void wxTextCtrl::SetWindowStyleFlag(long style)
+{
+ long styleOld = GetWindowStyleFlag();
+
+ wxTextCtrlBase::SetWindowStyleFlag(style);
+
+ if ( (style & wxTE_READONLY) != (styleOld & wxTE_READONLY) )
+ GTKSetEditable();
+
+ if ( (style & wxTE_PASSWORD) != (styleOld & wxTE_PASSWORD) )
+ GTKSetVisibility();
+
+ if ( (style & wxTE_PROCESS_ENTER) != (styleOld & wxTE_PROCESS_ENTER) )
+ GTKSetActivatesDefault();
+
+ static const long flagsWrap = wxTE_WORDWRAP | wxTE_CHARWRAP | wxTE_DONTWRAP;
+ if ( (style & flagsWrap) != (styleOld & flagsWrap) )
+ GTKSetWrapMode();
+
+ static const long flagsAlign = wxTE_LEFT | wxTE_CENTRE | wxTE_RIGHT;
+ if ( (style & flagsAlign) != (styleOld & flagsAlign) )
+ GTKSetJustification();
+}
+
+// ----------------------------------------------------------------------------
+// control value
+// ----------------------------------------------------------------------------
+