Example #1
0
        private void FormMain_Shown(object sender, EventArgs e)
        {
            setting.RestoreFormRect(this);

            // https://alexpkent.wordpress.com/2011/05/11/25/
            ToolStripManager.LoadSettings(this);

            this.FormClosed += (s, a) =>
            {
                setting.SaveFormRect(this);
                ToolStripManager.SaveSettings(this);
                setting.OnSysProxyChanged -= OnSysProxyChangedHandler;
                formMainCtrl.Cleanup();
                servers.LazyGC();
            };

            this.Text = string.Format(
                "{0} v{1}",
                Properties.Resources.AppName,
                Properties.Resources.Version);

            formMainCtrl = InitFormMainCtrl();

            BindToolStripButtonToMenuItem();

            toolMenuItemCurrentSysProxy.Text = GetCurrentSysProxySetting();
            setting.OnSysProxyChanged       += OnSysProxyChangedHandler;
        }
Example #2
0
        private void Init()
        {
            InitDockLayout();

            PluginHelper.Init(this);

            ToolStripManager.LoadSettings(this);

            TilesHelper.Init(mnuTiles);

            InitLegend();

            this.InitMenus();

            RefreshUI();

            var gs = new GlobalSettings();

            gs.ApplicationCallback = _callback;

            Shown += (s, e) => Map.Focus();

            FormClosing += MainForm_FormClosing;

            App.Project.ProjectChanged += (s, e) => RefreshUI();

            App.Project.Load(AppSettings.Instance.LastProject);
        }
Example #3
0
        private void MainWindow_Load(object sender, EventArgs e)
        {
            if (Properties.Settings.Default.MainWindowLocation != null)
            {
                Location = Properties.Settings.Default.MainWindowLocation;
            }

            if (Properties.Settings.Default.MainWindowSize != null)
            {
                Size = Properties.Settings.Default.MainWindowSize;
            }

            if (Properties.Settings.Default.LastStorageLocation == "")
            {
                Properties.Settings.Default.LastStorageLocation = Environment.GetFolderPath(Environment.SpecialFolder.MyVideos);
            }
            CaptureCursor.Checked   = Properties.Settings.Default.CaptureCursor;
            HighlightCursor.Checked = Properties.Settings.Default.HighlightCursor;
            byte fps = Properties.Settings.Default.FPS;

            Fps30.Checked = fps != 60;
            Fps60.Checked = fps == 60;
            ToolStripManager.LoadSettings(this);
            UpdateFPS();
        }
Example #4
0
        //---------------------------------------------


        #region MainForm Events
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            if (!this.DesignMode)
            {
                // Set form Sizing and Location
                if (!Properties.Settings.Default.main_FirstLoad)
                {
                    this.Size        = Properties.Settings.Default.main_Size;
                    this.Location    = Properties.Settings.Default.main_Location;
                    this.WindowState = Properties.Settings.Default.main_WindowState;
                }

                // Fix ToolStrip
                ToolStripManager.LoadSettings(this);

                // Load Workbench Layout
                workbench.LoadLayout();
                workbench.MruDocuments = this.mruProviderDocuments;
                workbench.MruWorkplace = this.mruProviderWorkplace;

                // Show Start Page (if configured to do so)
                if (Properties.Settings.Default.behaviour_ShowStartPage)
                {
                    StartPage page = new StartPage(workbench);
                    page.Show(this.dockMain, DockState.Document);
                }

                // Wire-up some events
                this.workbench.WorkplaceOpened += new EventHandler(Workbench_WorkplaceChanged);

                HistoryListener.Write("Sinapse Interface Loaded");
            }
        }
Example #5
0
        private void MainFormLoad(object sender, EventArgs e)
        {
            ToolStripManager.LoadSettings(this, "SecureNotePad");
            richTextBox.ShowSelectionMargin = true;

            ToolStripManager.RenderMode = ToolStripManagerRenderMode.Professional;
        }
Example #6
0
        private Dictionary <string, GroupchatWindow> groupChats;                                // Hashtable for groupChats

        public JustTalk()
        {
            InitializeComponent();

            // Load Toolbars state
            ToolStripManager.LoadSettings(this);

            model          = new JabberModel(this);     // TODO: Revise this
            this.connected = false;
        }
Example #7
0
 private void MonitorPackManagement_Load(object sender, EventArgs e)
 {
     txtAgentsRegistrationFile.Text = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
     try
     {
         ToolStripManager.LoadSettings(this, "QuickMon.ConfigurationEditorToolbar");
         if (monitorPack != null && monitorPack.AgentRegistrations.Count == 0)
         {
             monitorPack.AgentsAssemblyPath = "";
         }
     }
     catch { }
 }
