Beispiel #1
0
        /// <summary>
        /// 控件添加方法
        /// </summary>
        public override void onLoad()
        {
            base.onLoad();
            //添加按钮
            FCHost host = Native.Host;

            if (m_addButton == null)
            {
                m_addButton = host.createInternalControl(this, "addbutton") as FCButton;
                m_addButton.addEvent(m_addButtonTouchDownEvent, FCEventID.TOUCHDOWN);
                m_addButton.addEvent(m_addButtonTouchUpEvent, FCEventID.TOUCHUP);
                addControl(m_addButton);
            }
            if (m_backButton == null)
            {
                m_backButton = host.createInternalControl(this, "backbutton") as FCButton;
                addControl(m_backButton);
            }
            if (m_reduceButton == null)
            {
                m_reduceButton = host.createInternalControl(this, "reducebutton") as FCButton;
                m_reduceButton.addEvent(m_reduceButtonTouchDownEvent, FCEventID.TOUCHDOWN);
                m_reduceButton.addEvent(m_reduceButtonTouchUpEvent, FCEventID.TOUCHUP);
                addControl(m_reduceButton);
            }
            if (m_scrollButton == null)
            {
                m_scrollButton           = host.createInternalControl(this, "scrollbutton") as FCButton;
                m_scrollButton.AllowDrag = true;
                m_scrollButton.addEvent(m_scrollButtonDraggingEvent, FCEventID.DRAGGING);
                m_backButton.addControl(m_scrollButton);
            }
        }
Beispiel #2
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);
            }
        }
Beispiel #3
0
        /// <summary>
        /// 添加控件方法
        /// </summary>
        public override void onLoad()
        {
            bool     isAdd      = false;
            FCButton backButton = BackButton;

            if (backButton != null)
            {
                isAdd = true;
            }
            base.onLoad();
            if (!isAdd)
            {
                backButton = BackButton;
                backButton.addEvent(m_backButtonTouchDownEvent, FCEventID.TOUCHDOWN);
                backButton.addEvent(m_backButtonTouchUpEvent, FCEventID.TOUCHUP);
            }
        }
Beispiel #4
0
 /// <summary>
 /// 添加控件方法
 /// </summary>
 public override void onLoad()
 {
     base.onLoad();
     if (m_tabControl != null)
     {
         if (m_headerButton == null)
         {
             FCHost host = Native.Host;
             m_headerButton = host.createInternalControl(this, "headerbutton") as FCButton;
             m_headerButton.addEvent(m_dragHeaderBeginEvent, FCEventID.DRAGBEGIN);
             m_headerButton.addEvent(m_dragHeaderEndEvent, FCEventID.DRAGEND);
             m_headerButton.addEvent(m_draggingHeaderEvent, FCEventID.DRAGGING);
             m_headerButton.addEvent(m_headerTouchDownEvent, FCEventID.TOUCHDOWN);
         }
         if (!m_tabControl.containsControl(m_headerButton))
         {
             m_tabControl.addControl(m_headerButton);
         }
     }
 }
Beispiel #5
0
 /// <summary>
 /// 添加控件方法
 /// </summary>
 public override void onLoad()
 {
     base.onLoad();
     if (m_splitter == null)
     {
         FCHost host = Native.Host;
         m_splitter = host.createInternalControl(this, "splitter") as FCButton;
         m_splitter.addEvent(m_splitterDraggingEvent, FCEventID.DRAGGING);
         addControl(m_splitter);
     }
     m_oldSize = Size;
 }
Beispiel #6
0
        /// <summary>
        /// 添加控件方法
        /// </summary>
        public override void onLoad()
        {
            base.onLoad();
            FCHost host = Native.Host;

            if (m_downButton == null)
            {
                m_downButton = host.createInternalControl(this, "downbutton") as FCButton;
                m_downButton.addEvent(m_downButtoTouchDownEvent, FCEventID.TOUCHDOWN);
                m_downButton.addEvent(m_downButtoTouchUpEvent, FCEventID.TOUCHUP);
                addControl(m_downButton);
            }
            if (m_upButton == null)
            {
                m_upButton = host.createInternalControl(this, "upbutton") as FCButton;
                m_upButton.addEvent(m_upButtonTouchDownEvent, FCEventID.TOUCHDOWN);
                m_upButton.addEvent(m_upButtonTouchUpEvent, FCEventID.TOUCHUP);
                addControl(m_upButton);
            }
            update();
        }
Beispiel #7
0
 /// <summary>
 /// 添加控件方法
 /// </summary>
 public override void onLoad()
 {
     base.onLoad();
     if (m_dropDownButton == null)
     {
         FCHost host = Native.Host;
         m_dropDownButton = host.createInternalControl(this, "dropdownbutton") as FCButton;
         addControl(m_dropDownButton);
         m_dropDownButton.addEvent(m_dropDownButtonTouchDownEvent, FCEventID.TOUCHDOWN);
     }
     if (m_dropDownMenu != null)
     {
         m_dropDownMenu.Native = Native;
     }
 }
Beispiel #8
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]);
            }
        }
Beispiel #9
0
        /// <summary>
        /// 添加控件方法
        /// </summary>
        public override void onLoad()
        {
            base.onLoad();
            FCHost host = Native.Host;

            if (m_dropDownButton == null)
            {
                m_dropDownButton = host.createInternalControl(this, "dropdownbutton") as FCButton;
                addControl(m_dropDownButton);
                m_dropDownButton.addEvent(m_dropDownButtonTouchDownEvent, FCEventID.TOUCHDOWN);
            }
            if (m_dropDownMenu == null)
            {
                m_dropDownMenu = host.createInternalControl(this, "dropdownmenu") as FCComboBoxMenu;
                Native.addControl(m_dropDownMenu);
                m_dropDownMenu.Visible = false;
                m_dropDownMenu.addEvent(m_menuItemClickEvent, FCEventID.MENUITEMCLICK);
                m_dropDownMenu.addEvent(m_menuKeyDownEvent, FCEventID.KEYDOWN);
            }
            else
            {
                m_dropDownMenu.Native = Native;
            }
        }