Example #1
0
        private void Flash_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
        {
            Control[] Cont = { btnPlay, cmbBox, linkLabel1, Stan, menuStrip1, btnToHTML, btnEpisodesList };

            //Przejdź w tryb pełnoekranowy
            if (e.KeyCode == Keys.F)
            {
                if (Flash.Visible == true)
                {
                    frm.Maximize(this);
                    this.Focus();
                }
            }
            //Wyłącz odtwarzanie i przywróć pierwotne rozmiary okna
            if (e.KeyCode == Keys.Escape)
            {
                if (Flash.Visible == true)
                {
                    frm.Restore(this);
                    this.Size = new Size(Iwidth, Iheight);
                    Flash.LoadMovie(0, "http://www.megavideo.com");//żeby nie odtwarzać filmu
                    KontrolkiVisible(true, Cont);
                    this.Text = "Przyjaciele Player";
                }
            }
            //Wyjście z trybu pełnoekranowego przy oglądaniu filmu
            if (e.KeyCode == Keys.W)
            {
                if (Flash.Visible == true)
                {
                    frm.Restore(this);
                }
            }
        }
Example #2
0
        public MainWindow()
        {
            InitializeComponent();
            //full screen

            this.Left           = this.Top = 0;
            this.panelView.Size = new Size(App.Default.AppScreenWidth, App.Default.AppScreenHeight);

            this.Width  = Screen.PrimaryScreen.WorkingArea.Width;
            this.Height = Screen.PrimaryScreen.WorkingArea.Height;

            formState.Maximize(this);
            this.TopMost         = true;
            this.Bounds          = Screen.PrimaryScreen.Bounds;
            this.Location        = Screen.PrimaryScreen.WorkingArea.Location;
            this.FormBorderStyle = FormBorderStyle.None;
            this.WindowState     = FormWindowState.Maximized;
            Taskbar.Hide();

            this.context = Context.CreateFromXmlFile(SAMPLE_XML_FILE, out scriptNode);

            //this.context.
            this.depth = context.FindExistingNode(NodeType.Depth) as DepthGenerator;
            if (this.depth == null)
            {
                throw new Exception("Viewer must have a depth node!");
            }

            this.userGenerator           = new UserGenerator(this.context);
            this.skeletonCapbility       = this.userGenerator.SkeletonCapability;
            this.poseDetectionCapability = this.userGenerator.PoseDetectionCapability;
            this.calibPose = this.skeletonCapbility.CalibrationPose;

            this.userGenerator.NewUser  += userGenerator_NewUser;
            this.userGenerator.LostUser += userGenerator_LostUser;
            this.poseDetectionCapability.PoseDetected  += poseDetectionCapability_PoseDetected;
            this.skeletonCapbility.CalibrationComplete += skeletonCapbility_CalibrationComplete;

            this.skeletonCapbility.SetSkeletonProfile(SkeletonProfile.All);
            this.joints = new Dictionary <int, Dictionary <SkeletonJoint, SkeletonJointPosition> >();
            this.userGenerator.StartGenerating();


            this.histogram = new int[this.depth.DeviceMaxDepth];

            MapOutputMode mapMode = this.depth.MapOutputMode;

            this.bitmap       = new Bitmap((int)mapMode.XRes, (int)mapMode.YRes);
            this.shouldRun    = true;
            this.readerThread = new Thread(ReaderThread);
            this.readerThread.Start();
        }
Example #3
0
        public void ToggleScreenMode()
        {
            FullScreen = !FullScreen;

            if (FullScreen)
            {
                _formState.Maximize(this);
            }
            else
            {
                _formState.Restore(this);
            }
        }
        private void OpenPage(string pagename)
        {
            string s = myProjectPath + pagename + ".page";

            try
            {
                //open pages form
                VisualGraph.VisualGraph vs = new VisualGraph.VisualGraph();
                vs.Name         = pagename;
                vs.Width        = 800;
                vs.Height       = 480;
                vs.Click       += new EventHandler(vs_Click);
                vs.DoubleClick += new EventHandler(vs_DoubleClick);
                vs.MouseDown   += new MouseEventHandler(vs_MouseDown);
                vs.MouseUp     += new MouseEventHandler(vs_MouseUp);
                //建立监控画面
                FormEdit page = new FormEdit();
                page.Name = pagename;
                page.Text = pagename;
                page.Controls.Add(vs);
                editFormList.Add(page);
                FormState formState = new FormState();
                formState.Maximize(page);
                vs.LoadFromXml(s);
                //设置每个图元的lock和runmode属性
                int count = vs.ObjList.Count();
                for (int i = 0; i < count; i++)
                {
                    DrawObject o = (DrawObject)vs.ObjList[i];
                    o.RunMode = true;
                    o.Lock    = true;
                }
                vs.Invalidate();
            }
            catch (System.Exception ex)
            {
                MessageBox.Show("Exception:" + ex.ToString(), " Open Page error.");
            }
        }
