示例#1
0
        public override void AddedToContainer()
        {
            base.AddedToContainer();

            columnListBox = new ColumnListBox();
            columnListBox.Initialize(4);
            AddDrawBox(columnListBox);
            columnListBox.SetIntOrStringSort(false, true, true, true);
            columnListBox.SetColumnName(0, "Name");
            columnListBox.SetColumnName(1, "GeneID");
            columnListBox.SetColumnName(2, "Bias");
            columnListBox.SetColumnName(3, "Connections");
            columnListBox.Width  = 200;
            columnListBox.Height = 200;

            columnListBox.ItemDoubleClicked += delegate(object sender, TakaGUI.DrawBoxes.ColumnListBox.ListBoxRow item, int index)
            {
                T neuron = null;
                foreach (var n in neuronList)
                {
                    if (n.ID == (uint)item.ExtraValues[0])
                    {
                        neuron = n;
                    }
                }

                if (neuron != null)
                {
                    EditNeuronForm.ShowDialogue(Parent, neuron, delegate(object _sender)
                    {
                        ReloadListBox();
                    });
                }
            };

            ReloadListBox();

            var okButton = new ResizableButton();

            okButton.Initialize();
            AddDrawBox(okButton);
            okButton.Title = "OK";
            okButton.FitToText();
            Push.ToTheBottomSideOf(okButton, columnListBox, 3, Push.VerticalAlign.Left);
            okButton.Width  = 200;
            okButton.Click += delegate(object sender)
            {
                Close();
            };

            Wrap();

            columnListBox.Alignment = DrawBoxAlignment.GetFull();
            okButton.Alignment      = DrawBoxAlignment.GetLeftRightBottom();

            X = (Parent.Width / 2) - (Width / 2);
            Y = (Parent.Height / 2) - (Height / 2);
        }
示例#2
0
        public static EditNeuronForm ShowDialogue(Window window, RMP_Neuron _neuronGene, CloseEvent closeFunction = null, string category = null, ISkinFile file = null)
        {
            var form = new EditNeuronForm();

            form.Initialize(_neuronGene, closeFunction, "Edit Neuron", true, true, category, file);
            form.Show(window);

            return(form);
        }