コード例 #1
0
        public CrewMemberPanel()
        {
            this.MouseDown += new MouseEventHandler(CrewPanel_MouseDown);
            this.MouseMove += new MouseEventHandler(CrewPanel_MouseMove);
            this.MouseUp += new MouseEventHandler(CrewPanel_MouseUp);
            this.MouseLeave += new EventHandler(CrewPanel_MouseLeave);
            this.MouseEnter += new EventHandler(CrewPanel_MouseEnter);
            this.PreviewKeyDown += new PreviewKeyDownEventHandler(CrewPanel_PreviewKeyDown);
            this.AllowDrop = true;
            this.BackgroundImageLayout = ImageLayout.Stretch;
            this.BackColor = Color.Transparent;
            this.BorderStyle = BorderStyle.FixedSingle;

            nameLabel = new Label();
            nameLabel.AutoSize = false;
            nameLabel.Location = new Point(0, 0);
            nameLabel.TextAlign = ContentAlignment.MiddleLeft;
            nameLabel.DoubleClick += new EventHandler(NameLabel_DoubleClick);
            nameLabel.MouseDown += new MouseEventHandler(CrewPanel_MouseDown);
            nameLabel.MouseMove += new MouseEventHandler(CrewPanel_MouseMove);
            nameLabel.MouseUp += new MouseEventHandler(CrewPanel_MouseUp);
            nameLabel.MouseLeave += new EventHandler(CrewPanel_MouseLeave);
            nameLabel.MouseEnter += new EventHandler(CrewPanel_MouseEnter);
            nameLabel.BorderStyle = BorderStyle.FixedSingle;
            this.Controls.Add(nameLabel);

            activityLabel = new Label();
            activityLabel.AutoSize = false;
            activityLabel.TextAlign = ContentAlignment.MiddleLeft;
            activityLabel.DoubleClick += new EventHandler(activityLabel_DoubleClick);
            activityLabel.MouseDown += new MouseEventHandler(CrewPanel_MouseDown);
            activityLabel.MouseMove += new MouseEventHandler(CrewPanel_MouseMove);
            activityLabel.MouseUp += new MouseEventHandler(CrewPanel_MouseUp);
            activityLabel.MouseLeave += new EventHandler(CrewPanel_MouseLeave);
            activityLabel.MouseEnter += new EventHandler(CrewPanel_MouseEnter);
            activityLabel.BorderStyle = BorderStyle.FixedSingle;
            this.Controls.Add(activityLabel);

            nameBox = new AdjHeightTextBox();
            nameBox.Dock = DockStyle.Fill;
            nameBox.TextAlign = HorizontalAlignment.Left;
            nameBox.Leave += new EventHandler(nameBox_Leave);
            nameBox.KeyPress += new KeyPressEventHandler(nameBox_KeyPress);
            nameBox.Visible = false;
            nameLabel.Controls.Add(nameBox);

            activityBox = new AdjHeightTextBox();
            activityBox.Dock = DockStyle.Fill;
            activityBox.TextAlign = HorizontalAlignment.Left;
            activityBox.Leave += new EventHandler(roleBox_Leave);
            activityBox.KeyPress += new KeyPressEventHandler(roleBox_KeyPress);
            activityBox.Visible = false;
            activityLabel.Controls.Add(activityBox);

            DeleteBox = new PictureBox();
            DeleteBox.Width = 20;
            DeleteBox.Dock = DockStyle.Right;
            DeleteBox.BackgroundImageLayout = ImageLayout.Zoom;
            DeleteBox.BackgroundImage = global::MetaVideoEditor.Properties.Resources.delete;
            DeleteBox.MouseLeave += new EventHandler(CrewPanel_MouseLeave);
            DeleteBox.MouseEnter += new EventHandler(CrewPanel_MouseEnter);
            DeleteBox.Visible = false;
            this.Controls.Add(DeleteBox);

            ContextMenuStrip contextMenu = new ContextMenuStrip();
            ContextMenuItem editNameMenu = new ContextMenuItem();
            editNameMenu.Text = Kernel.Instance.GetString("EditNameActTab");
            editNameMenu.DefaultItem = true;
            editNameMenu.Click += new EventHandler(NameLabel_DoubleClick);
            ContextMenuItem editActivityMenu = new ContextMenuItem();
            editActivityMenu.Text = Kernel.Instance.GetString("EditActivityCreTab");
            editActivityMenu.Click += new EventHandler(activityLabel_DoubleClick);
            ContextMenuItem deleteMenu = new ContextMenuItem();
            deleteMenu.Text = Kernel.Instance.GetString("DeleteMW");
            deleteMenu.Click += new EventHandler(deleteMenu_Click);

            contextMenu.Items.Add(editNameMenu);
            contextMenu.Items.Add(editActivityMenu);
            contextMenu.Items.Add(deleteMenu);
            this.ContextMenuStrip = contextMenu;
        }
