Exemplo n.º 1
0
 /// <summary>
 /// 销毁方法
 /// </summary>
 public override void delete()
 {
     if (!IsDeleted)
     {
         if (m_dropDownButton != null)
         {
             if (m_dropDownButtonTouchDownEvent != null)
             {
                 m_dropDownButton.removeEvent(m_dropDownButtonTouchDownEvent, FCEventID.TOUCHDOWN);
                 m_dropDownButtonTouchDownEvent = null;
             }
         }
         if (m_dropDownMenu != null)
         {
             if (m_menuItemClickEvent != null)
             {
                 m_dropDownMenu.removeEvent(m_menuItemClickEvent, FCEventID.MENUITEMCLICK);
                 m_menuItemClickEvent = null;
             }
             if (m_menuKeyDownEvent != null)
             {
                 m_dropDownMenu.removeEvent(m_menuKeyDownEvent, FCEventID.KEYDOWN);
                 m_menuKeyDownEvent = null;
             }
             Native.removeControl(m_dropDownMenu);
             m_dropDownMenu.delete();
             m_dropDownMenu = null;
         }
     }
     base.delete();
 }
Exemplo n.º 2
0
 /// <summary>
 /// 调用菜单的触摸事件
 /// </summary>
 /// <param name="eventID">事件ID</param>
 /// <param name="item">菜单项</param>
 /// <param name="touchInfo">触摸信息</param>
 protected void callMenuItemTouchEvent(int eventID, FCMenuItem item, FCTouchInfo touchInfo)
 {
     if (m_events != null && m_events.containsKey(eventID))
     {
         ArrayList <object> events = m_events.get(eventID);
         int eventSize             = events.size();
         for (int i = 0; i < eventSize; i++)
         {
             FCMenuItemTouchEvent func = events.get(i) as FCMenuItemTouchEvent;
             if (func != null)
             {
                 func(this, item, touchInfo);
             }
         }
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// 创建下拉列表
 /// </summary>
 public FCComboBox()
 {
     m_dropDownButtonTouchDownEvent = new FCTouchEvent(dropDownButtonTouchDown);
     m_menuItemClickEvent           = new FCMenuItemTouchEvent(menuItemClick);
     m_menuKeyDownEvent             = new FCKeyEvent(MenuKeyDown);
 }
Exemplo n.º 4
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;
                }
                }
            }
        }