Esempio n. 1
0
        /// <summary>
        /// 调用方法
        /// </summary>
        /// <param name="sender">调用者</param>
        /// <param name="eventID">事件ID</param>
        public virtual String callFunction(object sender, int eventID)
        {
            FCView control = sender as FCView;

            if (m_events.containsKey(control))
            {
                FCEventInfo eventInfo = m_events.get(control);
                String      function  = eventInfo.getFunction(eventID);
                if (function != null && function.Length > 0)
                {
                    FCUIScript script = m_xml.Script;
                    if (script != null)
                    {
                        m_sender = control.Name;
                        String result = script.callFunction(function);
                        m_sender = "";
                        return(result);
                    }
                }
            }
            return(null);
        }
Esempio n. 2
0
        /// <summary>
        /// 注册事件
        /// </summary>
        /// <param name="control">控件</param>
        /// <param name="eventName">事件名称</param>
        /// <param name="function">方法</param>
        public virtual void registerEvent(FCView control, String eventName, String function)
        {
            int eventID = getEventID(eventName);

            if (eventID != -1)
            {
                FCEventInfo eventInfo = null;
                if (m_events.containsKey(control))
                {
                    eventInfo = m_events.get(control);
                }
                else
                {
                    eventInfo = new FCEventInfo();
                    m_events.put(control, eventInfo);
                }
                eventInfo.addEvent(eventID, function);
                switch (eventID)
                {
                case FCEventID.ADD: {
                    FCEvent cEvent = new FCEvent(callAdd);
                    control.addEvent(cEvent, eventID);
                    break;
                }

                case FCEventID.BACKCOLORCHANGED: {
                    FCEvent cEvent = new FCEvent(callBackColorChanged);
                    control.addEvent(cEvent, eventID);
                    break;
                }

                case FCEventID.BACKIMAGECHANGED: {
                    FCEvent cEvent = new FCEvent(CallBackImageChanged);
                    control.addEvent(cEvent, eventID);
                    break;
                }

                case FCEventID.CHAR: {
                    FCKeyEvent cEvent = new FCKeyEvent(callChar);
                    control.addEvent(cEvent, eventID);
                    break;
                }

                case FCEventID.CHECKEDCHANGED: {
                    FCEvent cEvent = new FCEvent(callCheckedChanged);
                    control.addEvent(cEvent, eventID);
                    break;
                }

                case FCEventID.CLICK: {
                    FCTouchEvent cEvent = new FCTouchEvent(callClick);
                    control.addEvent(cEvent, eventID);
                    break;
                }

                case FCEventID.COPY: {
                    FCEvent cEvent = new FCEvent(callCopy);
                    control.addEvent(cEvent, eventID);
                    break;
                }

                case FCEventID.CUT: {
                    FCEvent cEvent = new FCEvent(callCut);
                    control.addEvent(cEvent, eventID);
                    break;
                }

                case FCEventID.DOCKCHANGED: {
                    FCEvent cEvent = new FCEvent(callDockChanged);
                    control.addEvent(cEvent, eventID);
                    break;
                }

                case FCEventID.DOUBLECLICK: {
                    FCEvent cEvent = new FCEvent(callDoubleClick);
                    control.addEvent(cEvent, eventID);
                    break;
                }

                case FCEventID.DRAGBEGIN: {
                    FCEvent cEvent = new FCEvent(callDragBegin);
                    control.addEvent(cEvent, eventID);
                    break;
                }

                case FCEventID.DRAGEND: {
                    FCEvent cEvent = new FCEvent(CallDragEnd);
                    control.addEvent(cEvent, eventID);
                    break;
                }

                case FCEventID.DRAGGING: {
                    FCEvent cEvent = new FCEvent(callDragging);
                    control.addEvent(cEvent, eventID);
                    break;
                }

                case FCEventID.ENABLECHANGED: {
                    FCEvent cEvent = new FCEvent(callEnableChanged);
                    control.addEvent(cEvent, eventID);
                    break;
                }

                case FCEventID.FONTCHANGED: {
                    FCEvent cEvent = new FCEvent(callFontChanged);
                    control.addEvent(cEvent, eventID);
                    break;
                }

                case FCEventID.TEXTCOLORCHANGED: {
                    FCEvent cEvent = new FCEvent(callTextColorChanged);
                    control.addEvent(cEvent, eventID);
                    break;
                }

                case FCEventID.GOTFOCUS: {
                    FCEvent cEvent = new FCEvent(callGotFocus);
                    control.addEvent(cEvent, eventID);
                    break;
                }

                case FCEventID.GRIDCELLCLICK: {
                    FCEvent cEvent = new FCEvent(callFCGridCellClick);
                    control.addEvent(cEvent, eventID);
                    break;
                }

                case FCEventID.GRIDCELLEDITBEGIN: {
                    FCEvent cEvent = new FCEvent(callFCGridCellEditBegin);
                    control.addEvent(cEvent, eventID);
                    break;
                }

                case FCEventID.GRIDCELLEDITEND: {
                    FCEvent cEvent = new FCEvent(callFCGridCellEditEnd);
                    control.addEvent(cEvent, eventID);
                    break;
                }

                case FCEventID.GRIDCELLTOUCHDOWN: {
                    FCEvent cEvent = new FCEvent(callFCGridCellTouchDown);
                    control.addEvent(cEvent, eventID);
                    break;
                }

                case FCEventID.GRIDCELLTOUCHMOVE: {
                    FCEvent cEvent = new FCEvent(callFCGridCellTouchMove);
                    control.addEvent(cEvent, eventID);
                    break;
                }

                case FCEventID.GRIDCELLTOUCHUP: {
                    FCEvent cEvent = new FCEvent(callFCGridCellTouchUp);
                    control.addEvent(cEvent, eventID);
                    break;
                }

                case FCEventID.INVOKE: {
                    FCInvokeEvent cEvent = new FCInvokeEvent(callInvoke);
                    control.addEvent(cEvent, eventID);
                    break;
                }

                case FCEventID.KEYDOWN: {
                    FCKeyEvent cEvent = new FCKeyEvent(callKeyDown);
                    control.addEvent(cEvent, eventID);
                    break;
                }

                case FCEventID.KEYUP: {
                    FCKeyEvent cEvent = new FCKeyEvent(CallKeyUp);
                    control.addEvent(cEvent, eventID);
                    break;
                }

                case FCEventID.LOAD: {
                    FCEvent cEvent = new FCEvent(callLoad);
                    control.addEvent(cEvent, eventID);
                    break;
                }

                case FCEventID.LOCATIONCHANGED: {
                    FCEvent cEvent = new FCEvent(callLocationChanged);
                    control.addEvent(cEvent, eventID);
                    break;
                }

                case FCEventID.LOSTFOCUS: {
                    FCEvent cEvent = new FCEvent(callLostFocus);
                    control.addEvent(cEvent, eventID);
                    break;
                }

                case FCEventID.MARGINCHANGED: {
                    FCEvent cEvent = new FCEvent(callMarginChanged);
                    control.addEvent(cEvent, eventID);
                    break;
                }

                case FCEventID.MENUITEMCLICK: {
                    FCMenuItemTouchEvent cEvent = new FCMenuItemTouchEvent(callMenuItemClick);
                    control.addEvent(cEvent, eventID);
                    break;
                }

                case FCEventID.TOUCHDOWN: {
                    FCTouchEvent cEvent = new FCTouchEvent(callTouchDown);
                    control.addEvent(cEvent, eventID);
                    break;
                }

                case FCEventID.TOUCHENTER: {
                    FCTouchEvent cEvent = new FCTouchEvent(callTouchEnter);
                    control.addEvent(cEvent, eventID);
                    break;
                }

                case FCEventID.TOUCHLEAVE: {
                    FCTouchEvent cEvent = new FCTouchEvent(callTouchLeave);
                    control.addEvent(cEvent, eventID);
                    break;
                }

                case FCEventID.TOUCHMOVE: {
                    FCTouchEvent cEvent = new FCTouchEvent(callTouchMove);
                    control.addEvent(cEvent, eventID);
                    break;
                }

                case FCEventID.TOUCHUP: {
                    FCTouchEvent cEvent = new FCTouchEvent(callTouchUp);
                    control.addEvent(cEvent, eventID);
                    break;
                }

                case FCEventID.TOUCHWHEEL: {
                    FCTouchEvent cEvent = new FCTouchEvent(callTouchWheel);
                    control.addEvent(cEvent, eventID);
                    break;
                }

                case FCEventID.PADDINGCHANGED: {
                    FCPaintEvent cEvent = new FCPaintEvent(callPaddingChanged);
                    control.addEvent(cEvent, eventID);
                    break;
                }

                case FCEventID.PAINT: {
                    FCPaintEvent cEvent = new FCPaintEvent(callPaint);
                    control.addEvent(cEvent, eventID);
                    break;
                }

                case FCEventID.PAINTBORDER: {
                    FCPaintEvent cEvent = new FCPaintEvent(callPaintBorder);
                    control.addEvent(cEvent, eventID);
                    break;
                }

                case FCEventID.PARENTCHANGED: {
                    FCEvent cEvent = new FCEvent(callParentChanged);
                    control.addEvent(cEvent, eventID);
                    break;
                }

                case FCEventID.PASTE: {
                    FCEvent cEvent = new FCEvent(callPaste);
                    control.addEvent(cEvent, eventID);
                    break;
                }

                case FCEventID.REGIONCHANGED: {
                    FCEvent cEvent = new FCEvent(CallRegionChanged);
                    control.addEvent(cEvent, eventID);
                    break;
                }

                case FCEventID.REMOVE: {
                    FCEvent cEvent = new FCEvent(callRemove);
                    control.addEvent(cEvent, eventID);
                    break;
                }

                case FCEventID.SCROLLED: {
                    FCEvent cEvent = new FCEvent(callScrolled);
                    control.addEvent(cEvent, eventID);
                    break;
                }

                case FCEventID.SELECTEDTIMECHANGED: {
                    FCEvent cEvent = new FCEvent(callSelectedTimeChanged);
                    control.addEvent(cEvent, eventID);
                    break;
                }

                case FCEventID.SELECTEDINDEXCHANGED: {
                    FCEvent cEvent = new FCEvent(callSelectedIndexChanged);
                    control.addEvent(cEvent, eventID);
                    break;
                }

                case FCEventID.SELECTEDTABPAGECHANGED: {
                    FCEvent cEvent = new FCEvent(CallSelectedTabPageChanged);
                    control.addEvent(cEvent, eventID);
                    break;
                }

                case FCEventID.SIZECHANGED: {
                    FCEvent cEvent = new FCEvent(callSizeChanged);
                    control.addEvent(cEvent, eventID);
                    break;
                }

                case FCEventID.TABINDEXCHANGED: {
                    FCEvent cEvent = new FCEvent(callTabIndexChanged);
                    control.addEvent(cEvent, eventID);
                    break;
                }

                case FCEventID.TABSTOP: {
                    FCEvent cEvent = new FCEvent(CallTabStop);
                    control.addEvent(cEvent, eventID);
                    break;
                }

                case FCEventID.TEXTCHANGED: {
                    FCEvent cEvent = new FCEvent(callTextChanged);
                    control.addEvent(cEvent, eventID);
                    break;
                }

                case FCEventID.TIMER: {
                    FCTimerEvent cEvent = new FCTimerEvent(callTimer);
                    control.addEvent(cEvent, eventID);
                    break;
                }

                case FCEventID.VALUECHANGED: {
                    FCEvent cEvent = new FCEvent(callVisibleChanged);
                    control.addEvent(cEvent, eventID);
                    break;
                }

                case FCEventID.VISIBLECHANGED: {
                    FCEvent cEvent = new FCEvent(callVisibleChanged);
                    control.addEvent(cEvent, eventID);
                    break;
                }

                case FCEventID.WINDOWCLOSED: {
                    FCEvent cEvent = new FCEvent(callWindowClosed);
                    control.addEvent(cEvent, eventID);
                    break;
                }
                }
            }
        }