Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/haxeui/haxeui-core
Browse files Browse the repository at this point in the history
  • Loading branch information
ianharrigan committed Jul 7, 2024
2 parents e94ce3b + fd5b925 commit 605d9f8
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,13 +158,13 @@ _Note: `Screen` was used here as a universal way to add items to the application
It is also possible for HaxeUI to take a user interface definition from a markup language (like XML) and use that to build code similar to above:

```haxe
var main = ComponentMacros.buildComponent("assets/ui/demo/main.xml");
var main = haxe.ui.ComponentBuilder.fromFile("assets/ui/demo/main.xml");
Screen.instance.addComponent(main);
```
If your xml isn't available at compile time you can use `Toolkit.componentFromString`:

```haxe
var main = Toolkit.componentFromString('<vbox><button text="Button" /></vbox>', "xml");
var main = haxe.ui.RuntimeComponentBuilder.fromString('<vbox><button text="Button" /></vbox>', "xml");
Screen.instance.addComponent(main);
```

Expand Down
2 changes: 1 addition & 1 deletion haxe/ui/components/popups/ColorPickerPopup.hx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class ColorPickerPopup extends DropDown {
}

private var _liveTracking:Bool = true;
public var liveTracking(get, set):Bool;
@:clonable public var liveTracking(get, set):Bool;
private function get_liveTracking():Bool {
return _liveTracking;
}
Expand Down
4 changes: 4 additions & 0 deletions haxe/ui/core/Screen.hx
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ class Screen extends ScreenImpl {
* @return The added component.
*/
public override function removeComponent(component:Component, dispose:Bool = true, invalidate:Bool = true):Component {
if (component == null) {
return null;
}

if (@:privateAccess !component._allowDispose) {
dispose = false;
}
Expand Down
8 changes: 7 additions & 1 deletion haxe/ui/validators/Validator.hx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ class Validator implements IValidator {
valid = validateString(null);
case TObject:
valid = validateString(component.text);
case TClass(Date):
var stringValue:String = null;
if (component.value != null) {
stringValue = Std.string(component.value);
}
valid = validateString(stringValue);
case _:
trace("unsupported", Type.typeof(component.value), component.id, component.className, component.value);
}
Expand Down Expand Up @@ -87,4 +93,4 @@ class Validator implements IValidator {
invalidMessage = value;
}
}
}
}

0 comments on commit 605d9f8

Please sign in to comment.