Ejemplo n.º 1
0
        /// <summary>Initializes a new instance of the <see cref="SummaryView"/> class.</summary>
        public SummaryView(ViewBase owner) : base(owner)
        {
            topBox                      = new HBox();
            SummaryCheckBox             = new CheckBoxView(this);
            SummaryCheckBox.TextOfLabel = "Capture summary?";
            WarningCheckBox             = new CheckBoxView(this);
            WarningCheckBox.TextOfLabel = "Capture warning messages?";
            ErrorCheckBox               = new CheckBoxView(this);
            ErrorCheckBox.TextOfLabel   = "Capture error messages?";
            topBox.PackStart(SummaryCheckBox.MainWidget, false, false, 10);
            topBox.PackStart(WarningCheckBox.MainWidget, false, false, 10);
            topBox.PackStart(ErrorCheckBox.MainWidget, false, false, 10);

            middleBox          = new HBox();
            SimulationDropDown = new DropDownView(this);
            middleBox.PackStart(new Label("Simulation:"), false, false, 10);
            middleBox.PackStart(SimulationDropDown.MainWidget, true, true, 10);

            mainControl = new VBox();
            mainWidget  = mainControl;
            mainControl.PackStart(topBox, false, false, 0);
            mainControl.PackStart(middleBox, false, false, 0);
            HtmlView = new HTMLView(this);
            mainControl.PackEnd(HtmlView.MainWidget, true, true, 0);

            mainWidget.Destroyed += MainWidgetDestroyed;
        }
Ejemplo n.º 2
0
        /// <summary>Initializes a new instance of the <see cref="DataStoreView" /> class.</summary>
        public DataStoreView(ViewBase owner) : base(owner)
        {
            Builder builder = BuilderFromResource("ApsimNG.Resources.Glade.DataStoreView.glade");

            vbox1       = (VBox)builder.GetObject("vbox1");
            table1      = (Table)builder.GetObject("table1");
            hbox1       = (HBox)builder.GetObject("hbox1");
            _mainWidget = vbox1;
            gridView    = new GridView(this)
            {
                ReadOnly = true,
                CanGrow  = false
            };
            vbox1.PackStart(gridView.MainWidget, true, true, 0);
            vbox1.ReorderChild(hbox1, 2);
            dropDownView1 = new DropDownView(this);
            editView1     = new EditView(this);
            rowFilter     = new EditView(this);
            table1.Attach(dropDownView1.MainWidget, 1, 2, 0, 1);
            table1.Attach(editView1.MainWidget, 1, 2, 1, 2);
            table1.Attach(rowFilter.MainWidget, 1, 2, 2, 3);
            editView2 = new EditView(this);
            hbox1.PackStart(editView2.MainWidget, false, false, 0);
            _mainWidget.Destroyed += _mainWidget_Destroyed;
        }
Ejemplo n.º 3
0
 /// <summary>Initializes a new instance of the <see cref="TabbedMetDataView"/> class.</summary>
 public TabbedMetDataView(ViewBase owner) : base(owner)
 {
     Glade.XML gxml = new Glade.XML("ApsimNG.Resources.Glade.TabbedMetDataView.glade", "vbox1");
     gxml.Autoconnect(this);
     _mainWidget      = vbox1;
     graphViewSummary = new GraphView(this);
     alignSummary.Add(graphViewSummary.MainWidget);
     graphViewRainfall = new GraphView(this);
     vboxRainChart.PackEnd(graphViewRainfall.MainWidget);
     graphViewMonthlyRainfall = new GraphView(this);
     vboxRainMonthly.PackEnd(graphViewMonthlyRainfall.MainWidget);
     graphViewTemperature = new GraphView(this);
     vboxTemp.PackEnd(graphViewTemperature.MainWidget);
     graphViewRadiation = new GraphView(this);
     vboxRadn.PackEnd(graphViewRadiation.MainWidget);
     gridViewData          = new GridView(this);
     gridViewData.ReadOnly = true;
     alignData.Add(gridViewData.MainWidget);
     button1.Clicked            += OnButton1Click;
     spinStartYear.ValueChanged += OnGraphStartYearValueChanged;
     spinNYears.ValueChanged    += OnGraphShowYearsValueChanged;
     notebook1.SwitchPage       += TabControl1_SelectedIndexChanged;
     GraphStartYearMaxValue      = 2100;
     GraphStartYearMinValue      = 1900;
     GraphStartYearValue         = 2000;
     GraphShowYearsValue         = 1;
     worksheetCombo              = new DropDownView(this);
     alignment10.Add(worksheetCombo.MainWidget);
     worksheetCombo.IsVisible = true;
     worksheetCombo.Changed  += WorksheetCombo_Changed;
     _mainWidget.Destroyed   += _mainWidget_Destroyed;
 }
Ejemplo n.º 4
0
        /// <summary>
        /// Construtor
        /// </summary>
        public LegendView(ViewBase owner) : base(owner)
        {
            Builder builder = BuilderFromResource("ApsimNG.Resources.Glade.LegendView.glade");

            hbox1 = (HBox)builder.GetObject("hbox1");
            ComboBox combobox1        = (ComboBox)builder.GetObject("combobox1");
            ComboBox orientationCombo = (ComboBox)builder.GetObject("combobox2");

            listview   = (Gtk.TreeView)builder.GetObject("listview");
            mainWidget = hbox1;

            OrientationDropDown = new DropDownView(this, orientationCombo);
            PositionDropDown    = new DropDownView(this, combobox1);

            chkLegendInsideGraph          = (CheckButton)builder.GetObject("chkLegendInsideGraph");
            chkLegendInsideGraph.Toggled += OnToggleLegendInsideGraph;

            listview.Model = listModel;
            TreeViewColumn column = new TreeViewColumn();

            column.Title = "Series name";
            column.PackStart(listToggle, false);
            listRender.Editable = false;
            column.PackStart(listRender, true);
            column.SetAttributes(listToggle, "active", 0);
            column.SetAttributes(listRender, "text", 1);
            listview.AppendColumn(column);
            listToggle.Activatable = true;
            listToggle.Toggled    += OnItemChecked;
            mainWidget.Destroyed  += _mainWidget_Destroyed;
        }
Ejemplo n.º 5
0
        /// <summary>Initializes a new instance of the <see cref="SeriesView" /> class</summary>
        public SeriesView(ViewBase owner)
            : base(owner)
        {
            Glade.XML gxml = new Glade.XML("ApsimNG.Resources.Glade.SeriesView.glade", "vbox1");
            gxml.Autoconnect(this);
            _mainWidget = vbox1;

            graphView1 = new GraphView(this);
            vbox1.PackStart(graphView1.MainWidget, true, true, 0);

            dropDownView1 = new DropDownView(this);
            dropDownView2 = new DropDownView(this);
            dropDownView3 = new DropDownView(this);
            dropDownView4 = new DropDownView(this);
            dropDownView5 = new DropDownView(this);
            dropDownView6 = new DropDownView(this);
            dropDownView7 = new DropDownView(this);
            dropDownView8 = new DropDownView(this);
            dropDownView9 = new ColourDropDownView(this);
            dropDownView10 = new DropDownView(this);
            dropDownView11 = new DropDownView(this);

            checkBoxView1 = new CheckBoxView(this);
            checkBoxView1.TextOfLabel = "on top?";
            checkBoxView2 = new CheckBoxView(this);
            checkBoxView2.TextOfLabel = "on right?";
            checkBoxView3 = new CheckBoxView(this);
            checkBoxView3.TextOfLabel = "cumulative?";
            checkBoxView4 = new CheckBoxView(this);
            checkBoxView4.TextOfLabel = "cumulative?";
            checkBoxView5 = new CheckBoxView(this);
            checkBoxView5.TextOfLabel = "Show in legend?";
            checkBoxView6 = new CheckBoxView(this);
            checkBoxView6.TextOfLabel = "Include series name in legend?";

            editView1 = new EditView(this);

            table1.Attach(dropDownView1.MainWidget, 1, 2, 0, 1, AttachOptions.Fill, 0, 10, 2);
            table1.Attach(dropDownView2.MainWidget, 1, 2, 1, 2, AttachOptions.Fill, 0, 10, 2);
            table1.Attach(dropDownView3.MainWidget, 1, 2, 2, 3, AttachOptions.Fill, 0, 10, 2);
            table1.Attach(dropDownView5.MainWidget, 1, 2, 3, 4, AttachOptions.Fill, 0, 10, 2);
            table1.Attach(dropDownView4.MainWidget, 1, 2, 4, 5, AttachOptions.Fill, 0, 10, 2);
            table1.Attach(dropDownView6.MainWidget, 1, 2, 5, 6, AttachOptions.Fill, 0, 10, 2);
            table1.Attach(dropDownView7.MainWidget, 1, 2, 6, 7, AttachOptions.Fill, 0, 10, 2);
            table1.Attach(dropDownView8.MainWidget, 1, 2, 7, 8, AttachOptions.Fill, 0, 10, 2);
            table1.Attach(dropDownView9.MainWidget, 1, 2, 8, 9, AttachOptions.Fill, 0, 10, 2);
            table1.Attach(editView1.MainWidget, 1, 2, 9, 10, AttachOptions.Fill, 0, 10, 2);

            table1.Attach(checkBoxView1.MainWidget, 2, 3, 1, 2, AttachOptions.Fill, 0, 0, 0);
            table1.Attach(checkBoxView2.MainWidget, 2, 3, 2, 3, AttachOptions.Fill, 0, 0, 0);
            table1.Attach(checkBoxView3.MainWidget, 3, 4, 1, 2, AttachOptions.Fill, 0, 0, 0);
            table1.Attach(checkBoxView4.MainWidget, 3, 4, 2, 3, AttachOptions.Fill, 0, 0, 0);

            table1.Attach(checkBoxView5.MainWidget, 2, 4, 8, 9, AttachOptions.Fill, 0, 0, 0);
            table1.Attach(checkBoxView6.MainWidget, 2, 4, 9, 10, AttachOptions.Fill, 0, 0, 0);

            table1.Attach(dropDownView10.MainWidget, 3, 4, 6, 7, AttachOptions.Fill, 0, 0, 5);
            table1.Attach(dropDownView11.MainWidget, 3, 4, 7, 8, AttachOptions.Fill, 0, 0, 5);
        }