Example #8
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            MainForm form = new MainForm();

            ToolStripManager.LoadSettings(form, "BLToolkit.Demo");

            form.FormClosing += delegate
            {
                ToolStripManager.SaveSettings(form, "BLToolkit.Demo");
            };

            Application.Run(form);
        }
        private void MainForm_Load(object sender, EventArgs e)
        {
            if (MittoDeveloper.Properties.Settings.Default.MainForm_Location.X != -1 && MittoDeveloper.Properties.Settings.Default.MainForm_Location.Y != -1)
            {
                this.Location = MittoDeveloper.Properties.Settings.Default.MainForm_Location;
                this.Size     = MittoDeveloper.Properties.Settings.Default.MainForm_Size;
            }
            this.WindowState = MittoDeveloper.Properties.Settings.Default.MainForm_WindowState;
            splitContainer1.SplitterDistance = MittoDeveloper.Properties.Settings.Default.MainForm_Splitter1;
            splitContainer2.SplitterDistance = MittoDeveloper.Properties.Settings.Default.MainForm_Splitter2;

            //this.Text = "Mitto Developer - " + documentName;

            ToolStripManager.LoadSettings(this);

            mittoInterpreter.OutputF = MittoOutput;
        }
Example #10
0
        private void MainWindow_Load(object sender, EventArgs e)
        {
            if (Properties.Settings.Default.MainWindowLocation != null)
            {
                Location = Properties.Settings.Default.MainWindowLocation;
            }

            if (Properties.Settings.Default.MainWindowSize != null)
            {
                Size = Properties.Settings.Default.MainWindowSize;
            }

            if (Properties.Settings.Default.LastStorageLocation == "")
            {
                Properties.Settings.Default.LastStorageLocation = Environment.GetFolderPath(Environment.SpecialFolder.MyVideos);
            }
            CaptureCursor.Checked   = Properties.Settings.Default.CaptureCursor;
            HighlightCursor.Checked = Properties.Settings.Default.HighlightCursor;
            ushort fps = Properties.Settings.Default.FPS;

            fpsComboBox.Text = fps.ToString();
            ToolStripManager.LoadSettings(this);
        }
Example #11
0
 private void MainForm_Load(object sender, EventArgs e)
 {
     if ((Properties.Settings.Default.MainWindowLocation.X == 0) && (Properties.Settings.Default.MainWindowLocation.Y == 0))
     {
         this.Location = new Point((Screen.PrimaryScreen.WorkingArea.Width - this.Width) / 2, (Screen.PrimaryScreen.WorkingArea.Height - this.Height) / 2);
     }
     else
     {
         this.Location = Properties.Settings.Default.MainWindowLocation;
         this.Size     = Properties.Settings.Default.MainWindowSize;
     }
     SnappingEnabled     = Properties.Settings.Default.MainFormSnap;
     monitorPack.Enabled = false;
     monitorPack.MonitorPackPathChanged += new MonitorPackPathChangedDelegate(monitorPack_MonitorPackPathChanged);
     mainRefreshTimer          = new System.Timers.Timer();
     mainRefreshTimer.Elapsed += new System.Timers.ElapsedEventHandler(mainRefreshTimer_Elapsed);
     mainRefreshTimer.Interval = Properties.Settings.Default.PollFrequency;
     mainRefreshTimer.Enabled  = true;
     try
     {
         ToolStripManager.LoadSettings(this, "QuickMon.MainToolbar");
     }
     catch { }
 }
Example #12
0
 /// <summary>
 /// sourceFormに配置されたToolStripPanel内のToolStripの位置を復元する
 /// </summary>
 /// <param name="sourceForm"></param>
 public static void LoadSettings(Form sourceForm)
 {
     ToolStripManager.LoadSettings(sourceForm);
     ToolStripManager2.InternalLoadSettings(sourceForm);
 }
