public FerretPanel() { control = new FerretControl(this, FerretControl.incomingStatus()); var grid = new QGrid(); Content = grid; grid.addColumns(4); statusLabel = new Label { Content = "Currently in Unknown mode", FontSize = 24, VerticalAlignment = VerticalAlignment.Center }; dma = new QButton("DMA", () => control.onButtonPressed("DMA")) { Background = Brushes.SpringGreen, HorizontalAlignment = HorizontalAlignment.Stretch, MinWidth = 250, FontSize = 24, IsEnabled = false }; ticket = new QButton("Ticket", () => control.onButtonPressed("Ticket")) { Background = Brushes.Yellow, HorizontalAlignment = HorizontalAlignment.Stretch, MinWidth = 250, FontSize = 24, IsEnabled = false }; staged = new QButton("Stage", () => control.onButtonPressed("Stage")) { Background = Brushes.Red, HorizontalAlignment = HorizontalAlignment.Stretch, MinWidth = 250, FontSize = 24, IsEnabled = false }; grid.add(statusLabel, 0); grid.add(dma, 1); grid.add(ticket, 2); grid.add(staged, 3); }
public WorkbenchPanel() { runButton = new QButton("Historical", () => new Researcher(this).run(false)); liveButton = new QButton("Live", () => { endDatePicker.SelectedDate = null; new Researcher(this).run(true); }); loadSystemButton = new QButton("Load System", () => Researcher.loadSystem(this)); loadButton = new QButton("Load Settings", () => load(false)); saveButton = new QButton("Save Settings", saveSettings); showPlots = new QCheckBox("With Plots", true, isChecked => showPlots_ = isChecked) { FlowDirection = FlowDirection.RightToLeft, VerticalContentAlignment = VerticalAlignment.Center, VerticalAlignment = VerticalAlignment.Center }; runInNativeCurrencyBox = new QCheckBox(" Run In Native Currency ", false, isChecked => runInNativeCurrency_ = isChecked) { FlowDirection = FlowDirection.RightToLeft, VerticalContentAlignment = VerticalAlignment.Center, VerticalAlignment = VerticalAlignment.Center, HorizontalAlignment = HorizontalAlignment.Left }; setLayout(); buildParametersTable(); load(true); }
/// <summary> /// 按钮事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void ClickEvent(object sender, EventArgs e) { QButton button = (QButton)sender; //当前被点击的按钮 var qpList = SearchSells(button.QPoint); listQnode.Add(new Qnode { TSY = button.QPoint.TSY, Qpoints = qpList }); ShowCells(); }
public ReconPanel() { Producer <string> buttonText = () => "set LOG__VERBOSE " + (Log.verbose() ? "off" : "on"); QButton[] verboseButton = { null }; verboseButton[0] = new QButton(buttonText(), () => { bool newVerbose; LogC.flipVerbose(out newVerbose); runOnGuiThread(() => verboseButton[0].setText(buttonText())); }) { HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Top, Width = 250 }; var dockPanel = new QDockPanel { LastChildFill = false }; Content = dockPanel; dockPanel.add(verboseButton[0], Dock.Top); var executionConfigurationGrid = new QGrid { Height = 25 }; dockPanel.add(executionConfigurationGrid, Dock.Top); O.zeroTo(4, i => executionConfigurationGrid.addColumn(200)); var platformBox = new TextBox(); var routeBox = new TextBox(); var typeBox = new QComboBox("Future", selected => { var config = ExecutionConfigurationTable.currentConfiguration(selected); platformBox.Text = config.platform(); routeBox.Text = config.route(); }, O.list("Equity")); executionConfigurationGrid.add(typeBox, 0); executionConfigurationGrid.add(withLabel("Platform", platformBox), 1); executionConfigurationGrid.add(withLabel("Route", routeBox), 2); executionConfigurationGrid.add(new QButton("Set Current Execution Configuration", () => { var type = typeBox.selected("NA"); var platform = platformBox.Text; var route = routeBox.Text; ExecutionConfigurationTable.CONFIG.insert(type, platform, route); Db.commit(); Email.notification("Execution Configuration Changed for " + type + ": " + platform + ", " + route, "").sendTo("team"); alertUser("Configuration changed for " + type + " - don't forget to restart systems to pick up the change."); }) { Width = 200 }, 3); }
/// <summary> /// 展示队列中最后一个节点 /// </summary> public void ShowCells() { var qnode = listQnode.Last(); this.panel1.Controls.Clear();//清除面板 if (listQnode.Count > 1) { this.butIndex.Enabled = true; this.butSuper.Enabled = true; } else { this.butIndex.Enabled = false; this.butSuper.Enabled = false; } Label label = new Label(); label.Location = new Point(100, 10); label.Text = qnode.TSY; this.panel1.Controls.Add(label); if (qnode.Qpoints != null && qnode.Qpoints.Count > 0) { int xLocation = 100; //x轴位置 int yLocation = 50; //y轴位置 int butNum = 0; foreach (Qpoint qpoint in qnode.Qpoints) { QButton button = new QButton(); button.Location = new Point(xLocation, yLocation); button.Text = qpoint.Text; button.Click += ClickEvent; button.QPoint = qpoint; this.panel1.Controls.Add(button); yLocation += 30; butNum++; } } autoRecord = true; Naudio.GetInstance().PlayText(qnode.TSY); }