Example #1
0
        private void filmLabel_MouseUp(object sender, MouseEventArgs e)
        {
            if (isMouseDown == true && e.Button == System.Windows.Forms.MouseButtons.Left)
            {
                ColorBorderLabel label = sender as ColorBorderLabel;

                // 计算放映计划时间表的屏幕坐标
                int x = spPanShowPlan.Location.X + scSplit.Location.X + scSplit.SplitterDistance + scSplit.SplitterWidth;
                int y = spPanShowPlan.Location.Y + panShowPlanContainer.Location.Y + scSplit.Location.Y;

                // 计算放映计划时间表的控件区域(屏幕坐标)
                Rectangle showPlanRectangle = new Rectangle(x, y, spPanShowPlan.Width, spPanShowPlan.Height);

                if (showPlanRectangle.Contains(tempLabel.Location) == true)
                {
                    spPanShowPlan.Controls.Add(tempLabel);
                }
                else
                {
                    ShowPlan showPlan = tempLabel.Tag as ShowPlan;
                    dataManager.RemoveTempData(showPlan);

                    this.Controls.Remove(tempLabel);
                    tempLabel.IsEnableTimeLabel = false;
                    tempLabel.Dispose();
                }

                isMouseDown = false;
            }
        }
Example #2
0
        private void filmLabel_MouseDown(object sender, MouseEventArgs e)
        {
            try
            {
                if (e.Button == System.Windows.Forms.MouseButtons.Left)
                {
                    ColorBorderLabel label = sender as ColorBorderLabel;

                    // 计算被点击电影的屏幕坐标
                    int x = label.Location.X + flPanFilm.Location.X + gbFilm.Location.X + scSplit.Location.X;
                    int y = label.Location.Y + flPanFilm.Location.Y + gbFilm.Location.Y + scSplit.Location.Y;

                    // 计算被点击电影的坐标偏移量(相对于屏幕坐标)
                    xOffset = Control.MousePosition.X - x;
                    yOffset = Control.MousePosition.Y - y;

                    tempLabel = GetNewTempFilmLabel(label);

                    //ShowPlan film = tempLabel.Tag as ShowPlan;
                    //if (film==null||film.FilmLength == null || film.FilmLength == 0)
                    //{
                    //    MessageBox.Show("影片时长为空,请先进行设置!", "信息提示",MessageBoxButtons.OK,MessageBoxIcon.Error);
                    //    return;
                    //}
                    this.Controls.Add(tempLabel);

                    tempLabel.Location = new Point(x, y);
                    tempLabel.BringToFront();

                    tempLabel.IsEnableTimeLabel = true;


                    isMouseDown = true;
                }
                if (e.Button == System.Windows.Forms.MouseButtons.Right)
                {
                    string           id;
                    ColorBorderLabel label = sender as ColorBorderLabel;

                    FilmAndFilmMode showPlan = label.Tag as FilmAndFilmMode;
                    id = showPlan.FilmId;
                    if (showPlan.HasMode == true && showPlan.FilmModeId != null && showPlan.Film_FilmModeId != null && showPlan.FilmId.IndexOf(';') == -1)
                    {
                        id += ";" + showPlan.FilmModeId;
                    }
                    FilmSet(id, 1);
                }
            }
            catch { }
        }
Example #3
0
        /// <summary>
        /// 根据电影方块信息,生成临时电影方块
        /// </summary>
        /// <param name="label"></param>
        /// <returns></returns>
        private ColorBorderLabel GetNewTempFilmLabel(ColorBorderLabel label)
        {
            FilmAndFilmMode film = label.Tag as FilmAndFilmMode;

            ColorBorderLabel colorBorderLabel = new ColorBorderLabel(dataManager);


            colorBorderLabel.BackColor   = label.BackColor;
            colorBorderLabel.BorderColor = label.BorderColor;
            colorBorderLabel.Width       = spPanShowPlan.GetFilmLabelWidth(film);
            colorBorderLabel.TextAlign   = label.TextAlign;

            colorBorderLabel.Text = label.Text;
            colorBorderLabel.Font = fontOfFilmLabel;
            colorBorderLabel.Tag  = dataManager.GetNewShowPlan(film);

            return(colorBorderLabel);
        }
Example #4
0
        /// <summary>
        /// 不从数据库更新
        /// </summary>
        private void RefreshLoadFilmList(List <FilmAndFilmMode> filmAndFilmModeList)
        {
            string[] defineColor = dataManager.GetColor;
            this.flPanFilm.Controls.Clear();
            Color color;

            foreach (var film in filmAndFilmModeList.OrderBy(p => p.FilmId).ToList())
            {
                ColorBorderLabel filmLabel = new ColorBorderLabel(dataManager);
                filmLabel.BackColor = Color.White;

                filmLabel.Width     = 138;
                filmLabel.Margin    = new Padding(0, 5, 0, 0);
                filmLabel.TextAlign = ContentAlignment.MiddleLeft;
                filmLabel.Font      = fontOfFilmLabel;

                if (film.HasMode == true)
                {
                    if (film.Film_FilmModeColorCode != null && film.Film_FilmModeColorCode.Trim() != string.Empty)
                    {
                        try
                        {
                            string[] Array = film.Film_FilmModeColorCode.Split(';');
                            color = Color.FromArgb(Convert.ToInt32(Array[0]), Convert.ToInt32(Array[1]), Convert.ToInt32(Array[2]), Convert.ToInt32(Array[3]));
                            filmLabel.BorderColor = color;
                        }
                        catch
                        {
                            filmLabel.BorderColor = Color.Black;
                        }
                    }
                    else
                    {
                        filmLabel.BorderColor = Color.Black;
                    }

                    if (film.HasMode == true && film.Film_FilmModeId != null && film.FilmModeId != null && film.FilmModeName != null)
                    {
                        filmLabel.Text = film.FilmName + "(" + film.FilmModeName + ")";
                    }
                    else
                    {
                        filmLabel.Text = film.FilmName;
                    }
                }
                else
                {
                    if (film.ColorCode != null && film.ColorCode.Trim() != string.Empty)
                    {
                        try
                        {
                            string[] Array = film.ColorCode.Split(';');
                            color = Color.FromArgb(Convert.ToInt32(Array[0]), Convert.ToInt32(Array[1]), Convert.ToInt32(Array[2]), Convert.ToInt32(Array[3]));
                            filmLabel.BorderColor = color;
                        }
                        catch
                        {
                            filmLabel.BorderColor = Color.Black;
                        }
                    }
                    else
                    {
                        filmLabel.BorderColor = Color.Black;
                    }
                    filmLabel.Text = film.FilmName;
                }


                filmLabel.Tag = film;

                filmLabel.MouseDown += new MouseEventHandler(filmLabel_MouseDown);
                filmLabel.MouseMove += new MouseEventHandler(filmLabel_MouseMove);
                filmLabel.MouseUp   += new MouseEventHandler(filmLabel_MouseUp);
                this.flPanFilm.Controls.Add(filmLabel);
            }
        }