Esempio n. 1
0
 public ButtonCell GetButtonCell(MultiRowContentAlignment align = MultiRowContentAlignment.MiddleCenter)
 {
     return(new ButtonCell()
     {
         Style = GetDefaultCellStyle(align)
     });
 }
Esempio n. 2
0
        private GcDateTimeCell GetDateCellEditBase(MultiRowContentAlignment align, bool isInput, string format = "yyyy/MM/dd")
        {
            var cell = new GcDateTimeCell();

            cell.Fields.Clear();
            cell.DisplayFields.Clear();
            cell.HighlightText  = GrapeCity.Win.Editors.HighlightText.All;
            cell.Spin.AllowSpin = false;
            cell.ShortcutKeys.Remove(Keys.F2);
            cell.ShortcutKeys.Remove(Keys.F4);
            cell.ShortcutKeys.Remove(Keys.F5);
            cell.SideButtons[0].BackColor = SystemColors.Control;
            cell.Style = GetDefaultCellStyle(align);
            if (isInput)
            {
                cell.Style.DataSourceNullValue = null;
            }
            else
            {
                cell.SideButtons.Clear();
            }
            if (!string.IsNullOrEmpty(format))
            {
                cell.Fields.AddRange(format);
            }
            return(cell);
        }
Esempio n. 3
0
        public ComboBoxCell GetComboBoxCell(MultiRowContentAlignment align = MultiRowContentAlignment.MiddleLeft)
        {
            var cell = new ComboBoxCell();

            cell.FlatStyle     = FlatStyle.Flat;
            cell.DropDownStyle = MultiRowComboBoxStyle.DropDownList;
            cell.Style         = GetDefaultCellStyle(align);
            return(cell);
        }
Esempio n. 4
0
 public HeaderCell GetHeaderCell(MultiRowContentAlignment align = MultiRowContentAlignment.MiddleCenter)
 {
     return(new HeaderCell()
     {
         FlatStyle = FlatStyle.System,
         Style = new CellStyle
         {
             BackColor = SystemColors.Control,
             Font = Font,
             TextAlign = align
         }
     });
 }
Esempio n. 5
0
 private CellStyle GetDefaultCellStyle(MultiRowContentAlignment align, ImeMode imeMode = ImeMode.Disable)
 {
     return(new CellStyle()
     {
         Border = border,
         DisabledForeColor = Color.Black,
         Font = Font,
         ForeColor = Color.Black,
         ImeMode = imeMode,
         //InputScope = GetInputScope(imeMode),
         ImeSentenceMode = ImeSentenceMode.Normal,
         Padding = new Padding(2, -1, 2, -1),
         TextEffect = TextEffect.Flat,
         TextAlign = align,
         WordWrap = MultiRowTriState.False
     });
 }
Esempio n. 6
0
        public GcNumberCell GetNumberCell(MultiRowContentAlignment align = MultiRowContentAlignment.MiddleRight,
                                          string fieldFormat             = "#,###,###,###,###", string displayFormat = "#,###,###,###,##0")
        {
            var cell = new GcNumberCell();

            cell.ExitOnArrowKey = true;
            cell.Fields.SetFields(fieldFormat, "", "", "-", "");
            cell.DisplayFields.AddRange(displayFormat, "", "", "-", "");
            cell.Fields.IntegerPart.MinDigits = 1;
            cell.FlatStyle      = FlatStyle.Flat;
            cell.Spin.AllowSpin = false;
            cell.ShortcutKeys.Remove(Keys.F2);
            cell.ShortcutKeys.Remove(Keys.F4);
            cell.Style = GetDefaultCellStyle(align);
            cell.SideButtons.Clear();
            cell.MaxValue       = 9999999999999M;
            cell.MinValue       = -9999999999999M;
            cell.MaxMinBehavior = GrapeCity.Win.Editors.MaxMinBehavior.AdjustToMaxMin;
            return(cell);
        }
Esempio n. 7
0
        public GcTextBoxCell GetTextBoxCell(MultiRowContentAlignment align = MultiRowContentAlignment.MiddleLeft
                                            , ImeMode ime = ImeMode.NoControl, string format = null, int?maxLength = null, bool isNumberCell = false
                                            , GrapeCity.Win.Editors.LengthUnit maxLengthUnit = GrapeCity.Win.Editors.LengthUnit.Char)
        {
            var cell = !isNumberCell
                ? new GcTextBoxCell()
                : new GcNumberTextBoxCell();

            cell.AutoComplete.CandidateListItemFont = Font;
            cell.AutoComplete.HighlightStyle.Font   = Font;
            cell.Format = format;
            if (maxLength.HasValue)
            {
                cell.MaxLength = maxLength.Value;
            }
            cell.ExitOnArrowKey = true;
            cell.ShortcutKeys.Remove(Keys.F2);
            cell.ShortcutKeys.Remove(Keys.F4);
            cell.Style         = GetDefaultCellStyle(align, ime);
            cell.MaxLengthUnit = maxLengthUnit;
            return(cell);
        }
Esempio n. 8
0
 public GcDateTimeCell GetDateCell_yyyyMMdd_Jp(MultiRowContentAlignment align = MultiRowContentAlignment.MiddleCenter, bool isInput = false)
 => GetDateCellEditBase(align, isInput, "yyyy年MM月dd日");
Esempio n. 9
0
 public GcDateTimeCell GetDateCell_MMdd(MultiRowContentAlignment align = MultiRowContentAlignment.MiddleCenter, bool isInput = false)
 => GetDateCellEditBase(align, isInput, "MM/dd");
Esempio n. 10
0
 public GcDateTimeCell GetDateCell_yyyyMMddHHmmss(MultiRowContentAlignment align = MultiRowContentAlignment.MiddleCenter, bool isInput = false)
 => GetDateCellEditBase(align, isInput, "yyyy/MM/dd HH:mm:ss");