bright-gpu-74537
01/19/2020, 4:52 PMbright-gpu-74537
01/19/2020, 4:52 PMbright-gpu-74537
01/19/2020, 4:54 PMuser
01/19/2020, 4:54 PMbright-gpu-74537
01/19/2020, 4:54 PMbright-gpu-74537
01/19/2020, 4:54 PMbright-gpu-74537
01/19/2020, 4:55 PMbright-gpu-74537
01/19/2020, 4:57 PMuser
01/19/2020, 5:00 PMbright-gpu-74537
01/19/2020, 5:01 PMuser
01/19/2020, 5:03 PMbright-gpu-74537
01/19/2020, 9:17 PMbright-gpu-74537
01/19/2020, 9:17 PMbright-gpu-74537
01/19/2020, 9:18 PMbright-gpu-74537
01/19/2020, 9:18 PMxml
<vbox style="padding: 5px;" width="300" height="300">
<button id="button1" text="Button 1" width="100%" />
<hbox width="100%" height="100%">
<button id="button2" text="Button 2" width="50" height="100%" />
<test-component id="test" width="100%" height="100%" htmlId="myTestComponent" />
<button id="button3" text="Button 3" height="100%" />
</hbox>
<button id="button4" text="Button 2" width="100%" />
<hbox>
<button text="Button 1 Bigger" onclick="button1.height += 20" />
<button text="Button 2 Bigger" onclick="button2.width += 20" />
<button text="Button 3 Bigger" onclick="button3.width += 20" />
<button text="Button 4 Bigger" onclick="button4.height += 20" />
</hbox>
</vbox>
bright-gpu-74537
01/19/2020, 9:18 PMbright-gpu-74537
01/19/2020, 9:18 PMhaxe
class TestComponent extends Component {
public var htmlId:String = null;
private var _el:Element = null;
public override function ready() {
super.ready();
_el = Browser.document.getElementById(htmlId);
_el.style.display = null;
Toolkit.callLater(function() { // something not quite right here, shouldnt need a 1 frame delay
syncElementBounds();
});
}
public override function onResized() {
syncElementBounds();
}
public override function onMoved() {
syncElementBounds();
}
public var offsetX:Float = 8; // location of the canvas on the html page
public var offsetY:Float = 8;
private function syncElementBounds() {
if (_el == null) {
trace("no element");
return;
}
_el.style.left = (offsetX + screenLeft) + "px";
_el.style.top = (offsetY + screenTop) + "px";
_el.style.width = width + "px";
_el.style.height = height + "px";
}
}
bright-gpu-74537
01/19/2020, 9:19 PMbright-gpu-74537
01/19/2020, 9:28 PMbright-gpu-74537
01/19/2020, 9:28 PMhtml
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Test</title>
</head>
<body>
<canvas id="khanvas" width="800" height="600" tabindex="-1" style="position:absolute;"></canvas>
<div id="myTestComponent" style="background-color:#CCCCFF;position:absolute;display:none;user-select:none">
This is a native html <div> element, the size and position is controlled from haxeui-kha
</div>
<script src="kha.js"></script>
</body>
</html>
user
01/19/2020, 9:56 PMuser
01/20/2020, 10:44 PM/home/jsnadeau/foundsdk/haxeui-code-editor/haxe/ui/editors/code/monaco/MonacoCodeEditor.hx:6: characters 8-21 : Type not found : monaco.Editor
user
01/20/2020, 10:44 PMuser
01/20/2020, 10:46 PMuser
01/20/2020, 11:00 PMuser
01/20/2020, 11:01 PM/home/jsnadeau/foundsdk/haxeui-code-editor/haxe/ui/editors/code/monaco/MonacoCodeEditor.hx:92: characters 26-35 : Class<Monaco> has no field languages
bright-gpu-74537
01/21/2020, 7:07 AMbright-gpu-74537
01/21/2020, 7:25 AMbright-gpu-74537
01/21/2020, 7:25 AMuser
01/21/2020, 1:50 PM