[view] add AlertView

This commit is contained in:
2020-02-06 17:10:19 +03:00
parent 07c228121c
commit a311dc1c19
2 changed files with 52 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
package haxework.view.popup;
import haxework.view.form.LabelView;
import haxework.view.text.TextView;
import promhx.Promise;
@:template class AlertView extends PopupView<Dynamic> {
@:view var header:LabelView;
@:view var message:TextView;
public function new() {
super();
}
public static function alert(message:String):Promise<Dynamic> {
var result = new AlertView();
result.message.text = message;
return result.show();
}
}

View File

@@ -0,0 +1,31 @@
---
view:
$type: haxework.view.group.VGroupView
geometry.width: 400
geometry.height: 200
geometry.padding: 10
geometry.hAlign: center
geometry.vAlign: middle
style: frame
views:
- $type: haxework.view.group.HGroupView
geometry.width: 100%
layout.margin: 10
views:
- id: header
$type: haxework.view.form.LabelView
- id: message
$type: haxework.view.form.LabelView
font.align: CENTER
layout.hAlign: center
layout.vAlign: middle
geometry.width: 100%
geometry.height: 100%
- $type: haxework.view.group.HGroupView
geometry.width: 100%
layout.hAlign: center
layout.margin: 10
views:
- $type: haxework.view.form.ButtonView
text: OK
+onPress: ~close('ok')