Exemple #1
0
        public SettingsDialog(Window parent) : base("Settings",
                                                    parent,
                                                    DialogFlags.Modal,
                                                    new object[]
        {
            "Cancel", ResponseType.Cancel,
            "Apply", ResponseType.Apply,
            "OK", ResponseType.Ok
        })
        {
            propertyEditor = new PropertyView(null);
            Box box;

#if NETFRAMEWORK
            box           = VBox;
            DefaultWidth  = 640;
            DefaultHeight = 480;
#else
            box = ContentArea;
#endif
            box.PackStart(propertyEditor.MainWidget, true, true, 0);
            propertyEditor.MainWidget.ShowAll();
            propertyEditor.PropertyChanged += OnPropertyChanged;
            Refresh();
        }
Exemple #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TreeProxyView" /> class.
        /// </summary>
        public TreeProxyView(ViewBase owner) : base(owner)
        {
            Builder        builder         = BuilderFromResource("ApsimNG.Resources.Glade.TreeProxyView.glade");
            ScrolledWindow temporalDataTab = (ScrolledWindow)builder.GetObject("scrolledwindow1");
            ScrolledWindow spatialDataTab  = (ScrolledWindow)builder.GetObject("scrolledwindow2");
            VPaned         mainPanel       = (VPaned)builder.GetObject("vpaned1");
            Alignment      constantsTab    = (Alignment)builder.GetObject("alignment1");
            HBox           graphContainer  = (HBox)builder.GetObject("hbox1");

            mainWidget = mainPanel;

            TemporalDataGrid = new GridView(this as ViewBase);
            TemporalDataGrid.CellsChanged += GridCellEdited;
            temporalDataTab.Add((TemporalDataGrid as ViewBase).MainWidget);

            SpatialDataGrid = new GridView(this as ViewBase);
            SpatialDataGrid.CellsChanged += GridCellEdited;
            spatialDataTab.Add((SpatialDataGrid as ViewBase).MainWidget);

            belowGroundGraph       = new PlotView();
            aboveGroundGraph       = new PlotView();
            aboveGroundGraph.Model = new PlotModel();
            belowGroundGraph.Model = new PlotModel();
            plots.Add(aboveGroundGraph);
            plots.Add(belowGroundGraph);
            aboveGroundGraph.SetSizeRequest(-1, 100);
            graphContainer.PackStart(aboveGroundGraph, true, true, 0);
            belowGroundGraph.SetSizeRequest(-1, 100);
            graphContainer.PackStart(belowGroundGraph, true, true, 0);

            Constants = new PropertyView(this);
            constantsTab.Add((Constants as ViewBase).MainWidget);
            MainWidget.ShowAll();
            mainWidget.Destroyed += MainWidgetDestroyed;
        }
Exemple #3
0
        public GraphPanelView(ViewBase owner) : base(owner)
        {
            notebook            = new Notebook();
            notebook.Scrollable = true;

            propertiesView = new PropertyView(this);
            notebook.AppendPage(propertiesView.MainWidget, new Label("Properties"));

            mainWidget = notebook;
        }
Exemple #4
0
        /// <summary>Constructor</summary>
        public PropertyAndGridView(ViewBase owner) : base(owner)
        {
            PropertiesView = new PropertyView(owner);
            Grid2          = new GridView(owner);

            VPaned panel = new VPaned();

            mainWidget = panel;
            panel.Pack1((PropertiesView as ViewBase).MainWidget, true, false);
            panel.Pack2((Grid2 as ViewBase).MainWidget, true, false);
            mainWidget.Destroyed += _mainWidget_Destroyed;
        }
        /// <summary>
        /// Creates a LinearAfterThresholdView instance.
        /// </summary>
        /// <param name="owner">Owner view.</param>
        public LinearAfterThresholdView(ViewBase owner) : base(owner)
        {
            properties = new PropertyView(this);
            graph      = new GraphView(this);

            panel = new Paned(Orientation.Vertical);

            panel.Pack1(properties.MainWidget, false, false);
            panel.Pack2(graph.MainWidget, true, false);
            panel.Destroyed += OnDestroyed;
            mainWidget       = panel;
            mainWidget.ShowAll();
        }
