Browse Source

fancyarray

Clément Espeute 7 tháng trước cách đây
mục cha
commit
0954fbbf7f
1 tập tin đã thay đổi với 34 bổ sung0 xóa
  1. 34 0
      hide/comp/FancyArray.hx

+ 34 - 0
hide/comp/FancyArray.hx

@@ -0,0 +1,34 @@
+package hide.comp;
+
+
+class FancyArray<T> extends hide.comp.Component {
+	public function new(parent: Element, e: Element, undo: hide.ui.UndoHistory) {
+		if (e == null)
+			e = new Element("<ul></ul>");
+		super(parent, e);
+		element.addClass("fancy-array");
+	}
+
+	public function refresh() : Void {
+		element.empty();
+		var items = getItems();
+
+
+	}
+
+	public var reorder : (oldIndex, newIndex) -> Void = null;
+	public var insert : (index) -> Void = null;
+	public var remove : (index) -> Void = null;
+
+	dynamic function getItems() : Array<T> {
+		return [];
+	}
+
+	dynamic function getItemName(item: T) : String {
+		return null;
+	}
+
+	dynamic function setItemName(name: String, item: T) : Void {
+
+	}
+}