Example #13
0
        private void Main_Load(object sender, EventArgs e)
        {
            ToolStripManager.LoadSettings(this); // managing toolStripLists

            if (settings.UpgradeNow)
            {
                settings.Upgrade();
                settings.UpgradeNow = false;
                settings.Save();

                // ToolStripManager does not provide Upgrade(), we do it here but for the side only.
                if (toolStripLists.Parent.Dock != settings.ToolStripDock)
                {
                    // relocate toolstrip.
                    switch (toolStripLists.Parent.Dock)
                    {
                    case DockStyle.Top: toolStripContainer1.TopToolStripPanel.Controls.Remove(toolStripLists); break;

                    case DockStyle.Right: toolStripContainer1.RightToolStripPanel.Controls.Remove(toolStripLists); break;

                    case DockStyle.Left: toolStripContainer1.LeftToolStripPanel.Controls.Remove(toolStripLists); break;

                    case DockStyle.Bottom: toolStripContainer1.BottomToolStripPanel.Controls.Remove(toolStripLists); break;
                    }
                    switch (settings.ToolStripDock)
                    {
                    default: goto case DockStyle.Top;

                    case DockStyle.Top: toolStripContainer1.TopToolStripPanel.Controls.Add(toolStripLists); break;

                    case DockStyle.Right: toolStripContainer1.RightToolStripPanel.Controls.Add(toolStripLists); break;

                    case DockStyle.Left: toolStripContainer1.LeftToolStripPanel.Controls.Add(toolStripLists); break;

                    case DockStyle.Bottom: toolStripContainer1.BottomToolStripPanel.Controls.Add(toolStripLists); break;
                    }
                }
            }

            // check if any part of the form is visible or not. e.g.: previous 'position' was 'collapsed', [-], which moves it out of sight.
            // Note: the form 'maximised' moves it to (-8,-8).
            var l = settings.FormLocation;
            var s = settings.FormSize;

            if ((l.X < 0) && (-l.X >= s.Width) || (l.Y < 0) && (-l.Y >= s.Height))
            {
                l = new Point(L_X1, L_Y1);
                s = new Size(S_W, S_H);
            }

            // check that the window is in a visible part on any screen.
            //var screens = Screen.AllScreens;
            var screen = Screen.FromControl(this);
            var d      = new Point(l.X + s.Width - screen.Bounds.Size.Width, l.Y + s.Height - screen.Bounds.Size.Height);
            var x      = l.X;
            var y      = l.Y;
            var w      = s.Width;
            var h      = s.Height;

            if (0 < d.X)
            {
                // translate over x
                x -= d.X;
                if (x < 0)
                {
                    // relocate x and shrink over w
                    w += x;
                    x  = 0;
                }
            }

            if (0 < d.Y)
            {
                // translate over y
                y -= d.Y;
                if (y < 0)
                {
                    // relocate y and shrink over h
                    h += y;
                    y  = 0;
                }
            }

            if ((settings.FormLocation.X != x) || (settings.FormLocation.Y != y))
            {
                settings.FormLocation = new Point(x, y);
            }
            if ((settings.FormSize.Width != w) || (settings.FormSize.Height != h))
            {
                settings.FormSize = new Size(w, h);
            }

            Binding bndLocation = new Binding("Location", settings, "FormLocation", true, DataSourceUpdateMode.OnPropertyChanged);

            DataBindings.Add(bndLocation);
            Size = settings.FormSize; // Assign Size property, since databinding to Size doesn't work well.
        }
Example #14
0
        public FormBrowse()
        {
            InitializeComponent();

            ToolStripManager.LoadSettings(this, "toolsettings");
        }
Example #15
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            try
            {
                // load settings only if not in debug mode
                if (!Settings.Default.ShowLogConsole)
                {
                    ToolStripManager.LoadSettings(this, Name);
                }

                // ---
                // initialize menu state
                PicGlobalCotationProperties.ShowShortCotationLines = Settings.Default.UseCotationShortLines;
                _log.Info(string.Format("ShowShortCotationLines initialized with value : {0}", Settings.Default.UseCotationShortLines.ToString()));
                toolStripMenuItemCotationShortLines.Checked = PicGlobalCotationProperties.ShowShortCotationLines;

                // Set DockPanel properties
                dockPanel.DocumentStyle         = DocumentStyle.DockingMdi;
                dockPanel.ActiveAutoHideContent = null;
                dockPanel.Parent = this;
                dockPanel.SuspendLayout(true);

                UpdateToolCommands(null, null);

                ShowLogConsole();
                dockPanel.ResumeLayout(true, true);

                if (IsWebSiteReachable)
                {
                    ShowStartPage();
                }
                CreateBasicLayout();

                // update tool bars
                UpdateToolCommands(null);

                // Most recently used databases
                mruManager = new MRUManager();
                mruManager.Initialize(
                    this,                              // owner form
                    databaseToolStripMenuItem,         // Recent Files menu item
                    mnuFileMRU,                        // Recent Files menu item
                    "Software\\treeDiM\\PLMPackLib");  // Registry path to keep MRU list

                mruManager.Add(Pic.DAL.ApplicationConfiguration.CustomSection.DatabasePath);
            }
            catch (Exception ex)
            {
                Debug.Fail(ex.ToString());
                _log.Error(ex.ToString());
            }
            // restore window position
            if (null != Settings.Default.MainFormSettings && !Settings.Default.StartMaximized)
            {
                Settings.Default.MainFormSettings.Restore(this);
            }
            // show maximized
            if (Settings.Default.StartMaximized)
            {
                WindowState = FormWindowState.Maximized;
            }
        }
Example #16
0
 private void Form1_Load(object sender, EventArgs e)
 {
     //ToolStripManager.Merge(toolStrip2, toolStrip1);
     ToolStripManager.LoadSettings(this);
 }
Example #17
0
 private void LoadToolbarLayoutToolStripMenuItemClick(object sender, EventArgs e)
 {
     ToolStripManager.LoadSettings(this, "SecureNotePad");
 }
Example #18
0
 private void cmdRestore_Click(object sender, EventArgs e)
 {
     ToolStripManager.LoadSettings(this, "Test");
 }