public AnalogChannelDisplay() { SetSizeRequest(710, 50); label = new TouchLabel(); label.WidthRequest = 490; Put(label, 5, 0); label.Show(); textBox = new TouchTextBox(); textBox.WidthRequest = 175; textBox.TextChangedEvent += (sender, args) => { try { currentValue = Convert.ToSingle(args.text); ValueChanged(); } catch { ; } }; Put(textBox, 0, 20); textBox.Show(); progressBar = new TouchProgressBar(TouchOrientation.Horizontal); progressBar.WidthRequest = 425; progressBar.ProgressChangedEvent += (sender, args) => { currentValue = args.currentProgress * divisionSteps; ValueChanged(); }; Put(progressBar, 185, 20); progressBar.Show(); typeLabel = new TouchLabel(); typeLabel.Visible = false; typeLabel.WidthRequest = 200; typeLabel.textAlignment = TouchAlignment.Right; Put(typeLabel, 500, 0); forceButton = new TouchButton(); forceButton.SetSizeRequest(85, 30); forceButton.buttonColor = "grey4"; forceButton.text = "Force"; forceButton.ButtonReleaseEvent += OnForceReleased; Put(forceButton, 620, 20); forceButton.Show(); Show(); }
public BarPlotWidget(string name, string group, int row, int column) : base("BarPlot", name, group, row, column) { SetSizeRequest(100, 169); var box = new TouchGraphicalBox(100, 169); box.color = "grey4"; box.transparency = 0.1f; Put(box, 0, 0); nameLabel = new TouchLabel(); nameLabel.text = "Plot"; nameLabel.textColor = "grey3"; nameLabel.HeightRequest = 151; nameLabel.WidthRequest = 5; nameLabel.textAlignment = TouchAlignment.Center; nameLabel.textRender.textWrap = TouchTextWrap.Shrink; nameLabel.textRender.orientation = TouchOrientation.Vertical; Put(nameLabel, 82, 9); bar = new TouchProgressBar(); bar.colorBackground = "grey3"; bar.colorBackground.A = 0.15f; bar.SetSizeRequest(26, 161); Put(bar, 56, 4); fullScale = 100.0f; textBox = new TouchLabel(); textBox.SetSizeRequest(53, 30); textBox.textSize = 14; textBox.text = "0.0"; textBox.textColor = "pri"; textBox.textAlignment = TouchAlignment.Center; Put(textBox, 0, 49); }