Example #1
0
        Control GenerateContent()
        {
            if (Platform.IsWinForms || Platform.IsGtk)
            {
                var tabControl = new TabControlPlus();
                tabControl.Pages.Add(new TabPage {
                    Text = "Index", Content = new PanelIndex()
                });
                _tabControl = tabControl;
            }
            else
            {
                var tabControl = new TabControl();
                tabControl.Pages.Add(new TabPage {
                    Text = "Index", Content = new PanelIndex()
                });
                _tabControl = tabControl;
            }

            var layout = new DynamicLayout();

            layout.Add(_tabControl, yscale: true);
            layout.Add(StatusBar());

            return(layout);
        }
		public TabStyleVisualStudioProvider(TabControlPlus tabControl) : base(tabControl){
			this._ImageAlign = ContentAlignment.MiddleRight;
			this._Overlap = 7;
			
			//	Must set after the _Radius as this is used in the calculations of the actual padding
			this.Padding = new Point(14, 1);
		}
        public TabStyleVisualStudioProvider(TabControlPlus tabControl) : base(tabControl)
        {
            this._ImageAlign = ContentAlignment.MiddleRight;
            this._Overlap    = 7;

            //	Must set after the _Radius as this is used in the calculations of the actual padding
            this.Padding = new Point(14, 1);
        }
Example #4
0
        public TabStyleIE8Provider(TabControlPlus tabControl) : base(tabControl)
        {
            this._Radius            = 3;
            this._ShowTabCloser     = true;
            this._CloserColorActive = Color.Red;

            //	Must set after the _Radius as this is used in the calculations of the actual padding
            this.Padding = new Point(6, 5);
        }
		public TabStyleChromeProvider(TabControlPlus tabControl) : base(tabControl){
			this._Overlap = 16;
			this._Radius = 16;
			this._ShowTabCloser = true;
			this._CloserColorActive = Color.White;
			
			//	Must set after the _Radius as this is used in the calculations of the actual padding
			this.Padding = new Point(7, 5);
		}
Example #6
0
		public TabStyleIE8Provider(TabControlPlus tabControl) : base(tabControl){
			this._Radius = 3;
			this._ShowTabCloser = true;
			this._CloserColorActive = Color.Red;
			
			//	Must set after the _Radius as this is used in the calculations of the actual padding
			this.Padding = new Point(6, 5);

		}
        public TabStyleChromeProvider(TabControlPlus tabControl) : base(tabControl)
        {
            this._Overlap           = 16;
            this._Radius            = 16;
            this._ShowTabCloser     = true;
            this._CloserColorActive = Color.White;

            //	Must set after the _Radius as this is used in the calculations of the actual padding
            this.Padding = new Point(7, 5);
        }
		public TabStyleVS2010Provider(TabControlPlus tabControl) : base(tabControl){
			this._Radius = 3;
			this._ShowTabCloser = true;
			this._CloserColorActive = Color.Black;
			this._CloserColor = Color.FromArgb(117, 99, 61);
			this._TextColor = Color.White;
			this._TextColorDisabled = Color.WhiteSmoke;
			this._BorderColor = Color.Transparent;
			this._BorderColorHot = Color.FromArgb(155, 167, 183);

			//	Must set after the _Radius as this is used in the calculations of the actual padding
			this.Padding = new Point(6, 5);

		}
Example #9
0
        public TabStyleVS2010Provider(TabControlPlus tabControl) : base(tabControl)
        {
            this._Radius            = 3;
            this._ShowTabCloser     = true;
            this._CloserColorActive = Color.Black;
            this._CloserColor       = Color.FromArgb(117, 99, 61);
            this._TextColor         = Color.White;
            this._TextColorDisabled = Color.WhiteSmoke;
            this._BorderColor       = Color.Transparent;
            this._BorderColorHot    = Color.FromArgb(155, 167, 183);

            //	Must set after the _Radius as this is used in the calculations of the actual padding
            this.Padding = new Point(6, 5);
        }
        public static TabStyleProvider CreateProvider(TabControlPlus tabControl)
        {
            TabStyleProvider provider;

            //	Depending on the display style of the tabControl generate an appropriate provider.
            switch (tabControl.DisplayStyle)
            {
            case TabStyle.None:
                provider = new TabStyleNoneProvider(tabControl);
                break;

            case TabStyle.Default:
                provider = new TabStyleDefaultProvider(tabControl);
                break;

            case TabStyle.Angled:
                provider = new TabStyleAngledProvider(tabControl);
                break;

            case TabStyle.Rounded:
                provider = new TabStyleRoundedProvider(tabControl);
                break;

            case TabStyle.VisualStudio:
                provider = new TabStyleVisualStudioProvider(tabControl);
                break;

            case TabStyle.Chrome:
                provider = new TabStyleChromeProvider(tabControl);
                break;

            case TabStyle.IE8:
                provider = new TabStyleIE8Provider(tabControl);
                break;

            case TabStyle.VS2010:
                provider = new TabStyleVS2010Provider(tabControl);
                break;

            default:
                provider = new TabStyleDefaultProvider(tabControl);
                break;
            }

            provider._Style = tabControl.DisplayStyle;
            return(provider);
        }
