Example #1
0
        public QueryLimitBox(QueryOrder [] orders, QueryLimit [] limits) : base()
        {
            this.orders = orders;
            this.limits = limits;

            Spacing = 5;

            enabled_checkbox          = new CheckButton(Catalog.GetString("_Limit to"));
            enabled_checkbox.Toggled += OnEnabledToggled;

            // workaround for bgo#727294, we doubt anyway that it's very useful to have a max higher than 2147483647
            const double max = int.MaxValue;

            count_spin         = new SpinButton(0, max, 1);
            count_spin.Numeric = true;
            count_spin.Digits  = 0;
            count_spin.Value   = 25;
            count_spin.SetSizeRequest(60, -1);

            limit_combo = new ComboBoxText();
            foreach (QueryLimit limit in limits)
            {
                limit_combo.AppendText(limit.Label);
            }

            order_combo = new ComboBoxText();
            order_combo.RowSeparatorFunc = IsRowSeparator;
            foreach (QueryOrder order in orders)
            {
                if (order == null)
                {
                    order_combo.AppendText(String.Empty);
                }
                else
                {
                    order_combo.AppendText(order.Label);
                }
            }

            PackStart(enabled_checkbox, false, false, 0);
            PackStart(count_spin, false, false, 0);
            PackStart(limit_combo, false, false, 0);
            PackStart(new Label(Catalog.GetString("selected by")), false, false, 0);
            PackStart(order_combo, false, false, 0);

            enabled_checkbox.Active = false;
            limit_combo.Active      = 0;
            order_combo.Active      = 0;

            OnEnabledToggled(null, null);

            ShowAll();
        }
Example #2
0
        public QueryLimitBox(QueryOrder [] orders, QueryLimit [] limits) : base()
        {
            this.orders = orders;
            this.limits = limits;

            Spacing = 5;

            enabled_checkbox          = new CheckButton(Catalog.GetString("_Limit to"));
            enabled_checkbox.Toggled += OnEnabledToggled;

            count_spin = new SpinButton(0, double.MaxValue, 1)
            {
                Numeric = true,
                Digits  = 0,
                Value   = 25
            };
            count_spin.SetSizeRequest(60, -1);

            limit_combo = ComboBox.NewText();
            foreach (var limit in limits)
            {
                limit_combo.AppendText(limit.Label);
            }

            order_combo = ComboBox.NewText();
            order_combo.RowSeparatorFunc = IsRowSeparator;
            foreach (var order in orders)
            {
                if (order == null)
                {
                    order_combo.AppendText(string.Empty);
                }
                else
                {
                    order_combo.AppendText(order.Label);
                }
            }

            PackStart(enabled_checkbox, false, false, 0);
            PackStart(count_spin, false, false, 0);
            PackStart(limit_combo, false, false, 0);
            PackStart(new Label(Catalog.GetString("selected by")), false, false, 0);
            PackStart(order_combo, false, false, 0);

            enabled_checkbox.Active = false;
            limit_combo.Active      = 0;
            order_combo.Active      = 0;

            OnEnabledToggled(null, null);

            ShowAll();
        }
Example #3
0
        private void BuildHeader()
        {
            var max = Original.Episodes == 0 ? double.MaxValue : Original.Episodes;
            var adj = new Adjustment(Original.CurrentEpisode, 0, max, 1, 10, 0);

            _episodeSpin = new SpinButton(adj, 1, 0);

            // Pack Episode Spinner
            EpisodeCounter.PackStart(new Label("Episode"), false, false, 20);
            EpisodeCounter.Add(_episodeSpin);
            _episodeSpin.SetSizeRequest(50, 22);
            _episodeSpin.ValueChanged += OnEpisodeChanged;
            EpisodeCounter.PackEnd(new VBox(), true, true, 100);             // push everything left

            // Pack header table
            HeaderTable.NRows    = 3;
            HeaderTable.NColumns = 2;
            HeaderTable.Attach(new Label("Type: \t"), 0, 1, 0, 1, AttachOptions.Shrink, AttachOptions.Expand, 0, 0);
            HeaderTable.Attach(new Label(Enum.GetName(typeof(Anime.ShowTypes), Original.Type)), 1, 2, 0, 1, AttachOptions.Shrink, AttachOptions.Expand, 0, 0);
            HeaderTable.Attach(new Label("Season: \t\t"), 0, 1, 1, 2, AttachOptions.Shrink, AttachOptions.Expand, 0, 0);
            HeaderTable.Attach(new Label(Original.Season.ToString()), 1, 2, 1, 2, AttachOptions.Shrink, AttachOptions.Expand, 0, 0);
            HeaderTable.Attach(new Label("Score: \t"), 0, 1, 2, 3, AttachOptions.Shrink, AttachOptions.Expand, 0, 0);
            HeaderTable.Attach(new Label(Original.Score.ToString(CultureInfo.InvariantCulture)), 1, 2, 2, 3, AttachOptions.Shrink, AttachOptions.Expand, 0, 0);
        }