Ejemplo n.º 6
0
        /// <summary>Initializes a new instance of the <see cref="SeriesView" /> class</summary>
        public SeriesView(ViewBase owner) : base(owner)
        {
            Glade.XML gxml = new Glade.XML("ApsimNG.Resources.Glade.SeriesView.glade", "vbox1");
            gxml.Autoconnect(this);
            _mainWidget = vbox1;

            graphView1 = new GraphView(this);
            vbox1.PackStart(graphView1.MainWidget, true, true, 0);

            dropDownView1  = new DropDownView(this);
            dropDownView2  = new DropDownView(this);
            dropDownView3  = new DropDownView(this);
            dropDownView4  = new DropDownView(this);
            dropDownView5  = new DropDownView(this);
            dropDownView6  = new DropDownView(this);
            dropDownView7  = new DropDownView(this);
            dropDownView8  = new DropDownView(this);
            dropDownView9  = new ColourDropDownView(this);
            dropDownView10 = new DropDownView(this);
            dropDownView11 = new DropDownView(this);

            checkBoxView1             = new CheckBoxView(this);
            checkBoxView1.TextOfLabel = "on top?";
            checkBoxView2             = new CheckBoxView(this);
            checkBoxView2.TextOfLabel = "on right?";
            checkBoxView3             = new CheckBoxView(this);
            checkBoxView3.TextOfLabel = "cumulative?";
            checkBoxView4             = new CheckBoxView(this);
            checkBoxView4.TextOfLabel = "cumulative?";
            checkBoxView5             = new CheckBoxView(this);
            checkBoxView5.TextOfLabel = "Show in legend?";
            checkBoxView6             = new CheckBoxView(this);
            checkBoxView6.TextOfLabel = "Include series name in legend?";

            editView1 = new EditView(this);

            table1.Attach(dropDownView1.MainWidget, 1, 2, 0, 1, AttachOptions.Fill, 0, 10, 2);
            table1.Attach(dropDownView2.MainWidget, 1, 2, 1, 2, AttachOptions.Fill, 0, 10, 2);
            table1.Attach(dropDownView3.MainWidget, 1, 2, 2, 3, AttachOptions.Fill, 0, 10, 2);
            table1.Attach(dropDownView5.MainWidget, 1, 2, 3, 4, AttachOptions.Fill, 0, 10, 2);
            table1.Attach(dropDownView4.MainWidget, 1, 2, 4, 5, AttachOptions.Fill, 0, 10, 2);
            table1.Attach(dropDownView6.MainWidget, 1, 2, 5, 6, AttachOptions.Fill, 0, 10, 2);
            table1.Attach(dropDownView7.MainWidget, 1, 2, 6, 7, AttachOptions.Fill, 0, 10, 2);
            table1.Attach(dropDownView8.MainWidget, 1, 2, 7, 8, AttachOptions.Fill, 0, 10, 2);
            table1.Attach(dropDownView9.MainWidget, 1, 2, 8, 9, AttachOptions.Fill, 0, 10, 2);
            table1.Attach(editView1.MainWidget, 1, 2, 9, 10, AttachOptions.Fill, 0, 10, 2);

            table1.Attach(checkBoxView1.MainWidget, 2, 3, 1, 2, AttachOptions.Fill, 0, 0, 0);
            table1.Attach(checkBoxView2.MainWidget, 2, 3, 2, 3, AttachOptions.Fill, 0, 0, 0);
            table1.Attach(checkBoxView3.MainWidget, 3, 4, 1, 2, AttachOptions.Fill, 0, 0, 0);
            table1.Attach(checkBoxView4.MainWidget, 3, 4, 2, 3, AttachOptions.Fill, 0, 0, 0);

            table1.Attach(checkBoxView5.MainWidget, 2, 4, 8, 9, AttachOptions.Fill, 0, 0, 0);
            table1.Attach(checkBoxView6.MainWidget, 2, 4, 9, 10, AttachOptions.Fill, 0, 0, 0);

            table1.Attach(dropDownView10.MainWidget, 3, 4, 6, 7, AttachOptions.Fill, 0, 0, 5);
            table1.Attach(dropDownView11.MainWidget, 3, 4, 7, 8, AttachOptions.Fill, 0, 0, 5);
        }
Ejemplo n.º 7
0
        /// <summary>Initializes a new instance of the <see cref="TabbedMetDataView"/> class.</summary>
        public TabbedMetDataView(ViewBase owner) : base(owner)
        {
            Builder builder = BuilderFromResource("ApsimNG.Resources.Glade.TabbedMetDataView.glade");

            labelFileName                  = (Label)builder.GetObject("labelFileName");
            vbox1                          = (VBox)builder.GetObject("vbox1");
            notebook1                      = (Notebook)builder.GetObject("notebook1");
            textview1                      = (TextView)builder.GetObject("textview1");
            alignSummary                   = (Alignment)builder.GetObject("alignSummary");
            alignData                      = (Alignment)builder.GetObject("alignData");
            alignRainChart                 = (Alignment)builder.GetObject("alignRainChart");
            alignRainMonthly               = (Alignment)builder.GetObject("alignRainMonthly");
            alignTemp                      = (Alignment)builder.GetObject("alignTemp");
            alignRadn                      = (Alignment)builder.GetObject("alignRadn");
            vboxRainChart                  = (VBox)builder.GetObject("vboxRainChart");
            vboxRainMonthly                = (VBox)builder.GetObject("vboxRainMonthly");
            vboxTemp                       = (VBox)builder.GetObject("vboxTemp");
            vboxRadn                       = (VBox)builder.GetObject("vboxRadn");
            hboxOptions                    = (HBox)builder.GetObject("hboxOptions");
            spinStartYear                  = (SpinButton)builder.GetObject("spinStartYear");
            spinNYears                     = (SpinButton)builder.GetObject("spinNYears");
            button1                        = (Button)builder.GetObject("button1");
            vpaned1                        = (VPaned)builder.GetObject("vpaned1");
            hbox2                          = (HBox)builder.GetObject("hbox2");
            alignment10                    = (Alignment)builder.GetObject("alignment10");
            constantsFileSelector          = (Button)builder.GetObject("button2");
            constantsFileSelector.Clicked += OnChooseConstantsFile;
            constantsFileSelectorContainer = (Container)builder.GetObject("hbox3");
            labelConstantsFileName         = (Label)builder.GetObject("labelFileName1");
            mainWidget                     = vbox1;
            graphViewSummary               = new GraphView(this);
            alignSummary.Add(graphViewSummary.MainWidget);
            graphViewRainfall = new GraphView(this);
            vboxRainChart.PackEnd(graphViewRainfall.MainWidget);
            graphViewMonthlyRainfall = new GraphView(this);
            vboxRainMonthly.PackEnd(graphViewMonthlyRainfall.MainWidget);
            graphViewTemperature = new GraphView(this);
            vboxTemp.PackEnd(graphViewTemperature.MainWidget);
            graphViewRadiation = new GraphView(this);
            vboxRadn.PackEnd(graphViewRadiation.MainWidget);
            gridViewData          = new GridView(this);
            gridViewData.ReadOnly = true;
            alignData.Add(gridViewData.MainWidget);
            button1.Clicked            += OnButton1Click;
            spinStartYear.ValueChanged += OnGraphStartYearValueChanged;
            spinNYears.ValueChanged    += OnGraphShowYearsValueChanged;
            notebook1.SwitchPage       += TabControl1_SelectedIndexChanged;
            GraphStartYearMaxValue      = 2100;
            GraphStartYearMinValue      = 1900;
            GraphStartYearValue         = 2000;
            GraphShowYearsValue         = 1;
            worksheetCombo              = new DropDownView(this);
            alignment10.Add(worksheetCombo.MainWidget);
            worksheetCombo.Visible  = true;
            worksheetCombo.Changed += WorksheetCombo_Changed;
            mainWidget.Destroyed   += _mainWidget_Destroyed;
        }
