コード例 #1
0
        private void CreateControlLayout()
        {
            Headlabel.Text = $"Value";

            numericUpDown             = new NumUpDown();
            numericUpDown.Location    = Headlabel.Underneath().AddY(2).AddX(4);
            numericUpDown.Width       = this.Width / 2;
            numericUpDown.Maximum     = ushort.MaxValue;
            numericUpDown.BorderStyle = BorderStyle.None;


            numericUpDown.ValueChanged += (_, __) =>
            {
            };
            this.Height = numericUpDown.Bottom;

            var pos = new Point()
            {
                X = this.ClientRectangle.Width - 16,
                Y = Headlabel.Bottom
            };

            Output          = new ConnectionPoint(typeof(ushort));
            Output.Location = pos;
            Output.OnConnectionStateChange += (_, e) => { base.RaiseFeebackEvent(new FeebackEventArgs(e)); };
            Output.SetColor(COLORVALUE);

            this.Height = Output.Bottom;
            this.Controls.Add(numericUpDown);
            this.Controls.Add(Output);
        }
コード例 #2
0
        private void CreateControlLayout()
        {
            Headlabel.Text = $"Media";

            if (MainForm.Project != null)
            {
                string ps = "\\";
                string p  = $"{MainForm.Project.ProjectPath}{ps}{MainForm.Project.MediaPath.Replace(ps, "")}";
                if (Directory.Exists(p))
                {
                    sfw                     = new FileSystemWatcher(p);
                    sfw.Changed            += Sfw_Changed;
                    sfw.NotifyFilter        = NotifyFilters.Size;
                    sfw.EnableRaisingEvents = true;
                }
            }

            comboBox = new ComboBox
            {
                Location = Headlabel.Underneath(),
                Width    = this.Width / 2
            };
            foreach (var item in Directory.GetFiles(sfw.Path))
            {
                var f = Path.GetFileNameWithoutExtension(item);
                comboBox.Items.Add(f);
            }


            comboBox.DropDownStyle = ComboBoxStyle.DropDownList;

            if (comboBox.Items.Count > 0)
            {
                comboBox.SelectedIndex = 0;
            }

            var pos = new Point()
            {
                X = this.ClientRectangle.Width - 16,
                Y = Headlabel.Bottom
            };

            Output          = new ConnectionPoint(typeof(IOIDAction));
            Output.Location = pos;
            Output.OnConnectionStateChange += (_, e) => { base.RaiseFeebackEvent(new FeebackEventArgs(e)); };
            Output.SetColor(COLORACTION);

            this.Height = Output.Bottom;
            this.Controls.Add(comboBox);
            this.Controls.Add(Output);

            this.DoubleClick += (_, __) =>
            {
                var no = NodeObject(true);
                if (no != null && no is IOIDAction oID)
                {
                    RaiseMessageEvent(new MessageEventArgs($"{oID.GetActionString}"));
                }
            };
        }
コード例 #3
0
        private void CreateControlLayout()
        {
            Headlabel.Text = $"Manipulate";

            comboBox = new ComboBox();

            comboBox.Location = Headlabel.Underneath();
            comboBox.Width    = this.Width;
            comboBox.Items.AddRange(Enum.GetValues(typeof(MathOperators)).Cast <object>().ToArray());
            comboBox.DropDownStyle = ComboBoxStyle.DropDownList;
            comboBox.SelectedIndex = 0;

            Output          = new ConnectionPoint(typeof(IOIDAction));
            Output.Location = new Point(this.Width - Output.Width, comboBox.Bottom);
            Output.OnConnectionStateChange += (_, e) => { base.RaiseFeebackEvent(new FeebackEventArgs(e)); };
            Output.SetColor(COLORACTION);

            InputA          = new ConnectionPoint(new Type[] { typeof(OIDRegister) });
            InputA.Location = new Point(0, comboBox.Bottom);
            InputA.OnConnectionStateChange += (_, e) => { base.RaiseFeebackEvent(new FeebackEventArgs(e)); };
            InputA.SetColor(COLORREGISTER);

            HeadLabel l2 = new HeadLabel();

            l2.Text     = $"Register Only";
            l2.Location = InputA.RightFrom().AddY(2);

            InputB          = new ConnectionPoint(new Type[] { typeof(OIDRegister), typeof(ushort) });
            InputB.Location = new Point(0, InputA.Bottom);
            InputB.OnConnectionStateChange += (_, e) => { base.RaiseFeebackEvent(new FeebackEventArgs(e)); };
            InputB.SetColor(COLORREGVALUE);

            HeadLabel l3 = new HeadLabel();

            l3.Text     = $"Register, Value";
            l3.Location = InputB.RightFrom().AddY(3);

            this.Height = InputB.Bottom;
            this.Controls.Add(l2);
            this.Controls.Add(l3);
            this.Controls.Add(comboBox);
            this.Controls.Add(Output);
            this.Controls.Add(InputA);
            this.Controls.Add(InputB);

            this.DoubleClick += (_, __) =>
            {
                var no = NodeObject(true);
                if (no != null && no is IOIDAction oID)
                {
                    RaiseMessageEvent(new MessageEventArgs($"{oID.GetActionString}"));
                }
            };
        }
コード例 #4
0
ファイル: MediaNode.cs プロジェクト: ChristophSilge/TipToiGui
        private void CreateControlLayout()
        {
            Headlabel.Text = $"Media";

            if (MainForm.Project != null)
            {
            }

            comboBox = new ComboBox
            {
                Location = Headlabel.Underneath(),
                Width    = this.Width / 2
            };
            comboBox.Items.AddRange(MainForm.Project.MediaFiles.ToArray());



            comboBox.DropDownStyle = ComboBoxStyle.DropDownList;

            if (comboBox.Items.Count > 0)
            {
                comboBox.SelectedIndex = 0;
            }

            var pos = new Point()
            {
                X = this.ClientRectangle.Width - 16,
                Y = Headlabel.Bottom
            };

            Output          = new ConnectionPoint(typeof(IOIDAction));
            Output.Location = pos;
            Output.OnConnectionStateChange += (_, e) => { base.RaiseFeebackEvent(new FeebackEventArgs(e)); };
            Output.SetColor(COLORACTION);

            this.Height = Output.Bottom;
            this.Controls.Add(comboBox);
            this.Controls.Add(Output);

            this.DoubleClick += (_, __) =>
            {
                var no = NodeObject(true);
                if (no != null && no is IOIDAction oID)
                {
                    RaiseMessageEvent(new MessageEventArgs($"{oID.GetActionString}"));
                }
            };
        }