Exemple #6
0
 /// <summary>
 /// Constructor
 /// </summary>
 public ManagerView(ViewBase owner) : base(owner)
 {
     notebook       = new Notebook();
     mainWidget     = notebook;
     propertyEditor = new PropertyView(this);
     scriptEditor   = new EditorView(this)
     {
         ShowLineNumbers = true,
         Language        = "c-sharp",
     };
     notebook.AppendPage(propertyEditor.MainWidget, new Label("Parameters"));
     notebook.AppendPage(((ViewBase)scriptEditor).MainWidget, new Label("Script"));
     mainWidget.Destroyed += _mainWidget_Destroyed;
 }
Exemple #7
0
 private void _mainWidget_Destroyed(object sender, System.EventArgs e)
 {
     try
     {
         propertyEditor.MainWidget.Cleanup();
         propertyEditor = null;
         (scriptEditor as ViewBase)?.MainWidget?.Cleanup();
         scriptEditor          = null;
         mainWidget.Destroyed -= _mainWidget_Destroyed;
         owner = null;
     }
     catch (Exception err)
     {
         ShowError(err);
     }
 }
Exemple #8
0
 public SettingsDialog(Window parent) : base("Settings",
                                             parent,
                                             DialogFlags.Modal,
                                             new object[]
 {
     "Cancel", ResponseType.Cancel,
     "Apply", ResponseType.Apply,
     "OK", ResponseType.Ok
 })
 {
     propertyEditor = new PropertyView(null);
     VBox.PackStart(propertyEditor.MainWidget, true, true, 0);
     propertyEditor.MainWidget.ShowAll();
     propertyEditor.PropertyChanged += OnPropertyChanged;
     Refresh();
 }
Exemple #9
0
 private void _mainWidget_Destroyed(object sender, System.EventArgs e)
 {
     try
     {
         profileGrid.MainWidget.Cleanup();
         profileGrid = null;
         properitesView.MainWidget.Cleanup();
         properitesView = null;
         graph.MainWidget.Cleanup();
         graph = null;
         mainWidget.Destroyed -= _mainWidget_Destroyed;
         owner = null;
     }
     catch (Exception err)
     {
         ShowError(err);
     }
 }
Exemple #10
0
        public ProfileView(ViewBase owner) : base(owner)
        {
            Builder builder = BuilderFromResource("ApsimNG.Resources.Glade.ProfileView.glade");

            vpaned1        = (VPaned)builder.GetObject("vpaned1");
            vpaned2        = (VPaned)builder.GetObject("vpaned2");
            vbox1          = (VBox)builder.GetObject("vbox1");
            mainWidget     = vpaned1;
            properitesView = new PropertyView(this);
            vbox1.PackStart(properitesView.MainWidget, true, true, 0);
            //vpaned1.Pack1(PropertyGrid.MainWidget, true, true);
            profileGrid = new GridView(this);
            profileGrid.NumericFormat = "N3";
            vpaned2.Pack1(profileGrid.MainWidget, true, true);
            graph = new GraphView(this);
            vpaned2.Pack2(graph.MainWidget, true, false);
            graph.MainWidget.Realized += GraphWidget_Realized;
            mainWidget.Destroyed      += _mainWidget_Destroyed;
        }
        /// <summary>Constructor</summary>
        public PropertyAndGridView(ViewBase owner) : base(owner)
        {
            if (Configuration.Settings.UseNewPropertyPresenter)
            {
                PropertiesView = new PropertyView(owner);
            }
            else
            {
                PropertiesView = new GridView(this);
            }
            Grid2 = new GridView(owner);

            VPaned panel = new VPaned();

            mainWidget = panel;
            panel.Pack1((PropertiesView as ViewBase).MainWidget, true, false);
            panel.Pack2((Grid2 as ViewBase).MainWidget, true, false);
            mainWidget.Destroyed += _mainWidget_Destroyed;
        }