Ejemplo n.º 8
0
 /// <summary>
 /// Does cleanup when the main widget is destroyed
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void _mainWidget_Destroyed(object sender, System.EventArgs e)
 {
     gridView.MainWidget.Destroy();
     gridView = null;
     dropDownView1.MainWidget.Destroy();
     dropDownView1 = null;
     editView1.MainWidget.Destroy();
     editView1 = null;
     editView2.MainWidget.Destroy();
     editView2              = null;
     _mainWidget.Destroyed -= _mainWidget_Destroyed;
     _owner = null;
 }
Ejemplo n.º 9
0
        private Widget CreateSimulationFilter()
        {
            HBox box = new HBox();

            SimulationDropDown = new DropDownView(this);
            box.PackStart(new Label("Simulation:"), false, false, 5);
            box.PackStart(SimulationDropDown.MainWidget, false, false, 5);
            box.MarginBottom = 5;
            Frame frame = new Frame("Simulation Filter");

            frame.Add(box);
            frame.Margin = 5;
            return(frame);
        }
Ejemplo n.º 10
0
 /// <summary>Initializes a new instance of the <see cref="DataStoreView" /> class.</summary>
 public DataStoreView(ViewBase owner) : base(owner)
 {
     Glade.XML gxml = new Glade.XML("ApsimNG.Resources.Glade.DataStoreView.glade", "vbox1");
     gxml.Autoconnect(this);
     _mainWidget = vbox1;
     gridView    = new GridView(this);
     vbox1.PackStart(gridView.MainWidget, true, true, 0);
     vbox1.ReorderChild(hbox1, 2);
     dropDownView1 = new DropDownView(this);
     editView1     = new EditView(this);
     table1.Attach(dropDownView1.MainWidget, 1, 2, 0, 1);
     table1.Attach(editView1.MainWidget, 1, 2, 1, 2);
     editView2 = new EditView(this);
     hbox1.PackStart(editView2.MainWidget, false, false, 0);
 }
Ejemplo n.º 11
0
        /// <summary>Initializes a new instance of the <see cref="SummaryView"/> class.</summary>
        public SummaryView(ViewBase owner) : base(owner)
        {
            topBox = new HBox();
            SummaryCheckBox = new CheckBoxView(this);
            SummaryCheckBox.TextOfLabel = "Capture summary?";
            WarningCheckBox = new CheckBoxView(this);
            WarningCheckBox.TextOfLabel = "Capture warning messages?";
            ErrorCheckBox = new CheckBoxView(this);
            ErrorCheckBox.TextOfLabel = "Capture error messages?";
            topBox.PackStart(SummaryCheckBox.MainWidget, false, false, 10);
            topBox.PackStart(WarningCheckBox.MainWidget, false, false, 10);
            topBox.PackStart(ErrorCheckBox.MainWidget, false, false, 10);

            middleBox = new HBox();
            SimulationDropDown = new DropDownView(this);
            middleBox.PackStart(new Label("Simulation:"), false, false, 10);
            middleBox.PackStart(SimulationDropDown.MainWidget, true, true, 10);

            btnJumpToSimLog = new Button("Jump to simulation log");
            HBox buttonContainer = new HBox();
            buttonContainer.PackStart(btnJumpToSimLog, false, false, 0);
            btnJumpToSimLog.Clicked += OnJumpToSimulationLog;

            mainControl = new VBox();
            mainWidget = mainControl;
            mainControl.PackStart(topBox, false, false, 0);
            mainControl.PackStart(middleBox, false, false, 0);
            mainControl.PackStart(buttonContainer, false, false, 0);
            SummaryDisplay = new MarkdownView(this);
            Widget summaryWidget = ((ViewBase)SummaryDisplay).MainWidget as Widget;
            if (summaryWidget is Container container && container.Children != null && container.Children.Length == 1 && container.Children[0] is TextView editor)
            {
                // If possible, we want to generate a summary view which uses a single
                // TextView widget, which will allow for easy selection/searching/copying
                // of the entire text all at once. If we are using a single textview, we
                // want to add it directly to a ScrolledWindow; if we add it to another
                // container (e.g. Box) then add the Box to the container, some of the
                // TextView functionality (scroll_to_iter()) will not work.
                summaryWidget = new ScrolledWindow();
                editor.Reparent(summaryWidget);
                editor.WrapMode = WrapMode.None;
                (SummaryDisplay as MarkdownView).SetMainWidget(summaryWidget);
            }
            mainControl.PackEnd(summaryWidget, true, true, 0);

            mainWidget.Destroyed += MainWidgetDestroyed;
            mainWidget.ShowAll();
        }
Ejemplo n.º 12
0
 /// <summary>Initializes a new instance of the <see cref="DataStoreView" /> class.</summary>
 public DataStoreView(ViewBase owner)
     : base(owner)
 {
     Glade.XML gxml = new Glade.XML("ApsimNG.Resources.Glade.DataStoreView.glade", "vbox1");
     gxml.Autoconnect(this);
     _mainWidget = vbox1;
     gridView = new GridView(this);
     vbox1.PackStart(gridView.MainWidget, true, true, 0);
     vbox1.ReorderChild(hbox1, 2);
     dropDownView1 = new DropDownView(this);
     editView1 = new EditView(this);
     table1.Attach(dropDownView1.MainWidget, 1, 2, 0, 1);
     table1.Attach(editView1.MainWidget, 1, 2, 1, 2);
     editView2 = new EditView(this);
     hbox1.PackStart(editView2.MainWidget, false, false, 0);
 }
Ejemplo n.º 13
0
 /// <summary>
 /// Does cleanup when the main widget is destroyed
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void _mainWidget_Destroyed(object sender, System.EventArgs e)
 {
     fileName.Changed -= OnFileNameChanged;
     gridView.Dispose();
     gridView = null;
     dropDownView1.MainWidget.Destroy();
     dropDownView1 = null;
     editView1.MainWidget.Destroy();
     editView1 = null;
     editView2.MainWidget.Destroy();
     editView2 = null;
     rowFilter.MainWidget.Destroy();
     rowFilter              = null;
     _mainWidget.Destroyed -= _mainWidget_Destroyed;
     chooseFile.Clicked    -= OnChooseFile;
     _owner = null;
 }
Ejemplo n.º 14
0
        /// <summary>Initializes a new instance of the <see cref="DataStoreView" /> class.</summary>
        public DataStoreView(ViewBase owner) : base(owner)
        {
            Builder builder = new Builder("ApsimNG.Resources.Glade.DataStoreView.glade");

            vbox1       = (VBox)builder.GetObject("vbox1");
            table1      = (Table)builder.GetObject("table1");
            hbox1       = (HBox)builder.GetObject("hbox1");
            _mainWidget = vbox1;
            gridView    = new GridView(this);
            vbox1.PackStart(gridView.MainWidget, true, true, 0);
            vbox1.ReorderChild(hbox1, 2);
            dropDownView1 = new DropDownView(this);
            editView1     = new EditView(this);
            table1.Attach(dropDownView1.MainWidget, 1, 2, 0, 1);
            table1.Attach(editView1.MainWidget, 1, 2, 1, 2);
            editView2 = new EditView(this);
            hbox1.PackStart(editView2.MainWidget, false, false, 0);
        }