Example #11
0
        Control GenerateContent()
        {
            if (Platform.IsWinForms || Platform.IsGtk)
            {
                var tabControl = new TabControlPlus();
                tabControl.Pages.Add(new TabPage { Text = "Index", Content = new PanelIndex() });
                _tabControl = tabControl;
            }
            else
            {
                var tabControl = new TabControl();
                tabControl.Pages.Add(new TabPage { Text = "Index", Content = new PanelIndex() });
                _tabControl = tabControl;
            }

            var layout = new DynamicLayout();
            layout.Add(_tabControl, yscale: true);
            layout.Add(StatusBar());

            return layout;
        }
        protected TabStyleProvider(TabControlPlus tabControl)
        {
            this._TabControl = tabControl;

            this._BorderColor         = Color.Empty;
            this._BorderColorSelected = Color.Empty;
            this._FocusColor          = Color.Orange;

            if (this._TabControl.RightToLeftLayout)
            {
                this._ImageAlign = ContentAlignment.MiddleRight;
            }
            else
            {
                this._ImageAlign = ContentAlignment.MiddleLeft;
            }

            this.HotTrack = true;

            //	Must set after the _Overlap as this is used in the calculations of the actual padding
            this.Padding = new Point(6, 3);
        }
		public TabStyleRoundedProvider(TabControlPlus tabControl) : base(tabControl){
			this._Radius = 10;
			//	Must set after the _Radius as this is used in the calculations of the actual padding
			this.Padding = new Point(6, 3);
		}
Example #14
0
        public TextEditorForm(FileManager fileManager)
        {
            _fileManager = fileManager;
            Env.CommandCollection.AddActor(this);
            var stateHandler = Env.StateHandlerFactory.Create(new MyState(), nameof(TextEditorForm),
                                                              StateHandlerFlags.Exportable | StateHandlerFlags.UseCipher);

            _fileManager.OpenFile = async(name) => await OpenFileAsync(name);

            Opacity = 0;
            SuspendLayout();
            _tabControl = new TabControlPlus
            {
                Dock = DockStyle.Fill
            };
            Controls.Add(_tabControl);
            FormBorderStyle = FormBorderStyle.None;
            KeyPreview      = true;
            Text            = Env.Config.TextEditorWindowTitle;
            WindowState     = FormWindowState.Normal;
            StartPosition   = FormStartPosition.Manual;
            Left            = Screen.PrimaryScreen.WorkingArea.Left;
            Top             = Screen.PrimaryScreen.WorkingArea.Top;
            Width           = Screen.PrimaryScreen.WorkingArea.Width;
            Height          = Screen.PrimaryScreen.WorkingArea.Height;
            ResumeLayout(false);
            var updatePanelTimer = new Timer
            {
                Interval = (int)Env.Config.UpdatePanelInterval.TotalMilliseconds,
                Enabled  = true
            };

            updatePanelTimer.Tick += (s, e) =>
            {
                foreach (var fileTab in _fileTabs)
                {
                    fileTab.UpdatePanel();
                }
            };
            KeyDown += async(s, e) =>
            {
                switch (e.KeyData)
                {
                case Keys.Control | Keys.N:
                    e.Handled = true;
                    await CreateNewFileAsync();

                    break;

                case Keys.Control | Keys.Shift | Keys.F:
                    e.Handled = true;
                    await _fileManager.FindAllAsync();

                    break;

                case Keys.Control | Keys.O:
                    e.Handled = true;
                    await OpenCustomFileAsync();

                    break;
                }
            };
            FormClosing += async(s, e) =>
            {
                if (!_preventClose)
                {
                    return;
                }
                e.Cancel = true;
                await Task.Yield();

                Application.Exit();
            };
            Env.App.Exiting += () =>
            {
                CloseAll();
                updatePanelTimer.Dispose();
                _preventClose = false;
                Close();
            };
            _tabControl.SelectedIndexChanged += (s, e) =>
            {
                var tab     = _tabControl.SelectedTab;
                var fileTab = (FileTab)tab?.Tag;
                fileTab?.SelectRtb();
            };
            Env.App.AddSaveAction(async() =>
            {
                await Task.WhenAll(_fileTabs.Select(z => z.SaveAsync()));
                await stateHandler.SaveAsync();
            });
            Env.App.Run += async() =>
            {
                _state = await stateHandler.LoadAsync();

                Show();
            };
        }
 public TabStyleDefaultProvider(TabControlPlus tabControl) : base(tabControl)
 {
     this._FocusTrack = true;
     this._Radius     = 2;
 }
 public TabStyleNoneProvider(TabControlPlus tabControl) : base(tabControl)
 {
 }
Example #17
0
		public TabStyleNoneProvider(TabControlPlus tabControl) : base(tabControl){
		}
		public TabStyleDefaultProvider(TabControlPlus tabControl) : base(tabControl){
			this._FocusTrack = true;
			this._Radius = 2;
		}
 public TabStyleRoundedProvider(TabControlPlus tabControl) : base(tabControl)
 {
     this._Radius = 10;
     //	Must set after the _Radius as this is used in the calculations of the actual padding
     this.Padding = new Point(6, 3);
 }