Exemplo n.º 1
0
        /// <summary>Constructor</summary>
        public ReportView(ViewBase owner) : base(owner)
        {
            Builder builder = BuilderFromResource("ApsimNG.Resources.Glade.ReportView.glade");

            notebook1  = (Notebook)builder.GetObject("notebook1");
            vbox1      = (VBox)builder.GetObject("vbox1");
            vbox2      = (VBox)builder.GetObject("vbox2");
            alignment1 = (Alignment)builder.GetObject("alignment1");

            panel         = (VPaned)builder.GetObject("vpaned1");
            panel.Events |= Gdk.EventMask.PropertyChangeMask;
            panel.AddNotification(OnPropertyNotified);

            groupByEdit = new EditView(owner,
                                       (Entry)builder.GetObject("groupByEdit"));

            mainWidget = notebook1;

            variableEditor = new EditorView(this);
            variableEditor.StyleChanged += OnStyleChanged;
            vbox1.PackStart(variableEditor.MainWidget, true, true, 0);

            frequencyEditor = new EditorView(this);
            frequencyEditor.StyleChanged += OnStyleChanged;
            vbox2.PackStart(frequencyEditor.MainWidget, true, true, 0);

            dataStoreView1 = new ViewBase(this, "ApsimNG.Resources.Glade.DataStoreView.glade");
            alignment1.Add(dataStoreView1.MainWidget);
            mainWidget.Destroyed += _mainWidget_Destroyed;
        }
Exemplo n.º 2
0
        /// <summary>Initializes a new instance of the <see cref="DataStoreView" /> class.</summary>
        public DataStoreView(ViewBase owner) : base(owner)
        {
            Builder builder = MasterView.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;
        }
Exemplo n.º 3
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);
        }
Exemplo n.º 4
0
        /// <summary>Constructor</summary>
        /// <param name="owner">The owner widget.</param>
        public FactorView(ViewBase owner)
            : base(owner)
        {
            Builder builder = BuilderFromResource("ApsimNG.Resources.Glade.FactorView.glade");
            mainWidget = (VBox)builder.GetObject("vbox");
            mainWidget.Destroyed += OnMainWidgetDestroyed;

            Specification = new EditView(owner,
                                         (Entry)builder.GetObject("specificationEditBox"));
        }
Exemplo n.º 5
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;
 }
Exemplo n.º 6
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);
 }
Exemplo n.º 7
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);
 }
Exemplo 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)
 {
     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;
 }
Exemplo n.º 9
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);
        }
Exemplo n.º 10
0
        /// <summary>Constructor</summary>
        /// <param name="owner">The owner widget.</param>
        public ExperimentView(ViewBase owner) : base(owner)
        {
            Builder builder = BuilderFromResource("ApsimNG.Resources.Glade.ExperimentView.glade");

            mainWidget            = (VBox)builder.GetObject("vbox");
            mainWidget.Destroyed += OnMainWidgetDestroyed;

            List = new ListView(owner,
                                (Gtk.TreeView)builder.GetObject("list"),
                                (Gtk.Menu)builder.GetObject("popupMenu"));
            MaximumNumSimulations = new EditView(owner,
                                                 (Entry)builder.GetObject("maxNumSimulationsEdit"));
            NumberSimulationsLabel = new LabelView(owner,
                                                   (Label)builder.GetObject("numberOfSimulationsLabel"));
            RunAPSIMAction      = new MenuItemView((Gtk.MenuItem)builder.GetObject("runMenuItem"));
            EnableAction        = new MenuItemView((Gtk.MenuItem)builder.GetObject("enableMenuItem"));
            DisableAction       = new MenuItemView((Gtk.MenuItem)builder.GetObject("disableMenuItem"));
            ExportToCSVAction   = new MenuItemView((Gtk.MenuItem)builder.GetObject("exportToCSVMenuItem"));
            ImportFromCSVAction = new MenuItemView((Gtk.MenuItem)builder.GetObject("importFromCSVMenuItem"));
        }
Exemplo n.º 11
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;
        }
Exemplo n.º 12
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);
     }
 }
Exemplo n.º 13
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;
        }
Exemplo n.º 14
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;
        }
Exemplo n.º 15
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);
        }
Exemplo n.º 16
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);
        }
Exemplo n.º 17
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;
        }
Exemplo n.º 18
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);
        }