|
@@ -428,9 +428,12 @@ operator compose[A,B,C] { ab Lens2[A,B], f Lambda[Maybe[B],Lens2[B,C]] } Lens2[A
|
|
|
|
|
|
function ApiGet[T] { endpoint String, t IntoReflectType[T] } $[T] native('ApiGet')
|
|
|
|
|
|
-const BaseFontSize Int native('BaseFontSize')
|
|
|
+const Arguments List[String] native('Arguments')
|
|
|
+const Environment List[String] native('Environment')
|
|
|
|
|
|
-function ShowInfo { content String, title String('Information') } $[None] native('ShowInfo')
|
|
|
+const FontSize Int native('FontSize')
|
|
|
+
|
|
|
+function ShowInfo { content String, title String('Info') } $[None] native('ShowInfo')
|
|
|
function ShowWarning { content String, title String('Warning') } $[None] native('ShowWarning')
|
|
|
function ShowCritical { content String, title String('Error') } $[None] native('ShowCritical')
|
|
|
function ShowYesNo { content String, title String('Question') } $[Bool] native('ShowYesNo')
|
|
@@ -492,14 +495,16 @@ function <Widget>CreateSplitter { l List[Widget] } Hook[Widget] native('WidgetCr
|
|
|
function <Widget>CreateMainWindow { menu-bar MenuBar, tool-bar ToolBar, l Layout, margin-x Int, margin-y Int, width Int, height Int, icon Icon } Hook[Widget] native('WidgetCreateMainWindow')
|
|
|
function <Widget>CreateDialog { l Layout, margin-x Int, margin-y Int, width Int, height Int, icon Icon } Hook[Widget] native('WidgetCreateDialog')
|
|
|
function <Widget>CreateLabel { align Align, selectable Bool } Hook[Widget] native('WidgetCreateLabel')
|
|
|
-function <Widget>CreateIconLabel { icon Icon } Hook[Widget] native('WidgetCreateIconLabel')
|
|
|
+function <Widget>CreateIconLabel { icon Icon, size Int } Hook[Widget] native('WidgetCreateIconLabel')
|
|
|
function <Widget>CreateElidedLabel {} Hook[Widget] native('WidgetCreateElidedLabel')
|
|
|
function <Widget>CreateTextView { format TextFormat } Hook[Widget] native('WidgetCreateTextView')
|
|
|
function <Widget>CreateCheckBox { text String, checked Bool } Hook[Widget] native('WidgetCreateCheckBox')
|
|
|
function <Widget>CreateComboBox[T] { items List[ComboBoxItem[T]] } Hook[Widget] native('WidgetCreateComboBox')
|
|
|
function <Widget>CreatePushButton { icon Icon, text String, tooltip String } Hook[Widget] native('WidgetCreatePushButton')
|
|
|
function <Widget>CreateLineEdit { text String } Hook[Widget] native('WidgetCreateLineEdit')
|
|
|
-function <Widget>CreateDummyFocusableWidget {} Hook[Widget] native('WidgetCreateDummyFocusableWidget')
|
|
|
+function <Widget>CreatePlainTextEdit { text String } Hook[Widget] native('WidgetCreatePlainTextEdit')
|
|
|
+function <Widget>CreateSlider { value Int, min Int, max Int } Hook[Widget] native('WidgetCreateSlider')
|
|
|
+function <Widget>CreateProgressBar { max Int, format String } Hook[Widget] native('WidgetCreateProgressBar')
|
|
|
|
|
|
type <Signal>[T] native
|
|
|
type <Events>[T] native
|
|
@@ -507,9 +512,11 @@ function <Connect>[T] { s <Signal>[T], w Widget } $[T] native('Connect')
|
|
|
function <Listen>[T] { s <Events>[T], w Widget } $[T] native('Listen')
|
|
|
const <Signal>Toggled <Signal>[None] native('SignalToggled')
|
|
|
const <Signal>Clicked <Signal>[None] native('SignalClicked')
|
|
|
-const <Signal>TextChanged <Signal>[None] native('SignalTextChanged')
|
|
|
+const <Signal>TextChanged0 <Signal>[None] native('SignalTextChanged0')
|
|
|
+const <Signal>TextChanged1 <Signal>[None] native('SignalTextChanged1')
|
|
|
const <Signal>ReturnPressed <Signal>[None] native('SignalReturnPressed')
|
|
|
const <Signal>Rejected <Signal>[None] native('SignalRejected')
|
|
|
+const <Signal>ValueChanged <Signal>[None] native('SignalValueChanged')
|
|
|
const <Events>Close <Events>[None] native('EventsClose')
|
|
|
|
|
|
type <Prop>[T] native
|
|
@@ -520,6 +527,8 @@ const <Prop>Enabled <Prop>[Bool] native('PropEnabled')
|
|
|
const <Prop>WindowTitle <Prop>[String] native('PropWindowTitle')
|
|
|
const <Prop>Text <Prop>[String] native('PropText')
|
|
|
const <Prop>Checked <Prop>[Bool] native('PropChecked')
|
|
|
+const <Prop>PlainText <Prop>[String] native('PropPlainText')
|
|
|
+const <Prop>Value <Prop>[Int] native('PropValue')
|
|
|
|
|
|
type Icon record { Name String }
|
|
|
function Icon { name String('') } Icon { new Icon(name) }
|
|
@@ -617,10 +626,11 @@ function ElidedLabel { text $[String] } Hook[ElidedLabel] {
|
|
|
}
|
|
|
|
|
|
type IconLabel record { Widget Widget }
|
|
|
-function IconLabel { icon Icon } Hook[IconLabel] {
|
|
|
- @use widget = <Widget>CreateIconLabel(icon),
|
|
|
+function IconLabel { icon Icon, size IconSize(Auto) } Hook[IconLabel] {
|
|
|
+ @use widget = <Widget>CreateIconLabel(icon, ([Int])size),
|
|
|
Hook(new IconLabel(widget))
|
|
|
}
|
|
|
+type IconSize enum { Auto, Small, Medium, Large }
|
|
|
|
|
|
type TextView record { Widget Widget }
|
|
|
function TextView { text $[String], format TextFormat(Plain) } Hook[TextView] {
|
|
@@ -666,12 +676,33 @@ function TextBox { text String('') } Hook[TextBox] {
|
|
|
@use widget = <Widget>CreateLineEdit(text),
|
|
|
Hook(new TextBox(widget))
|
|
|
}
|
|
|
-method TextBox.Text $[String] { <Connect>(<Read>(<Prop>Text, <Signal>TextChanged), this.Widget) }
|
|
|
+method TextBox.Text $[String] { <Connect>(<Read>(<Prop>Text, <Signal>TextChanged1), this.Widget) }
|
|
|
method TextBox.Enter $[None] { <Connect>(<Signal>ReturnPressed, this.Widget) }
|
|
|
method TextBox.TextOn Lambda[$[None],$[String]] {{ triggers => <ClearTextLater>(this.Widget, (triggers map-to-latest-from this.Text)) }}
|
|
|
method TextBox.TextOnEnter $[String] { this.TextOn(this.Enter) }
|
|
|
operator bind-override { edit TextBox, text $[String] } $[None] { <Bind>(<Prop>Text, text, edit.Widget) }
|
|
|
|
|
|
+type TextArea record { Widget Widget }
|
|
|
+function TextArea { text String('') } Hook[TextArea] {
|
|
|
+ @use widget = <Widget>CreatePlainTextEdit(text),
|
|
|
+ Hook(new TextArea(widget))
|
|
|
+}
|
|
|
+method TextArea.Text $[String] { <Connect>(<Read>(<Prop>PlainText, <Signal>TextChanged0), this.Widget) }
|
|
|
+
|
|
|
+type Slider record { Widget Widget }
|
|
|
+function Slider { value Int, min Int, max Int } Hook[Slider] {
|
|
|
+ @use widget = <Widget>CreateSlider(value, min, max),
|
|
|
+ Hook(new Slider(widget))
|
|
|
+}
|
|
|
+method Slider.Value $[Int] { <Connect>(<Read>(<Prop>Value, <Signal>ValueChanged), this.Widget) }
|
|
|
+
|
|
|
+type ProgressBar record { Widget Widget }
|
|
|
+function ProgressBar { value $[Int], max Int, format String('') } Hook[ProgressBar] {
|
|
|
+ @use widget = <Widget>CreateProgressBar(max, format),
|
|
|
+ @use Effect(<Bind>(<Prop>Value, value, widget)),
|
|
|
+ Hook(new ProgressBar(widget))
|
|
|
+}
|
|
|
+
|
|
|
type ListView[T] record {
|
|
|
Widget Widget,
|
|
|
Extension $[Maybe[Widget]],
|