Beispiel #1
0
        public DataEntryField(DMIDataEntryValue field, int index, DataEntryWindow window, bool singleField)
        {
            Name            = field.Name;
            Field           = field;
            AcceptedValue   = PreviousValue = field.Value ?? "";
            Index           = index;
            DataEntryWindow = window;
            DMI             = DataEntryWindow.DMI;

            DataArea = new FieldDataArea(Name, !singleField, DMI);
            if (!singleField)
            {
                LabelArea     = new FieldLabelArea(Name, DMI);
                LabelEchoText = new DMIArea.TextPrimitive(new Point((int)(DataEntryWindow.LabelFont.MeasureString(Name) / DMI.Scale), 0), Color.White, Name, DataEntryWindow.LabelFont);
            }

            if (field.Keyboard.Type == DMIKeyboard.KeyboardType.Dedicate)
            {
                Keyboard = new DedicateKeyboard(field.Keyboard.KeyLabels, this);
            }
            else if (field.Keyboard.Type == DMIKeyboard.KeyboardType.Numeric)
            {
                Keyboard = new NumericKeyboard(this);
            }
            else if (field.Keyboard.Type == DMIKeyboard.KeyboardType.Alphanumeric)
            {
                Keyboard = new AlphanumericKeyboard(this);
            }

            DataArea.PressedAction    = () => DataEntryWindow.FieldSelected(Index);
            DataArea.ShowButtonBorder = false;

            UpdateText();
        }
Beispiel #2
0
 public void ScaleChanged()
 {
     Keyboard.Keys.ForEach(x => x.ScaleChanged());
     Keyboard.MoreKey.ScaleChanged();
     DataArea.ScaleChanged();
     if (LabelArea != null)
     {
         LabelArea.ScaleChanged();
         DataEchoText.Font = DataEntryWindow.LabelFont;
         LabelEchoText     = new DMIArea.TextPrimitive(new Point((int)(DataEntryWindow.LabelFont.MeasureString(Name) / DMI.Scale), 0), Color.White, Name, DataEntryWindow.LabelFont);
     }
 }
Beispiel #3
0
 private void UpdateText()
 {
     DataArea.BackgroundColor = Selected ? ColorMediumGrey : ColorDarkGrey;
     DataArea.SetText(CurrentValue, Selected ? Color.Black : (Accepted ? Color.White : ColorGrey));
     DataArea.UpdateCursor(CursorIndex);
     if (LabelEchoText != null)
     {
         string text;
         Color  color;
         if (TechnicalRangeInvalid || TechnicalResolutionInvalid)
         {
             text  = "++++";
             color = ColorRed;
         }
         else if (TechnicalCrossCheckInvalid)
         {
             text  = "????";
             color = ColorRed;
         }
         else if (OperationalRangeInvalid)
         {
             text  = "++++";
             color = ColorYellow;
         }
         else if (OperationalCrossCheckInvalid)
         {
             text  = "????";
             color = ColorYellow;
         }
         else
         {
             text  = AcceptedValue;
             color = Accepted ? Color.White : ColorGrey;
         }
         DataEchoText = new DMIArea.TextPrimitive(new Point(0, 0), color, text, DataEntryWindow.LabelFont);
     }
 }