Esempio n. 1
0
 public OneClickCell(PopupMenu popMenu)
     : base(String.Empty, editor)
 {
     base.AddController(popMenu);
 }
Esempio n. 2
0
 public OneClickTabCell(PopupMenu popMenu)
     : base(String.Empty, editor)
 {
     base.AddController(popMenu);
     base.View = view;
 }
Esempio n. 3
0
        public RuleGrid()
        {
            SpecialKeys = GridSpecialKeys.None | GridSpecialKeys.Enter | GridSpecialKeys.Escape | GridSpecialKeys.PageDownUp;
            SelectionMode = SourceGrid.GridSelectionMode.Row;
            BackColor = System.Drawing.SystemColors.Window;
            BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
            // padding-right = 4 for ellipse text drag-select

            ColumnsCount = 5;
            RowsCount = 1;
            FixedRows = 1;

            // Initialise custom editors
            emptyEditor = new EditorBase(typeof(int));
            emptyEditor.EnableEdit = false;

            readOnlyEditor = new EditorBase(typeof(String));
            readOnlyEditor.EnableEdit = false;

            //ruleTypeEditor = new SourceGrid.Cells.Editors.ComboBox(typeof(string));
            //ruleTypeEditor.StandardValues = new string[] { "Delete", "Copy", "Replace" };
            //ruleTypeEditor.EditableMode = SourceGrid.EditableMode.Focus | SourceGrid.EditableMode.SingleClick;
            //ruleTypeEditor.Control.DropDownStyle = ComboBoxStyle.DropDownList;

            emptyGray = new SourceGrid.Cells.Views.Cell();
            emptyGray.BackColor = System.Drawing.SystemColors.ControlDark;

            popMenu = new PopupMenu(this);

            //Header
            this[0, ColControl] = new SourceGrid.Cells.ColumnHeader(Textual.Enabled);
            this[0, ColType] = new SourceGrid.Cells.ColumnHeader(Textual.RuleType);
            this[0, ColDestination] = new SourceGrid.Cells.ColumnHeader(Textual.DestinationTag + "(?)");
            this[0, ColReplacement] = new SourceGrid.Cells.ColumnHeader(Textual.ReplacementText);
            this[0, ColPattern] = new SourceGrid.Cells.ColumnHeader(Textual.SearchPatterns);

            this.Columns[ColControl].AutoSizeMode = SourceGrid.AutoSizeMode.EnableAutoSize;
            this.Columns[ColType].AutoSizeMode = SourceGrid.AutoSizeMode.EnableAutoSize;
            this.Columns[ColDestination].AutoSizeMode = SourceGrid.AutoSizeMode.EnableAutoSize;
            this.Columns[ColReplacement].AutoSizeMode = SourceGrid.AutoSizeMode.EnableAutoSize;
            this.Columns[ColPattern].AutoSizeMode = SourceGrid.AutoSizeMode.Default | SourceGrid.AutoSizeMode.MinimumSize;

            this.Columns[ColPattern].MinimalWidth = 800;

            this.AutoStretchColumnsToFitWidth = true;
            //Columns.AutoSize(true);
            //ScrollBar = ScrollBars.Vertical;
            //this.VScroll = true;
            //this.SetVScrollBarVisible(true);

            this[0, ColDestination].ToolTipText = Textual.DestinationTagTooltip;
            SourceGrid.Cells.Controllers.ToolTipText toolTipController = new SourceGrid.Cells.Controllers.ToolTipText();
            toolTipController.IsBalloon = true;
            this[0, ColDestination].Controller.AddController(toolTipController);

            foreach(int i in new int[]{ColControl, ColType, ColDestination, ColReplacement, ColPattern})
            {
                this[0, i].RemoveController(this[0, i].FindController(typeof(SourceGrid.Cells.Controllers.SortableHeader)));
            }

            AutoSizeCells();
        }