示例#1
0
 internal Widget(Instance inst, FString name, Layout parent, WidgetType type)
 {
     mInstance = inst;
     mType = type;
     mName = name;
     mParentLayout = parent;
 }
示例#2
0
 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;
 }
示例#3
0
 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;
 }
示例#4
0
 internal ScrollBar(Instance inst, FString name, Layout parent)
     : base(inst, name, parent, WidgetType.ScrollBar)
 {
 }
示例#5
0
 internal TextBox(Instance inst, FString name, Layout parent, WidgetType type)
     : base(inst, name, parent, type)
 {
 }
示例#6
0
 internal Window(Instance inst, FString name, Layout parent)
     : base(inst, name, parent, WidgetType.Window)
 {
 }
示例#7
0
 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);
 }
示例#8
0
 internal RenderTarget(ScriptRuntime.RenderToTexture rtt)
 {
     mInstance = ICall_createFromScriptRuntimeRenderToTexture(rtt);
 }
示例#9
0
 internal virtual void Dispose()
 {
     clearEventsWidthOutParent();
     GUI.DisposeWidget(mInstance);
     mInstance = Instance.NullInstance;
 }
示例#10
0
        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;
        }
示例#11
0
 internal static Widget CreateWidget(Instance inst)
 {
     return CreateWidget(inst, null, null);
 }
示例#12
0
 internal static Widget CreateWidget(Instance inst, Layout parent_layout)
 {
     Widget widget = CreateWidget(inst, null, parent_layout);
     widget.mName = GetName(widget.mInstance.Ptr);
     return widget;
 }
示例#13
0
 internal bool TryGetWidget(Instance widget_inst, out Widget widget)
 {
     return mChilds.TryGetWidget(widget_inst, out widget);
 }
示例#14
0
 internal Button(Instance inst, FString name, Layout parent)
     : base(inst, name, parent, WidgetType.Button)
 {
 }
示例#15
0
 internal ItemBox(Instance inst, FString name, Layout parent)
     : base(inst, name, parent, WidgetType.ItemBox)
 {
 }
示例#16
0
 internal Canvas(Instance inst, FString name, Layout parent)
     : base(inst, name, parent, WidgetType.Canvas)
 {
 }
示例#17
0
        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;
        }
示例#18
0
 internal DDContainer(Instance inst, FString name, Layout parent, WidgetType type)
     : base(inst, name, parent, type)
 {
 }