Пример #1
0
 public Settings()
 {
     RadioCategory   = 0;
     VolumeLevel     = 50;
     Size            = new Size(553, 612);
     FormWindowState = FormWindowState.Normal;
 }
Пример #2
0
 public ConfigWindow()
 {
     X      = DEFAULT_WINDOW_X;
     Y      = DEFAULT_WINDOW_Y;
     State  = DEFAULT_WINDOW_STATE;
     Width  = DEFAULT_WINDOW_WIDTH;
     Height = DEFAULT_WINDOW_HEIGHT;
 }
Пример #3
0
 protected override void OnSizeChanged(EventArgs e)
 {
     base.OnSizeChanged(e);
     if (this.lastWindowState != this.WindowState)
     {
         this.listener.windowStateChanged();
     }
     this.lastWindowState = this.WindowState;
 }
Пример #4
0
        public void Load(XmlDocument doc)
        {
            int     ivalue;
            XmlNode n;

            n = doc.SelectSingleNode("/Settings/Window/X");
            if (n != null && int.TryParse(n.InnerText, out ivalue) && ivalue >= 0)
            {
                X = ivalue;
            }

            n = doc.SelectSingleNode("/Settings/Window/Y");
            if (n != null && int.TryParse(n.InnerText, out ivalue) && ivalue >= 0)
            {
                Y = ivalue;
            }

            n = doc.SelectSingleNode("/Settings/Window/Width");
            if (n != null && int.TryParse(n.InnerText, out ivalue) && ivalue >= 0)
            {
                Width = ivalue;
            }

            n = doc.SelectSingleNode("/Settings/Window/Height");
            if (n != null && int.TryParse(n.InnerText, out ivalue) && ivalue >= 0)
            {
                Height = ivalue;
            }


            n = doc.SelectSingleNode("/Settings/Window/State");
            if (n != null)
            {
                switch (n.InnerText)
                {
                case "Maximized":
                    State = System.Windows.Forms.FormWindowState.Maximized;
                    break;

                case "Minimized":
                    State = System.Windows.Forms.FormWindowState.Minimized;
                    break;

                case "Normal":
                    State = System.Windows.Forms.FormWindowState.Normal;
                    break;

                default:
                    State = DEFAULT_WINDOW_STATE;
                    break;
                }
            }
            else
            {
                State = DEFAULT_WINDOW_STATE;
            }
        }
Пример #5
0
 private void PerformSetVisualState(SWF.Form form, SWF.FormWindowState state)
 {
     if (form.InvokeRequired == true)
     {
         form.BeginInvoke(new PerformSetVisualStateDelegate(PerformSetVisualState),
                          new object [] { form, state });
         return;
     }
     form.WindowState = state;
 }
Пример #6
0
 private void FormWindowStateChanged(object sender, System.Windows.Forms.FormWindowState NewState)
 {
     if (NewState == FormWindowState.Maximized)
     {
         Border.ResizeEnabled = false;
     }
     else
     {
         Border.ResizeEnabled = true;
     }
 }
Пример #7
0
        //---------------------------------------------------------------------------
        public static void Show(IFormNavigable frm, Type typeNavigateur, System.Windows.Forms.FormWindowState windowState, IWin32Window owner)
        {
            CFormNavigateur oldNavigateur = CSc2iWin32DataNavigation.Navigateur;

            CFormNavigateurPopup navigateur = (CFormNavigateurPopup)Activator.CreateInstance(typeNavigateur, new object[] { frm });

            CSc2iWin32DataNavigation.PushNavigateur(navigateur);
            try
            {
                navigateur.WindowState = windowState;
                //LE 5/10/2007, stef
                //Il y avait ici : navigateur.TopMost = true, mais ça pose des problèmes,
                //parce que quand un navigateur popup ouvre un navigateur popup, ils se
                //passent les uns sous les autres.
                //tentative avec bringtofront
                navigateur.BringToFront();
                CFormEditionStandard formEdition = frm as CFormEditionStandard;
                if (formEdition != null)
                {
                    if (formEdition.IsEnEditionPourNouvelElement)
                    {
                        formEdition.AfterAnnulationModification += new ObjetDonneeEventHandler(CloseOnAnnuleOuValideModification);
                        formEdition.AfterValideModification     += new ObjetDonneeEventHandler(CloseOnAnnuleOuValideModification);
                    }
                }
                if (navigateur.m_contexteDonneePushedAsCurrent != null)
                {
                    CSc2iWin32DataClient.PushContexteCourant(navigateur.m_contexteDonneePushedAsCurrent);
                }
                try
                {
                    DialogResult result = navigateur.ShowDialog(owner);
                }
                finally
                {
                    if (navigateur.m_contexteDonneePushedAsCurrent != null)
                    {
                        CSc2iWin32DataClient.PopContexteCourant(navigateur.m_contexteDonneePushedAsCurrent);
                    }
                }
            }
            catch { }
            finally
            {
                CSc2iWin32DataNavigation.PopNavigateur();
            }
        }
