Example #1
0
 /// <summary>
 /// 创建单元格
 /// </summary>
 public FCGridControlCell()
 {
     m_touchDownEvent  = new FCTouchEvent(controlTouchDown);
     m_touchMoveEvent  = new FCTouchEvent(controlTouchMove);
     m_touchUpEvent    = new FCTouchEvent(controlToucheUp);
     m_touchWheelEvent = new FCTouchEvent(controlTouchWheel);
 }
Example #2
0
 /// <summary>
 /// 创建数值显示控件
 /// </summary>
 public FCSpin()
 {
     m_downButtoTouchDownEvent = new FCTouchEvent(DownButtonTouchDown);
     m_downButtoTouchUpEvent   = new FCTouchEvent(DownButtonTouchUp);
     m_upButtonTouchDownEvent  = new FCTouchEvent(upButtonTouchDown);
     m_upButtonTouchUpEvent    = new FCTouchEvent(upButtonTouchUp);
 }
Example #3
0
 /// <summary>
 /// 创建多页夹
 /// </summary>
 public FCTabPage()
 {
     m_dragHeaderBeginEvent = new FCEvent(DragHeaderBegin);
     m_dragHeaderEndEvent   = new FCEvent(DragHeaderEnd);
     m_draggingHeaderEvent  = new FCEvent(DraggingHeader);
     m_headerTouchDownEvent = new FCTouchEvent(HeaderTouchDown);
 }
Example #4
0
 /// <summary>
 /// 销毁方法
 /// </summary>
 public override void delete()
 {
     if (!IsDeleted)
     {
         if (m_calendar != null)
         {
             if (m_selectedTimeChangedEvent != null)
             {
                 m_calendar.removeEvent(m_selectedTimeChangedEvent, FCEventID.SELECTEDTIMECHANGED);
                 m_selectedTimeChangedEvent = null;
             }
         }
         if (m_dropDownButton != null)
         {
             if (m_dropDownButtonTouchDownEvent != null)
             {
                 m_dropDownButton.removeEvent(m_dropDownButtonTouchDownEvent, FCEventID.TOUCHDOWN);
                 m_dropDownButtonTouchDownEvent = null;
             }
         }
         if (m_dropDownMenu != null)
         {
             Native.removeControl(m_dropDownMenu);
             m_dropDownMenu.delete();
             m_dropDownMenu = null;
         }
     }
     base.delete();
 }
Example #5
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();
 }
Example #6
0
        /// <summary>
        /// 注册事件
        /// </summary>
        /// <param name="control">控件</param>
        private void registerEvents(FCView control)
        {
            FCTouchEvent  clickButtonEvent = new FCTouchEvent(clickButton);
            List <FCView> controls         = control.getControls();
            int           controlsSize     = controls.Count;

            for (int i = 0; i < controlsSize; i++)
            {
                FCView   subControl = controls[i];
                FCButton button     = subControl as FCButton;
                FCGrid   grid       = subControl as FCGrid;
                if (button != null)
                {
                    button.addEvent(clickButtonEvent, FCEventID.CLICK);
                }
                else if (grid != null)
                {
                    FCGridRowStyle rowStyle = new FCGridRowStyle();
                    grid.RowStyle              = rowStyle;
                    rowStyle.BackColor         = FCColor.None;
                    rowStyle.SelectedBackColor = FCDraw.FCCOLORS_SELECTEDROWCOLOR;
                    rowStyle.HoveredBackColor  = FCDraw.FCCOLORS_HOVEREDROWCOLOR;
                    rowStyle.SelectedTextColor = FCDraw.FCCOLORS_TEXTCOLOR4;
                }
                registerEvents(subControl);
            }
        }