Ejemplo n.º 15
0
        /// <summary>Initializes a new instance of the <see cref="SummaryView"/> class.</summary>
        public SummaryView(ViewBase owner) : base(owner)
        {
            topBox                      = new HBox();
            SummaryCheckBox             = new CheckBoxView(this);
            SummaryCheckBox.TextOfLabel = "Capture summary?";
            WarningCheckBox             = new CheckBoxView(this);
            WarningCheckBox.TextOfLabel = "Capture warning messages?";
            ErrorCheckBox               = new CheckBoxView(this);
            ErrorCheckBox.TextOfLabel   = "Capture error messages?";
            topBox.PackStart(SummaryCheckBox.MainWidget, false, false, 10);
            topBox.PackStart(WarningCheckBox.MainWidget, false, false, 10);
            topBox.PackStart(ErrorCheckBox.MainWidget, false, false, 10);

            middleBox          = new HBox();
            SimulationDropDown = new DropDownView(this);
            middleBox.PackStart(new Label("Simulation:"), false, false, 10);
            middleBox.PackStart(SimulationDropDown.MainWidget, true, true, 10);

            btnJumpToSimLog = new Button("Jump to simulation log");
            HBox buttonContainer = new HBox();

            buttonContainer.PackStart(btnJumpToSimLog, false, false, 0);
            btnJumpToSimLog.Clicked += OnJumpToSimulationLog;

            mainControl = new VBox();
            mainWidget  = mainControl;
            mainControl.PackStart(topBox, false, false, 0);
            mainControl.PackStart(middleBox, false, false, 0);
            mainControl.PackStart(buttonContainer, false, false, 0);
            SummaryDisplay = new MarkdownView(this);
            ScrolledWindow scroller = new ScrolledWindow();

            scroller.Add(((ViewBase)SummaryDisplay).MainWidget);
            mainControl.PackEnd(scroller, true, true, 0);

            mainWidget.Destroyed += MainWidgetDestroyed;
            mainWidget.ShowAll();
        }
Ejemplo n.º 16
0
 /// <summary>
 /// Does cleanup when the main widget is destroyed
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void _mainWidget_Destroyed(object sender, System.EventArgs e)
 {
     try
     {
         fileName.Leave -= OnFileNameChanged;
         gridView.Dispose();
         gridView = null;
         dropDownView1.MainWidget.Destroy();
         dropDownView1 = null;
         editView1.MainWidget.Destroy();
         editView1 = null;
         editView2.MainWidget.Destroy();
         editView2 = null;
         rowFilter.MainWidget.Destroy();
         rowFilter             = null;
         mainWidget.Destroyed -= _mainWidget_Destroyed;
         chooseFile.Clicked   -= OnChooseFile;
         owner = null;
     }
     catch (Exception err)
     {
         ShowError(err);
     }
 }
Ejemplo n.º 17
0
        /// <summary>Initializes a new instance of the <see cref="DataStoreView" /> class.</summary>
        public DataStoreView(ViewBase owner) : base(owner)
        {
            Builder builder = BuilderFromResource("ApsimNG.Resources.Glade.DataStoreView.glade");

            vbox1      = (VBox)builder.GetObject("vbox1");
            table1     = (Table)builder.GetObject("table1");
            hbox1      = (HBox)builder.GetObject("hbox1");
            mainWidget = vbox1;
            gridView   = new GridView(this)
            {
                ReadOnly = true,
                CanGrow  = false
            };
            vbox1.PackStart(gridView.MainWidget, true, true, 0);
            vbox1.ReorderChild(hbox1, 2);

            fileName            = new EditView(this);
            fileName.Leave     += OnFileNameChanged;
            chooseFile          = new Button("...");
            chooseFile.Clicked += OnChooseFile;
            HBox fileNameContainer = new HBox();

            fileNameContainer.PackStart(fileName.MainWidget, true, true, 0);
            fileNameContainer.PackStart(chooseFile, false, false, 0);

            dropDownView1 = new DropDownView(this);
            editView1     = new EditView(this);
            rowFilter     = new EditView(this);
            table1.Attach(fileNameContainer, 1, 2, 0, 1);
            table1.Attach(dropDownView1.MainWidget, 1, 2, 1, 2);
            table1.Attach(editView1.MainWidget, 1, 2, 2, 3);
            table1.Attach(rowFilter.MainWidget, 1, 2, 3, 4);
            editView2 = new EditView(this);
            hbox1.PackStart(editView2.MainWidget, false, false, 0);
            mainWidget.Destroyed += _mainWidget_Destroyed;
        }
Ejemplo n.º 18
0
 /// <summary>Initializes a new instance of the <see cref="TabbedMetDataView"/> class.</summary>
 public TabbedMetDataView(ViewBase owner)
     : base(owner)
 {
     Glade.XML gxml = new Glade.XML("ApsimNG.Resources.Glade.TabbedMetDataView.glade", "vbox1");
     gxml.Autoconnect(this);
     _mainWidget = vbox1;
     graphViewSummary = new GraphView(this);
     alignSummary.Add(graphViewSummary.MainWidget);
     graphViewRainfall = new GraphView(this);
     vboxRainChart.PackEnd(graphViewRainfall.MainWidget);
     graphViewMonthlyRainfall = new GraphView(this);
     vboxRainMonthly.PackEnd(graphViewMonthlyRainfall.MainWidget);
     graphViewTemperature = new GraphView(this);
     vboxTemp.PackEnd(graphViewTemperature.MainWidget);
     graphViewRadiation = new GraphView(this);
     vboxRadn.PackEnd(graphViewRadiation.MainWidget);
     gridViewData = new GridView(this);
     gridViewData.ReadOnly = true;
     alignData.Add(gridViewData.MainWidget);
     button1.Clicked += OnButton1Click;
     spinStartYear.ValueChanged += OnGraphStartYearValueChanged;
     spinNYears.ValueChanged += OnGraphShowYearsValueChanged;
     notebook1.SwitchPage += TabControl1_SelectedIndexChanged;
     GraphStartYearMaxValue = 2100;
     GraphStartYearMinValue = 1900;
     GraphStartYearValue = 2000;
     GraphShowYearsValue = 1;
     worksheetCombo = new DropDownView(this);
     alignment10.Add(worksheetCombo.MainWidget);
     worksheetCombo.IsVisible = true;
     worksheetCombo.Changed += WorksheetCombo_Changed;
     _mainWidget.Destroyed += _mainWidget_Destroyed;
 }
Ejemplo n.º 19
0
        public StockView(ViewBase owner) : base(owner)
        {
            Builder builder = MasterView.BuilderFromResource("ApsimNG.Resources.Glade.StockView.glade");

            notebook1             = (Notebook)builder.GetObject("notebook1");
            notebook1.SwitchPage += TabControl1_SelectedIndexChanged;

            gbxGenotype           = (Frame)builder.GetObject("gbxGenotype");
            edtGenotypeName       = (Entry)builder.GetObject("edtGenotypeName");
            btnNewGeno            = (Button)builder.GetObject("btnNewGeno");
            btnDelGeno            = (Button)builder.GetObject("btnDelGeno");
            rbtnSheep             = (Gtk.RadioButton)builder.GetObject("rbtnSheep");
            rbtnCattle            = (Gtk.RadioButton)builder.GetObject("rbtnCattle");
            lblConception3        = (Label)builder.GetObject("lblConception3");
            unitConception        = (Label)builder.GetObject("unitConception");
            lblBreedPFW_PeakMilk  = (Label)builder.GetObject("lblBreedPFW_PeakMilk");
            unitBreedPFW_PeakMilk = (Label)builder.GetObject("unitBreedPFW_PeakMilk");
            untWoolYield          = (Label)builder.GetObject("untWoolYield");
            lblWoolYield          = (Label)builder.GetObject("lblWoolYield");
            lblDamBreed           = (Label)builder.GetObject("lblDamBreed");
            lblSireBreed          = (Label)builder.GetObject("lblSireBreed");
            lblBreedMaxMu         = (Label)builder.GetObject("lblBreedMaxMu");
            unitBreedMaxMu        = (Label)builder.GetObject("unitBreedMaxMu");

            cbxDamBreed      = new Views.DropDownView(this, (ComboBox)builder.GetObject("cbxDamBreed"));
            cbxSireBreed     = new Views.DropDownView(this, (ComboBox)builder.GetObject("cbxSireBreed"));
            cbxGeneration    = new Views.DropDownView(this, (ComboBox)builder.GetObject("cbxGeneration"));
            cbxGroupGenotype = new Views.DropDownView(this, (ComboBox)builder.GetObject("cbxGroupGenotype"));   // animals tab

            deWnrDeath           = new DoubleEditView(this, (Entry)builder.GetObject("edtWnrDeathRate"), 100, 0, 1);
            deDeath              = new DoubleEditView(this, (Entry)builder.GetObject("edtDeathRate"), 100, 0, 1);
            dePFW_Milk           = new DoubleEditView(this, (Entry)builder.GetObject("edtBreedPFW_PeakMilk"), 100, 0, 2);
            deBreedSRW           = new DoubleEditView(this, (Entry)builder.GetObject("edtBreedSRW"));
            deBreedSRW.DecPlaces = 1;
            deBreedMaxMu         = new DoubleEditView(this, (Entry)builder.GetObject("edtBreedMaxMu"), 50, 5, 1);
            deWoolYield          = new DoubleEditView(this, (Entry)builder.GetObject("edtWoolYield"), 100, 50, 1);
            deConception1        = new DoubleEditView(this, (Entry)builder.GetObject("edtConception1"), 100, 0, 0);
            deConception2        = new DoubleEditView(this, (Entry)builder.GetObject("edtConception2"), 100, 0, 0);
            deConception3        = new DoubleEditView(this, (Entry)builder.GetObject("edtConception3"), 100, 0, 0);

            cbxGeneration.Values = new string[] { "Purebred", "First cross", "Second cross", "Third cross", "Fourth cross", "Fifth cross", "Sixth cross" };

            // configure the treeview of genotype names
            lbxGenotypeList       = (Gtk.TreeView)builder.GetObject("tvGenotypes");
            lbxGenotypeList.Model = genoList;
            CellRendererText textRender = new Gtk.CellRendererText();
            TreeViewColumn   column     = new TreeViewColumn("Genotype Names", textRender, "text", 0);

            lbxGenotypeList.AppendColumn(column);
            lbxGenotypeList.HeadersVisible = false;
            lbxGenotypeList.CursorChanged += lbxGenotypeList_SelectedIndexChanged;

            btnNewGeno.Clicked      += btnNewGeno_Clicked;
            btnDelGeno.Clicked      += btnDelGeno_Clicked;
            edtGenotypeName.Changed += ChangeGenotypeName;
            rbtnSheep.Clicked       += ClickAnimal;
            rbtnCattle.Clicked      += ClickAnimal;
            cbxDamBreed.Changed     += ChangeBreed;
            cbxGeneration.Changed   += ChangeGeneration;

            _mainWidget            = notebook1;
            _mainWidget.Destroyed += _mainWidget_Destroyed;
        }