Пример #8
0
 public void ChangeCurrentWindow()
 {
     if (_currentWindow != SystemWindow.ForegroundWindow)
     {
         if (_currentWindow != null)
         {
             ResizeStates.RemoveAt(ResizeStates.Count - 1);// remove last (resize state of the former window )
         }
         _currentWindow = SystemWindow.ForegroundWindow;
         Screen screen = Screen.FromPoint(_currentWindow.Location);
         ResizeStates.Add(new ResizerHotkeyState(
                              ScaleVectorFromLocation(screen.WorkingArea, _currentWindow.Location),
                              ScaleVectorFromSize(screen.WorkingArea.Size, _currentWindow.Size)));//add resize state of the current window
         _curWindowFormerState = _currentWindow.WindowState;
         _statePointer         = 0;
         OnCurrentWindowChanged();
     }
 }
Пример #9
0
        public void SetVisualState(WindowVisualState state)
        {
            SWF.FormWindowState newState = form.WindowState;
            switch (state)
            {
            case WindowVisualState.Maximized:
                newState = SWF.FormWindowState.Maximized;
                break;

            case WindowVisualState.Minimized:
                newState = SWF.FormWindowState.Minimized;
                break;

            case WindowVisualState.Normal:
                newState = SWF.FormWindowState.Normal;
                break;
            }
            PerformSetVisualState(form, newState);
        }
 /// <summary>
 /// Goes to fullscreen or the old state.
 /// </summary>
 private void UpgradeFullscreen()
 {
     if (!fullscreen)
     {
         oldsize              = this.Size;
         oldstate             = this.WindowState;
         oldstyle             = this.FormBorderStyle;
         oldlocation          = this.Location;
         this.WindowState     = System.Windows.Forms.FormWindowState.Normal;
         this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
         this.Bounds          = System.Windows.Forms.Screen.PrimaryScreen.Bounds;
         fullscreen           = true;
     }
     else
     {
         this.Location        = oldlocation;
         this.WindowState     = oldstate;
         this.FormBorderStyle = oldstyle;
         this.Size            = oldsize;
         fullscreen           = false;
     }
 }
Пример #11
0
        /// <summary>
        /// 設定値をファイルに保存する
        /// </summary>
        /// <returns></returns>
        private bool ConfigSave()
        {
            return(true);

#if false
            // 設定値の取得
            Config configData = GetConfigData();

            // ウィンドウ状態
            System.Windows.Forms.FormWindowState state = this.WindowState;
            if (state == FormWindowState.Maximized)
            {
                this.WindowState = FormWindowState.Normal;
            }
            configData.locationX    = this.DesktopLocation.X;
            configData.locationY    = this.DesktopLocation.Y;
            configData.windowWidth  = this.Size.Width;
            configData.windowHeight = this.Size.Height;
            if (state == FormWindowState.Maximized)
            {
                this.WindowState = FormWindowState.Maximized;
            }

            // 保存処理
            string        configPath = GetConfigXmlPath();
            XmlSerializer serializer = new XmlSerializer(typeof(Config));
            try {
                using (FileStream fs = new FileStream(configPath, FileMode.Create)) {
                    serializer.Serialize(fs, configData);
                    fs.Close();
                }
            }
            catch {
                return(false);
            }

            return(true);
#endif
        }
Пример #12
0
 private void OnWindowStateChanged(object sender, System.Windows.Forms.FormWindowState NewState)
 {
 }
Пример #13
0
 //---------------------------------------------------------------------------
 public static void Show(IFormNavigable frm, Type typeNavigateur, System.Windows.Forms.FormWindowState windowState)
 {
     Show(frm, typeNavigateur, windowState, null);
 }
Пример #14
0
 //---------------------------------------------------------------------------
 public static void Show(IFormNavigable frm, System.Windows.Forms.FormWindowState windowState)
 {
     Show(frm, typeof(CFormNavigateurPopup), windowState);
 }
Пример #15
0
 private void tsbDebitor_Click(object sender, System.EventArgs e)
 {
     this.m_WindowState = base.WindowState;
     base.set_Enabled(false);
     DebitorsForm form = new DebitorsForm();
     form.add_Resize(new System.EventHandler(this.ChildFormResize));
     form.add_FormClosed(new System.Windows.Forms.FormClosedEventHandler(this.ChildFormClosed));
     form.Show(this);
 }
Пример #16
0
 protected override void OnSizeChanged( EventArgs e )
 {
     base.OnSizeChanged( e );
     if( this.lastWindowState != this.WindowState ) {
         this.listener.windowStateChanged();
     }
     this.lastWindowState = this.WindowState;
 }