Exemple #1
0
 public void UpdateTextBox()
 {
     GenText();
     if (Selected)
     {
         TopForm.ControllerNodeSelect(this);
     }
 }
Exemple #2
0
 public void UpdateName()
 {
     Node.Text = GetName();
     if (Selected)
     {
         TopForm.ControllerNodeSelect(this);
     }
 }
Exemple #3
0
        private void SetScreenArea(bool selectArea)
        {
            screenLeft = screenTop = 0;
            useArea    = false;

            // get entire desktop area size
            string screenName = cb_screenSelector.SelectedValue.ToString();

            if (string.Compare(screenName, @"Select ALL", StringComparison.OrdinalIgnoreCase) == 0)
            {
                foreach (Screen screen in Screen.AllScreens)
                {
                    _screenArea = screen.Bounds;
                    _width      = _screenArea.Width;
                    _height     = _screenArea.Height;
                }
            } // o de cima foca a tela toda!
            else if (string.Compare(screenName, @"Custom screen area", StringComparison.OrdinalIgnoreCase) == 0)
            {
                using (TopForm f = new TopForm())
                {
                    if (f.ShowDialog() == DialogResult.OK)
                    {
                        WindowState = FormWindowState.Minimized;
                        _screenArea = f.AreaBounds;

                        decimal prop       = (decimal)4 / 3;
                        decimal realProp   = (decimal)f.w / f.h;
                        bool    makeLonger = realProp < prop;
                        int     w          = Convert.ToInt32(makeLonger ? f.h * prop : f.w);
                        int     h          = Convert.ToInt32(makeLonger ? f.h : f.w / prop);

                        if ((w & 1) != 0)
                        {
                            w = w + 1;
                        }
                        if ((h & 1) != 0)
                        {
                            h = h + 1;
                        }

                        _width     = w;
                        _height    = h;
                        screenLeft = f.AreaBounds.Left;
                        screenTop  = f.AreaBounds.Top;
                    }
                }
            }
            else
            {
                _screenArea = Screen.AllScreens.Last(scr => scr.DeviceName.Equals(screenName)).Bounds;
                _width      = _screenArea.Width;
                _height     = _screenArea.Height;
            }
        }