Esempio n. 1
0
        public TableChildRendererBase(TableControl tableControl)
        {
            _tableControl     = tableControl;
            DisabledTextColor = SystemColors.GrayText;

            //row highlighting type default
            RowHighlitingStyle = RowHighlightType.BackgroundControls;
        }
Esempio n. 2
0
 /// <summary>
 /// constructor
 /// </summary>
 /// <param name="idx"></param>
 /// <param name="tableControl"></param>
 internal TableItem(int idx, TableControl tableControl)
 {
     _tableControl = tableControl;
     Idx           = idx;
     Controls      = null;
     IsValid       = true;
     RowBGColor    = Color.Empty;
     IsVisibe      = true;
 }
Esempio n. 3
0
 /// <summary>
 /// constructor
 /// </summary>
 /// <param name="table"></param>
 /// <param name="row"></param>
 /// <param name="columnIdx"></param>
 public TableEditor(TableControl table, int row, TableColumn column)
     : base(table)
 {
     RowIdx = row;
     Column = column;
     // Register TableControl.RowHeightChanged event so as to adjust the height
     // according to row height.
     table.RowHeightChanged += new EventHandler(OnRowHeightChanged);
 }
Esempio n. 4
0
 private void TableControlDesigner_ControlAdded(object sender, ControlEventArgs e)
 {
     // Record instance of control we're designing
     if (e.Control is TableControl)
     {
         tableControl = ((Control)Component).Controls[0] as TableControl;
         tableControl.CollectionChanged += new NotifyCollectionChangedEventHandler(tableControl_CollectionChanged);
         SetVerbStatus();
     }
 }
Esempio n. 5
0
        /// <summary>
        /// calculate editor bounds
        /// </summary>
        /// <returns></returns>
        public override Rectangle Bounds()
        {
            Rectangle rect = new Rectangle();

            if (_column != null)
            {
                rect = ((TableControl)parentControl).getCellRect(_column.Index, RowIdx);
                if (IsHeaderEditor)
                {
                    ICoordinator coordinator = BoundsComputer as ICoordinator;
                    if (coordinator != null)
                    {
                        if (coordinator.X < 0)
                        {
                            TableControl tableControl = (TableControl)parentControl;
                            // Defect# 130148: When a column is re-ordered with 1st column, then only use actual co-ordinates for X,
                            // otherwise this problem occurs i.e. control from 1st column remains at same location
                            if ((!(tableControl.RightToLeftLayout) && _column.Index == 0) ||
                                (tableControl.RightToLeftLayout && tableControl.ColumnCount - 1 == _column.Index))
                            {
                                rect.X = coordinator.X;
                            }
                        }
                        rect.Y = coordinator.Y < 0 ? coordinator.Y : 0;
                    }

                    rect.Height = Math.Abs(rect.Y) + ((TableControl)parentControl).Height;
                    if (((TableControl)parentControl).RightToLeftLayout)
                    {
                        rect.Width = rect.Width + rect.X;
                        rect.X     = 0;
                    }
                    else
                    {
                        rect.Width = parentControl.Bounds.Width - rect.X;
                    }
                }
            }

            // Defect 140258: If header control is hidden when column to which it is attached is hidden,
            // BoundsComputer is null. So return empty rectangle in this case.
            if (BoundsComputer != null)
            {
                return(BoundsComputer.computeEditorBounds(rect, IsHeaderEditor));
            }
            else
            {
                return(Rectangle.Empty);
            }
        }
Esempio n. 6
0
        public LogicalColumnHelper(TableControl tableControl, int mgColumnIdx, bool createTableColumn)
        {
            _tableControl = tableControl;
            _mgColumnIdx  = mgColumnIdx;
            _placement    = true;

            if (createTableColumn)
            {
                int insertIdx = _tableControl.RightToLeftLayout
                      ? 0
                      : _tableControl.Columns.Count;;
                _tableColumn = new TableColumn();
                _tableControl.Columns.Insert(insertIdx, _tableColumn);
                Visible = true;
            }
        }
Esempio n. 7
0
        internal static HeaderRenderer GetRenderer(TableControl tableControl, Header header)
        {
            switch (tableControl.ControlStyle)
            {
            case ControlStyle.TwoD:
                return(new TwoDStyleHeaderRenderer(tableControl, header));

            case ControlStyle.ThreeD:
                return(new ThreeDRaisedStyleHeaderRenderer(tableControl, header));

            case ControlStyle.Windows3d:
                return(new WindowsThreeDStyleHeaderRenderer(tableControl, header));

            default:
                return(new WindowsStyleHeaderRenderer(tableControl, header));
            }
        }
Esempio n. 8
0
        public override void Initialize(System.ComponentModel.IComponent component)
        {
            base.Initialize(component);

            // #297589. Do not show the grids on table control.
            BindingFlags bindingAttrs = BindingFlags.Instance | BindingFlags.NonPublic;
            Type         classType    = typeof(ParentControlDesigner);

            MemberInfo[] memberinfos = classType.GetMember("DrawGrid", bindingAttrs);
            PropertyInfo propInfo    = memberinfos[0] as PropertyInfo;

            propInfo.SetValue(this, false, null);

            // Record instance of control we're designing
            tableControl = (TableControl)component;

            // Hook up events
            //ISelectionService s = (ISelectionService)GetService(typeof(ISelectionService));
            IComponentChangeService c = (IComponentChangeService)GetService(typeof(IComponentChangeService));

            canParentProvider = new CanParentProvider(this);

            dragDropHandler = new TableControlDragDropHandler((Control)component, this.BehaviorService, (IDesignerHost)this.GetService(typeof(IDesignerHost)));
        }
Esempio n. 9
0
 public TableMultiColumnStrategyBase(TableControl tableControl)
 {
     this.tableControl = tableControl;
 }
Esempio n. 10
0
 public TableMultiColumnEnabledStrategy(TableControl tableControl)
     : base(tableControl)
 {
 }
Esempio n. 11
0
 public ThreeDStyleHeaderRenderer(TableControl tableControl, Header header) : base(tableControl, header)
 {
 }
Esempio n. 12
0
 public ThreeDRaisedStyleHeaderRenderer(TableControl tableControl, Header header) : base(tableControl, header)
 {
     header.BeforeSectionTrack += Header_BeforeSectionTrack;
     header.AfterSectionTrack  += Header_AfterSectionTrack;
 }
Esempio n. 13
0
 public TableEditor(TableControl table)
     : this(table, 0, null)
 {
 }
Esempio n. 14
0
 /// <summary>
 /// constructor
 /// </summary>
 /// <param name="table"></param>
 /// <param name="row"></param>
 /// <param name="columnIdx"></param>
 public TableEditor(TableControl table, int row, int columnIdx)
     : base(table)
 {
 }
Esempio n. 15
0
 public TableEditor(TableControl table)
     : this(table, 0, TableControl.TAIL_COLUMN_IDX)
 {
 }
Esempio n. 16
0
 public WindowsStyleHeaderRenderer(TableControl tableControl, Header header)
     : base(tableControl, header)
 {
 }
Esempio n. 17
0
 public TableColumns(TableControl tableControl)
 {
     this.tableControl = tableControl;
     Columns           = new ObservableCollection <TableColumn>();
 }
Esempio n. 18
0
 public HeaderRenderer(TableControl tableControl, Header header)
 {
     this.tableControl = tableControl;
     this.header       = header;
     UpdateTitleBrush();
 }