示例#1
0
        internal static void OnKeySetFocus(Widget widget, FocusEventArg arg)
        {
            Instance root_inst   = arg.focus_widget_root;
            Instance widget_inst = arg.focus_widget;
            Layout   layout      = null;

            if (GUI.SearchLayout(root_inst, out layout))
            {
                Widget widget2 = null;
                if (layout.TryGetWidget(widget_inst, out widget2))
                {
                    widget.mHandleKeySetFocus(widget.Name, layout.Name, widget2.Name);
                    return;
                }
                else if (widget_inst.IsValid)
                {
                    String name = Widget.GetName(widget_inst.Ptr);
                    if (name.Length > 0)//[2012/6/17 zhongdaohuan]暂不支持编辑匿名的ui控件
                    {
                        widget2 = Widget.CreateWidget(widget_inst, name, layout);
                        widget.mHandleKeySetFocus(widget.Name, layout.Name, widget2.Name);
                        return;
                    }
                }
            }
            widget.mHandleKeySetFocus(widget.Name, null, null);
        }
示例#2
0
        internal static void SetItemInfo(DDContainer sender, ref DragEventArg arg, ref DDItemInfo item_info)
        {
            _DDItemInfo _info = (_DDItemInfo)Util.PtrToStruct <_DDItemInfo>(arg.DDItemInfo);

            item_info.receiver_index = _info.receiver_index;
            item_info.sender_index   = _info.sender_index;

            item_info.sender = sender.Name;

            if (_info.receiver == IntPtr.Zero)
            {
                item_info.receiver = null;
            }
            item_info.receiver = Widget.GetName(_info.receiver);
        }
示例#3
0
        ///** Get window caption widget */
        internal TextBox GetCaptionWidget()
        {
            if (null == mCaption)
            {
                Instance inst = ICall_getCaptionWidget(mInstance.Ptr);
                if (inst.IsValid)
                {
                    int temp = mInstance.Ptr.ToInt32() + inst.Ptr.ToInt32();

                    string name = mName + "_" + Widget.GetName(inst.Ptr) + "_" + temp.ToString();
                    mCaption = new TextBox(inst, name, mParentLayout);
                    mParentLayout.AddWidget(mCaption);
                }
            }
            return(mCaption);
        }