diff --git a/haxelib.json b/haxelib.json index deb9ad3..ee23ceb 100755 --- a/haxelib.json +++ b/haxelib.json @@ -9,7 +9,6 @@ "contributors": ["shmyga"], "classPath": "src/main", "dependencies": { - "promhx": "", - "openfl": "" + "promhx": "" } } diff --git a/src/main/haxework/gui/InputTextField.hx b/src/main/haxework/gui/InputTextField.hx index c8e6b88..6e37c4b 100644 --- a/src/main/haxework/gui/InputTextField.hx +++ b/src/main/haxework/gui/InputTextField.hx @@ -14,11 +14,11 @@ class InputTextField extends TextField { public function new() { super(); - #if flash + //#if flash type = TextFieldType.INPUT; - #elseif js - addEventListener(MouseEvent.CLICK, onMouseClick); - #end + //#elseif js + //addEventListener(MouseEvent.CLICK, onMouseClick); + //#end } #if js diff --git a/src/main/haxework/gui/InputView.hx b/src/main/haxework/gui/InputView.hx index 17e269a..3770a2b 100755 --- a/src/main/haxework/gui/InputView.hx +++ b/src/main/haxework/gui/InputView.hx @@ -1,5 +1,6 @@ package haxework.gui; +import flash.text.TextFormatAlign; import haxework.dispath.Dispatcher; import haxework.dispath.IDispatcher; import flash.events.Event; @@ -29,6 +30,7 @@ class InputView extends TextView implements IDisposable { hintTextField = buildHintTextField(); contentAsSprite.addChild(hintTextField); + textFormat.align = TextFormatAlign.LEFT; } override private function buildTextField():TextField { diff --git a/src/main/haxework/gui/SpriteView.hx b/src/main/haxework/gui/SpriteView.hx index 9685d48..5a98d27 100755 --- a/src/main/haxework/gui/SpriteView.hx +++ b/src/main/haxework/gui/SpriteView.hx @@ -18,7 +18,7 @@ class SpriteView extends View { #if dev_layout override public function update():Void { super.update(); - var g:Graphics = content.graphics; + var g:Graphics = contentAsSprite.graphics; g.lineStyle(1, 0x00ff00); g.drawRect(0, 0, width, height); g.lineStyle(); diff --git a/src/main/haxework/gui/TextView.hx b/src/main/haxework/gui/TextView.hx index 75260f5..6077ab6 100755 --- a/src/main/haxework/gui/TextView.hx +++ b/src/main/haxework/gui/TextView.hx @@ -191,12 +191,12 @@ class TextView extends SpriteView implements ITextView { placeTextField(textField); } //ToDo: - var t:Point = content.localToGlobal(new Point(textField.x, textField.y)); - t.x = Math.round(t.x); - t.y = Math.round(t.y); - t = content.globalToLocal(t); - textField.x = t.x; - textField.y = t.y; + //var t:Point = content.localToGlobal(new Point(textField.x, textField.y)); + //t.x = Math.round(t.x); + //t.y = Math.round(t.y); + //t = content.globalToLocal(t); + //textField.x = t.x; + //textField.y = t.y; super.update(); } diff --git a/src/main/haxework/gui/build/Builder.hx b/src/main/haxework/gui/build/Builder.hx index afda4e4..741bdd1 100755 --- a/src/main/haxework/gui/build/Builder.hx +++ b/src/main/haxework/gui/build/Builder.hx @@ -70,7 +70,7 @@ class Builder { case "link": "(links == null) ? untyped this : Reflect.field(links, \"" + a[1] + "\")"; case _: - throw "Unsupported prefix \"" + a[0] + "\""; + Context.error("Unsupported prefix \"" + a[0] + "\"", getPosition(position)); } } @@ -93,7 +93,12 @@ class Builder { if (Reflect.hasField(value, "@type")) { var n = "a" + i++; var type = Reflect.field(value, "@type"); - exprs.push(Context.parse("var " + n + " = new " + type + "()", getPosition(position))); + if (type == "Dynamic") { + //ToDo: + exprs.push(Context.parse("var " + n + " = cast {}", getPosition(position))); + } else { + exprs.push(Context.parse("var " + n + " = new " + type + "()", getPosition(position))); + } createElement(value, n); n; } else { diff --git a/src/main/haxework/provider/Provider.hx b/src/main/haxework/provider/Provider.hx index f64c1f2..bf97344 100755 --- a/src/main/haxework/provider/Provider.hx +++ b/src/main/haxework/provider/Provider.hx @@ -1,15 +1,16 @@ package haxework.provider; -import haxework.net.manage.LoaderManager; -import haxework.net.manage.ILoaderManager; import haxe.ds.ObjectMap; class Provider { //private static var factories:ObjectMap> = new ObjectMap>(); private static var factories:ObjectMap> = cast [ - ILoaderManager => LoaderManager + #if (!neko) + haxework.net.manage.LoaderManager => haxework.net.manage.ILoaderManager + #end ]; + private static var args:ObjectMap> = new ObjectMap>(); private static var instances:ObjectMap = new ObjectMap(); @@ -31,7 +32,7 @@ class Provider { instances.set(key, instance); return instance; } else { - throw "Factory for\"" + i + "\" not found"; + throw "Factory for\" " + i + "\" not found"; } } diff --git a/src/main/haxework/text/TextUtil.hx b/src/main/haxework/text/TextUtil.hx index aa9f08d..a6d5553 100644 --- a/src/main/haxework/text/TextUtil.hx +++ b/src/main/haxework/text/TextUtil.hx @@ -19,7 +19,7 @@ class TextUtil { var _textWidth = textField.width; #else var _textWidth = textField.textWidth; - var _textHeight = textField.textHeight;// * K_HEIGHT; + var _textHeight = textField.textHeight * K_HEIGHT; #end return new Point(_textWidth, _textHeight); }