コード例 #2
0
        public TrailerPanel()
        {
            this.MouseDown += new MouseEventHandler(TextPanel_MouseDown);
            this.MouseMove += new MouseEventHandler(TextPanel_MouseMove);
            this.MouseUp += new MouseEventHandler(TextPanel_MouseUp);
            this.MouseLeave += new EventHandler(TextPanel_MouseLeave);
            this.MouseEnter += new EventHandler(TextPanel_MouseEnter);
            this.PreviewKeyDown += new PreviewKeyDownEventHandler(TextPanel_PreviewKeyDown);
            this.BackgroundImageLayout = ImageLayout.Stretch;
            this.BackColor = Color.Transparent;
            this.BorderStyle = BorderStyle.FixedSingle;

            textLabel = new Label();
            textLabel.AutoSize = false;
            textLabel.Font = new Font("Microsoft Sans Serif", 11F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0)));
            textLabel.Dock = DockStyle.Fill;
            textLabel.TextAlign = ContentAlignment.MiddleLeft;
            textLabel.DoubleClick += new EventHandler(TextLabel_DoubleClick);
            textLabel.MouseDown += new MouseEventHandler(TextPanel_MouseDown);
            textLabel.MouseMove += new MouseEventHandler(TextPanel_MouseMove);
            textLabel.MouseUp += new MouseEventHandler(TextPanel_MouseUp);
            textLabel.MouseLeave += new EventHandler(TextPanel_MouseLeave);
            textLabel.MouseEnter += new EventHandler(TextPanel_MouseEnter);
            this.Controls.Add(textLabel);

            textBox = new AdjHeightTextBox();
            textBox.Dock = DockStyle.Fill;
            textBox.TextAlign = HorizontalAlignment.Left;
            textBox.Leave += new EventHandler(textBox_Leave);
            textBox.KeyPress += new KeyPressEventHandler(textBox_KeyPress);
            textBox.Visible = false;
            textLabel.Controls.Add(textBox);

            DeleteBox = new PictureBox();
            DeleteBox.Width = 20;
            DeleteBox.Dock = DockStyle.Right;
            DeleteBox.BackgroundImageLayout = ImageLayout.Zoom;
            DeleteBox.BackgroundImage = global::MetaVideoEditor.Properties.Resources.delete;
            DeleteBox.MouseLeave += new EventHandler(TextPanel_MouseLeave);
            DeleteBox.MouseEnter += new EventHandler(TextPanel_MouseEnter);
            DeleteBox.Visible = false;
            this.Controls.Add(DeleteBox);

            contextMenu = new ContextMenuStrip();
            ContextMenuItem playMenu = new ContextMenuItem();
            playMenu.Text = Kernel.Instance.GetString("PlayTraTab");
            playMenu.DefaultItem = true;
            playMenu.Image = global::MetaVideoEditor.Properties.Resources.play;
            playMenu.Click += new EventHandler(playMenu_Click);

            dlMenu = new ContextMenuItem();
            dlMenu.Text = Kernel.Instance.GetString("DownloadTraTab");
            dlMenu.Image = global::MetaVideoEditor.Properties.Resources.download;
            dlMenu.Click += new EventHandler(dlMenu_Click);

            ContextMenuItem editMenu = new ContextMenuItem();
            editMenu.Text = Kernel.Instance.GetString("EditMW");
            editMenu.Image = global::MetaVideoEditor.Properties.Resources.edit;
            editMenu.Click += new EventHandler(editMenu_Click);

            ContextMenuItem deleteMenu = new ContextMenuItem();
            deleteMenu.Text = Kernel.Instance.GetString("DeleteMW");
            deleteMenu.Image = global::MetaVideoEditor.Properties.Resources.delete;
            deleteMenu.Click += new EventHandler(deleteMenu_Click);

            contextMenu.Items.Add(playMenu);
            contextMenu.Items.Add(editMenu);
            contextMenu.Items.Add(dlMenu);
            contextMenu.Items.Add(deleteMenu);
            this.ContextMenuStrip = contextMenu;
        }