Esempio n. 1
0
        private void SelectNewPanel()
        {
            string panelName = this.OptionsTreeView.SelectedNode.Tag.ToString();

            Debug.WriteLine("Selected panel: " + panelName);
            List <IOptionPanel> uc = this.FindOptionPanels();

            this.currentPanel = uc.FirstOrDefault(panel => ((panel is OptionPanel) ? ((OptionPanel)panel).Name : panel.Name.StartsWith("panel") ? panel.Name.Substring(5, panel.Name.Length - 5) : panel.Name) == panelName);
        }
Esempio n. 2
0
        private void UpdateLookAndFeel()
        {
            // Update the old treeview theme to the new theme
            WindowsApi.SetWindowTheme(this.OptionsTreeView.Handle, "Explorer", null);

            this.currentPanel = this.panelStartupShutdown;
            this.OptionsTreeView.SelectedNode = this.OptionsTreeView.Nodes[0];
            this.OptionsTreeView.Select();
            this.OptionTitelLabel.BackColor = Color.FromArgb(17, 0, 252);

            this.DrawBottomLine();
        }
Esempio n. 3
0
        /// <summary>
        /// Raises the <see cref="E:System.Windows.Forms.Form.Closing"/> event.
        /// </summary>
        /// <param name="e">A <see cref="T:System.ComponentModel.CancelEventArgs"/> that contains the event data. </param>
        protected override void OnClosing(System.ComponentModel.CancelEventArgs e)
        {
            if (DialogResult == DialogResult.OK)
            {
                IOptionPanel optionPanel = lstSettings.SelectedItem as IOptionPanel;

                if (optionPanel != null && !optionPanel.ValidateControl())
                {
                    e.Cancel = true;
                }
            }

            base.OnClosing(e);
        }
Esempio n. 4
0
        /// <summary>
        /// 설정창 리스트 항목 이동시 발생
        /// </summary>
        private void gridView_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
        {
            try
            {
                IOptionPanel pane = null;

                this.lbl_SettingDetail.Text = " " + this.GetSelectedSettingInfo.SETTINGNAME;
                switch (e.FocusedRowHandle)
                {
                case 0:
                    this.generalSettingControl.Visible = true;
                    this.shortcutsControl.Visible      = false;
                    this.aboutControl.Visible          = false;
                    pane = this.generalSettingControl;
                    break;

                case 1:
                    this.generalSettingControl.Visible = false;
                    this.shortcutsControl.Visible      = true;
                    this.aboutControl.Visible          = false;
                    pane = this.shortcutsControl;
                    break;

                case 2:
                    this.generalSettingControl.Visible = false;
                    this.shortcutsControl.Visible      = false;
                    this.aboutControl.Visible          = true;
                    break;

                default:
                    break;
                }

                if (pane != null && !this.OptionPanels.Contains(pane))
                {
                    this.OptionPanels.Add(pane);
                }
            }
            catch (Exception ex)
            {
                ConsoleLib.ConsoleLib.WriteFormatted(ex.ToString() + "                    ", t);
                ConsoleLib.ConsoleLib.WriteLine(Environment.NewLine);
            }
        }
Esempio n. 5
0
            void LoadPadContentIfRequired()
            {
                if (placeholder != null && placeholder.IsVisible)
                {
                    placeholder = null;
                    optionPanel = descriptor.OptionPanel;
                    if (optionPanel != null)
                    {
                        // some panels initialize themselves on the first LoadOptions call,
                        // so we need to load the options before attaching event handlers
                        optionPanel.LoadOptions();

                        ICanBeDirty dirty = optionPanel as ICanBeDirty;
                        if (dirty != null)
                        {
                            dirty.IsDirtyChanged += options.OnIsDirtyChanged;
                        }
                        this.SetContent(optionPanel.Control);
                    }
                }
            }
Esempio n. 6
0
            private void LoadPadContentIfRequired()
            {
                if (placeholder != null && placeholder.IsVisible)
                {
                    placeholder = null;
                    optionPanel = descriptor.OptionPanel;
                    if (optionPanel != null)
                    {
                        // some panels initialize themselves on the first LoadOptions call,
                        // so we need to load the options before attaching event handlers
                        //optionPanel.LoadOptions(); // TODO LelliD 2017-11-20 reimplement this

                        var dirty = optionPanel as ICanBeDirty;
                        if (dirty != null)
                        {
                            dirty.IsDirtyChanged += options.OnIsDirtyChanged;
                        }
                        Altaxo.Current.GetRequiredService <IWinFormsService>().SetContent(this, optionPanel.ViewObject);
                    }
                }
            }
Esempio n. 7
0
        /// <summary>
        /// Creates a new instance of the <see cref="FrmOptions"/> <see cref="Form"/>.
        /// </summary>
        /// <param name="panels">The list of <see cref="IOptionPanel"/>s to add.</param>
        public FrmOptions(IOptionPanel[] panels)
        {
            InitializeComponent();

              SetStyle(ControlStyles.AllPaintingInWmPaint, true);

              if (panels == null || panels.Length == 0)
              {
            // No panels to add.
            return;
              }

              lstSettings.Items.AddRange(panels);

              using (new WaitCursor(Cursors.WaitCursor))
              {
            // Initialize all option panels.
            foreach (IOptionPanel optionPanel in lstSettings.Items)
            {
              optionPanel.InitializeControl();
            }
              }
        }
Esempio n. 8
0
			void LoadPadContentIfRequired()
			{
				if (placeholder != null && placeholder.IsVisible) {
					placeholder = null;
					optionPanel = descriptor.OptionPanel;
					if (optionPanel != null) {
						// some panels initialize themselves on the first LoadOptions call,
						// so we need to load the options before attaching event handlers
						optionPanel.LoadOptions();
						
						ICanBeDirty dirty = optionPanel as ICanBeDirty;
						if (dirty != null)
							dirty.IsDirtyChanged += options.OnIsDirtyChanged;
						this.SetContent(optionPanel.Control);
					}
				}
			}