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