コード例 #1
0
ファイル: Form1.cs プロジェクト: xcui4/ConsoleSample
        private void printButton_Click(object sender, EventArgs e)
        {
            try
            {
                streamToPrint = new StreamReader("C:\\MyFile.txt");
                try
                {
                    //var pd = new PrintDocument();
                    //pd.PrintPage += PdPrintPage;
                    //pd.Print();

                    var gridControlBase = new GridControlBase();
                    var gpd = new GridPrintDocument(gridControlBase);
                    gpd.PrintPage += PdPrintPage;

                    gpd.Print();
                }
                finally
                {
                    streamToPrint.Close();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
 public едакторЯчеек_МногострочныйРедактор_Renderer(GridControlBase grid, GridCellModelBase cellModel) : base(grid, cellModel)
 {
     this.drawПолеМногострРедактора = new ВыпадающийТекст();
     this.editПолеМногострРедактора = new ВыпадающийТекст();
     this.editПолеМногострРедактора.EditValueChanged += new EventHandler(this.editПолеМногострРедактора_EditValueChanged);
     base.SupportsFocusControl = true;
     base.FixControlParent(this.drawПолеМногострРедактора);
     base.SetControl(this.editПолеМногострРедактора);
 }
 public едакторЯчеек_РедакторВремени_Renderer(GridControlBase grid, GridCellModelBase cellModel) : base(grid, cellModel)
 {
     this.drawРедакторВремени = new TimeEdit();
     this.editРедакторВремени = new TimeEdit();
     this.editРедакторВремени.EditValueChanged += new EventHandler(this.editПолеВыбораДаты_EditValueChanged);
     base.SupportsFocusControl = true;
     base.FixControlParent(this.drawРедакторВремени);
     base.SetControl(this.editРедакторВремени);
 }
コード例 #4
0
ファイル: SelectionTrigger.cs プロジェクト: Abbas1546/WPF
        protected override void Invoke(object parameter)
        {
            var selectionchkbox = this.AssociatedObject as CheckBox;

            selectionchkbox.Checked   += new System.Windows.RoutedEventHandler(selectionchkbox_Checked);
            selectionchkbox.Unchecked += new System.Windows.RoutedEventHandler(selectionchkbox_Unchecked);
            this.grid = ((this.AssociatedObject as CheckBox).DataContext as SpreadsheetControl).GridProperties.ActiveSpreadsheetGrid;
            this.grid.Model.GraphicModel.GraphicQueryCellInfo += new GraphicQueryCellInfoEventHandler(GraphicModel_GraphicQueryCellInfo);
        }
コード例 #5
0
 public TreeCellRenderer(GridControlBase grid, GridCellModelBase cellModel)
     : base(grid, cellModel)
 {
     _indentSize  = 20;
     bitmapWidth  = 20;
     bitmapHeight = 17;
     nodeList     = new Hashtable();
     nodeList.Add(this.Grid.Model[1, 3].Text, "Added");
 }
コード例 #6
0
        private void gridDataBoundGrid1_CurrentCellActivated(object sender, EventArgs e)
        {
            GridControlBase grid = sender as GridControlBase;

            if (grid != null)
            {
                grid.CurrentCell.ScrollInView();
            }
        }
コード例 #7
0
        /// <summary>
        /// Initializes a new <see cref="GridCellRendererBase"/> object for the given GridControlBase
        /// and <see cref="GridCellModelBase"/>.
        /// </summary>
        /// <param name="grid">The <see cref="GridControlBase"/> that display this cell renderer.</param>
        /// <param name="cellModel">The <see cref="GridCellModelBase"/> that holds data for this cell renderer that should
        /// be shared among views.</param>
        /// <remarks>References to GridControlBase,
        /// and GridCellModelBase will be saved.</remarks>
        public GridDataBoundTreeCellRenderer(GridControlBase grid, GridCellModelBase cellModel, TreeGridHelper helper)
            : base(grid, cellModel)
        {
            AddButton(new GridDataBoundTreeCellButton(this, helper));

            lineColor = Color.Black;

            this.treeHelper = helper;
        }
コード例 #8
0
 private void Hook(GridControlBase grid)
 {
     if (!Grids.Contains(grid))
     {
         Grids.Add(grid);
         grid.CurrentCellChanged += new GridRoutedEventHandler(grid_CurrentCellChanged);
         grid.CurrentCellMoved   += new GridCurrentCellMovedEventHandler(grid_CurrentCellMoved);
         grid.IsVisibleChanged   += new DependencyPropertyChangedEventHandler(grid_IsVisibleChanged);
     }
 }
コード例 #9
0
        public override void InvokeAction(object sender, EventArgs e)
        {
            GridControlBase grid = ActiveGrid;

            if (grid != null)
            {
                GridRangeInfo range = grid.Model.Selections.Ranges.ActiveRange;
                grid.Model.CoveredRanges.Add(range);
            }
        }
コード例 #10
0
		public override void InvokeAction(object sender, EventArgs e)
		{
			GridControlBase grid = ActiveGrid;
			if (grid != null)
			{
				PropertyForm form = new PropertyForm(grid.Model.Properties);
				form.ShowDialog();
				grid.Model.Refresh();
			}
		}
コード例 #11
0
        public override void InvokeAction(object sender, EventArgs e)
        {
            GridControlBase grid = ActiveGrid;

            if (grid != null)
            {
                GridBaseStylesMap.ShowGridBaseStylesMapDialog(grid.Model, "BaseStylesMap");
                grid.Model.Refresh();
            }
        }
コード例 #12
0
        void tb_GotFocus(object sender, System.Windows.RoutedEventArgs e)
        {
            GridControlBase grid = lastGridWithFocus;

            if (grid != null)
            {
                GridCurrentCell cc = grid.CurrentCell;
                cc.BeginEdit();
            }
        }
コード例 #13
0
        void tb_LostFocus(object sender, RoutedEventArgs e)
        {
            GridControlBase grid = lastGridWithFocus;

            if (grid != null)
            {
                GridCurrentCell cc = grid.CurrentCell;
                cc.EndEdit();
            }
        }
コード例 #14
0
 public void Unwire()
 {
     GridControlBase[] allGrids = new GridControlBase[Grids.Count];
     allGrids = Grids.ToArray();
     foreach (GridControlBase grid in allGrids)
     {
         Unhook(grid);
     }
     UnhookTextBox();
 }
コード例 #15
0
        public override void InvokeAction(object sender, EventArgs e)
        {
            GridControlBase grid = ActiveGrid;

            if (grid != null)
            {
                grid.Selections.Clear();
                grid.Selections.Add(GridRangeInfo.Table());
            }
        }
コード例 #16
0
        public override void InvokeAction(object sender, EventArgs e)
        {
            GridControlBase grid = ActiveGrid;

            if (grid != null)
            {
                grid.Model.Properties.BlackWhite = !grid.Model.Properties.BlackWhite;
                grid.Model.Refresh();
            }
        }
コード例 #17
0
        void grid_CurrentCellActivated(object sender, SyncfusionRoutedEventArgs args)
        {
            GridControlBase current_cell = args.Source as GridControlBase;

            if (grid.Model[current_cell.CurrentCell.RowIndex, current_cell.CurrentCell.ColumnIndex].CellType == "IntegerEdit")
            {
                g = grid.Model[current_cell.CurrentCell.RowIndex, current_cell.CurrentCell.ColumnIndex];
                SetSeperatorText();
                SetNumberOfDigitsText();
            }
        }
コード例 #18
0
		public override void InvokeAction(object sender, EventArgs e)
		{
            GridControlBase grid = ActiveGrid;
            if (grid != null)
            {
                foreach (GridRangeInfo range in grid.Model.Selections)
                {
                    grid.Model.RowHeights.ResizeToFit(range, GridResizeToFitOptions.ResizeCoveredCells);
                }
            }
        }
コード例 #19
0
        public LinkLabelCellRenderer(GridControlBase grid, GridCellModelBase cellModel)
            : base(grid, cellModel)
        {
            _isMouseDown = false;
            _drawHotLink = false;

            _hotColor     = Color.Red;
            _visitedColor = Color.Purple;

            _EXEname = "iexplore.exe";
        }
コード例 #20
0
		public override void InvokeAction(object sender, EventArgs e)
		{
			GridControlBase grid = ActiveGrid;
			if (grid != null)
			{
				grid.Model.Options.TransparentBackground = false;
				grid.SupportsTransparentBackColor = false;
				grid.BackgroundImage = null;
				grid.BackColor = Color.White;
			}
		}
コード例 #21
0
        void grid_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
        {
            GridControlBase grid = sender as GridControlBase;

            if (grid != null)
            {
                lastGridWithFocus = grid;
                GridCurrentCell cc = grid.CurrentCell;
                FormulaBox.Text = grid.Model[cc.CellRowColumnIndex.RowIndex, cc.CellRowColumnIndex.ColumnIndex].Text;
            }
        }
コード例 #22
0
        void grid_CurrentCellActivated(object sender, SyncfusionRoutedEventArgs args)
        {
            GridControlBase current_cell = args.Source as GridControlBase;

            if (grid.Model[current_cell.CurrentCell.RowIndex, current_cell.CurrentCell.ColumnIndex].CellType == "DateTimeEdit")
            {
                g = grid.Model[current_cell.CurrentCell.RowIndex, current_cell.CurrentCell.ColumnIndex];
                SetTheDateTimeFormatCombo();
                SetTheCultureInfoFormatCombo();
            }
        }
コード例 #23
0
 public SliderCellRenderer(GridControlBase grid, GridCellModelBase cellModel)
     : base(grid, cellModel)
 {
     cm = (SliderCellModel)cellModel;
     SupportsFocusControl = true;
     FixControlParent(drawSlider);
     SetControl(editSlider);
     editSlider.AutoSize      = false;
     editSlider.ValueChanged += new EventHandler(trackBar_ValueChanged);
     cm.trackBarControlSize   = drawSlider.Size;
 }
コード例 #24
0
 public GridFillSeriesMouseController(GridControlBase grid)
 {
     this.grid          = grid;
     this.Filltype      = SeriesType.FillSeries | SeriesType.CopySeries | SeriesType.FillFormatOnly | SeriesType.FillWithoutFormat;
     this.InnerFillType = SeriesType.CopySeries;
     this.Gridmodel.Options.ExcelLikeCurrentCell    = true;
     this.Gridmodel.Options.ExcelLikeSelectionFrame = true;
     this.Gridmodel.Options.AllowSelection          = GridSelectionFlags.Any;
     this.Gridmodel.Options.ListBoxSelectionMode    = GridSelectionMode.None;
     this.grid.SelectionChanged += new GridSelectionChangedEventHandler(grid_SelectionChanged);
 }
コード例 #25
0
 public едакторЯчеек_ВыборДаты_Renderer(GridControlBase grid, GridCellModelBase cellModel) : base(grid, cellModel)
 {
     this.drawПолеВыбораДаты = new ПолеВыбораДаты();
     this.editПолеВыбораДаты = new ПолеВыбораДаты();
     this.drawПолеВыбораДаты.НазначитьКнопки();
     this.editПолеВыбораДаты.EditValueChanged += new EventHandler(this.editПолеВыбораДаты_EditValueChanged);
     this.editПолеВыбораДаты.НазначитьКнопки();
     base.SupportsFocusControl = true;
     base.FixControlParent(this.drawПолеВыбораДаты);
     base.SetControl(this.editПолеВыбораДаты);
 }
コード例 #26
0
		public override void InvokeAction(object sender, EventArgs e)
        {
            GridControlBase grid = ActiveGrid;
            if (grid != null)
            {
                int rowIndex, colIndex;
                if (grid.CurrentCell.GetCurrentCell(out rowIndex, out colIndex))
                {
					grid.Model.Cols.InsertRange(colIndex, 1, null);
				}
            }
        }
コード例 #27
0
        public DropDownUserCellRenderer(GridControlBase grid, GridCellModelBase cellModel)
            : base(grid, cellModel)
        {
            this.ddUser         = ((DropDownUserCellModel)this.Model).ddUser;
            this.ddUser.Visible = false;
            DropDownPart        = new GridDropDownCellImp(this);
            DropDownButton      = new GridCellComboBoxButton(this);

            //hook the usercontrol save and cancel events...
            this.ddUser.UserControlSave   += new EventHandler(user_Save);
            this.ddUser.UserControlCancel += new EventHandler(user_Cancel);
        }
コード例 #28
0
 public DragButtonCellRenderer(GridControlBase grid, GridCellModelBase cellModel)
     : base(grid, cellModel)
 {
     mybuttons = new CellDragButton[3];
     for (int n = 0; n < 3; n++)
     {
         mybuttons[n] = new CellDragButton(this);
         AddButton(mybuttons[n]);
     }
     mybuttons[1].Interior = new BrushInfo(GradientStyle.PathEllipse, Color.FromArgb(0xde, 0x64, 0x13), Color.White);
     mybuttons[2].Interior = new BrushInfo(PatternStyle.SmallCheckerBoard, Color.FromArgb(255, 187, 111), Color.White);              //.FromArgb( 0xff, 0xbf, 0x34 ));
 }
        private GridStyleInfo GetStyle(GridCellInfo cellInfo)
        {
            var currentCellRowIndex = new RowColumnIndex(cellInfo.RowIndex, cellInfo.ColumnIndex);

            this.grid = GetGrid(cellInfo.GridName);
            var cc = this.grid.CoveredCells.GetCellSpan(cellInfo.RowIndex, cellInfo.ColumnIndex);

            if (cc != null)
            {
                currentCellRowIndex = new RowColumnIndex(cellInfo.RowIndex, cc.Left);
            }
            return(this.grid.GetRenderStyleInfo(currentCellRowIndex.RowIndex, currentCellRowIndex.ColumnIndex));
        }
コード例 #30
0
        void grid_CurrentCellMoved(object sender, GridCurrentCellMovedEventArgs e)
        {
            inCurrentCellMoved = true;
            GridControlBase grid = sender as GridControlBase;

            if (grid != null)
            {
                lastGridWithFocus = grid;
                GridCurrentCell cc = grid.CurrentCell;
                FormulaBox.Text = grid.Model[cc.CellRowColumnIndex.RowIndex, cc.CellRowColumnIndex.ColumnIndex].Text;
            }
            inCurrentCellMoved = false;
        }
コード例 #31
0
		public override void InvokeAction(object sender, EventArgs e)
		{
			GridControlBase grid = ActiveGrid;
			if (grid != null)
			{
				grid.SupportsTransparentBackColor = !grid.SupportsTransparentBackColor;
				if (grid.SupportsTransparentBackColor)
					grid.Model.TableStyle.Interior = new BrushInfo(Color.FromArgb(50, Color.White));
				else
					grid.Model.TableStyle.ResetInterior();
				grid.Model.Options.TransparentBackground = !grid.SupportsTransparentBackColor && grid.BackgroundImage == null;
			}
		}