Add support for multi-line text entries
This commit is contained in:
Родитель
8c61341e18
Коммит
71c03b4577
|
@ -152,6 +152,10 @@ namespace Xwt.GtkBackend
|
|||
Widget.HasFrame = value;
|
||||
}
|
||||
}
|
||||
|
||||
public bool MultiLine {
|
||||
get; set;
|
||||
}
|
||||
|
||||
public override void EnableEvent (object eventId)
|
||||
{
|
||||
|
|
|
@ -49,6 +49,7 @@ namespace Xwt.Mac
|
|||
} else {
|
||||
ViewObject = new CustomTextField (EventSink, ApplicationContext);
|
||||
}
|
||||
MultiLine = false;
|
||||
}
|
||||
|
||||
protected override Size GetNaturalSize ()
|
||||
|
@ -103,6 +104,23 @@ namespace Xwt.Mac
|
|||
}
|
||||
}
|
||||
|
||||
public bool MultiLine {
|
||||
get {
|
||||
return Widget.Cell.UsesSingleLineMode;
|
||||
}
|
||||
set {
|
||||
if (value) {
|
||||
Widget.Cell.UsesSingleLineMode = true;
|
||||
Widget.Cell.Scrollable = true;
|
||||
Widget.Cell.Wraps = false;
|
||||
} else {
|
||||
Widget.Cell.UsesSingleLineMode = false;
|
||||
Widget.Cell.Scrollable = false;
|
||||
Widget.Cell.Wraps = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void SetFocus ()
|
||||
{
|
||||
Widget.BecomeFirstResponder ();
|
||||
|
|
|
@ -78,6 +78,11 @@ namespace Xwt.WPFBackend
|
|||
set { TextBox.ShowFrame = value; }
|
||||
}
|
||||
|
||||
// TODO
|
||||
public bool MultiLine {
|
||||
get; set;
|
||||
}
|
||||
|
||||
public override void EnableEvent (object eventId)
|
||||
{
|
||||
base.EnableEvent (eventId);
|
||||
|
|
|
@ -34,6 +34,7 @@ namespace Xwt.Backends
|
|||
string PlaceholderText { get; set; }
|
||||
bool ReadOnly { get; set; }
|
||||
bool ShowFrame { get; set; }
|
||||
bool MultiLine { get; set; }
|
||||
}
|
||||
|
||||
public interface ITextEntryEventSink: IWidgetEventSink
|
||||
|
|
|
@ -94,6 +94,12 @@ namespace Xwt
|
|||
set { Backend.ShowFrame = value; }
|
||||
}
|
||||
|
||||
[DefaultValue (true)]
|
||||
public bool MultiLine {
|
||||
get { return Backend.MultiLine; }
|
||||
set { Backend.MultiLine = value; }
|
||||
}
|
||||
|
||||
protected virtual void OnChanged (EventArgs e)
|
||||
{
|
||||
if (changed != null)
|
||||
|
|
Загрузка…
Ссылка в новой задаче