Ejemplo n.º 1
0
        /// <summary>
        /// 表格选中行改变方法
        /// </summary>
        public void onGridSelectedRowsChanged()
        {
            ArrayList <FCTreeNode> selectedNodes = m_tvTypes.SelectedNodes;
            int selectedNodesSize = selectedNodes.Count;

            if (selectedNodesSize > 0)
            {
                FCTreeNode            node = selectedNodes[0];
                String                name = node.Name.Replace("node_", "");
                ArrayList <FCGridRow> rows = m_gridTemplate.m_rows;
                int rowsSize = rows.Count;
                ArrayList <FCGridRow> selectedRows = new ArrayList <FCGridRow>();
                if (name.IndexOf('_') != -1)
                {
                    String language = name.Substring(0, name.IndexOf('_'));
                    String platform = name.Substring(name.IndexOf('_') + 1);
                    for (int i = 0; i < rowsSize; i++)
                    {
                        FCGridRow row = rows[i];
                        if (row.getCell("COLT2").getString() == language &&
                            row.getCell("COLT3").getString() == platform)
                        {
                            if (selectedRows.Count == 0)
                            {
                                selectedRows.Add(row);
                            }
                            row.Visible = true;
                        }
                        else
                        {
                            row.Visible = false;
                        }
                    }
                }
                else
                {
                    for (int i = 0; i < rowsSize; i++)
                    {
                        FCGridRow row = rows[i];
                        if (row.getCell("COLT2").getString() == name)
                        {
                            if (selectedRows.Count == 0)
                            {
                                selectedRows.Add(row);
                            }
                            row.Visible = true;
                        }
                        else
                        {
                            row.Visible = false;
                        }
                    }
                }
                m_gridTemplate.VScrollBar.Pos = 0;
                m_gridTemplate.SelectedRows   = selectedRows;
                m_gridTemplate.update();
                m_gridTemplate.invalidate();
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 触摸移动方法
 /// </summary>
 /// <param name="touchInfo">触摸信息</param>
 public override void onTouchMove(FCTouchInfo touchInfo)
 {
     base.onTouchMove(touchInfo);
     if (m_allowResize)
     {
         FCPoint mp = touchInfo.m_firstPoint;
         if (m_resizeState > 0)
         {
             FCPoint curPoint = Native.TouchPoint;
             int     newWidth = m_beginWidth + (curPoint.x - m_touchDownPoint.x);
             if (newWidth > 0)
             {
                 if (m_resizeState == 1)
                 {
                     Grid.getColumn(m_index - 1).Width = newWidth;
                 }
                 else if (m_resizeState == 2)
                 {
                     Width = newWidth;
                 }
             }
             if (m_grid != null)
             {
                 m_grid.update();
                 m_grid.invalidate();
             }
         }
         else
         {
             if ((m_index > 0 && mp.x < 5) || mp.x > Width - 5)
             {
                 Cursor = FCCursors.SizeWE;
             }
             else
             {
                 Cursor = FCCursors.Arrow;
             }
         }
         if (IsDragging)
         {
             Cursor = FCCursors.Arrow;
         }
     }
 }
Ejemplo n.º 3
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;
                    }
                }
            }
        }