internal Widget(Instance inst, FString name, Layout parent, WidgetType type) { mInstance = inst; mType = type; mName = name; mParentLayout = parent; }
public bool GetLayout(Instance layout_inst, out Layout layout) { foreach (KeyValuePair<FString, Layout> ly in mLayoutTable) { if (ly.Value.Root.Instance == layout_inst) { layout = ly.Value; return true; } } layout = null; return false; }
public bool TryGetWidget(Instance widget_inst, out Widget widget) { foreach (KeyValuePair<FString, Widget> item in mWidgetTable) { if (item.Value.Instance == widget_inst) { widget = item.Value; return true; } } widget = null; return false; }
internal ScrollBar(Instance inst, FString name, Layout parent) : base(inst, name, parent, WidgetType.ScrollBar) { }
internal TextBox(Instance inst, FString name, Layout parent, WidgetType type) : base(inst, name, parent, type) { }
internal Window(Instance inst, FString name, Layout parent) : base(inst, name, parent, WidgetType.Window) { }
internal static bool Equals(Instance ls, Instance rs) { if (ReferenceEquals(ls, null)) { return ReferenceEquals(rs, null); } else if (ReferenceEquals(rs, null)) { return false; } return (ls.mPtr == rs.mPtr); }
internal RenderTarget(ScriptRuntime.RenderToTexture rtt) { mInstance = ICall_createFromScriptRuntimeRenderToTexture(rtt); }
internal virtual void Dispose() { clearEventsWidthOutParent(); GUI.DisposeWidget(mInstance); mInstance = Instance.NullInstance; }
internal static Widget CreateWidget(Instance inst, FString name, Layout parent_layout) { WidgetType type = ICall_getType(inst.Ptr); Widget widget = null; switch (type) { case WidgetType.Widget: widget = new Widget(inst, name, parent_layout, WidgetType.Widget); break; case WidgetType.ImageBox: widget = new ImageBox(inst, name, parent_layout); break; case WidgetType.Window: widget = new Window(inst, name, parent_layout); break; case WidgetType.TextBox: widget = new TextBox(inst, name, parent_layout); break; case WidgetType.ListBox: widget = new ListBox(inst, name, parent_layout); break; case WidgetType.Button: widget = new Button(inst, name, parent_layout); break; case WidgetType.EditBox: widget = new EditBox(inst, name, parent_layout); break; case WidgetType.ComboBox: widget = new ComboBox(inst, name, parent_layout); break; case WidgetType.ScrollBar: widget = new ScrollBar(inst, name, parent_layout); break; case WidgetType.DDContainer: widget = new DDContainer(inst, name, parent_layout); break; case WidgetType.ItemBox: widget = new ItemBox(inst, name, parent_layout); break; case WidgetType.Canvas: widget = new Canvas(inst, name, parent_layout); break; default: widget = new Widget(inst, name, parent_layout, WidgetType.Unknown); break; } return widget; }
internal static Widget CreateWidget(Instance inst) { return CreateWidget(inst, null, null); }
internal static Widget CreateWidget(Instance inst, Layout parent_layout) { Widget widget = CreateWidget(inst, null, parent_layout); widget.mName = GetName(widget.mInstance.Ptr); return widget; }
internal bool TryGetWidget(Instance widget_inst, out Widget widget) { return mChilds.TryGetWidget(widget_inst, out widget); }
internal Button(Instance inst, FString name, Layout parent) : base(inst, name, parent, WidgetType.Button) { }
internal ItemBox(Instance inst, FString name, Layout parent) : base(inst, name, parent, WidgetType.ItemBox) { }
internal Canvas(Instance inst, FString name, Layout parent) : base(inst, name, parent, WidgetType.Canvas) { }
protected ItemInfo findItem(Instance inst) { ItemInfo info = null; mItems.TryGetValue(inst.Ptr, out info); if (null == info) { int temp = mInstance.Ptr.ToInt32() + inst.Ptr.ToInt32(); string name = mName.Name + "_item_" + temp.ToString(); Widget widget = Widget.CreateWidget(inst, name, mParentLayout);// info = new ItemInfo(this, widget); mItems.Add(inst.Ptr, info); mParentLayout.AddWidget(info.Item); } return info; }
internal DDContainer(Instance inst, FString name, Layout parent, WidgetType type) : base(inst, name, parent, type) { }