Example #7
0
 /// <summary>
 /// 销毁方法
 /// </summary>
 public override void delete()
 {
     if (!IsDeleted)
     {
         if (m_downButton != null)
         {
             if (m_downButtoTouchDownEvent != null)
             {
                 m_downButton.removeEvent(m_downButtoTouchDownEvent, FCEventID.TOUCHDOWN);
                 m_downButtoTouchDownEvent = null;
             }
             if (m_downButtoTouchUpEvent != null)
             {
                 m_downButton.removeEvent(m_downButtoTouchUpEvent, FCEventID.TOUCHUP);
                 m_downButtoTouchUpEvent = null;
             }
         }
         if (m_upButton != null)
         {
             if (m_upButtonTouchDownEvent != null)
             {
                 m_upButton.removeEvent(m_upButtonTouchDownEvent, FCEventID.TOUCHDOWN);
                 m_upButtonTouchDownEvent = null;
             }
             if (m_upButtonTouchUpEvent != null)
             {
                 m_upButton.removeEvent(m_upButtonTouchUpEvent, FCEventID.TOUCHUP);
                 m_upButtonTouchUpEvent = null;
             }
         }
     }
     base.delete();
 }
Example #8
0
        /// <summary>
        /// 创建支持滚动条的控件
        /// </summary>
        public FCDiv()
        {
            m_scrollButtonKeyDownEvent    = new FCKeyEvent(scrollButtonKeyDown);
            m_scrollButtonTouchWheelEvent = new FCTouchEvent(scrollButtonTouchWheel);
            FCSize size = new FCSize(200, 200);

            Size = size;
        }
Example #9
0
 /// <summary>
 /// 销毁方法
 /// </summary>
 public override void delete()
 {
     if (!IsDeleted)
     {
         m_scrollButtonKeyDownEvent    = null;
         m_scrollButtonTouchWheelEvent = null;
     }
     base.delete();
 }
Example #10
0
        /// <summary>
        /// 创建滚动条
        /// </summary>
        public FCScrollBar()
        {
            m_addButtonTouchDownEvent    = new FCTouchEvent(addButtonTouchDown);
            m_addButtonTouchUpEvent      = new FCTouchEvent(addButtonTouchUp);
            m_scrollButtonDraggingEvent  = new FCEvent(scrollButtonDragging);
            m_reduceButtonTouchDownEvent = new FCTouchEvent(reduceButtonTouchDown);
            m_reduceButtonTouchUpEvent   = new FCTouchEvent(reduceButtonTouchUp);
            CanFocus      = false;
            DisplayOffset = false;
            FCSize size = new FCSize(10, 10);

            Size    = size;
            TopMost = true;
        }
Example #11
0
        /// <summary>
        /// 注册事件
        /// </summary>
        /// <param name="control">控件</param>
        private void registerEvents(FCView control)
        {
            FCTouchEvent  clickButtonEvent = new FCTouchEvent(clickButton);
            List <FCView> controls         = control.getControls();
            int           controlsSize     = controls.Count;

            for (int i = 0; i < controlsSize; i++)
            {
                FCButton button = controls[i] as FCButton;
                if (button != null)
                {
                    button.addEvent(clickButtonEvent, FCEventID.CLICK);
                }
                registerEvents(controls[i]);
            }
        }
Example #12
0
 /// <summary>
 /// 销毁方法
 /// </summary>
 public override void delete()
 {
     if (!IsDeleted)
     {
         stopTimer(m_timerID);
         if (m_addButton != null)
         {
             if (m_addButtonTouchDownEvent != null)
             {
                 m_addButton.removeEvent(m_addButtonTouchDownEvent, FCEventID.TOUCHDOWN);
                 m_addButtonTouchDownEvent = null;
             }
             if (m_addButtonTouchUpEvent != null)
             {
                 m_addButton.removeEvent(m_addButtonTouchUpEvent, FCEventID.TOUCHUP);
                 m_addButtonTouchUpEvent = null;
             }
         }
         if (m_scrollButton != null)
         {
             if (m_scrollButtonDraggingEvent != null)
             {
                 m_scrollButton.removeEvent(m_scrollButtonDraggingEvent, FCEventID.DRAGGING);
                 m_scrollButtonDraggingEvent = null;
             }
         }
         if (m_reduceButton != null)
         {
             if (m_reduceButtonTouchDownEvent != null)
             {
                 m_reduceButton.removeEvent(m_reduceButtonTouchDownEvent, FCEventID.TOUCHDOWN);
                 m_reduceButtonTouchDownEvent = null;
             }
             if (m_reduceButtonTouchUpEvent != null)
             {
                 m_reduceButton.removeEvent(m_reduceButtonTouchUpEvent, FCEventID.TOUCHUP);
                 m_reduceButtonTouchUpEvent = null;
             }
         }
     }
     base.delete();
 }
