private void pocistiPlotBox() { var list = PlotBox.AllChildren; foreach (Gtk.Widget w in list) { PlotBox.Remove(w); } }
void SetupCornerBoxController(PlotBox box) { Color c = KnownColors.FromKnownColor(KnownColor.Orange); box.BackColor = new Color(100, c.R, c.G, c.B); //controllerBox1.dbugTag = 3; box.Visible = true; SetupCornerProperties(box); // _controls.Add(box); }
void TestSimplePlot1(AppHost host) { //------------ //create sample data //1. basic data=> a list of (x,y) point List <PointF> pointList = new List <PointF>(10); pointList.Add(new PointF(10 * 3, 20 * 3)); pointList.Add(new PointF(10 * 3, 80 * 3)); pointList.Add(new PointF(15 * 3, 30 * 3)); pointList.Add(new PointF(18 * 3, 40 * 3)); pointList.Add(new PointF(20 * 3, 20 * 3)); pointList.Add(new PointF(25 * 3, 25 * 3)); pointList.Add(new PointF(30 * 3, 10 * 3)); //2. from data create a presentation of that data int j = pointList.Count; List <PlotBox> plotBoxes = new List <PlotBox>(j); for (int i = 0; i < j; ++i) { PlotBox pt = new PlotBox(5, 5); PointF data = pointList[i]; pt.SetLocation((int)data.X, _chartHeight - (int)data.Y); //invertY pt.BackColor = Color.Red; plotBoxes.Add(pt); host.AddChild(pt); } //3. create connected line between each plotbox //... for (int i = 0; i < j - 1; ++i) { PlotBox p0 = plotBoxes[i]; PlotBox p1 = plotBoxes[i + 1]; PlotLine line = new PlotLine(p0, p1); host.AddChild(line); } }
public void UpdateControlPoints(PlotBox p0, PlotBox p1) { this.p0 = p0; this.p1 = p1; int m = _controls.Count; for (int n = 0; n < m; ++n) { _controls[n].RemoveSelf(); } _controls.Clear(); //*** _points.Clear(); //2. create new control points... }
public PlotsView(PlotBox control) { if (control.GetType().GetMethod("CreateGraphics") == null) { throw new CannotCreateGraphicsException("The control can't create a graphics object"); } c = control; PLOTTER_TRANSFORM_REGKEY = "plotter_transform_" + control.Name; c.Paint += C_Paint; c.MouseMove += C_MouseMove; c.MouseUp += C_MouseUp; c.MouseWheel += C_MouseWheel; c.MouseDown += C_MouseDown; c.KeyDown += C_KeyDown; wheelEndTimer.Interval = 30; wheelEndTimer.Tick += WheelEndTimer_Tick; }
void SetupCornerProperties(PlotBox cornerBox) { ////for controller box //cornerBox.MouseDrag += (s, e) => //{ // Point pos = cornerBox.Position; // int newX = pos.X + e.XDiff; // int newY = pos.Y + e.YDiff; // cornerBox.SetLocation(newX, newY); // //var targetBox = cornerBox.TargetBox; // //if (targetBox != null) // //{ // // //move target box too // // targetBox.SetLocation(newX + 5, newY + 5); // //} // e.CancelBubbling = true; // //then update the vxs shape //}; }
public PlotLine(PlotBox p0, PlotBox p1) { UpdateControlPoints(p0, p1); }
public MainWindow(PlotBox[] graphs) : base() { //MainWindow Proprieties this.SetDefaultSize(400, 400); //this.SetIconFromFile ("../../icons/main_icon.ico"); this.BorderWidth = 4; //background this.background = new Table(cellX, cellY, false); this.Add(background); background.RowSpacing = 10; background.ColumnSpacing = 10; //monitor this.monitorFrame = new Frame(); background.Attach(monitorFrame, 0, cellX - 1, 0, cellY - 1); this.monitor = new VBox(); monitorFrame.Add(monitor); this.monitorDeck = new VBox(); monitor.Add(monitorDeck); this.monitorSpace = new MonitorScrollableSpace(monitorDeck); //this.surface2d = new PlotSurface2D(); //int[] x = { 1, 3, 5, 7, 9, 11, 13 }; //int[] y = { 3, 4, 10, 11, 34, 1, 0 }; //test filler //Image[] prova = new Image[20]; //PlotWindow[] graphs = new PlotWindow[20]; this.graphs = graphs; for (int i = 0; i < numberOfBox; i++) { //prova[i] = new Image("../../icons/Heartbeat.jpg"); graphs[i] = new PlotBox(i + 1); monitorSpace.getContainer().PackStart(graphs[i], true, true, 4); monitorSpace.getContainer().Add(graphs[i]); } //warning this.warningFrame = new Frame(); background.Attach(warningFrame, 0, cellX, cellY - 1, cellY); this.warningBox = new VBox(); warningFrame.Add(warningBox); this.warningLabel = new Label(warningFillerText); warningBox.Add(warningLabel); //toolbar this.toolbarFrame = new Frame("Toolbar"); this.toolbar = new VBox(); background.Attach(toolbarFrame, cellX - 1, cellX, 0, cellY - 1); toolbarFrame.Add(toolbar); toolbar.Spacing = 10; //login this.loginFrame = new Frame("Account"); loginFrame.BorderWidth = 10; this.loginBox = new VBox(); this.loginButtonBox = new HButtonBox(); this.loginButton = new Button(); toolbar.PackStart(loginFrame, false, false, 20); toolbar.Add(loginFrame); loginFrame.Add(loginBox); loginBox.PackStart(loginButtonBox, false, false, 10); loginBox.Add(loginButtonBox); loginButtonBox.PackStart(loginButton, false, false, 0); loginButtonBox.Add(loginButton); //image button this.imageBox = new HBox(); this.accountImage = new Image("../../icons/account.png"); loginButton.Add(imageBox); imageBox.PackStart(accountImage, false, false, 3); imageBox.Add(accountImage); //accountImage.SetSizeRequest(128, 128); this.loginLabel = new Label(loginText); imageBox.PackStart(loginLabel, false, false, 0); imageBox.Add(loginLabel); //Buttons loginButton.Clicked += new EventHandler(OpenLoginWindow); }
protected void OnButtonStupcastiDijagram(object sender, EventArgs e) { pocistiPlotBox(); PlotBox.Add(PresenterStatistika.BarView(comboboxMjeseci.Active + 1, GodinaSpinbutton.ValueAsInt)); PlotBox.ShowAll(); }