Esempio n. 1
0
        /// <summary>
        /// 字符转换为光标
        /// </summary>
        /// <param name="str">字符</param>
        /// <returns>光标</returns>
        public static FCCursors convertStrToCursor(String str)
        {
            str = str.ToLower();
            FCCursors cursor = FCCursors.Arrow;

            if (str == "appstarting")
            {
                cursor = FCCursors.AppStarting;
            }
            else if (str == "cross")
            {
                cursor = FCCursors.Cross;
            }
            else if (str == "hand")
            {
                cursor = FCCursors.Hand;
            }
            else if (str == "help")
            {
                cursor = FCCursors.Help;
            }
            else if (str == "ibeam")
            {
                cursor = FCCursors.IBeam;
            }
            else if (str == "no")
            {
                cursor = FCCursors.No;
            }
            else if (str == "sizeall")
            {
                cursor = FCCursors.SizeAll;
            }
            else if (str == "sizenesw")
            {
                cursor = FCCursors.SizeNESW;
            }
            else if (str == "sizens")
            {
                cursor = FCCursors.SizeNS;
            }
            else if (str == "sizenwse")
            {
                cursor = FCCursors.SizeNWSE;
            }
            else if (str == "sizewe")
            {
                cursor = FCCursors.SizeWE;
            }
            else if (str == "uparrow")
            {
                cursor = FCCursors.UpArrow;
            }
            else if (str == "waitcursor")
            {
                cursor = FCCursors.WaitCursor;
            }
            return(cursor);
        }
Esempio n. 2
0
        /// <summary>
        /// 触摸移动方法
        /// </summary>
        /// <param name="touchInfo">触摸信息</param>
        public override void onTouchMove(FCTouchInfo touchInfo)
        {
            callTouchEvents(FCEventID.TOUCHMOVE, touchInfo);
            FCGrid grid = Grid;

            if (m_band != null && grid != null)
            {
                FCPoint mp = touchInfo.m_firstPoint;
                if (AllowResize)
                {
                    ArrayList <FCBandedFCGridColumn> bandColumns = m_band.getColumns();
                    int columnsSize = bandColumns.size();
                    int index       = -1;
                    int width       = Width;
                    for (int i = 0; i < columnsSize; i++)
                    {
                        if (this == bandColumns.get(i))
                        {
                            index = i;
                            break;
                        }
                    }
                    if (m_resizeState > 0)
                    {
                        FCPoint curPoint = Native.TouchPoint;
                        int     newWidth = m_beginWidth + (curPoint.x - m_touchDownPoint.x);
                        if (newWidth > 0)
                        {
                            if (m_resizeState == 1)
                            {
                                FCBandedFCGridColumn leftColumn = bandColumns.get(index - 1);
                                int leftWidth = leftColumn.Width;
                                leftColumn.Width = newWidth;
                                width           += leftWidth - newWidth;
                                Width            = width;
                            }
                            else if (m_resizeState == 2)
                            {
                                Width = newWidth;
                                FCBandedFCGridColumn rightColumn = bandColumns.get(index + 1);
                                int rightWidth = rightColumn.Width;
                                rightWidth       += width - newWidth;
                                rightColumn.Width = rightWidth;
                            }
                        }
                        grid.invalidate();
                        return;
                    }
                    else
                    {
                        FCCursors oldCursor = Cursor;
                        FCCursors newCursor = oldCursor;
                        if ((index > 0 && mp.x < 5) || (index < columnsSize - 1 && mp.x > width - 5))
                        {
                            newCursor = FCCursors.SizeWE;
                        }
                        else
                        {
                            newCursor = FCCursors.Arrow;
                        }
                        if (oldCursor != newCursor)
                        {
                            Cursor = newCursor;
                            invalidate();
                        }
                    }
                    if (!IsDragging)
                    {
                        Cursor = FCCursors.Arrow;
                    }
                }
            }
        }
Esempio n. 3
0
 /// <summary>
 /// 设置光标
 /// </summary>
 /// <param name="cursor">光标</param>
 public abstract void setCursor(FCCursors cursor);
Esempio n. 4
0
        /// <summary>
        /// 光标转换为字符
        /// </summary>
        /// <param name="cursor">光标</param>
        /// <returns>字符</returns>
        public static String convertCursorToStr(FCCursors cursor)
        {
            String str = "";

            if (cursor == FCCursors.AppStarting)
            {
                str = "AppStarting";
            }
            else if (cursor == FCCursors.Arrow)
            {
                str = "Arrow";
            }
            else if (cursor == FCCursors.Cross)
            {
                str = "Cross";
            }
            else if (cursor == FCCursors.Hand)
            {
                str = "Hand";
            }
            else if (cursor == FCCursors.Help)
            {
                str = "Help";
            }
            else if (cursor == FCCursors.IBeam)
            {
                str = "IBeam";
            }
            else if (cursor == FCCursors.No)
            {
                str = "NO";
            }
            else if (cursor == FCCursors.SizeAll)
            {
                str = "SizeAll";
            }
            else if (cursor == FCCursors.SizeNESW)
            {
                str = "SizeNESW";
            }
            else if (cursor == FCCursors.SizeNS)
            {
                str = "SizeNS";
            }
            else if (cursor == FCCursors.SizeNWSE)
            {
                str = "SizeNWSE";
            }
            else if (cursor == FCCursors.SizeWE)
            {
                str = "SizeWE";
            }
            else if (cursor == FCCursors.UpArrow)
            {
                str = "UpArrow";
            }
            else if (cursor == FCCursors.WaitCursor)
            {
                str = "WaitCursor";
            }
            return(str);
        }
Esempio n. 5
0
 /// <summary>
 /// 设置光标
 /// </summary>
 /// <param name="cursor">光标</param>
 public override void setCursor(FCCursors cursor)
 {
     if (m_container != null)
     {
         FCCursors csr = cursor;
         if (csr == FCCursors.Arrow)
         {
             m_container.Cursor = Cursors.Arrow;
         }
         else if (csr == FCCursors.AppStarting)
         {
             m_container.Cursor = Cursors.AppStarting;
         }
         else if (csr == FCCursors.Cross)
         {
             m_container.Cursor = Cursors.Cross;
         }
         else if (csr == FCCursors.Hand)
         {
             m_container.Cursor = Cursors.Hand;
         }
         else if (csr == FCCursors.Help)
         {
             m_container.Cursor = Cursors.Help;
         }
         else if (csr == FCCursors.IBeam)
         {
             m_container.Cursor = Cursors.IBeam;
         }
         else if (csr == FCCursors.No)
         {
             m_container.Cursor = Cursors.No;
         }
         else if (csr == FCCursors.SizeAll)
         {
             m_container.Cursor = Cursors.SizeAll;
         }
         else if (csr == FCCursors.SizeNESW)
         {
             m_container.Cursor = Cursors.SizeNESW;
         }
         else if (csr == FCCursors.SizeNS)
         {
             m_container.Cursor = Cursors.SizeNS;
         }
         else if (csr == FCCursors.SizeNWSE)
         {
             m_container.Cursor = Cursors.SizeNWSE;
         }
         else if (csr == FCCursors.SizeWE)
         {
             m_container.Cursor = Cursors.SizeWE;
         }
         else if (csr == FCCursors.UpArrow)
         {
             m_container.Cursor = Cursors.UpArrow;
         }
         else if (csr == FCCursors.WaitCursor)
         {
             m_container.Cursor = Cursors.WaitCursor;
         }
     }
 }