コード例 #1
0
        /// <summary>Initializes a new instance of the <see cref="SummaryView"/> class.</summary>
        public SummaryView(ViewBase owner) : base(owner)
        {
            captureRules     = CreateCaptureRules();
            simulationFilter = CreateSimulationFilter();

            Widget jumpToLogContainer = CreateJumpToLogContainer();

            messageFilters = CreateFilteringWidgets();
            // messageSorting = CreateSortingWidgets();


            mainControl = new VBox();
            mainWidget  = mainControl;
            mainControl.PackStart(captureRules, false, false, 0);
            mainControl.PackStart(messageFilters, false, false, 0);
            // mainControl.PackStart(messageSorting, false, false, 0);
            mainControl.PackStart(simulationFilter, false, false, 0);
            mainControl.PackStart(jumpToLogContainer, 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();
        }
コード例 #2
0
 /// <summary>
 /// Add a description to the right hand view.
 /// </summary>
 /// <param name="description">The description to show.</param>
 public void AddDescriptionToRightHandView(string description)
 {
     if (description == null)
     {
         if (descriptionView != null)
         {
             Widget descriptionWidget = (descriptionView as ViewBase).MainWidget;
             rightHandView.Remove(descriptionWidget);
             descriptionWidget.Cleanup();
         }
         descriptionView = null;
     }
     else
     {
         if (descriptionView == null)
         {
             descriptionView = new MarkdownView(this);
             rightHandView.PackStart(descriptionView.MainWidget, false, false, 0);
         }
         descriptionView.Text = description;
     }
 }
コード例 #3
0
        /// <summary>
        /// Constructor
        /// </summary>
        public UpgradeView(ViewBase owner) : base(owner)
        {
            Builder builder = BuilderFromResource("ApsimNG.Resources.Glade.UpgradeView.glade");

            window1          = (Window)builder.GetObject("window1");
            button1          = (Button)builder.GetObject("button1");
            button2          = (Button)builder.GetObject("button2");
            table1           = (Table)builder.GetObject("table1");
            table2           = (Table)builder.GetObject("table2");
            firstNameBox     = (Entry)builder.GetObject("firstNameBox");
            lastNameBox      = (Entry)builder.GetObject("lastNameBox");
            organisationBox  = (Entry)builder.GetObject("organisationBox");
            emailBox         = (Entry)builder.GetObject("emailBox");
            countryBox       = (ComboBox)builder.GetObject("countryBox");
            label1           = (Label)builder.GetObject("label1");
            licenseContainer = (Container)builder.GetObject("licenseContainer");
            checkbutton1     = (CheckButton)builder.GetObject("checkbutton1");
            listview1        = (Gtk.TreeView)builder.GetObject("listview1");
            alignment7       = (Alignment)builder.GetObject("alignment7");
            oldVersions      = (CheckButton)builder.GetObject("checkbutton2");
            listview1.Model  = listmodel;

            Version version = Assembly.GetExecutingAssembly().GetName().Version;

            if (version.Build == 0)
            {
                button1.Sensitive = false;
                table2.Hide();
                checkbutton1.Hide();
            }

            CellRendererText textRender = new Gtk.CellRendererText();

            textRender.Editable = false;

            TreeViewColumn column0 = new TreeViewColumn("Version", textRender, "text", 0);

            listview1.AppendColumn(column0);
            column0.Sizing    = TreeViewColumnSizing.Autosize;
            column0.Resizable = true;

            TreeViewColumn column1 = new TreeViewColumn("Description", textRender, "text", 1);

            listview1.AppendColumn(column1);
            column1.Sizing    = TreeViewColumnSizing.Autosize;
            column1.Resizable = true;

            // Populate the combo box with a list of valid country names.
            ListStore countries = new ListStore(typeof(string));

            foreach (string country in Constants.Countries)
            {
                countries.AppendValues(country);
            }
            countryBox.Model = countries;

            // Add a cell renderer to the combo box.
            CellRendererText cell = new CellRendererText();

            countryBox.PackStart(cell, false);
            countryBox.AddAttribute(cell, "text", 0);

            // Make the tab order a little more sensible than the defaults
            table1.FocusChain = new Widget[] { alignment7, button1, button2 };
            table2.FocusChain = new Widget[] { firstNameBox, lastNameBox, emailBox, organisationBox, countryBox };

            licenseView = new MarkdownView(owner);
            licenseContainer.Add(licenseView.MainWidget);
            tabbedExplorerView = owner as IMainView;

            window1.TransientFor = owner.MainWidget.Toplevel as Window;
            window1.Modal        = true;
            oldVersions.Toggled += OnShowOldVersionsToggled;
            button1.Clicked     += OnUpgrade;
            button2.Clicked     += OnViewMoreDetail;
            window1.Destroyed   += OnFormClosing;
            window1.MapEvent    += OnShown;
        }