Example #4
0
        public MainWindow() : base("AIS Model")
        {
            mPlot = new CPlot();

            this.DeleteEvent += (o, args) => {
                args.RetVal = true;
                Application.Quit();
            };



            this.SetSizeRequest(700, 900);

            VBox vbox1 = new VBox(false, 0);

            vbox1.PackStart(mPlot.GetPlotView(), true, false, 0);

            hscale_b = new  SpinButton(0.0, 1.0, 0.1);
            hscale_b.SetSizeRequest(200, -1);
//			hscale_b.UpdatePolicy = SpinButtonUpdatePolicy. UpdateType.Continuous;
            hscale_b.Digits = 1;
//			hscale_b.ValuePos = PositionType.Top;
//			hscale_b.DrawValue = true;
            vbox1.PackStart(new Label("b - которое будем называть коэффициентом «размножения» антигенов"), true, true, 0);
            vbox1.PackStart(hscale_b, true, true, 0);
            hscale_b.ShowAll();
            hscale_b.Changed += Hscale_b_ChangeValue;

            hscale_y = new SpinButton(0.0, 1.0, 0.1);
            hscale_y.SetSizeRequest(200, -1);
//			hscale_y.UpdatePolicy = UpdateType.Continuous;
            hscale_y.Digits = 1;
//			hscale_y.ValuePos = PositionType.Top;
//			hscale_y.DrawValue = true;
            vbox1.PackStart(new Label("y- коэффициент, связанный с вероятностью предотвращения несанкционированных действий;"), true, true, 0);
            vbox1.PackStart(hscale_y, true, true, 0);
            hscale_y.ShowAll();
            hscale_y.Changed += Hscale_b_ChangeValue;


            hscale_a = new SpinButton(0.0, 1.0, 0.1);
            hscale_a.SetSizeRequest(200, -1);
//			hscale_a.UpdatePolicy = UpdateType.Continuous;
            hscale_a.Digits = 1;
//			hscale_a.ValuePos = PositionType.Top;
//			hscale_a.DrawValue = true;
            vbox1.PackStart(new Label("a - коэффициент генерации детекторов"), true, true, 0);
            vbox1.PackStart(hscale_a, true, true, 0);
            hscale_a.ShowAll();
            hscale_a.Changed += Hscale_b_ChangeValue;


            hscale_mc = new SpinButton(0.0, 1.0, 0.1);
            hscale_mc.SetSizeRequest(200, -1);
//			hscale_mc.UpdatePolicy = UpdateType.Continuous;
            hscale_mc.Digits = 1;
//			hscale_mc.ValuePos = PositionType.Top;
//			hscale_mc.DrawValue = true;
            vbox1.PackStart(new Label("mc - коэффициент времени работы детектора"), true, true, 0);
            vbox1.PackStart(hscale_mc, true, true, 0);
            hscale_mc.ShowAll();
            hscale_mc.Changed += Hscale_b_ChangeValue;



            hscale_p = new SpinButton(0.0, 1.0, 0.1);
            hscale_p.SetSizeRequest(200, -1);
//			hscale_p.UpdatePolicy = UpdateType.Continuous;
            hscale_p.Digits = 1;
//			hscale_p.ValuePos = PositionType.Top;
//			hscale_p.DrawValue = true;
            vbox1.PackStart(new Label("p - скорость производства антител одним детектором"), true, true, 0);
            vbox1.PackStart(hscale_p, true, true, 0);
            hscale_p.ShowAll();
            hscale_p.Changed += Hscale_b_ChangeValue;

            hscale_n = new SpinButton(0.0, 1.0, 0.1);
            hscale_n.SetSizeRequest(200, -1);
//			hscale_n.UpdatePolicy = UpdateType.Continuous;
            hscale_n.Digits = 1;
//			hscale_n.ValuePos = PositionType.Top;
//			hscale_n.DrawValue = true;
            vbox1.PackStart(new Label("n - уменьшение числа антител"), true, true, 0);
            vbox1.PackStart(hscale_n, true, true, 0);
            hscale_n.ShowAll();
            hscale_n.Changed += Hscale_b_ChangeValue;

            hscale_mf = new SpinButton(0.0, 1.0, 0.1);
            hscale_mf.SetSizeRequest(200, -1);
//			hscale_mf.UpdatePolicy = UpdateType.Continuous;
            hscale_mf.Digits = 1;
//			hscale_mf.ValuePos = PositionType.Top;
//			hscale_mf.DrawValue = true;
            vbox1.PackStart(new Label("mf - уменьшение количества антител (время жизни)"), true, true, 0);
            vbox1.PackStart(hscale_mf, true, true, 0);
            hscale_mf.ShowAll();
            hscale_mf.Changed += Hscale_b_ChangeValue;

            this.Add(vbox1);


            double b = 1.1;
            double y = 1.0;

            hscale_b.Value = b;
            hscale_y.Value = y;

            double a  = 0.9;
            double mc = 0.2;

            hscale_a.Value  = a;
            hscale_mc.Value = mc;

            double p  = 1.1;
            double n  = 0.1;
            double mf = 0.4;

            hscale_p.Value  = p;
            hscale_n.Value  = n;
            hscale_mf.Value = mf;
        }