Example #5
0
        private void ToggleFullscreen()
        {
            if (_fullScreen)
            {
                _formState.Restore(this);
                menuStrip1.Visible = true;
                BackColor          = _applicationSettingsService.Settings.MainWindowBackgroundColor.ToColor();
                Cursor.Show();
            }
            else
            {
                _formState.Save(this);
                _formState.Maximize(this);
                menuStrip1.Visible = false;

                BackColor = Color.Black;
                Cursor.Hide();
                //HideCursorInFullScreen().Start();
            }

            _fullScreen = !_fullScreen;
        }
        private void menuItem2_Click(object sender, EventArgs e)
        {
            if (ceProjectPath != "")
            {
                CloseProject();
            }
            OpenFileDialog openFileDialog1 = new OpenFileDialog();

            openFileDialog1.Filter           = "cePrj Files (*.cePrj)|*.cePrj";
            openFileDialog1.InitialDirectory = "";
            openFileDialog1.FileName         = "";
            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                ceProjectPath = openFileDialog1.FileName;
                myProjectPath = new FileInfo(ceProjectPath).DirectoryName;
                myProjectPath = myProjectPath + "\\";
                //open solution tree
                openTreeSolution(ceProjectPath);
                //select first page
                SelectedPage = (FormEdit)editFormList[0];
                FormState state = new FormState();
                state.Maximize((FormEdit)editFormList[0]);
                SelectedPage.Show();
                SelectedPage.BringToFront();
                nCurrentForm = 0;
                ////register event
                RegisterEvent();
                ////create virtual device
                CreateVirtualDevice();
                ////create serial device
                thread_poll = new Thread(new ThreadStart(Poll_Thread));
                thread_poll.Start();
                ////create web server
                CreateWebServer();
            }
        }
        public void DealEventProperty(bool bClick, object sender, EventArgs e)
        {
            VisualGraph.VisualGraph drawArea = (VisualGraph.VisualGraph)sender;

            //取得鼠标位置
            Point      point = new Point(MousePosition.X, MousePosition.Y);
            DrawObject gp    = drawArea.ObjList.GetSelectedObject(point);

            if (gp != null)//选中了
            {
                if (bClick)
                {
                    if (gp.Click != "")//deal the click event
                    {
                        string[] strContent = gp.Click.Split('+');
                        if (strContent[0].Equals("打开画面"))
                        {
                            try
                            {
                                int n = editFormList.Count;
                                for (int i = 0; i < n; i++)
                                {
                                    if (((FormEdit)editFormList[i]).Text.Equals(strContent[1]))
                                    {
                                        SelectedPage.SendToBack();
                                        FormState state = new FormState();
                                        state.Maximize((FormEdit)editFormList[i]);
                                        ((FormEdit)editFormList[i]).Show();
                                        ((FormEdit)editFormList[i]).BringToFront();
                                        SelectedPage = editFormList[i];
                                        nCurrentForm = i;
                                        break;
                                    }
                                }
                            }
                            catch (System.Exception ex)
                            {
                                MessageBox.Show(ex.Message, "Error");
                            }
                        }
                        else if (strContent[0].Equals("写变量值"))
                        {
                            WritetoDevice(strContent[1], strContent[2]);
                        }
                    }
                }
                else
                {
                    if (gp.DoubleClick != "")//deal the dclick event
                    {
                        string[] strContent = gp.Click.Split('+');
                        if (strContent[0].Equals("打开画面"))
                        {
                            try
                            {
                                int n = editFormList.Count;
                                for (int i = 0; i < n; i++)
                                {
                                    if (((FormEdit)editFormList[i]).Text.Equals(strContent[1]))
                                    {
                                        FormState state = new FormState();
                                        state.Maximize((FormEdit)editFormList[i]);
                                        ((FormEdit)editFormList[i]).Show();
                                        ((FormEdit)editFormList[i]).BringToFront();
                                        SelectedPage = editFormList[i];
                                        break;
                                    }
                                }
                            }
                            catch (System.Exception ex)
                            {
                                MessageBox.Show(ex.Message, "Error");
                            }
                        }
                        else if (strContent[0].Equals("写变量值"))
                        {
                            WritetoDevice(strContent[1], strContent[2]);
                        }
                    }
                }
            }
        }