Ejemplo n.º 20
0
        /// <summary>
        /// Generate and initialise input widget for the given property.
        /// This involves attaching the appropriate event handlers and
        /// populating it with an initial value.
        /// </summary>
        /// <param name="property">The property to be presented.</param>
        private Widget GenerateInputWidget(Property property)
        {
            Widget component;

            switch (property.DisplayMethod)
            {
            case PropertyType.MultiLineText:
                TextView editor = new TextView();
                editor.SizeAllocated += OnTextViewSizeAllocated;
                string text = ReflectionUtilities.ObjectToString(property.Value, CultureInfo.CurrentCulture);
                editor.Buffer.Text             = text ?? "";
                originalEntryText[property.ID] = text;
                editor.Name = property.ID.ToString();
                Frame outline = new Frame();
                outline.Add(editor);
                component             = outline;
                editor.FocusOutEvent += OnEntryFocusOut;
                break;

            case PropertyType.SingleLineText:
                string entryValue = ReflectionUtilities.ObjectToString(property.Value, CultureInfo.InvariantCulture);
                Entry  textInput  = new Entry(entryValue ?? "");
                textInput.FocusOutEvent += OnEntryFocusOut;
                component = textInput;
                originalEntryText[property.ID] = textInput.Text;
                break;

            case PropertyType.Checkbox:
                CheckButton toggleButton = new CheckButton();
                toggleButton.Active   = (bool)property.Value;
                toggleButton.Toggled += OnToggleCheckButton;
                component             = toggleButton;
                break;

            case PropertyType.DropDown:
                // Dropdown list - use a DropDownView (which wraps GtkComboBox).
                DropDownView dropDown = new DropDownView(this);
                dropDown.Values        = property.DropDownOptions;
                dropDown.SelectedValue = property.Value?.ToString();
                dropDown.Changed      += OnDropDownChanged;
                component = dropDown.MainWidget;
                break;

            case PropertyType.File:
            case PropertyType.Files:
            case PropertyType.Directory:
                //case PropertyType.Directories:
                // Add an Entry and a Button inside a VBox.
                Entry fileNameInput = new Entry(property.Value?.ToString() ?? "");
                fileNameInput.Name             = property.ID.ToString();
                fileNameInput.FocusOutEvent   += OnEntryFocusOut;
                originalEntryText[property.ID] = fileNameInput.Text;

                Button fileChooserButton = new Button("...");
                fileChooserButton.Name = property.ID.ToString();
                if (property.DisplayMethod == PropertyType.File)
                {
                    fileChooserButton.Clicked += (o, _) => ChooseFile(o as Widget, false, false);
                }
                else if (property.DisplayMethod == PropertyType.Files)
                {
                    fileChooserButton.Clicked += (o, _) => ChooseFile(o as Widget, true, false);
                }
                else if (property.DisplayMethod == PropertyType.Directory)
                {
                    fileChooserButton.Clicked += (o, _) => ChooseFile(o as Widget, false, true);
                }

                Box container = new HBox();
                container.PackStart(fileNameInput, true, true, 0);
                container.PackStart(fileChooserButton, false, false, 0);
                component = container;
                break;

            case PropertyType.Colour:
                ColourDropDownView colourChooser = new ColourDropDownView(this);
                List <object>      colours       = new List <object>();
                foreach (var colour in ColourUtilities.Colours)
                {
                    colours.Add(colour);
                }
                colourChooser.Values          = colours.ToArray();
                colourChooser.SelectedValue   = property.Value;
                colourChooser.Changed        += OnDropDownChanged;
                colourChooser.MainWidget.Name = property.ID.ToString();
                component = colourChooser.MainWidget;
                break;

            default:
                throw new Exception($"Unknown display type {property.DisplayMethod}");
            }

            // Set the widget's name to the property name.
            // This allows us to provide the property name when firing off
            // the property changed event, despite the event handlers being
            // shared by multiple components.
            return(component);
        }
