fixes
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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<Dynamic, Class<Dynamic>> = new ObjectMap<Dynamic, Class<Dynamic>>();
|
||||
private static var factories:ObjectMap<Dynamic, Class<Dynamic>> = cast [
|
||||
ILoaderManager => LoaderManager
|
||||
#if (!neko)
|
||||
haxework.net.manage.LoaderManager => haxework.net.manage.ILoaderManager
|
||||
#end
|
||||
];
|
||||
|
||||
private static var args:ObjectMap<Dynamic, Array<Dynamic>> = new ObjectMap<Dynamic, Array<Dynamic>>();
|
||||
private static var instances:ObjectMap<Dynamic, Dynamic> = new ObjectMap<Dynamic, Dynamic>();
|
||||
|
||||
@@ -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";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user