Exemplo n.º 1
0
        public frmHome()
        {
            LanguageHelper.SetLang(Profile.getLang(), this, typeof(frmHome));

            InitializeComponent();
            panel1.Visible = false;

            Text += ((decimal)App.VERSION / 10).ToString("0.0");

            if (Profile.networkMode() == Profile.NetworkMode.LAN)
            {
                rbLan.Checked = true;
            }
            else
            {
                rbWan.Checked = true;
            }

            if (Profile.boxResolution() == Profile.BoxResolution.R1280_720)
            {
                rb1280.Checked = true;
                LocationCalc.setScreen(1280, 720);
            }
            else
            {
                rb1920.Checked = true;
                LocationCalc.setScreen(1920, 1080);
            }

            // Initialize MaterialSkinManager
            materialSkinManager = MaterialSkinManager.Instance;
            materialSkinManager.AddFormToManage(this);
            materialSkinManager.Theme = MaterialSkinManager.Themes.LIGHT;
            // materialSkinManager.ColorScheme = new ColorScheme(Primary.BlueGrey800, Primary.BlueGrey900, Primary.BlueGrey500, Accent.LightBlue200, TextShade.WHITE);
            materialSkinManager.ColorScheme = new ColorScheme(Primary.Indigo500, Primary.Indigo700, Primary.Indigo100, Accent.Pink200, TextShade.WHITE);

            frmMain progEdit = new frmMain();

            tbcHome.TabPages[0].Controls.Add(progEdit);
            progEdit.Dock = DockStyle.Fill;

            ProgramRelease progRel = new ProgramRelease();

            // ucProgSend.Size = tbcHome.TabPages[1].Size;
            tbcHome.TabPages[1].Controls.Add(progRel);
            progRel.Dock = DockStyle.Fill;

            BgTemplate bgTemplate = new BgTemplate(tbcHome, progEdit);

            // ucProgSend.Size = tbcHome.TabPages[1].Size;
            tbcHome.TabPages[2].Controls.Add(bgTemplate);
            bgTemplate.Dock = DockStyle.Fill;

            BoxCtrl boxCtrl = new BoxCtrl();

            // ucProgSend.Size = tbcHome.TabPages[1].Size;
            tbcHome.TabPages[3].Controls.Add(boxCtrl);
            boxCtrl.Dock = DockStyle.Fill;
        }
Exemplo n.º 2
0
        public override void Draw(Graphics g)
        {
            base.Draw(g);

            //Console.WriteLine(parent.Location.ToString());
            //Console.WriteLine(parent.FindForm().PointToClient(parent.Parent.PointToScreen(parent.Location)).ToString());
            //Console.WriteLine(" " + ToScreenX(Path.GetBounds().X));
            //Console.WriteLine(" " + ToScreenY(Path.GetBounds().Y));
            //Console.WriteLine(" " + ToScreenX(Path.GetBounds().Width));
            //Console.WriteLine(" " + ToScreenY(Path.GetBounds().Height));

            //LocationChgEventArgs e = new LocationChgEventArgs();

            // 用户设定坐标后,  无需转换得到屏幕坐标值
            // 除非又再移动 /缩放
            if (UserSetPos == false)
            {
                Prop.x = LocationCalc.ToScreenX(Path.GetBounds().X, parent.Width);
                Prop.y = LocationCalc.ToScreenY(Path.GetBounds().Y, parent.Height);
                Prop.w = LocationCalc.ToScreenX(Path.GetBounds().Width, parent.Width);
                Prop.h = LocationCalc.ToScreenY(Path.GetBounds().Height, parent.Height);
            }

            Prop.fx  = Path.GetBounds().X;
            Prop.fy  = Path.GetBounds().Y;
            Prop.fx1 = Path.GetBounds().X + Path.GetBounds().Width;
            Prop.fy1 = Path.GetBounds().Y + Path.GetBounds().Height;

            //Prop.fx = Path.GetBounds()X

            if (LocationChanged != null)
            {
                LocationChanged(this, Prop);
            }

            //LastLocation = e;
            if (ItemType == AdItemType.Video && Path.GetBounds().Width != 0)
            {
                //g.DrawString("没有添加视频文件,为HDMI输入窗口", new Font("Arial", 10), new SolidBrush(Color.White), Path.GetBounds());
                g.DrawString("请添加视频!", new Font("Arial", 10), new SolidBrush(Color.White), Path.GetBounds());
            }

            if (ItemType == AdItemType.Picture && Path.GetBounds().Width != 0)
            {
                g.DrawString("请添加图片!", new Font("Arial", 10), new SolidBrush(Color.Black), Path.GetBounds());
            }

            if (Mlabel != null)
            {
                Mlabel.Width    = (int)Path.GetBounds().Width;
                Mlabel.Height   = (int)Path.GetBounds().Height;
                Mlabel.Location = new Point((int)(Path.GetBounds().Location.X), (int)(Path.GetBounds().Location.Y));
            }

            if (_bitmap != null)
            {
                g.DrawImage(_bitmap, base.Path.GetBounds());
            }
        }
Exemplo n.º 3
0
        private void frmMain_Load(object sender, EventArgs e)
        {
            Console.WriteLine("frmMain_Load");
            this.ParentForm.FormClosing += (s, evt) => { OnHandleDestroyed(new EventArgs()); };

            //frmSend fs = new frmSend();
            //fs.ShowDialog();
            if (!App.VIDEO)
            {
                tsAddVideo.Enabled = tsAddVideo.Visible = false;
            }

            //miHDMIFullscr.Enabled = miHDMIFullscr.Visible = false;

            //FormBorderStyle = FormBorderStyle.FixedSingle;
            ///TODO: 时间,日期, 星期几

            gbDrawTool.Enabled    = false;
            txtSceneName.Enabled  = false;
            btSceneRename.Enabled = btSceneDel.Enabled = btOpenScene.Enabled = false;
            //btCloseScene.Enabled = false;

            //btSceneDown.Enabled = btSceneUp.Enabled = false;
            //btnSend.Enabled =   false;

            //btSceneNewSave.Enabled = false;
            muDelElement.Enabled = false;
            updateCtrlEnable(AdItemType.Select);
            tsFontname.SelectedIndex = 0;


            initialCavans();
            initialData();

            //_pScreen = pScreen.FindForm().PointToClient(pScreen.Parent.PointToScreen(pScreen.Location));

            for (int i = 10; i <= 200; i += 5)
            {
                tsFontsize.Items.Add(i);
            }

            loadScene();

            //cmBox.Items.Insert(0, new ToolStripLabel("终端控制"));
            //cmBox.Items.Insert(1, new ToolStripSeparator());

            btSceneNewSave.Focus();
            btSceneNewSave.Select();

            setScreenWH();

            log.e("CanvasMain: " + CanvasMain.Size);
            LocationCalc.setCanvas(CanvasMain.Size);
        }
Exemplo n.º 4
0
        private void rb1920_CheckedChanged(object sender, EventArgs e)
        {
            RadioButton rb = sender as RadioButton;

            if (rb != null)
            {
                if (rb.Checked)
                {
                    LocationCalc.setScreen(1920, 1080);
                    Profile.boxResolution(Profile.BoxResolution.R1920_1080);
                }
            }
        }