Ejemplo n.º 21
0
        /// <summary>Initializes a new instance of the <see cref="SeriesView" /> class</summary>
        public SeriesView(ViewBase owner) : base(owner)
        {
            Builder builder = BuilderFromResource("ApsimNG.Resources.Glade.SeriesView.glade");

            vbox1 = (VBox)builder.GetObject("vbox1");

            Widget table = (Widget)builder.GetObject("table1");

            vbox1.Remove(table);
            table1 = new Grid();
            table1.ColumnSpacing = 10;
            // Set expand to false on this grid, to ensure that any extra space
            // is allocated to the graph (aka plotview).
            vbox1.PackStart(table1, false, true, 0);
            vbox1.ReorderChild(table1, 0);

            label4     = (Label)builder.GetObject("label4");
            label5     = (Label)builder.GetObject("label5");
            mainWidget = vbox1;

            graphView1 = new GraphView(this);
            vbox1.PackStart(graphView1.MainWidget, true, true, 0);

            dataSourceDropDown    = new DropDownView(this);
            xDropDown             = new DropDownView(this);
            yDropDown             = new DropDownView(this);
            x2DropDown            = new DropDownView(this);
            y2DropDown            = new DropDownView(this);
            seriesDropDown        = new DropDownView(this);
            lineTypeDropDown      = new DropDownView(this);
            markerTypeDropDown    = new DropDownView(this);
            colourDropDown        = new ColourDropDownView(this);
            lineThicknessDropDown = new DropDownView(this);
            markerSizeDropDown    = new DropDownView(this);

            checkBoxView1             = new CheckBoxView(this);
            checkBoxView1.TextOfLabel = "on top?";
            checkBoxView2             = new CheckBoxView(this);
            checkBoxView2.TextOfLabel = "on right?";
            checkBoxView3             = new CheckBoxView(this);
            checkBoxView3.TextOfLabel = "cumulative?";
            checkBoxView4             = new CheckBoxView(this);
            checkBoxView4.TextOfLabel = "cumulative?";
            checkBoxView5             = new CheckBoxView(this);
            checkBoxView5.TextOfLabel = "Show in legend?";
            checkBoxView6             = new CheckBoxView(this);
            checkBoxView6.TextOfLabel = "Include series name in legend?";

            editView1 = new EditView(this);

            Image helpImage = new Image(null, "ApsimNG.Resources.MenuImages.Help.svg");

            helpBox = new EventBox();
            helpBox.Add(helpImage);
            helpBox.ButtonReleaseEvent += Help_ButtonPressEvent;
            HBox filterBox = new HBox();

            filterBox.PackStart(editView1.MainWidget, true, true, 0);
            filterBox.PackEnd(helpBox, false, true, 0);

            table1.Attach(new Label("Data Source:")
            {
                Xalign = 0
            }, 0, 0, 1, 1);
            table1.Attach(new Label("X:")
            {
                Xalign = 0
            }, 0, 1, 1, 1);
            table1.Attach(new Label("Y:")
            {
                Xalign = 0
            }, 0, 2, 1, 1);
            label4 = new Label("Y2:")
            {
                Xalign = 0
            };
            label5 = new Label("X2:")
            {
                Xalign = 0
            };
            table1.Attach(label4, 0, 3, 1, 1);
            table1.Attach(label5, 0, 4, 1, 1);
            table1.Attach(new Label("Type:")
            {
                Xalign = 0
            }, 0, 5, 1, 1);
            table1.Attach(new Label("Line type:")
            {
                Xalign = 0
            }, 0, 6, 1, 1);
            table1.Attach(new Label("Marker type:")
            {
                Xalign = 0
            }, 0, 7, 1, 1);
            table1.Attach(new Label("Colour:")
            {
                Xalign = 0
            }, 0, 8, 1, 1);
            table1.Attach(new Label("Filter:")
            {
                Xalign = 0
            }, 0, 9, 1, 1);

            // fixme: these widgets used to have 10px horizontal padding and 2px vertical padding.
            table1.Attach(dataSourceDropDown.MainWidget, 1, 0, 1, 1 /*, 10, 2*/);
            table1.Attach(xDropDown.MainWidget, 1, 1, 1, 1 /*10, 2*/);
            table1.Attach(yDropDown.MainWidget, 1, 2, 1, 1 /*10, 2*/);
            table1.Attach(y2DropDown.MainWidget, 1, 3, 1, 1 /*10, 2*/);
            table1.Attach(x2DropDown.MainWidget, 1, 4, 1, 1 /*10, 2*/);
            table1.Attach(seriesDropDown.MainWidget, 1, 5, 1, 1 /*10, 2*/);
            table1.Attach(lineTypeDropDown.MainWidget, 1, 6, 1, 1 /*10, 2*/);
            table1.Attach(markerTypeDropDown.MainWidget, 1, 7, 1, 1 /*10, 2*/);
            table1.Attach(colourDropDown.MainWidget, 1, 8, 1, 1 /*10, 2*/);

            table1.Attach(filterBox, 1, 9, 1, 1 /*10, 2*/);

            table1.Attach(checkBoxView1.MainWidget, 2, 1, 1, 1);
            table1.Attach(checkBoxView2.MainWidget, 2, 2, 1, 1);
            table1.Attach(checkBoxView3.MainWidget, 3, 1, 1, 1);
            table1.Attach(checkBoxView4.MainWidget, 3, 2, 1, 1);

            table1.Attach(checkBoxView5.MainWidget, 2, 8, 2, 1);
            table1.Attach(checkBoxView6.MainWidget, 2, 9, 2, 1);

            // fixme: These apparently used to have 5px vertical padding.
            table1.Attach(new Label("Line thickness:")
            {
                Xalign = 0
            }, 2, 6, 1, 1 /*, 0, 5*/);
            table1.Attach(lineThicknessDropDown.MainWidget, 3, 6, 1, 1 /*, 0, 5*/);
            table1.Attach(new Label("Marker size:")
            {
                Xalign = 0
            }, 2, 7, 1, 1 /*, 0, 5*/);
            table1.Attach(markerSizeDropDown.MainWidget, 3, 7, 1, 1 /*, 0, 5*/);
            mainWidget.Destroyed += _mainWidget_Destroyed;
        }
Ejemplo n.º 22
0
        /// <summary>Initializes a new instance of the <see cref="SeriesView" /> class</summary>
        public SeriesView(ViewBase owner) : base(owner)
        {
            Builder builder = BuilderFromResource("ApsimNG.Resources.Glade.SeriesView.glade");

            vbox1 = (VBox)builder.GetObject("vbox1");
#if NETFRAMEWORK
            table1 = (Table)builder.GetObject("table1");
#else
            Widget table = (Widget)builder.GetObject("table1");
            vbox1.Remove(table);
            table1 = new Grid();
            table1.ColumnSpacing = 10;
            // Set expand to false on this grid, to ensure that any extra space
            // is allocated to the graph (aka plotview).
            vbox1.PackStart(table1, false, true, 0);
            vbox1.ReorderChild(table1, 0);
#endif
            label4     = (Label)builder.GetObject("label4");
            label5     = (Label)builder.GetObject("label5");
            mainWidget = vbox1;

            graphView1 = new GraphView(this);
            vbox1.PackStart(graphView1.MainWidget, true, true, 0);

            dataSourceDropDown    = new DropDownView(this);
            xDropDown             = new DropDownView(this);
            yDropDown             = new DropDownView(this);
            x2DropDown            = new DropDownView(this);
            y2DropDown            = new DropDownView(this);
            seriesDropDown        = new DropDownView(this);
            lineTypeDropDown      = new DropDownView(this);
            markerTypeDropDown    = new DropDownView(this);
            colourDropDown        = new ColourDropDownView(this);
            lineThicknessDropDown = new DropDownView(this);
            markerSizeDropDown    = new DropDownView(this);

            checkBoxView1             = new CheckBoxView(this);
            checkBoxView1.TextOfLabel = "on top?";
            checkBoxView2             = new CheckBoxView(this);
            checkBoxView2.TextOfLabel = "on right?";
            checkBoxView3             = new CheckBoxView(this);
            checkBoxView3.TextOfLabel = "cumulative?";
            checkBoxView4             = new CheckBoxView(this);
            checkBoxView4.TextOfLabel = "cumulative?";
            checkBoxView5             = new CheckBoxView(this);
            checkBoxView5.TextOfLabel = "Show in legend?";
            checkBoxView6             = new CheckBoxView(this);
            checkBoxView6.TextOfLabel = "Include series name in legend?";

            editView1 = new EditView(this);

            Image helpImage = new Image(null, "ApsimNG.Resources.help.png");
            helpBox = new EventBox();
            helpBox.Add(helpImage);
            helpBox.ButtonReleaseEvent += Help_ButtonPressEvent;
            HBox filterBox = new HBox();
            filterBox.PackStart(editView1.MainWidget, true, true, 0);
            filterBox.PackEnd(helpBox, false, true, 0);

#if NETCOREAPP
            table1.Attach(new Label("Data Source:")
            {
                Xalign = 0
            }, 0, 1, 0, 1, AttachOptions.Fill, AttachOptions.Shrink, 0, 0);
            table1.Attach(new Label("X:")
            {
                Xalign = 0
            }, 0, 1, 1, 2, AttachOptions.Fill, AttachOptions.Shrink, 0, 0);
            table1.Attach(new Label("Y:")
            {
                Xalign = 0
            }, 0, 1, 2, 3, AttachOptions.Fill, AttachOptions.Shrink, 0, 0);
            label4 = new Label("Y2:")
            {
                Xalign = 0
            };
            label5 = new Label("X2:")
            {
                Xalign = 0
            };
            table1.Attach(label4, 0, 1, 3, 4, AttachOptions.Fill, AttachOptions.Shrink, 0, 0);
            table1.Attach(label5, 0, 1, 4, 5, AttachOptions.Fill, AttachOptions.Shrink, 0, 0);
            table1.Attach(new Label("Type:")
            {
                Xalign = 0
            }, 0, 1, 5, 6, AttachOptions.Fill, AttachOptions.Shrink, 0, 0);
            table1.Attach(new Label("Line type:")
            {
                Xalign = 0
            }, 0, 1, 6, 7, AttachOptions.Fill, AttachOptions.Shrink, 0, 0);
            table1.Attach(new Label("Marker type:")
            {
                Xalign = 0
            }, 0, 1, 7, 8, AttachOptions.Fill, AttachOptions.Shrink, 0, 0);
            table1.Attach(new Label("Colour:")
            {
                Xalign = 0
            }, 0, 1, 8, 9, AttachOptions.Fill, AttachOptions.Shrink, 0, 0);
            table1.Attach(new Label("Filter:")
            {
                Xalign = 0
            }, 0, 1, 9, 10, AttachOptions.Fill, AttachOptions.Shrink, 0, 0);
#endif

            table1.Attach(dataSourceDropDown.MainWidget, 1, 2, 0, 1, AttachOptions.Fill, 0, 10, 2);
            table1.Attach(xDropDown.MainWidget, 1, 2, 1, 2, AttachOptions.Fill, 0, 10, 2);
            table1.Attach(yDropDown.MainWidget, 1, 2, 2, 3, AttachOptions.Fill, 0, 10, 2);
            table1.Attach(y2DropDown.MainWidget, 1, 2, 3, 4, AttachOptions.Fill, 0, 10, 2);
            table1.Attach(x2DropDown.MainWidget, 1, 2, 4, 5, AttachOptions.Fill, 0, 10, 2);
            table1.Attach(seriesDropDown.MainWidget, 1, 2, 5, 6, AttachOptions.Fill, 0, 10, 2);
            table1.Attach(lineTypeDropDown.MainWidget, 1, 2, 6, 7, AttachOptions.Fill, 0, 10, 2);
            table1.Attach(markerTypeDropDown.MainWidget, 1, 2, 7, 8, AttachOptions.Fill, 0, 10, 2);
            table1.Attach(colourDropDown.MainWidget, 1, 2, 8, 9, AttachOptions.Fill, 0, 10, 2);

            //table1.Attach(editView1.MainWidget, 1, 2, 9, 10, AttachOptions.Fill, 0, 10, 2);
            table1.Attach(filterBox, 1, 2, 9, 10, AttachOptions.Fill, 0, 10, 2);

            table1.Attach(checkBoxView1.MainWidget, 2, 3, 1, 2, AttachOptions.Fill, 0, 0, 0);
            table1.Attach(checkBoxView2.MainWidget, 2, 3, 2, 3, AttachOptions.Fill, 0, 0, 0);
            table1.Attach(checkBoxView3.MainWidget, 3, 4, 1, 2, AttachOptions.Fill, 0, 0, 0);
            table1.Attach(checkBoxView4.MainWidget, 3, 4, 2, 3, AttachOptions.Fill, 0, 0, 0);

            table1.Attach(checkBoxView5.MainWidget, 2, 4, 8, 9, AttachOptions.Fill, 0, 0, 0);
            table1.Attach(checkBoxView6.MainWidget, 2, 4, 9, 10, AttachOptions.Fill, 0, 0, 0);

            table1.Attach(new Label("Line thickness:")
            {
                Xalign = 0
            }, 2, 3, 6, 7, AttachOptions.Fill, 0, 0, 5);
            table1.Attach(lineThicknessDropDown.MainWidget, 3, 4, 6, 7, AttachOptions.Fill, 0, 0, 5);
            table1.Attach(new Label("Marker size:")
            {
                Xalign = 0
            }, 2, 3, 7, 8, AttachOptions.Fill, 0, 0, 5);
            table1.Attach(markerSizeDropDown.MainWidget, 3, 4, 7, 8, AttachOptions.Fill, 0, 0, 5);
            mainWidget.Destroyed += _mainWidget_Destroyed;
        }