Example #13
0
 /// <summary>
 /// 销毁方法
 /// </summary>
 public override void delete()
 {
     if (!IsDeleted)
     {
         FCButton backButton = BackButton;
         if (backButton != null)
         {
             if (m_backButtonTouchDownEvent != null)
             {
                 backButton.removeEvent(m_backButtonTouchDownEvent, FCEventID.TOUCHDOWN);
                 m_backButtonTouchDownEvent = null;
             }
             if (m_backButtonTouchUpEvent != null)
             {
                 backButton.removeEvent(m_backButtonTouchUpEvent, FCEventID.TOUCHUP);
                 m_backButtonTouchUpEvent = null;
             }
         }
     }
     base.delete();
 }
Example #14
0
 /// <summary>
 /// 销毁方法
 /// </summary>
 public override void delete()
 {
     if (!IsDeleted)
     {
         if (m_dragHeaderBeginEvent != null)
         {
             if (m_headerButton != null)
             {
                 m_headerButton.removeEvent(m_dragHeaderBeginEvent, FCEventID.DRAGBEGIN);
             }
             m_dragHeaderBeginEvent = null;
         }
         if (m_dragHeaderEndEvent != null)
         {
             if (m_headerButton != null)
             {
                 m_headerButton.removeEvent(m_dragHeaderEndEvent, FCEventID.DRAGEND);
             }
             m_dragHeaderEndEvent = null;
         }
         if (m_draggingHeaderEvent != null)
         {
             if (m_headerButton != null)
             {
                 m_headerButton.removeEvent(m_draggingHeaderEvent, FCEventID.DRAGGING);
             }
             m_draggingHeaderEvent = null;
         }
         if (m_headerTouchDownEvent != null)
         {
             if (m_headerButton != null)
             {
                 m_headerButton.removeEvent(m_headerTouchDownEvent, FCEventID.TOUCHDOWN);
             }
             m_headerTouchDownEvent = null;
         }
         m_headerButton = null;
     }
     base.delete();
 }
Example #15
0
 /// <summary>
 /// 创建控件
 /// </summary>
 public FCHScrollBar()
 {
     m_backButtonTouchDownEvent = new FCTouchEvent(backButtonTouchDown);
     m_backButtonTouchUpEvent   = new FCTouchEvent(backButtonTouchUp);
 }
Example #16
0
 /// <summary>
 /// 创建下拉列表
 /// </summary>
 public FCComboBox()
 {
     m_dropDownButtonTouchDownEvent = new FCTouchEvent(dropDownButtonTouchDown);
     m_menuItemClickEvent           = new FCMenuItemTouchEvent(menuItemClick);
     m_menuKeyDownEvent             = new FCKeyEvent(MenuKeyDown);
 }
Example #17
0
 /// <summary>
 /// 创建日期控件
 /// </summary>
 public FCDateTimePicker()
 {
     m_dropDownButtonTouchDownEvent = new FCTouchEvent(DropDownButtonTouchDown);
     m_selectedTimeChangedEvent     = new FCEvent(selectedTimeChanged);
 }
Example #18
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;
                }
                }
            }
        }