示例#1
0
            /// <summary>
            /// 设置请求对象坐标事件
            /// </summary>
            /// <param name="layout_name">界面名称</param>
            /// <param name="widget_name">控件名称</param>
            /// <param name="func">事件委托</param>
            /// <param name="control">控制属性</param>
            /// <returns>结果</returns>
            public static ExecuteResult SetEventRequestCoordItem(FString layout_name, FString widget_name, Event.SenderRefIntCoordBool func, EventControl control)
            {
                ItemBox ib = null;
                ExecuteResult ret = FindUI(layout_name, widget_name, out ib);
                if (ExecuteResult.Success == ret)
                {

                    switch (control)
                    {
                        case EventControl.Add:
                            {
                                ib.RequestCoordItem = func;
                            }
                            break;
                        case EventControl.Remove:
                            {
                                ib.RequestCoordItem = null;
                            }
                            break;
                    }
                }
                return ret;
            }
示例#2
0
            /// <summary>
            /// 设置改变对象坐标事件
            /// </summary>
            /// <param name="layout_name">界面名称</param>
            /// <param name="widget_name">控件名称</param>
            /// <param name="func">事件委托</param>
            /// <param name="control">控制属性</param>
            /// <returns>结果</returns>
            public static ExecuteResult SetChangeItemPosition(FString layout_name, FString widget_name, Event.SenderInt func, EventControl control)
            {
                ItemBox ib = null;
                ExecuteResult ret = FindUI(layout_name, widget_name, out ib);
                if (ExecuteResult.Success == ret)
                {

                    switch (control)
                    {
                        case EventControl.Add:
                            {
                                ib.EventChangeItemPosition += func;
                            }
                            break;
                        case EventControl.Remove:
                            {
                                ib.EventChangeItemPosition -= func;
                            }
                            break;
                    }
                }
                return ret;
            }
示例#3
0
            /// <summary>
            /// 设置记录事件
            /// </summary>
            /// <param name="layout_name">界面名称</param>
            /// <param name="widget_name">控件名称</param>
            /// <param name="func">事件委托</param>
            /// <param name="control">控制属性</param>
            /// <returns>结果</returns>
            public static ExecuteResult SetEventTick(FString layout_name, FString widget_name, Event.SenderTick func, EventControl control)
            {
                Widget widget = null;
                ExecuteResult ret = FindWidget(layout_name, widget_name, out widget);
                if (ExecuteResult.Success == ret)
                {

                    switch (control)
                    {
                        case EventControl.Add:
                            {
                                widget.EventTick += func;
                            }
                            break;
                        case EventControl.Remove:
                            {
                                widget.EventTick -= func;
                            }
                            break;
                    }
                }
                return ret;
            }
示例#4
0
            /// <summary>
            /// 设置鼠标双击或接收回车键的事件操作
            /// </summary>
            /// <param name="layout_name">面板名称</param>
            /// <param name="widget_name">控件名称</param>
            /// <param name="func">事件操作代理</param>
            /// <param name="control">事件控制方式</param>
            /// <returns>执行结果,若结果为Success,则表示操作成功;否则,表示操作失败</returns>
            public static ExecuteResult SetListSelectAccept(FString layout_name, FString widget_name, Event.SenderInt func, EventControl control)
            {
                ListBox lb = null;
                ExecuteResult ret = FindUI(layout_name, widget_name, out lb);
                if (ExecuteResult.Success == ret)
                {

                    switch (control)
                    {
                        case EventControl.Add:
                            {
                                lb.EventListSelectAccept += func;
                            }
                            break;
                        case EventControl.Remove:
                            {
                                lb.EventListSelectAccept -= func;
                            }
                            break;
                    }
                }
                return ret;
            }
示例#5
0
            /// <summary>
            /// 设置通知事件
            /// </summary>
            /// <param name="layout_name">界面名称</param>
            /// <param name="widget_name">控件名称</param>
            /// <param name="func">事件委托</param>
            /// <param name="control">控制属性</param>
            /// <returns>结果</returns>
            public static ExecuteResult SetNotifyItem(FString layout_name, FString widget_name, Event.SenderRefIBNotifyItemData func, EventControl control)
            {
                ItemBox ib = null;
                ExecuteResult ret = FindUI(layout_name, widget_name, out ib);
                if (ExecuteResult.Success == ret)
                {

                    switch (control)
                    {
                        case EventControl.Add:
                            {
                                ib.EventNotifyItem += func;
                            }
                            break;
                        case EventControl.Remove:
                            {
                                ib.EventNotifyItem -= func;
                            }
                            break;
                    }
                }
                return ret;
            }
示例#6
0
            /// <summary>
            /// 设置窗口位置大小改变事件操作
            /// </summary>
            /// <param name="layout_name">面板名称</param>
            /// <param name="widget_name">控件名称</param>
            /// <param name="func">窗口位置大小改变代理</param>
            /// <param name="control">窗口位置大小改变事件控制方式</param>
            /// <returns>执行结果,若结果为Success,则表示操作成功;否则,表示操作失败</returns>
            public static ExecuteResult SetWindowChangeCoord(FString layout_name, FString widget_name, Event.SenderVoid func, EventControl control)
            {
                Window window = null;
                ExecuteResult ret = FindUI(layout_name, widget_name, out window);
                if (ExecuteResult.Success == ret)
                {

                    switch (control)
                    {
                        case EventControl.Add:
                            {
                                window.EventWindowChangeCoord += func;
                            }
                            break;
                        case EventControl.Remove:
                            {
                                window.EventWindowChangeCoord -= func;
                            }
                            break;
                    }
                }
                return ret;
            }