Ejemplo n.º 23
0
        /// <summary>Initializes a new instance of the <see cref="SeriesView" /> class</summary>
        public SeriesView(ViewBase owner) : base(owner)
        {
            Builder builder = BuilderFromResource("ApsimNG.Resources.Glade.SeriesView.glade");

            vbox1      = (VBox)builder.GetObject("vbox1");
            table1     = (Table)builder.GetObject("table1");
            label4     = (Label)builder.GetObject("label4");
            label5     = (Label)builder.GetObject("label5");
            mainWidget = vbox1;

            graphView1 = new GraphView(this);
            vbox1.PackStart(graphView1.MainWidget, true, true, 0);

            dataSourceDropDown    = new DropDownView(this);
            xDropDown             = new DropDownView(this);
            yDropDown             = new DropDownView(this);
            x2DropDown            = new DropDownView(this);
            y2DropDown            = new DropDownView(this);
            seriesDropDown        = new DropDownView(this);
            lineTypeDropDown      = new DropDownView(this);
            markerTypeDropDown    = new DropDownView(this);
            colourDropDown        = new ColourDropDownView(this);
            lineThicknessDropDown = new DropDownView(this);
            markerSizeDropDown    = new DropDownView(this);

            checkBoxView1             = new CheckBoxView(this);
            checkBoxView1.TextOfLabel = "on top?";
            checkBoxView2             = new CheckBoxView(this);
            checkBoxView2.TextOfLabel = "on right?";
            checkBoxView3             = new CheckBoxView(this);
            checkBoxView3.TextOfLabel = "cumulative?";
            checkBoxView4             = new CheckBoxView(this);
            checkBoxView4.TextOfLabel = "cumulative?";
            checkBoxView5             = new CheckBoxView(this);
            checkBoxView5.TextOfLabel = "Show in legend?";
            checkBoxView6             = new CheckBoxView(this);
            checkBoxView6.TextOfLabel = "Include series name in legend?";

            editView1 = new EditView(this);

            table1.Attach(dataSourceDropDown.MainWidget, 1, 2, 0, 1, AttachOptions.Fill, 0, 10, 2);
            table1.Attach(xDropDown.MainWidget, 1, 2, 1, 2, AttachOptions.Fill, 0, 10, 2);
            table1.Attach(yDropDown.MainWidget, 1, 2, 2, 3, AttachOptions.Fill, 0, 10, 2);
            table1.Attach(y2DropDown.MainWidget, 1, 2, 3, 4, AttachOptions.Fill, 0, 10, 2);
            table1.Attach(x2DropDown.MainWidget, 1, 2, 4, 5, AttachOptions.Fill, 0, 10, 2);
            table1.Attach(seriesDropDown.MainWidget, 1, 2, 5, 6, AttachOptions.Fill, 0, 10, 2);
            table1.Attach(lineTypeDropDown.MainWidget, 1, 2, 6, 7, AttachOptions.Fill, 0, 10, 2);
            table1.Attach(markerTypeDropDown.MainWidget, 1, 2, 7, 8, AttachOptions.Fill, 0, 10, 2);
            table1.Attach(colourDropDown.MainWidget, 1, 2, 8, 9, AttachOptions.Fill, 0, 10, 2);

            Image helpImage = new Image(null, "ApsimNG.Resources.help.png");

            helpBox = new EventBox();
            helpBox.Add(helpImage);
            helpBox.ButtonReleaseEvent += Help_ButtonPressEvent;
            HBox filterBox = new HBox();

            filterBox.PackStart(editView1.MainWidget, true, true, 0);
            filterBox.PackEnd(helpBox, false, true, 0);

            //table1.Attach(editView1.MainWidget, 1, 2, 9, 10, AttachOptions.Fill, 0, 10, 2);
            table1.Attach(filterBox, 1, 2, 9, 10, AttachOptions.Fill, 0, 10, 2);

            table1.Attach(checkBoxView1.MainWidget, 2, 3, 1, 2, AttachOptions.Fill, 0, 0, 0);
            table1.Attach(checkBoxView2.MainWidget, 2, 3, 2, 3, AttachOptions.Fill, 0, 0, 0);
            table1.Attach(checkBoxView3.MainWidget, 3, 4, 1, 2, AttachOptions.Fill, 0, 0, 0);
            table1.Attach(checkBoxView4.MainWidget, 3, 4, 2, 3, AttachOptions.Fill, 0, 0, 0);

            table1.Attach(checkBoxView5.MainWidget, 2, 4, 8, 9, AttachOptions.Fill, 0, 0, 0);
            table1.Attach(checkBoxView6.MainWidget, 2, 4, 9, 10, AttachOptions.Fill, 0, 0, 0);

            table1.Attach(lineThicknessDropDown.MainWidget, 3, 4, 6, 7, AttachOptions.Fill, 0, 0, 5);
            table1.Attach(markerSizeDropDown.MainWidget, 3, 4, 7, 8, AttachOptions.Fill, 0, 0, 5);
            mainWidget.Destroyed += _mainWidget_Destroyed;
        }
