コード例 #1
0
ファイル: NeuronForms.cs プロジェクト: lukastk/EvoSim
        public override void AddedToContainer()
        {
            base.AddedToContainer();

            columnListBox = new ColumnListBox();
            columnListBox.Initialize(4);
            AddDrawBox(columnListBox);
            columnListBox.SetIntOrStringSort(true, true, true, true);
            columnListBox.SetColumnName(0, "ID");
            columnListBox.SetColumnName(1, "Source");
            columnListBox.SetColumnName(1, "Target");
            columnListBox.SetColumnName(3, "Weight");
            columnListBox.Width  = 200;
            columnListBox.Height = 200;

            columnListBox.ItemDoubleClicked += delegate(object sender, TakaGUI.DrawBoxes.ColumnListBox.ListBoxRow item, int index)
            {
                RMP_Connection connection = null;
                foreach (var c in connections)
                {
                    if (c.ID == (uint)item.Values[0])
                    {
                        connection = c;
                    }
                }

                if (connection != null)
                {
                    EditConnectionForm.ShowDialogue(Parent, connection, 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
ファイル: NeuronForms.cs プロジェクト: lukastk/EvoSim
        public static EditConnectionForm ShowDialogue(Window window, RMP_Connection _connection, CloseEvent closeFunction = null, string category = null, ISkinFile file = null)
        {
            var form = new EditConnectionForm();

            form.Initialize(_connection, closeFunction, "Edit Connection-gene", true, true, category, file);
            form.Show(window);

            return(form);
        }