Ejemplo n.º 24
0
        /// <summary>Initializes a new instance of the <see cref="SeriesView" /> class</summary>
        public SeriesView(ViewBase owner) : base(owner)
        {
            Builder builder = BuilderFromResource("ApsimNG.Resources.Glade.SeriesView.glade");

            vbox1       = (VBox)builder.GetObject("vbox1");
            table1      = (Table)builder.GetObject("table1");
            label4      = (Label)builder.GetObject("label4");
            label5      = (Label)builder.GetObject("label5");
            _mainWidget = vbox1;

            graphView1 = new GraphView(this);
            vbox1.PackStart(graphView1.MainWidget, true, true, 0);

            dropDownView1  = new DropDownView(this);
            dropDownView2  = new DropDownView(this);
            dropDownView3  = new DropDownView(this);
            dropDownView4  = new DropDownView(this);
            dropDownView5  = new DropDownView(this);
            dropDownView6  = new DropDownView(this);
            dropDownView7  = new DropDownView(this);
            dropDownView8  = new DropDownView(this);
            dropDownView9  = new ColourDropDownView(this);
            dropDownView10 = new DropDownView(this);
            dropDownView11 = new DropDownView(this);

            checkBoxView1             = new CheckBoxView(this);
            checkBoxView1.TextOfLabel = "on top?";
            checkBoxView2             = new CheckBoxView(this);
            checkBoxView2.TextOfLabel = "on right?";
            checkBoxView3             = new CheckBoxView(this);
            checkBoxView3.TextOfLabel = "cumulative?";
            checkBoxView4             = new CheckBoxView(this);
            checkBoxView4.TextOfLabel = "cumulative?";
            checkBoxView5             = new CheckBoxView(this);
            checkBoxView5.TextOfLabel = "Show in legend?";
            checkBoxView6             = new CheckBoxView(this);
            checkBoxView6.TextOfLabel = "Include series name in legend?";

            editView1 = new EditView(this);

            table1.Attach(dropDownView1.MainWidget, 1, 2, 0, 1, AttachOptions.Fill, 0, 10, 2);
            table1.Attach(dropDownView2.MainWidget, 1, 2, 1, 2, AttachOptions.Fill, 0, 10, 2);
            table1.Attach(dropDownView3.MainWidget, 1, 2, 2, 3, AttachOptions.Fill, 0, 10, 2);
            table1.Attach(dropDownView5.MainWidget, 1, 2, 3, 4, AttachOptions.Fill, 0, 10, 2);
            table1.Attach(dropDownView4.MainWidget, 1, 2, 4, 5, AttachOptions.Fill, 0, 10, 2);
            table1.Attach(dropDownView6.MainWidget, 1, 2, 5, 6, AttachOptions.Fill, 0, 10, 2);
            table1.Attach(dropDownView7.MainWidget, 1, 2, 6, 7, AttachOptions.Fill, 0, 10, 2);
            table1.Attach(dropDownView8.MainWidget, 1, 2, 7, 8, AttachOptions.Fill, 0, 10, 2);
            table1.Attach(dropDownView9.MainWidget, 1, 2, 8, 9, AttachOptions.Fill, 0, 10, 2);
            Image    helpImage = new Image(null, "ApsimNG.Resources.help.png");
            EventBox ebHelp    = new EventBox();

            ebHelp.Add(helpImage);
            ebHelp.ButtonPressEvent += Help_ButtonPressEvent;
            HBox filterBox = new HBox();

            filterBox.PackStart(editView1.MainWidget, true, true, 0);
            filterBox.PackEnd(ebHelp, false, true, 0);

            //table1.Attach(editView1.MainWidget, 1, 2, 9, 10, AttachOptions.Fill, 0, 10, 2);
            table1.Attach(filterBox, 1, 2, 9, 10, AttachOptions.Fill, 0, 10, 2);

            table1.Attach(checkBoxView1.MainWidget, 2, 3, 1, 2, AttachOptions.Fill, 0, 0, 0);
            table1.Attach(checkBoxView2.MainWidget, 2, 3, 2, 3, AttachOptions.Fill, 0, 0, 0);
            table1.Attach(checkBoxView3.MainWidget, 3, 4, 1, 2, AttachOptions.Fill, 0, 0, 0);
            table1.Attach(checkBoxView4.MainWidget, 3, 4, 2, 3, AttachOptions.Fill, 0, 0, 0);

            table1.Attach(checkBoxView5.MainWidget, 2, 4, 8, 9, AttachOptions.Fill, 0, 0, 0);
            table1.Attach(checkBoxView6.MainWidget, 2, 4, 9, 10, AttachOptions.Fill, 0, 0, 0);

            table1.Attach(dropDownView10.MainWidget, 3, 4, 6, 7, AttachOptions.Fill, 0, 0, 5);
            table1.Attach(dropDownView11.MainWidget, 3, 4, 7, 8, AttachOptions.Fill, 0, 0, 5);
        }
Ejemplo n.º 25
0
        /// <summary>Initializes a new instance of the <see cref="SeriesView" /> class</summary>
        public SeriesView(ViewBase owner)
            : base(owner)
        {
            Glade.XML gxml = new Glade.XML("ApsimNG.Resources.Glade.SeriesView.glade", "vbox1");
            gxml.Autoconnect(this);
            _mainWidget = vbox1;

            graphView1 = new GraphView(this);
            vbox1.PackStart(graphView1.MainWidget, true, true, 0);

            dropDownView1 = new DropDownView(this);
            dropDownView2 = new DropDownView(this);
            dropDownView3 = new DropDownView(this);
            dropDownView4 = new DropDownView(this);
            dropDownView5 = new DropDownView(this);
            dropDownView6 = new DropDownView(this);
            dropDownView7 = new DropDownView(this);
            dropDownView8 = new DropDownView(this);
            dropDownView9 = new ColourDropDownView(this);
            dropDownView10 = new DropDownView(this);
            dropDownView11 = new DropDownView(this);

            checkBoxView1 = new CheckBoxView(this);
            checkBoxView1.TextOfLabel = "on top?";
            checkBoxView2 = new CheckBoxView(this);
            checkBoxView2.TextOfLabel = "on right?";
            checkBoxView3 = new CheckBoxView(this);
            checkBoxView3.TextOfLabel = "cumulative?";
            checkBoxView4 = new CheckBoxView(this);
            checkBoxView4.TextOfLabel = "cumulative?";
            checkBoxView5 = new CheckBoxView(this);
            checkBoxView5.TextOfLabel = "Show in legend?";
            checkBoxView6 = new CheckBoxView(this);
            checkBoxView6.TextOfLabel = "Include series name in legend?";

            editView1 = new EditView(this);

            table1.Attach(dropDownView1.MainWidget, 1, 2, 0, 1, AttachOptions.Fill, 0, 10, 2);
            table1.Attach(dropDownView2.MainWidget, 1, 2, 1, 2, AttachOptions.Fill, 0, 10, 2);
            table1.Attach(dropDownView3.MainWidget, 1, 2, 2, 3, AttachOptions.Fill, 0, 10, 2);
            table1.Attach(dropDownView5.MainWidget, 1, 2, 3, 4, AttachOptions.Fill, 0, 10, 2);
            table1.Attach(dropDownView4.MainWidget, 1, 2, 4, 5, AttachOptions.Fill, 0, 10, 2);
            table1.Attach(dropDownView6.MainWidget, 1, 2, 5, 6, AttachOptions.Fill, 0, 10, 2);
            table1.Attach(dropDownView7.MainWidget, 1, 2, 6, 7, AttachOptions.Fill, 0, 10, 2);
            table1.Attach(dropDownView8.MainWidget, 1, 2, 7, 8, AttachOptions.Fill, 0, 10, 2);
            table1.Attach(dropDownView9.MainWidget, 1, 2, 8, 9, AttachOptions.Fill, 0, 10, 2);
            Image helpImage = new Image(null, "ApsimNG.Resources.help.png");
            EventBox ebHelp = new EventBox();
            ebHelp.Add(helpImage);
            ebHelp.ButtonPressEvent += Help_ButtonPressEvent;
            HBox filterBox = new HBox();
            filterBox.PackStart(editView1.MainWidget, true, true, 0);
            filterBox.PackEnd(ebHelp, false, true, 0);

            //table1.Attach(editView1.MainWidget, 1, 2, 9, 10, AttachOptions.Fill, 0, 10, 2);
            table1.Attach(filterBox, 1, 2, 9, 10, AttachOptions.Fill, 0, 10, 2);

            table1.Attach(checkBoxView1.MainWidget, 2, 3, 1, 2, AttachOptions.Fill, 0, 0, 0);
            table1.Attach(checkBoxView2.MainWidget, 2, 3, 2, 3, AttachOptions.Fill, 0, 0, 0);
            table1.Attach(checkBoxView3.MainWidget, 3, 4, 1, 2, AttachOptions.Fill, 0, 0, 0);
            table1.Attach(checkBoxView4.MainWidget, 3, 4, 2, 3, AttachOptions.Fill, 0, 0, 0);

            table1.Attach(checkBoxView5.MainWidget, 2, 4, 8, 9, AttachOptions.Fill, 0, 0, 0);
            table1.Attach(checkBoxView6.MainWidget, 2, 4, 9, 10, AttachOptions.Fill, 0, 0, 0);

            table1.Attach(dropDownView10.MainWidget, 3, 4, 6, 7, AttachOptions.Fill, 0, 0, 5);
            table1.Attach(dropDownView11.MainWidget, 3, 4, 7, 8, AttachOptions.Fill, 0, 0, 5);
        }