상속: Panel
예제 #1
0
 public CustomFloatWindow(DockPanel dockPanel, DockPane pane, Rectangle bounds)
     : base(dockPanel, pane, bounds)
 {
     FormBorderStyle = FormBorderStyle.Sizable;
     ShowInTaskbar = true;
     Owner = null;
 }
예제 #2
0
 internal WindowsMenuManager(ToolStripMenuItem windowsMenu,
     List<DockContent> startupPanes, DockPanel dockPanel)
 {
     _windowsMenu = windowsMenu;
     _dockPanel = dockPanel;
     InitItems(startupPanes);
 }
예제 #3
0
 //private DockPanel _DockPanel;
 //private DockState _DockState;
 public EditorContainer(Editor editor, DockPanel dock, DockState dockState = DockState.Document)
 {
     Editor = editor;
     Editor.UndoRedoStateChanged += Editor_UndoRedoStateChanged;
     Editor.TextChangedDelayed += Editor_TextChangedDelayed;
     Splitter = new Splitter() { Dock = DockStyle.Right, BackColor = SystemColors.ControlDarkDark, Width = 4 };
     DocumentMap = new DocumentMap() {
         Target = editor,
         Dock = DockStyle.Right,
         Width = DocumentMapInitialWidth,
         MinimumSize = new Size(DocumentMapMinimumWidth, 0),
         Scale = DocumentMapInitialWidth * DocumentMapScaleFactor,
         BackColor = EditorSyntax.Styles.Background,
         ForeColor = Color.FromArgb(0, 122, 204)
     };
     DocumentMap.DoubleClick += DocumentMap_DoubleClick;
     DocumentMap.MouseWheel += DocumentMap_MouseWheel;
     Splitter.SplitterMoved += Splitter_SplitterMoved;
     Name = Editor.File.FileName;
     ToolTipText = Editor.File.Path;
     Controls.Add(Editor);
     Controls.Add(Splitter);
     Controls.Add(DocumentMap);
     UpdateText(true);
     FormClosing += EditorContainer_FormClosing;
     FormClosed += EditorContainer_FormClosed;
     System.Threading.Thread.Sleep(10);
     dock.Invoke(new Action(() => { Show(dock, dockState); }));
 }
예제 #4
0
		private void InternalConstruct(DockPanel dockPanel, DockPane pane, bool boundsSpecified, Rectangle bounds)
		{
			if (dockPanel == null)
				throw(new ArgumentNullException(Strings.FloatWindow_Constructor_NullDockPanel));

			m_nestedPanes = new NestedPaneCollection(this);

			FormBorderStyle = FormBorderStyle.SizableToolWindow;
			ShowInTaskbar = false;
            if (dockPanel.RightToLeft != RightToLeft)
                RightToLeft = dockPanel.RightToLeft;
            if (RightToLeftLayout != dockPanel.RightToLeftLayout)
                RightToLeftLayout = dockPanel.RightToLeftLayout;
			
			SuspendLayout();
            if (boundsSpecified)
            {
                Bounds = bounds;
                StartPosition = FormStartPosition.Manual;
            }
            else
            {
                StartPosition = FormStartPosition.WindowsDefaultLocation;
                Size = dockPanel.DefaultFloatWindowSize;
            }

			m_dockPanel = dockPanel;
			Owner = DockPanel.FindForm();
			DockPanel.AddFloatWindow(this);
			if (pane != null)
				pane.FloatWindow = this;

			ResumeLayout();
		}
예제 #5
0
 internal DockWindow(DockPanel dockPanel, DockState dockState)
 {
     this.m_nestedPanes = new NestedPaneCollection(this);
     this.m_dockPanel = dockPanel;
     this.m_dockState = dockState;
     this.Visible = false;
     this.SuspendLayout();
     if(this.DockState == DockState.DockLeft || this.DockState == DockState.DockRight
        || this.DockState == DockState.DockTop || this.DockState == DockState.DockBottom){
         this.m_splitter = new SplitterControl();
         this.Controls.Add(this.m_splitter);
     }
     if(this.DockState == DockState.DockLeft){
         this.Dock = DockStyle.Left;
         this.m_splitter.Dock = DockStyle.Right;
     } else if(this.DockState == DockState.DockRight){
         this.Dock = DockStyle.Right;
         this.m_splitter.Dock = DockStyle.Left;
     } else if(this.DockState == DockState.DockTop){
         this.Dock = DockStyle.Top;
         this.m_splitter.Dock = DockStyle.Bottom;
     } else if(this.DockState == DockState.DockBottom){
         this.Dock = DockStyle.Bottom;
         this.m_splitter.Dock = DockStyle.Top;
     } else if(this.DockState == DockState.Document){
         this.Dock = DockStyle.Fill;
     }
     this.ResumeLayout();
 }
예제 #6
0
		public override void Apply(DockPanel dockPanel) {
			if (dockPanel == null) {
				throw new NullReferenceException("dockPanel");
			}

			Measures.SplitterSize = 6;
			dockPanel.Extender.DockPaneCaptionFactory = new VS2010PaneCaptionFactory();
			dockPanel.Extender.AutoHideStripFactory = new VS2010AutoHideStripFactory();
			dockPanel.Extender.AutoHideWindowFactory = new VS2010AutoHideWindowFactory();
			dockPanel.Extender.DockPaneStripFactory = new VS2010DockPaneStripFactory();
			dockPanel.Extender.DockPaneSplitterControlFactory = new VS2010DockPaneSplitterControlFactory();
			dockPanel.Extender.DockWindowSplitterControlFactory = new VS2010DockWindowSplitterControlFactory();
			dockPanel.Extender.DockWindowFactory = new VS2010DockWindowFactory();
			dockPanel.Extender.PaneIndicatorFactory = new VS2010PaneIndicatorFactory();
			dockPanel.Extender.PanelIndicatorFactory = new VS2010PanelIndicatorFactory();
			dockPanel.Extender.DockOutlineFactory = null;
			dockPanel.BackColor = Background;
			dockPanel.Padding = new Padding(6);
			dockPanel.Skin = CreateVisualStudio2010();

			dockPanel.MouseDown += (sender, e) => {
				dockPanel.ActiveAutoHideContent = null;
				dockPanel.Focus();
			};
			dockPanel.ActiveContentChanged += (sender, e) => {
				if (dockPanel.ActiveContent != null && dockPanel.ActiveAutoHideContent != null &&
				    dockPanel.ActiveContent != dockPanel.ActiveAutoHideContent)
					dockPanel.ActiveAutoHideContent = null;
			};
		}
 /// <summary>
 /// Setup constructor
 /// </summary>
 /// <param name="commandUi">Command UI manager. Any show command attached to views get added to this object</param>
 /// <param name="mainDockPanel">Main docking panel to dock views to</param>
 public DockingViewManager( ICommandUiManager commandUi, DockPanel mainDockPanel )
 {
     Arguments.CheckNotNull( commandUi, "commandUi" );
     Arguments.CheckNotNull( mainDockPanel, "mainDockPanel" );
     m_MainDockPanel = mainDockPanel;
     m_CommandUi = commandUi;
 }
예제 #8
0
        public MainForm()
        {
            InitializeComponent();
            labNewVersion.Tag = DOWNLOAD_URL;

            dockPanel = this.dockPanel1;
        }
예제 #9
0
        public ControlHostService(Form mainForm)
        {
            m_controls = new ActiveCollection<ControlInfo>();
            m_controls.ActiveItemChanged += controls_ActiveItemChanged;
            m_controls.ActiveItemChanging += controls_ActiveItemChanging;
            m_controls.ItemAdded += controls_ItemAdded;
            m_controls.ItemRemoved += controls_ItemRemoved;

            m_mainForm = mainForm;

            m_dockPanel = new DockPanel();
            m_dockPanel.Dock = DockStyle.Fill;
            m_dockPanel.DockBackColor = mainForm.BackColor;
            m_dockPanel.ShowDocumentIcon = true;
            m_dockPanel.ActiveContentChanged += dockPanel_ActiveContentChanged;
            m_dockPanel.ContentAdded += DockPanelContentAdded;
            m_dockPanel.ContentRemoved += DockPanelContentRemoved;

            // default behavior - when double clicking a float window's title it will
            // maximize the floating window instead of docking the floating window
            DoubleClickFloatWindowTitleMaximizes = true;

            // try a default delay (in milliseconds!)
            MouseOverTabSwitchDelay = 250;

            m_uiLockImage = ResourceUtil.GetImage24(Resources.LockUIImage);
            m_uiUnlockImage = ResourceUtil.GetImage24(Resources.UnlockUIImage);
        }
 /// <summary>
 /// Setup constructor
 /// </summary>
 /// <param name="commandUi">Command UI manager. Any show command attached to views get added to this object</param>
 /// <param name="mainPanel">Main docking panel</param>
 /// <param name="hostPaneName">Name of the host pane</param>
 public DockedHostPaneViewManager( ICommandUiManager commandUi, DockPanel mainPanel, string hostPaneName )
 {
     Arguments.CheckNotNull( commandUi, "commandUi" );
     Arguments.CheckNotNull( mainPanel, "mainPanel" );
     m_UnhostedViewManager = new DockingViewManager( commandUi, mainPanel );
     m_HostViewInfo = new DockingViewInfo( hostPaneName, CreateHostControl, DockState.DockLeft );
 }
예제 #11
0
파일: DockForm.cs 프로젝트: VE-2016/VE-2016
        public DockForm()
        {
            InitializeComponent();

            SuspendLayout();

            dock = new WeifenLuo.WinFormsUI.Docking.DockPanel();

            dock.Dock = DockStyle.Fill;

            dock.DocumentStyle = DocumentStyle.DockingWindow;

            dock.SupportDeeplyNestedContent = false;

            //dock.AllowEndUserDocking = false;

            //dock.AllowEndUserNestedDocking = false;

            dock.Theme = new VS2013BlueTheme();

            this.Controls.Add(dock);

            scr = new ScriptControl.ScriptControl(this);

            scr.Dock = DockStyle.Fill;

            ResumeLayout();

            LoadTW("Explorer");
            LoadTW("Output");
            LoadTW("Folders");
            LoadTW("Recent");

            LoadDocumentWindow();
        }
예제 #12
0
파일: DockMenu.cs 프로젝트: Klutzdon/PBIMSN
        public DockMenu(DockPanel dockPanel, Sys_UserMaster_usm_Info userInfo)
        {
            try
            {
                if (userInfo.usm_cUserLoginID.ToUpper() == "SA")
                {
                    treeNodeInfos = SystemMenuBLLFactory.Instance.GetISystemMenuBLL().GetMenuTreeNodes(CustEnum.System.HBManager);
                }
                else
                {
                    treeNodeInfos = SystemMenuBLLFactory.Instance.GetISystemMenuBLL().CheckUser(userInfo, CustEnum.System.HBManager);
                }

                foreach (TreeNodeInfo node in treeNodeInfos)
                {
                    if (node.Name == "SystemMenu")
                    {
                        node.Index = 4;
                    }
                    MenuToolForm mtf = new MenuToolForm(dockPanel, node, userInfo);
                    menuToolForms.Add(mtf);
                }
            }
            catch (Exception Ex)
            {
                throw Ex;
            }
        }
예제 #13
0
        public MainForm()
        {
            InitializeComponent();

            // Create and Add docking Panel:
            m_oDockPanel = new DockPanel();
            m_oDockPanel.DocumentStyle = DocumentStyle.DockingWindow;
            m_oDockPanel.Dock = DockStyle.Fill;
            m_oDockPanel.BackgroundImage = new Bitmap(UIConstants.PULSAR4X_LOGO);
            m_oDockPanel.BackgroundImageLayout = ImageLayout.Center;

            // set Mono only stuff:
            if (Helpers.UIController.Instance.IsRunningOnMono)
            {
                m_oDockPanel.SupportDeeplyNestedContent = false;
                m_oDockPanel.AllowEndUserDocking = false;
                m_oDockPanel.AllowEndUserNestedDocking = false;
            }

            m_oToolStripContainer.ContentPanel.Controls.Add(m_oDockPanel);

            // setup viewmodel:
            VM = new MenuViewModel();

            // bind menu items to game data:
            //this.Bind(c => c.Text, VM, d => d.GameDateTime);
            this.Text = "Pulsar4X - " + GameState.Instance.GameDateTime.ToString();
        }
예제 #14
0
        private Workbench()
        {
            // restore form location from last session
            FormLocationHelper.Apply(this, "StartupFormPosition", true);

            dockPanel = new WeifenLuo.WinFormsUI.Docking.DockPanel();
            dockPanel.DocumentStyle = DocumentStyle.SystemMdi;

            var formOne = new FormOne();

            formOne.Text = "测试1";
            formOne.Dock = DockStyle.Fill;
            formOne.Show(dockPanel, DockState.DockLeft);

            var formTwo = new FormOne();

            formTwo.Text = "测试2";
            formTwo.Dock = DockStyle.Fill;
            formTwo.Show(dockPanel, DockState.DockRight);

            dockPanel.Dock = DockStyle.Fill;
            dockPanel.ResumeLayout(true, true);
            this.Controls.Add(dockPanel);

            Application.Idle += OnApplicationIdle;
        }
예제 #15
0
 public WindowManager(IPathResolver pathResolver, DockPanel dockPanel, Settings settings)
 {
     m_settings = settings;
       m_fileEditorMap = new Dictionary<string, EditorContentBox>();
       m_pathResolver = pathResolver;
       m_dockPanel = dockPanel;
 }
        public WindowManager(DockPanel dockPanel)
        {
            this.dockPanel  = dockPanel;
            this.mruManager = new MRUManager(Env.Current.Commands.GetContext("FileContext"), this);

            //Create toolwindows
            projectContentView = new ProjectContentView(this);
            projectContentView.Show(dockPanel, DockState.DockLeft);
            projectContentView.OpenEntity += new ProjectContentView.OpenEntityHandler(ActivateDocument);
            projectContentView.SelectNode += new ProjectContentView.SelectNodeHandler(OnSelectProjectNode);

            toolBoxView = new ToolBoxView();
            toolBoxView.Show(dockPanel, DockState.DockRight);

            propertyBrowserView = new PropertyBrowserView();
            propertyBrowserView.Show(toolBoxView.Pane, DockAlignment.Bottom, 0.6);

            //Connect Windows Manager to heleper events
            dockPanel.ActiveDocumentChanged += new EventHandler(OnActiveDocumentChanged);
            Env.Current.Commands.RegisterContext("ToolboxContext", new ToolboxContext(toolBoxView));
            Env.Current.Commands.GetContext("FileContext").AddCommand(new CommonUI.GlobalCommands.LoadProjectCommand(mruManager, this));
            Env.Current.Commands.GetContext("FileContext").AddCommand(new Commands.SaveProjectCommand(mruManager, this));
            Env.Current.Commands.GetContext("FileContext").AddCommand(new CommonUI.GlobalCommands.NullCommand((int)CommandManager.Priorities.FileCommandsEnd));
            Env.Current.Commands.GetContext("FileContext").AddCommand(new CommonUI.GlobalCommands.NullCommand((int)CommandManager.Priorities.MruCommandsEnd));
            Env.Current.Commands.GetContext("FileContext").AddCommand(new CommonUI.GlobalCommands.ExitCommand());
            Env.Current.Commands.GetContext(PredefinedContexts.GlobalToolbar).AddCommand(new Commands.NewProjectCommand(this));
            Env.Current.Commands.GetContext(PredefinedContexts.GlobalToolbar).AddCommand(new Commands.NewSchemaCommand(this));
            Env.Current.Commands.GetContext(PredefinedContexts.GlobalToolbar).AddCommand(new Commands.RunProjectCommand());

            //Env.Current.ScriptManager.NewScriptCreated += new ScriptManager.NewScriptCreatedHandler(OnOpenScript);
        }
예제 #17
0
        private void MainForm_Shown(object sender, EventArgs e)
        {
            this.Text = this.Text + " V" + Assembly.GetExecutingAssembly().GetName().Version.ToString();

            dockPanel = this.dockPanel1;

            frmDatabase             = new DatabaseForm();
            frmDatabase.OutputCode += new Action <Model.Database>(frmDatabase_OutputCode);
            frmDatabase.CreateCode += new Action <Model.Table>(frmDatabase_CreateCode);
            frmDatabase.Show(dockPanel);

            frmTemplate = new TemplateForm();
            frmTemplate.TemplateChanged += new Action(frmTemplate_TemplateChanged);
            frmTemplate.Show(dockPanel);

            frmDebug = new DebugForm();
            frmDebug.Show(dockPanel);

            BackgroundWorker bw = new BackgroundWorker();

            bw.DoWork             += new DoWorkEventHandler(bw_DoWork);
            bw.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bw_RunWorkerCompleted);
            bw.RunWorkerAsync();

            OpenUrl(HOME_URL);
        }
예제 #18
0
 // 销毁
 public void Destroy(DockPanel dockPanel)
 {
     // 保存配置界面
     String applicationPath = System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName;
     String szConfigFile = Path.Combine(Path.GetDirectoryName(applicationPath), "WorldEditor.DockPanel.config");
     dockPanel.SaveAsXml(szConfigFile);
 }
예제 #19
0
        public MainLayout(DockPanel panel, List<ToolStripComboBox> comboBoxes, List<ToolStripButton> buttons, TrackBar trackBar, string path)
        {
            Logger = LogManager.GetLogger(Settings.Default.ApplicationLogger);

            Panel = panel;
            ComboBoxes = comboBoxes;
            Buttons = buttons;
            TrackBar = trackBar;

            if (!Directory.Exists(path))
                Directory.CreateDirectory(path);

            DockConfigPath = Path.Combine(path, Settings.Default.DockingConfigurationPath);

            TreeView = new TreeViewFrame();

            TreeView.SelectedDatabaseChanged += TreeView_SlectedDatabaseChanged;
            TreeView.PropertiesClick += TreeView_PropertiesClick;

            StepFrames = new Dictionary<TestMethod, StepFrame>();
            LogFrame = new LogFrame();

            PropertiesFrame = new PropertiesFrame();
            PropertiesFrame.Caller = TreeView;

            foreach (TestMethod method in GetTestMethods())
                StepFrames[method] = CreateStepFrame(method);
        }
예제 #20
0
 public AmusementsForm(GameRecords model, DockPanel parent, ToolStripMenuItem amusement)
 {
     InitializeComponent();
     dockP = parent;
     buyForm = new AmusementBuyForm(model,parent);
     this.amusItem = amusement;
 }
 public VS2003AutoHideStrip(DockPanel panel)
     : base(panel)
 {
     SetStyle(ControlStyles.ResizeRedraw, true);
     SetStyle(ControlStyles.UserPaint, true);
     SetStyle(ControlStyles.AllPaintingInWmPaint, true);
     BackColor = Color.WhiteSmoke;
 }
예제 #22
0
 public VS2005AutoHideStrip(DockPanel panel)
     : base(panel)
 {
     SetStyle(ControlStyles.ResizeRedraw, true);
     SetStyle(ControlStyles.UserPaint, true);
     SetStyle(ControlStyles.AllPaintingInWmPaint, true);
     BackColor = SystemColors.Control;
 }
예제 #23
0
 public AmusementBuyForm(GameRecords m, DockPanel parent)
 {
     InitializeComponent();
     this.dockPanel = parent;
     model = m;
     color = Color.Yellow;
     this.Hide();
 }
예제 #24
0
 public static void DoAprilFoolWindow(DockPanel panel)
 {
     foreach(DockContent c in panel.Contents)
     {
         var form = c.FindForm();
         form.Text = kamos[rand.Next(0, kamos.Length)];
     }
 }
 /// <summary>
 /// Setup constructor
 /// </summary>
 /// <param name="panel">Docking panel used to host this frame</param>
 public DockingFrame( DockPanel panel )
 {
     Arguments.CheckNotNull( panel, "panel" );
     m_Panel = panel;
     m_Content = new DockContent( );
     m_Content.AutoScroll = true;
     m_Content.Closing += OnContentClosing;
 }
예제 #26
0
 public void CreateContent()
 {
     this.Text = "DockPanelSuite TestApp";
     this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     this.ClientSize = new System.Drawing.Size(800, 600);
     //
     var dockPanel = new DockPanel();
     dockPanel.AllowDrop = true;
     dockPanel.TabIndex = 1;
     dockPanel.DocumentStyle = DocumentStyle.DockingWindow;
     dockPanel.AllowEndUserDocking = true;
     dockPanel.AllowEndUserNestedDocking = true;
     dockPanel.Dock = DockStyle.Fill;
     this.Controls.Add(dockPanel);
     //
     var dc = new DockContent();
     dc.TabText = "Hello Doc!";
     dc.DockPanel = dockPanel;
     dc.DockAreas = DockAreas.Document;
     var rtb = new RichTextBox();
     rtb.Dock = DockStyle.Fill;
     dc.Controls.Add(rtb);
     dc.Show();
     //
     DockContent dc2 = new DockContent();
     dc2.TabText = "Hello Doc!";
     dc2.DockPanel = dockPanel;
     dc2.DockAreas = DockAreas.Document;
     var rtb2 = new RichTextBox();
     rtb2.Dock = DockStyle.Fill;
     dc2.Controls.Add(rtb2);
     dc2.Show();
     //
     DockContent dc3 = new DockContent();
     dc3.AllowEndUserDocking = true;
     dc3.AllowDrop = true;
     dc3.TabText = "Hello Tab!";
     dc3.DockPanel = dockPanel;
     dc3.DockAreas = DockAreas.DockBottom | DockAreas.DockLeft | DockAreas.DockRight | DockAreas.DockTop;
     dc3.DockState = DockState.DockRight;
     var rtb3 = new RichTextBox();
     rtb3.Dock = DockStyle.Fill;
     dc3.Controls.Add(rtb3);
     dc3.Show();
     //
     DockContent dc4 = new DockContent();
     dc4.AllowEndUserDocking = true;
     dc4.AllowDrop = true;
     dc4.TabText = "Hello Tab!";
     dc4.DockPanel = dockPanel;
     dc4.DockAreas = DockAreas.DockBottom | DockAreas.DockLeft | DockAreas.DockRight | DockAreas.DockTop | DockAreas.Float;
     dc4.DockState = DockState.DockBottomAutoHide;
     var rtb4 = new RichTextBox();
     rtb4.Dock = DockStyle.Fill;
     dc4.Controls.Add(rtb4);
     dc4.Show();
 }
예제 #27
0
        private void Home_Load(object sender, EventArgs e)

        {
            dockPanel = new WeifenLuo.WinFormsUI.Docking.DockPanel();

            dockPanel.Dock                       = System.Windows.Forms.DockStyle.Fill;
            dockPanel.DockBackColor              = System.Drawing.Color.FromArgb(((int)(((byte)(45)))), ((int)(((byte)(45)))), ((int)(((byte)(48)))));
            dockPanel.DockBottomPortion          = 150D;
            dockPanel.DockLeftPortion            = 200D;
            dockPanel.DockRightPortion           = 200D;
            dockPanel.DockTopPortion             = 150D;
            dockPanel.Font                       = new System.Drawing.Font("Tahoma", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.World, ((byte)(0)));
            dockPanel.Location                   = new System.Drawing.Point(0, 61);
            dockPanel.Name                       = "dockPanel";
            dockPanel.Padding                    = new System.Windows.Forms.Padding(6);
            dockPanel.RightToLeftLayout          = true;
            dockPanel.ShowAutoHideContentOnHover = false;
            dockPanel.Size                       = new System.Drawing.Size(810, 455);
            dockPanel.TabIndex                   = 12;
            dockPanel.Theme                      = this.vS2015DarkTheme1;
            this.panel1.Controls.Add(dockPanel);
            SetSchema(this.vS2015DarkTheme1, null);

            string configFile = Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "OSMaker.config");



            CloseAllContents();

            CreateStandardControls();
            m_propertyWindow.Show(dockPanel, DockState.DockRight);

            m_solutionExplorer.Show(m_propertyWindow.Pane, DockAlignment.Top, 0.5);
            m_propertyWindow.DockState = DockState.DockRightAutoHide;

            m_toolbox.Show(dockPanel, DockState.DockLeftAutoHide);



            dockPanel.ResumeLayout(true, true);

            Accueil MonAccueil = CreateNewAccueil();

            if (dockPanel.DocumentStyle == DocumentStyle.SystemMdi)
            {
                MonAccueil.MdiParent = this;
                MonAccueil.Show();
            }
            else
            {
                MonAccueil.Show(dockPanel);
            }

            m_sortie.Show(MonAccueil.PanelPane, DockAlignment.Left, 0.5);
            m_sortie.Text      = "Output";
            m_sortie.DockState = DockState.DockBottomAutoHide;
        }
 public VS2012AutoHideStrip(DockPanel panel)
     : base(panel)
 {
     SetStyle(ControlStyles.ResizeRedraw |
         ControlStyles.UserPaint |
         ControlStyles.AllPaintingInWmPaint |
         ControlStyles.OptimizedDoubleBuffer, true);
     BackColor = DockPanel.Theme.ColorPalette.MainWindowActive.Background;
 }
 public VS2012DarkAutoHideStrip(DockPanel panel)
     : base(panel)
 {
     SetStyle(ControlStyles.ResizeRedraw |
         ControlStyles.UserPaint |
         ControlStyles.AllPaintingInWmPaint |
         ControlStyles.OptimizedDoubleBuffer, true);
     BackColor = Color.FromArgb(68, 68, 68);
 }
       internal void IniciarSnifferPC(MarcadorPC marcador, DockPanel dockPanel)
       {
           FormaSnifferPC sniffer = new FormaSnifferPC(marcador);
           sniffer.AllowEndUserDocking = false;
           sniffer.Show(dockPanel, DockState.DockBottom);
           _formsSniffers.Add(marcador.Id, sniffer);
           _modeloSniffer.PeticionEnviarInformacionPC(marcador.Id);

       }
예제 #31
0
        /// <summary>
        /// Instantiate the treeview containing the sessions
        /// </summary>
        /// <param name="dockPanel">The DockPanel container</param>
        /// <remarks>Having the dockpanel container is necessary to allow us to
        /// dock any terminal or file transfer sessions from within the treeview class</remarks>
        public SessionTreeview(DockPanel dockPanel)
        {
            m_DockPanel = dockPanel;

            this.Enabled = false;

              //  this.m_DockPanel.Paint += (a, b) => DrawWarningMessage(a, b);
            checkActivation();
        }
 public VS2012LightAutoHideStrip(DockPanel panel)
     : base(panel)
 {
     SetStyle(ControlStyles.ResizeRedraw |
              ControlStyles.UserPaint |
              ControlStyles.AllPaintingInWmPaint |
              ControlStyles.OptimizedDoubleBuffer, true);
     BackColor = SystemColors.ControlLight;
 }
       public void IniciarSnifferSwitch(MarcadorSwitch marcador, DockPanel dockPanel)
       {
           FormaSnifferSwitch sniffer = new FormaSnifferSwitch(marcador);
           sniffer.AllowEndUserDocking = false;
           sniffer.Show(dockPanel, DockState.DockBottom);
           _formsSniffers.Add(marcador.Id, sniffer);
           _modeloSniffer.PeticionEnviarInformacionSwitch(marcador.Id);

       }
예제 #34
0
 ///<summary>
 /// Creates new instance of <see cref="EditorWindowBase"/> included in specified <see cref="DockPanel"/>
 ///</summary>
 ///<param name="parentDockPanel">Parent dock panel</param>
 public EditorWindowBase(DockPanel parentDockPanel)
 {
     InitializeComponent();
     _ParentDockPanel = parentDockPanel;
     if (_PreviousDockState == DockState.Unknown)
     {
         _PreviousDockState = DockState.Float;
     }
 }
예제 #35
0
        public MDITabbed()
        {
            
            InitializeComponent();

            DockPanel dockPanel = new DockPanel();
            dockPanel.Dock = DockStyle.Fill;
            dockPanel.BackColor = Color.Beige;
            Controls.Add(dockPanel);
            //dockPanel.AllowEndUserNestedDocking = false;
            dockPanel.AllowEndUserDocking = false;
            dockPanel.BringToFront();

            Form1 form = new Form1();
            //form.AllowEndUserDocking = false;
            //form.WindowState = FormWindowState.Maximized;
            form.MinimizeBox = false;
            form.Show(dockPanel);

            form3 = new Form1();
            form3.Text = "Form 3";
            //form.AllowEndUserDocking = false;
            //form.WindowState = FormWindowState.Maximized;
            form3.MinimizeBox = false;
            form3.Show(dockPanel);
            form3.Select();


            frmMed = new frmMedicine();
            frmMed.Text = "Medicine";
            //form.AllowEndUserDocking = false;
            //form.WindowState = FormWindowState.Maximized;
            frmMed.MinimizeBox = false;
            frmMed.Show(dockPanel);
            frmMed.Select();

            frmFig = new frmFigure();
            frmFig.Text = "Figure";
            //form.AllowEndUserDocking = false;
            //form.WindowState = FormWindowState.Maximized;
            frmFig.MinimizeBox = false;
            frmFig.Show(dockPanel);
            frmFig.Select();

            
            Form1 form2 = new Form1(); ;
            form2.ShowHint = DockState.DockLeft;
            form2.AllowEndUserDocking = false;
            form2.CloseButton = false;
            form2.IsFloat = false;
            form2.CloseButtonVisible = false;
            form2.Show(dockPanel);
            dockPanel.Select();
            //form2.Select();
            //MessageBox.Show(dockPanel.Panes.Count.ToString());
        }
예제 #36
0
 public MainForm()
 {
     InitializeComponent();
     m_dockPanel = new DockPanel();
     m_dockPanel.ActiveAutoHideContent = null;
     m_dockPanel.Dock = DockStyle.Fill;
     m_dockPanel.Name = "dockPanel";
     Controls.Add(m_dockPanel);
     m_dockPanel.BringToFront();
 }
예제 #37
0
        /*显示被选中的元件节点*/
        private void SelectLibNodeToShow(TreeNode node)
        {
            ShowViewForm viewForm = null;
            NodeInfo     info     = (NodeInfo)node.Tag;

            CloseExistForm(node);

            try
            {
                if (info._formType == Princeple.FormType.APP || info._formType == Princeple.FormType.STATUS)
                {
                    TargetNode   target   = GetTargetNode(node);
                    ShowViewForm destForm = (info._formType == Princeple.FormType.APP ? target.DynamicTopoForm : target.StatusForm);
                    if (destForm != null)
                    {
                        viewForm = destForm;
                    }
                    else
                    {
                        viewForm = new ShowViewForm(node);
                        if (info._formType == Princeple.FormType.APP)
                        {
                            target.DynamicTopoForm = viewForm;
                        }
                        else
                        {
                            target.StatusForm = viewForm;
                        }
                    }
                }
                else
                {
                    viewForm = new ShowViewForm(node);
                }

                //1.显示窗体
                viewForm.Text = node.Text;
                WeifenLuo.WinFormsUI.Docking.DockPanel panel = MainForm.GetPanel();
                viewForm.Show(panel);

                //2.通过view来初始化propertyGrid
                PropertyForm.Show(viewForm.showViewPanel1.ShowView.GetModelInstance());

                //3.配置树节点的NodeInfo
                info._form     = viewForm;
                info._formFlag = true;
            }
            catch (Exception e)
            {
                MainForm.SetOutPutText(e.StackTrace);
            }
        }
예제 #38
0
        /// <summary>
        /// Displays the forms in default position.
        /// </summary>
        internal static void DisplayFormsInDefaultPosition()
        {
            WeifenLuo.WinFormsUI.Docking.DockPanel dockPanel = ViewModel.MainView.dockPanel;

            // default position for nics form, profiles form and console form
            ViewModel.NetworkCardsView.Show(dockPanel);
            ViewModel.ProfilesView.Show(dockPanel);
            ViewModel.ConsoleView.Show(dockPanel);

            UseCaseView.Display(ViewModel.NetworkCardsView, true, DockState.DockBottomAutoHide);
            UseCaseView.Display(ViewModel.ConsoleView, true, DockState.DockBottomAutoHide);
            UseCaseView.Display(ViewModel.ProfilesView, true, DockState.DockLeft);
        }
예제 #39
0
        public WindowManager(DockPanel dockPanel, MainWindow mWin)
        {
            this.dockPanel = dockPanel;
            _env           = Env.getEnv();
            _env.winMgr    = this;
            mainWindow     = mWin;
            //Create toolwindows
            iedWindow = new IedTreeView(this);
            iedWindow.CloseButtonVisible = false;
            iedWindow.FormClosing       += new FormClosingEventHandler(persistentWindows_FormClosing);
            iedWindow.Show(dockPanel, DockState.DockLeft);

            dataWindow                    = new IedDataView();
            dataWindow.ShowHint           = DockState.Document;
            dataWindow.CloseButtonVisible = false;
            dataWindow.FormClosing       += new FormClosingEventHandler(persistentWindows_FormClosing);
            dataWindow.Show(dockPanel);

            reportWindow                    = new ReportsView();
            reportWindow.ShowHint           = DockState.Document;
            reportWindow.CloseButtonVisible = false;
            reportWindow.FormClosing       += new FormClosingEventHandler(persistentWindows_FormClosing);
            reportWindow.Show(dockPanel);

            pollWindow                    = new PollView();
            pollWindow.ShowHint           = DockState.Document;
            pollWindow.CloseButtonVisible = false;
            pollWindow.FormClosing       += new FormClosingEventHandler(persistentWindows_FormClosing);
            pollWindow.Show(dockPanel);

            captureWindow                    = new CaptureView();
            captureWindow.ShowHint           = DockState.Document;
            captureWindow.CloseButtonVisible = false;
            captureWindow.FormClosing       += new FormClosingEventHandler(persistentWindows_FormClosing);
            captureWindow.Show(dockPanel);

            watchWindow                    = new WatchDataView();
            watchWindow.ShowHint           = DockState.Document;
            watchWindow.CloseButtonVisible = false;
            watchWindow.FormClosing       += new FormClosingEventHandler(persistentWindows_FormClosing);
            //watchWindow.Show(dockPanel);

            logWindow                    = new LogView();
            logWindow.ShowHint           = DockState.DockBottom;
            logWindow.CloseButtonVisible = false;
            logWindow.FormClosing       += new FormClosingEventHandler(persistentWindows_FormClosing);
            logWindow.Show(dockPanel);

            //Connect Windows Manager to helper events
            dockPanel.ActiveDocumentChanged += new EventHandler(OnActiveDocumentChanged);
        }
예제 #40
0
        /// <summary>
        /// 选择资源节点去显示
        /// </summary>
        /// <param name="node"></param>
        private void SelectSourceNodeToShow(TreeNode node)
        {
            NodeInfo info     = (NodeInfo)node.Tag;
            String   nodeName = node.Text;

            CloseExistForm(node);

            //显示一个view
            ShowViewForm viewForm = new ShowViewForm(node);

            viewForm.Text = nodeName;
            WeifenLuo.WinFormsUI.Docking.DockPanel panel = MainForm.GetPanel();
            viewForm.Show(panel);
        }
예제 #41
0
        private void InitializeComponent()
        {
            DockPanel = new WeifenLuo.WinFormsUI.Docking.DockPanel();
            //   DockPanel.BackColor = System.Drawing.SystemColors.ControlDarkDark;
            DockPanel.Dock = System.Windows.Forms.DockStyle.Fill;

            DockPanel.Theme = new VS2015BlueTheme();

            Controls.Add(DockPanel);
            Font = Consolas975;

            IsMdiContainer = true;
            Name           = "Main";
            Text           = "Main";
        }
예제 #42
0
파일: Utils.cs 프로젝트: AlexAbramov/gis
 internal static void SaveAsXml(string filePath, WeifenLuo.WinFormsUI.Docking.DockPanel dockPanel)
 {
     using (FileStream fs = new FileStream(filePath, FileMode.Create))
     {
         using (MemoryStream ms = new MemoryStream(1 << 12))
         {
             dockPanel.SaveAsXml(ms, System.Text.Encoding.ASCII);
             byte[] bytes = ms.ToArray();
             for (int i = 0; i < bytes.Length; i++)
             {
                 bytes[i] += (byte)i;
             }
             fs.Write(bytes, 0, bytes.Length);
         }
     }
 }
예제 #43
0
파일: Utils.cs 프로젝트: AlexAbramov/gis
 internal static void LoadFromXml(string filePath, WeifenLuo.WinFormsUI.Docking.DockPanel dockPanel, WeifenLuo.WinFormsUI.Docking.DeserializeDockContent m_deserializeDockContent)
 {
     if (File.Exists(filePath))
     {
         using (FileStream fs = new FileStream(App.DockPanelConfigFilePath, FileMode.Open))
         {
             byte[] bytes = new byte[fs.Length];
             fs.Read(bytes, 0, bytes.Length);
             for (int i = 0; i < bytes.Length; i++)
             {
                 bytes[i] -= (byte)i;
             }
             using (MemoryStream ms = new MemoryStream(bytes))
             {
                 dockPanel.LoadFromXml(ms, m_deserializeDockContent);
             }
         }
     }
 }
        public WindowManager(DockPanel dockPanel)
        {
            this.dockPanel = dockPanel;

            mruManager = new MRUManager(CommandManager.viewContext, this);
            //Create toolwindows
            dockPanel.SuspendLayout();
            projectContentView = new ProjectContentView();
            projectContentView.Show(dockPanel, DockState.DockLeft);
            projectContentView.OpenEntity += new ProjectContentView.OpenEntityHandler(OnOpenProjectEntity);

            logConsoleView = new LogConsoleView();
            logConsoleView.Show(dockPanel, DockState.DockBottomAutoHide);
            dockPanel.ActiveAutoHideContent = null;

            projectContentView.Activate();
            dockPanel.ResumeLayout(true);

            //Connect Windows Manager to heleper events
            dockPanel.ActiveDocumentChanged += new EventHandler(OnActiveDocumentChanged);

            Env.Current.ScriptManager.ScriptApplication.OpenEntity += new FreeSCADA.Common.Scripting.Application.OpenEntityHandler(OnOpenProjectEntity);
        }
예제 #45
0
        public WindowManager(DockPanel dockPanel, MRUManager mruManager)
        {
            this.dockPanel  = dockPanel;
            this.mruManager = mruManager;

            mruManager.ItemClicked += new MRUManager.ItemClickedDelegate(OnMRUItemClicked);

            //Create toolwindows
            projectContentView = new ProjectContentView();
            projectContentView.Show(dockPanel, DockState.DockLeft);
            projectContentView.OpenEntity += new ProjectContentView.OpenEntityHandler(OnOpenProjectEntity);
            projectContentView.SelectNode += new ProjectContentView.SelectNodeHandler(OnSelectProjectNode);

            toolBoxView = new ToolBoxView();
            toolBoxView.Show(dockPanel, DockState.DockRight);

            propertyBrowserView = new PropertyBrowserView();
            propertyBrowserView.Show(toolBoxView.Pane, DockAlignment.Bottom, 0.6);

            //Connect Windows Manager to heleper events
            dockPanel.ActiveDocumentChanged            += new EventHandler(OnActiveDocumentChanged);
            CommandManager.toolboxContext               = new ToolboxContext(toolBoxView);
            Env.Current.ScriptManager.NewScriptCreated += new ScriptManager.NewScriptCreatedHandler(OnOpenScript);
        }
예제 #46
0
 public void Show(DockPanel dockPanel, DockState dockState)
 {
     DockHandler.Show(dockPanel, dockState);
 }
예제 #47
0
 public void Show(DockPanel dockPanel)
 {
     DockHandler.Show(dockPanel);
 }
예제 #48
0
 public void Show(DockPanel dockPanel, Rectangle floatWindowBounds)
 {
     DockHandler.Show(dockPanel, floatWindowBounds);
 }
예제 #49
0
 public void DockTo(DockPanel panel, DockStyle dockStyle)
 {
     DockHandler.DockTo(panel, dockStyle);
 }
예제 #50
0
 public static void SaveAsXml(DockPanel dockPanel, Stream stream, Encoding encoding)
 {
     SaveAsXml(dockPanel, stream, encoding, false);
 }
예제 #51
0
            public static void SaveAsXml(DockPanel dockPanel, Stream stream, Encoding encoding, bool upstream)
            {
                XmlTextWriter xmlOut = new XmlTextWriter(stream, encoding);

                // Use indenting for readability
                xmlOut.Formatting = Formatting.Indented;

                if (!upstream)
                {
                    xmlOut.WriteStartDocument();
                }

                // Always begin file with identification and warning
                xmlOut.WriteComment(Strings.DockPanel_Persistor_XmlFileComment1);
                xmlOut.WriteComment(Strings.DockPanel_Persistor_XmlFileComment2);

                // Associate a version number with the root element so that future version of the code
                // will be able to be backwards compatible or at least recognise out of date versions
                xmlOut.WriteStartElement("DockPanel");
                xmlOut.WriteAttributeString("FormatVersion", ConfigFileVersion);
                xmlOut.WriteAttributeString("DockLeftPortion", dockPanel.DockLeftPortion.ToString(CultureInfo.InvariantCulture));
                xmlOut.WriteAttributeString("DockRightPortion", dockPanel.DockRightPortion.ToString(CultureInfo.InvariantCulture));
                xmlOut.WriteAttributeString("DockTopPortion", dockPanel.DockTopPortion.ToString(CultureInfo.InvariantCulture));
                xmlOut.WriteAttributeString("DockBottomPortion", dockPanel.DockBottomPortion.ToString(CultureInfo.InvariantCulture));
                xmlOut.WriteAttributeString("ActiveDocumentPane", dockPanel.Panes.IndexOf(dockPanel.ActiveDocumentPane).ToString(CultureInfo.InvariantCulture));
                xmlOut.WriteAttributeString("ActivePane", dockPanel.Panes.IndexOf(dockPanel.ActivePane).ToString(CultureInfo.InvariantCulture));

                // Contents
                xmlOut.WriteStartElement("Contents");
                xmlOut.WriteAttributeString("Count", dockPanel.Contents.Count.ToString(CultureInfo.InvariantCulture));
                foreach (IDockContent content in dockPanel.Contents)
                {
                    xmlOut.WriteStartElement("Content");
                    xmlOut.WriteAttributeString("ID", dockPanel.Contents.IndexOf(content).ToString(CultureInfo.InvariantCulture));
                    xmlOut.WriteAttributeString("PersistString", content.DockHandler.PersistString);
                    xmlOut.WriteAttributeString("AutoHidePortion", content.DockHandler.AutoHidePortion.ToString(CultureInfo.InvariantCulture));
                    xmlOut.WriteAttributeString("IsHidden", content.DockHandler.IsHidden.ToString(CultureInfo.InvariantCulture));
                    xmlOut.WriteAttributeString("IsFloat", content.DockHandler.IsFloat.ToString(CultureInfo.InvariantCulture));
                    xmlOut.WriteEndElement();
                }
                xmlOut.WriteEndElement();

                // Panes
                xmlOut.WriteStartElement("Panes");
                xmlOut.WriteAttributeString("Count", dockPanel.Panes.Count.ToString(CultureInfo.InvariantCulture));
                foreach (DockPane pane in dockPanel.Panes)
                {
                    xmlOut.WriteStartElement("Pane");
                    xmlOut.WriteAttributeString("ID", dockPanel.Panes.IndexOf(pane).ToString(CultureInfo.InvariantCulture));
                    xmlOut.WriteAttributeString("DockState", pane.DockState.ToString());
                    xmlOut.WriteAttributeString("ActiveContent", dockPanel.Contents.IndexOf(pane.ActiveContent).ToString(CultureInfo.InvariantCulture));
                    xmlOut.WriteStartElement("Contents");
                    xmlOut.WriteAttributeString("Count", pane.Contents.Count.ToString(CultureInfo.InvariantCulture));
                    foreach (IDockContent content in pane.Contents)
                    {
                        xmlOut.WriteStartElement("Content");
                        xmlOut.WriteAttributeString("ID", pane.Contents.IndexOf(content).ToString(CultureInfo.InvariantCulture));
                        xmlOut.WriteAttributeString("RefID", dockPanel.Contents.IndexOf(content).ToString(CultureInfo.InvariantCulture));
                        xmlOut.WriteEndElement();
                    }
                    xmlOut.WriteEndElement();
                    xmlOut.WriteEndElement();
                }
                xmlOut.WriteEndElement();

                // DockWindows
                xmlOut.WriteStartElement("DockWindows");
                int dockWindowId = 0;

                foreach (DockWindow dw in dockPanel.DockWindows)
                {
                    xmlOut.WriteStartElement("DockWindow");
                    xmlOut.WriteAttributeString("ID", dockWindowId.ToString(CultureInfo.InvariantCulture));
                    dockWindowId++;
                    xmlOut.WriteAttributeString("DockState", dw.DockState.ToString());
                    xmlOut.WriteAttributeString("ZOrderIndex", dockPanel.Controls.IndexOf(dw).ToString(CultureInfo.InvariantCulture));
                    xmlOut.WriteStartElement("NestedPanes");
                    xmlOut.WriteAttributeString("Count", dw.NestedPanes.Count.ToString(CultureInfo.InvariantCulture));
                    foreach (DockPane pane in dw.NestedPanes)
                    {
                        xmlOut.WriteStartElement("Pane");
                        xmlOut.WriteAttributeString("ID", dw.NestedPanes.IndexOf(pane).ToString(CultureInfo.InvariantCulture));
                        xmlOut.WriteAttributeString("RefID", dockPanel.Panes.IndexOf(pane).ToString(CultureInfo.InvariantCulture));
                        NestedDockingStatus status = pane.NestedDockingStatus;
                        xmlOut.WriteAttributeString("PrevPane", dockPanel.Panes.IndexOf(status.PreviousPane).ToString(CultureInfo.InvariantCulture));
                        xmlOut.WriteAttributeString("Alignment", status.Alignment.ToString());
                        xmlOut.WriteAttributeString("Proportion", status.Proportion.ToString(CultureInfo.InvariantCulture));
                        xmlOut.WriteEndElement();
                    }
                    xmlOut.WriteEndElement();
                    xmlOut.WriteEndElement();
                }
                xmlOut.WriteEndElement();

                // FloatWindows
                RectangleConverter rectConverter = new RectangleConverter();

                xmlOut.WriteStartElement("FloatWindows");
                xmlOut.WriteAttributeString("Count", dockPanel.FloatWindows.Count.ToString(CultureInfo.InvariantCulture));
                foreach (FloatWindow fw in dockPanel.FloatWindows)
                {
                    xmlOut.WriteStartElement("FloatWindow");
                    xmlOut.WriteAttributeString("ID", dockPanel.FloatWindows.IndexOf(fw).ToString(CultureInfo.InvariantCulture));
                    xmlOut.WriteAttributeString("Bounds", rectConverter.ConvertToInvariantString(fw.Bounds));
                    xmlOut.WriteAttributeString("ZOrderIndex", fw.DockPanel.FloatWindows.IndexOf(fw).ToString(CultureInfo.InvariantCulture));
                    xmlOut.WriteStartElement("NestedPanes");
                    xmlOut.WriteAttributeString("Count", fw.NestedPanes.Count.ToString(CultureInfo.InvariantCulture));
                    foreach (DockPane pane in fw.NestedPanes)
                    {
                        xmlOut.WriteStartElement("Pane");
                        xmlOut.WriteAttributeString("ID", fw.NestedPanes.IndexOf(pane).ToString(CultureInfo.InvariantCulture));
                        xmlOut.WriteAttributeString("RefID", dockPanel.Panes.IndexOf(pane).ToString(CultureInfo.InvariantCulture));
                        NestedDockingStatus status = pane.NestedDockingStatus;
                        xmlOut.WriteAttributeString("PrevPane", dockPanel.Panes.IndexOf(status.PreviousPane).ToString(CultureInfo.InvariantCulture));
                        xmlOut.WriteAttributeString("Alignment", status.Alignment.ToString());
                        xmlOut.WriteAttributeString("Proportion", status.Proportion.ToString(CultureInfo.InvariantCulture));
                        xmlOut.WriteEndElement();
                    }
                    xmlOut.WriteEndElement();
                    xmlOut.WriteEndElement();
                }
                xmlOut.WriteEndElement();       //	</FloatWindows>

                xmlOut.WriteEndElement();

                if (!upstream)
                {
                    xmlOut.WriteEndDocument();
                    xmlOut.Close();
                }
                else
                {
                    xmlOut.Flush();
                }
            }
예제 #52
0
 public static void LoadFromXml(DockPanel dockPanel, Stream stream, DeserializeDockContent deserializeContent)
 {
     LoadFromXml(dockPanel, stream, deserializeContent, true);
 }
예제 #53
0
            public static void LoadFromXml(DockPanel dockPanel, Stream stream, DeserializeDockContent deserializeContent, bool closeStream)
            {
                if (dockPanel.Contents.Count != 0)
                {
                    throw new InvalidOperationException(Strings.DockPanel_LoadFromXml_AlreadyInitialized);
                }

                XmlTextReader xmlIn = new XmlTextReader(stream);

                xmlIn.WhitespaceHandling = WhitespaceHandling.None;
                xmlIn.MoveToContent();

                while (!xmlIn.Name.Equals("DockPanel"))
                {
                    if (!MoveToNextElement(xmlIn))
                    {
                        throw new ArgumentException(Strings.DockPanel_LoadFromXml_InvalidXmlFormat);
                    }
                }

                string formatVersion = xmlIn.GetAttribute("FormatVersion");

                if (!IsFormatVersionValid(formatVersion))
                {
                    throw new ArgumentException(Strings.DockPanel_LoadFromXml_InvalidFormatVersion);
                }

                DockPanelStruct dockPanelStruct = new DockPanelStruct();

                dockPanelStruct.DockLeftPortion         = Convert.ToDouble(xmlIn.GetAttribute("DockLeftPortion"), CultureInfo.InvariantCulture);
                dockPanelStruct.DockRightPortion        = Convert.ToDouble(xmlIn.GetAttribute("DockRightPortion"), CultureInfo.InvariantCulture);
                dockPanelStruct.DockTopPortion          = Convert.ToDouble(xmlIn.GetAttribute("DockTopPortion"), CultureInfo.InvariantCulture);
                dockPanelStruct.DockBottomPortion       = Convert.ToDouble(xmlIn.GetAttribute("DockBottomPortion"), CultureInfo.InvariantCulture);
                dockPanelStruct.IndexActiveDocumentPane = Convert.ToInt32(xmlIn.GetAttribute("ActiveDocumentPane"), CultureInfo.InvariantCulture);
                dockPanelStruct.IndexActivePane         = Convert.ToInt32(xmlIn.GetAttribute("ActivePane"), CultureInfo.InvariantCulture);

                // Load Contents
                MoveToNextElement(xmlIn);
                if (xmlIn.Name != "Contents")
                {
                    throw new ArgumentException(Strings.DockPanel_LoadFromXml_InvalidXmlFormat);
                }
                ContentStruct[] contents = LoadContents(xmlIn);

                // Load Panes
                if (xmlIn.Name != "Panes")
                {
                    throw new ArgumentException(Strings.DockPanel_LoadFromXml_InvalidXmlFormat);
                }
                PaneStruct[] panes = LoadPanes(xmlIn);

                // Load DockWindows
                if (xmlIn.Name != "DockWindows")
                {
                    throw new ArgumentException(Strings.DockPanel_LoadFromXml_InvalidXmlFormat);
                }
                DockWindowStruct[] dockWindows = LoadDockWindows(xmlIn, dockPanel);

                // Load FloatWindows
                if (xmlIn.Name != "FloatWindows")
                {
                    throw new ArgumentException(Strings.DockPanel_LoadFromXml_InvalidXmlFormat);
                }
                FloatWindowStruct[] floatWindows = LoadFloatWindows(xmlIn);

                if (closeStream)
                {
                    xmlIn.Close();
                }

                dockPanel.SuspendLayout(true);

                dockPanel.DockLeftPortion   = dockPanelStruct.DockLeftPortion;
                dockPanel.DockRightPortion  = dockPanelStruct.DockRightPortion;
                dockPanel.DockTopPortion    = dockPanelStruct.DockTopPortion;
                dockPanel.DockBottomPortion = dockPanelStruct.DockBottomPortion;

                // Set DockWindow ZOrders
                int prevMaxDockWindowZOrder = int.MaxValue;

                for (int i = 0; i < dockWindows.Length; i++)
                {
                    int maxDockWindowZOrder = -1;
                    int index = -1;
                    for (int j = 0; j < dockWindows.Length; j++)
                    {
                        if (dockWindows[j].ZOrderIndex > maxDockWindowZOrder && dockWindows[j].ZOrderIndex < prevMaxDockWindowZOrder)
                        {
                            maxDockWindowZOrder = dockWindows[j].ZOrderIndex;
                            index = j;
                        }
                    }

                    dockPanel.DockWindows[dockWindows[index].DockState].BringToFront();
                    prevMaxDockWindowZOrder = maxDockWindowZOrder;
                }

                // Create Contents
                for (int i = 0; i < contents.Length; i++)
                {
                    IDockContent content = deserializeContent(contents[i].PersistString);
                    if (content == null)
                    {
                        content = new DummyContent();
                    }
                    content.DockHandler.DockPanel       = dockPanel;
                    content.DockHandler.AutoHidePortion = contents[i].AutoHidePortion;
                    content.DockHandler.IsHidden        = true;
                    content.DockHandler.IsFloat         = contents[i].IsFloat;
                }

                // Create panes
                for (int i = 0; i < panes.Length; i++)
                {
                    DockPane pane = null;
                    for (int j = 0; j < panes[i].IndexContents.Length; j++)
                    {
                        IDockContent content = dockPanel.Contents[panes[i].IndexContents[j]];
                        if (j == 0)
                        {
                            pane = dockPanel.DockPaneFactory.CreateDockPane(content, panes[i].DockState, false);
                        }
                        else if (panes[i].DockState == DockState.Float)
                        {
                            content.DockHandler.FloatPane = pane;
                        }
                        else
                        {
                            content.DockHandler.PanelPane = pane;
                        }
                    }
                }

                // Assign Panes to DockWindows
                for (int i = 0; i < dockWindows.Length; i++)
                {
                    for (int j = 0; j < dockWindows[i].NestedPanes.Length; j++)
                    {
                        DockWindow    dw            = dockPanel.DockWindows[dockWindows[i].DockState];
                        int           indexPane     = dockWindows[i].NestedPanes[j].IndexPane;
                        DockPane      pane          = dockPanel.Panes[indexPane];
                        int           indexPrevPane = dockWindows[i].NestedPanes[j].IndexPrevPane;
                        DockPane      prevPane      = (indexPrevPane == -1) ? dw.NestedPanes.GetDefaultPreviousPane(pane) : dockPanel.Panes[indexPrevPane];
                        DockAlignment alignment     = dockWindows[i].NestedPanes[j].Alignment;
                        double        proportion    = dockWindows[i].NestedPanes[j].Proportion;
                        pane.DockTo(dw, prevPane, alignment, proportion);
                        if (panes[indexPane].DockState == dw.DockState)
                        {
                            panes[indexPane].ZOrderIndex = dockWindows[i].ZOrderIndex;
                        }
                    }
                }

                // Create float windows
                for (int i = 0; i < floatWindows.Length; i++)
                {
                    FloatWindow fw = null;
                    for (int j = 0; j < floatWindows[i].NestedPanes.Length; j++)
                    {
                        int      indexPane = floatWindows[i].NestedPanes[j].IndexPane;
                        DockPane pane      = dockPanel.Panes[indexPane];
                        if (j == 0)
                        {
                            fw = dockPanel.FloatWindowFactory.CreateFloatWindow(dockPanel, pane, floatWindows[i].Bounds);
                        }
                        else
                        {
                            int           indexPrevPane = floatWindows[i].NestedPanes[j].IndexPrevPane;
                            DockPane      prevPane      = indexPrevPane == -1 ? null : dockPanel.Panes[indexPrevPane];
                            DockAlignment alignment     = floatWindows[i].NestedPanes[j].Alignment;
                            double        proportion    = floatWindows[i].NestedPanes[j].Proportion;
                            pane.DockTo(fw, prevPane, alignment, proportion);
                            if (panes[indexPane].DockState == fw.DockState)
                            {
                                panes[indexPane].ZOrderIndex = floatWindows[i].ZOrderIndex;
                            }
                        }
                    }
                }

                // sort IDockContent by its Pane's ZOrder
                int[] sortedContents = null;
                if (contents.Length > 0)
                {
                    sortedContents = new int[contents.Length];
                    for (int i = 0; i < contents.Length; i++)
                    {
                        sortedContents[i] = i;
                    }

                    int lastDocument = contents.Length;
                    for (int i = 0; i < contents.Length - 1; i++)
                    {
                        for (int j = i + 1; j < contents.Length; j++)
                        {
                            DockPane pane1        = dockPanel.Contents[sortedContents[i]].DockHandler.Pane;
                            int      ZOrderIndex1 = pane1 == null ? 0 : panes[dockPanel.Panes.IndexOf(pane1)].ZOrderIndex;
                            DockPane pane2        = dockPanel.Contents[sortedContents[j]].DockHandler.Pane;
                            int      ZOrderIndex2 = pane2 == null ? 0 : panes[dockPanel.Panes.IndexOf(pane2)].ZOrderIndex;
                            if (ZOrderIndex1 > ZOrderIndex2)
                            {
                                int temp = sortedContents[i];
                                sortedContents[i] = sortedContents[j];
                                sortedContents[j] = temp;
                            }
                        }
                    }
                }

                // show non-document IDockContent first to avoid screen flickers
                for (int i = 0; i < contents.Length; i++)
                {
                    IDockContent content = dockPanel.Contents[sortedContents[i]];
                    if (content.DockHandler.Pane != null && content.DockHandler.Pane.DockState != DockState.Document)
                    {
                        content.DockHandler.IsHidden = contents[sortedContents[i]].IsHidden;
                    }
                }

                // after all non-document IDockContent, show document IDockContent
                for (int i = 0; i < contents.Length; i++)
                {
                    IDockContent content = dockPanel.Contents[sortedContents[i]];
                    if (content.DockHandler.Pane != null && content.DockHandler.Pane.DockState == DockState.Document)
                    {
                        content.DockHandler.IsHidden = contents[sortedContents[i]].IsHidden;
                    }
                }

                for (int i = 0; i < panes.Length; i++)
                {
                    dockPanel.Panes[i].ActiveContent = panes[i].IndexActiveContent == -1 ? null : dockPanel.Contents[panes[i].IndexActiveContent];
                }

                if (dockPanelStruct.IndexActiveDocumentPane != -1)
                {
                    dockPanel.Panes[dockPanelStruct.IndexActiveDocumentPane].Activate();
                }

                if (dockPanelStruct.IndexActivePane != -1)
                {
                    dockPanel.Panes[dockPanelStruct.IndexActivePane].Activate();
                }

                for (int i = dockPanel.Contents.Count - 1; i >= 0; i--)
                {
                    if (dockPanel.Contents[i] is DummyContent)
                    {
                        dockPanel.Contents[i].DockHandler.Form.Close();
                    }
                }

                dockPanel.ResumeLayout(true, true);
            }
 protected DragHandler(DockPanel dockPanel)
 {
     this.m_dockPanel = dockPanel;
 }
예제 #55
0
 public AutoHideStripBase CreateAutoHideStrip(DockPanel panel)
 {
     return(new VS2003AutoHideStrip(panel));
 }
예제 #56
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.components = new System.ComponentModel.Container();
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(TextEditor));
     this.FToolbarImageList                = new System.Windows.Forms.ImageList(this.components);
     this.FDockPanel                       = new WeifenLuo.WinFormsUI.Docking.DockPanel();
     this.FMenuStrip                       = new System.Windows.Forms.MenuStrip();
     this.FFileToolStripMenuItem           = new System.Windows.Forms.ToolStripMenuItem();
     this.FSaveToolStripMenuItem           = new System.Windows.Forms.ToolStripMenuItem();
     this.FSaveAsFileToolStripMenuItem     = new System.Windows.Forms.ToolStripMenuItem();
     this.FSaveAsDocumentToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
     this.toolStripMenuItem5               = new System.Windows.Forms.ToolStripSeparator();
     this.FCloseToolStripMenuItem          = new System.Windows.Forms.ToolStripMenuItem();
     this.toolStripMenuItem1               = new System.Windows.Forms.ToolStripSeparator();
     this.FPrintToolStripMenuItem          = new System.Windows.Forms.ToolStripMenuItem();
     this.FEditToolStripMenuItem           = new System.Windows.Forms.ToolStripMenuItem();
     this.FUndoToolStripMenuItem           = new System.Windows.Forms.ToolStripMenuItem();
     this.FRedoToolStripMenuItem           = new System.Windows.Forms.ToolStripMenuItem();
     this.toolStripMenuItem2               = new System.Windows.Forms.ToolStripSeparator();
     this.FCutToolStripMenuItem            = new System.Windows.Forms.ToolStripMenuItem();
     this.FCopyToolStripMenuItem           = new System.Windows.Forms.ToolStripMenuItem();
     this.FPasteToolStripMenuItem          = new System.Windows.Forms.ToolStripMenuItem();
     this.toolStripMenuItem3               = new System.Windows.Forms.ToolStripSeparator();
     this.FSelectAllToolStripMenuItem      = new System.Windows.Forms.ToolStripMenuItem();
     this.toolStripMenuItem4               = new System.Windows.Forms.ToolStripSeparator();
     this.FFindToolStripMenuItem           = new System.Windows.Forms.ToolStripMenuItem();
     this.FReplaceToolStripMenuItem        = new System.Windows.Forms.ToolStripMenuItem();
     this.FFindNextToolStripMenuItem       = new System.Windows.Forms.ToolStripMenuItem();
     this.FViewToolStripMenuItem           = new System.Windows.Forms.ToolStripMenuItem();
     this.FSplitWindowToolStripMenuItem    = new System.Windows.Forms.ToolStripMenuItem();
     this.FToolStrip                       = new System.Windows.Forms.ToolStrip();
     this.FSaveToolStripButton             = new System.Windows.Forms.ToolStripButton();
     this.FSaveAsFileToolStripButton       = new System.Windows.Forms.ToolStripButton();
     this.FSaveAsDocumentToolStripButton   = new System.Windows.Forms.ToolStripButton();
     this.toolStripSeparator1              = new System.Windows.Forms.ToolStripSeparator();
     this.FPrintToolStripButton            = new System.Windows.Forms.ToolStripButton();
     this.toolStripSeparator2              = new System.Windows.Forms.ToolStripSeparator();
     this.FCutToolStripButton              = new System.Windows.Forms.ToolStripButton();
     this.FCopyToolStripButton             = new System.Windows.Forms.ToolStripButton();
     this.FPasteToolStripButton            = new System.Windows.Forms.ToolStripButton();
     this.toolStripSeparator3              = new System.Windows.Forms.ToolStripSeparator();
     this.FFindToolStripButton             = new System.Windows.Forms.ToolStripButton();
     this.FReplaceToolStripButton          = new System.Windows.Forms.ToolStripButton();
     this.FFindNextToolStripButton         = new System.Windows.Forms.ToolStripButton();
     this.toolStripSeparator4              = new System.Windows.Forms.ToolStripSeparator();
     this.FUndoToolStripButton             = new System.Windows.Forms.ToolStripButton();
     this.FRedoToolStripButton             = new System.Windows.Forms.ToolStripButton();
     this.FMenuStrip.SuspendLayout();
     this.FToolStrip.SuspendLayout();
     this.SuspendLayout();
     //
     // FBottomToolStripPanel
     //
     this.FBottomToolStripPanel.Location = new System.Drawing.Point(0, 354);
     this.FBottomToolStripPanel.Size     = new System.Drawing.Size(455, 22);
     //
     // FToolbarImageList
     //
     this.FToolbarImageList.ImageStream      = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("FToolbarImageList.ImageStream")));
     this.FToolbarImageList.TransparentColor = System.Drawing.Color.Transparent;
     this.FToolbarImageList.Images.SetKeyName(0, "");
     this.FToolbarImageList.Images.SetKeyName(1, "");
     this.FToolbarImageList.Images.SetKeyName(2, "");
     this.FToolbarImageList.Images.SetKeyName(3, "");
     this.FToolbarImageList.Images.SetKeyName(4, "");
     this.FToolbarImageList.Images.SetKeyName(5, "");
     this.FToolbarImageList.Images.SetKeyName(6, "");
     this.FToolbarImageList.Images.SetKeyName(7, "");
     this.FToolbarImageList.Images.SetKeyName(8, "");
     this.FToolbarImageList.Images.SetKeyName(9, "");
     this.FToolbarImageList.Images.SetKeyName(10, "");
     this.FToolbarImageList.Images.SetKeyName(11, "");
     this.FToolbarImageList.Images.SetKeyName(12, "");
     this.FToolbarImageList.Images.SetKeyName(13, "");
     this.FToolbarImageList.Images.SetKeyName(14, "");
     //
     // FDockPanel
     //
     this.FDockPanel.ActiveAutoHideContent = null;
     this.FDockPanel.Dock          = System.Windows.Forms.DockStyle.Fill;
     this.FDockPanel.DocumentStyle = WeifenLuo.WinFormsUI.Docking.DocumentStyle.DockingSdi;
     this.FDockPanel.Location      = new System.Drawing.Point(0, 0);
     this.FDockPanel.Name          = "FDockPanel";
     this.FDockPanel.Size          = new System.Drawing.Size(455, 354);
     this.FDockPanel.TabIndex      = 0;
     //
     // FMenuStrip
     //
     this.FMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
         this.FFileToolStripMenuItem,
         this.FEditToolStripMenuItem,
         this.FViewToolStripMenuItem
     });
     this.FMenuStrip.Location = new System.Drawing.Point(0, 0);
     this.FMenuStrip.Name     = "FMenuStrip";
     this.FMenuStrip.Size     = new System.Drawing.Size(455, 24);
     this.FMenuStrip.TabIndex = 9;
     this.FMenuStrip.Text     = "menuStrip1";
     this.FMenuStrip.Visible  = false;
     //
     // FFileToolStripMenuItem
     //
     this.FFileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
         this.FSaveToolStripMenuItem,
         this.FSaveAsFileToolStripMenuItem,
         this.FSaveAsDocumentToolStripMenuItem,
         this.toolStripMenuItem5,
         this.FCloseToolStripMenuItem,
         this.toolStripMenuItem1,
         this.FPrintToolStripMenuItem
     });
     this.FFileToolStripMenuItem.MergeAction = System.Windows.Forms.MergeAction.MatchOnly;
     this.FFileToolStripMenuItem.MergeIndex  = 10;
     this.FFileToolStripMenuItem.Name        = "FFileToolStripMenuItem";
     this.FFileToolStripMenuItem.Size        = new System.Drawing.Size(37, 20);
     this.FFileToolStripMenuItem.Text        = "&File";
     //
     // FSaveToolStripMenuItem
     //
     this.FSaveToolStripMenuItem.Image        = global::Alphora.Dataphor.Dataphoria.MenuImages.Save;
     this.FSaveToolStripMenuItem.MergeAction  = System.Windows.Forms.MergeAction.Insert;
     this.FSaveToolStripMenuItem.MergeIndex   = 60;
     this.FSaveToolStripMenuItem.Name         = "FSaveToolStripMenuItem";
     this.FSaveToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S)));
     this.FSaveToolStripMenuItem.Size         = new System.Drawing.Size(256, 22);
     this.FSaveToolStripMenuItem.Text         = "&Save";
     this.FSaveToolStripMenuItem.Click       += new System.EventHandler(this.FMainMenuStrip_ItemClicked);
     //
     // FSaveAsFileToolStripMenuItem
     //
     this.FSaveAsFileToolStripMenuItem.Image        = global::Alphora.Dataphor.Dataphoria.MenuImages.SaveFile;
     this.FSaveAsFileToolStripMenuItem.MergeAction  = System.Windows.Forms.MergeAction.Insert;
     this.FSaveAsFileToolStripMenuItem.MergeIndex   = 60;
     this.FSaveAsFileToolStripMenuItem.Name         = "FSaveAsFileToolStripMenuItem";
     this.FSaveAsFileToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift)
                                                                                    | System.Windows.Forms.Keys.F)));
     this.FSaveAsFileToolStripMenuItem.Size   = new System.Drawing.Size(256, 22);
     this.FSaveAsFileToolStripMenuItem.Text   = "Save As &File...";
     this.FSaveAsFileToolStripMenuItem.Click += new System.EventHandler(this.FMainMenuStrip_ItemClicked);
     //
     // FSaveAsDocumentToolStripMenuItem
     //
     this.FSaveAsDocumentToolStripMenuItem.Image        = global::Alphora.Dataphor.Dataphoria.MenuImages.SaveDocument;
     this.FSaveAsDocumentToolStripMenuItem.MergeAction  = System.Windows.Forms.MergeAction.Insert;
     this.FSaveAsDocumentToolStripMenuItem.MergeIndex   = 60;
     this.FSaveAsDocumentToolStripMenuItem.Name         = "FSaveAsDocumentToolStripMenuItem";
     this.FSaveAsDocumentToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift)
                                                                                        | System.Windows.Forms.Keys.D)));
     this.FSaveAsDocumentToolStripMenuItem.Size   = new System.Drawing.Size(256, 22);
     this.FSaveAsDocumentToolStripMenuItem.Text   = "Save As &Document...";
     this.FSaveAsDocumentToolStripMenuItem.Click += new System.EventHandler(this.FMainMenuStrip_ItemClicked);
     //
     // toolStripMenuItem5
     //
     this.toolStripMenuItem5.MergeAction = System.Windows.Forms.MergeAction.Insert;
     this.toolStripMenuItem5.MergeIndex  = 80;
     this.toolStripMenuItem5.Name        = "toolStripMenuItem5";
     this.toolStripMenuItem5.Size        = new System.Drawing.Size(253, 6);
     //
     // FCloseToolStripMenuItem
     //
     this.FCloseToolStripMenuItem.Image        = global::Alphora.Dataphor.Dataphoria.MenuImages.Close;
     this.FCloseToolStripMenuItem.MergeAction  = System.Windows.Forms.MergeAction.Insert;
     this.FCloseToolStripMenuItem.MergeIndex   = 80;
     this.FCloseToolStripMenuItem.Name         = "FCloseToolStripMenuItem";
     this.FCloseToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F4)));
     this.FCloseToolStripMenuItem.Size         = new System.Drawing.Size(256, 22);
     this.FCloseToolStripMenuItem.Text         = "C&lose";
     this.FCloseToolStripMenuItem.Click       += new System.EventHandler(this.FMainMenuStrip_ItemClicked);
     //
     // toolStripMenuItem1
     //
     this.toolStripMenuItem1.MergeAction = System.Windows.Forms.MergeAction.Insert;
     this.toolStripMenuItem1.MergeIndex  = 100;
     this.toolStripMenuItem1.Name        = "toolStripMenuItem1";
     this.toolStripMenuItem1.Size        = new System.Drawing.Size(253, 6);
     //
     // FPrintToolStripMenuItem
     //
     this.FPrintToolStripMenuItem.Image        = global::Alphora.Dataphor.Dataphoria.MenuImages.Print;
     this.FPrintToolStripMenuItem.MergeAction  = System.Windows.Forms.MergeAction.Insert;
     this.FPrintToolStripMenuItem.MergeIndex   = 100;
     this.FPrintToolStripMenuItem.Name         = "FPrintToolStripMenuItem";
     this.FPrintToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.P)));
     this.FPrintToolStripMenuItem.Size         = new System.Drawing.Size(256, 22);
     this.FPrintToolStripMenuItem.Text         = "&Print";
     this.FPrintToolStripMenuItem.Click       += new System.EventHandler(this.FMainMenuStrip_ItemClicked);
     //
     // FEditToolStripMenuItem
     //
     this.FEditToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
         this.FUndoToolStripMenuItem,
         this.FRedoToolStripMenuItem,
         this.toolStripMenuItem2,
         this.FCutToolStripMenuItem,
         this.FCopyToolStripMenuItem,
         this.FPasteToolStripMenuItem,
         this.toolStripMenuItem3,
         this.FSelectAllToolStripMenuItem,
         this.toolStripMenuItem4,
         this.FFindToolStripMenuItem,
         this.FReplaceToolStripMenuItem,
         this.FFindNextToolStripMenuItem
     });
     this.FEditToolStripMenuItem.MergeAction = System.Windows.Forms.MergeAction.Insert;
     this.FEditToolStripMenuItem.MergeIndex  = 1;
     this.FEditToolStripMenuItem.Name        = "FEditToolStripMenuItem";
     this.FEditToolStripMenuItem.Size        = new System.Drawing.Size(39, 20);
     this.FEditToolStripMenuItem.Text        = "&Edit";
     //
     // FUndoToolStripMenuItem
     //
     this.FUndoToolStripMenuItem.Image = global::Alphora.Dataphor.Dataphoria.MenuImages.Undo;
     this.FUndoToolStripMenuItem.Name  = "FUndoToolStripMenuItem";
     this.FUndoToolStripMenuItem.ShortcutKeyDisplayString = "Ctrl+Z";
     this.FUndoToolStripMenuItem.Size   = new System.Drawing.Size(164, 22);
     this.FUndoToolStripMenuItem.Text   = "&Undo";
     this.FUndoToolStripMenuItem.Click += new System.EventHandler(this.FMainMenuStrip_ItemClicked);
     //
     // FRedoToolStripMenuItem
     //
     this.FRedoToolStripMenuItem.Image = global::Alphora.Dataphor.Dataphoria.MenuImages.Redo;
     this.FRedoToolStripMenuItem.Name  = "FRedoToolStripMenuItem";
     this.FRedoToolStripMenuItem.ShortcutKeyDisplayString = "Ctrl+Y";
     this.FRedoToolStripMenuItem.Size   = new System.Drawing.Size(164, 22);
     this.FRedoToolStripMenuItem.Text   = "&Redo";
     this.FRedoToolStripMenuItem.Click += new System.EventHandler(this.FMainMenuStrip_ItemClicked);
     //
     // toolStripMenuItem2
     //
     this.toolStripMenuItem2.Name = "toolStripMenuItem2";
     this.toolStripMenuItem2.Size = new System.Drawing.Size(161, 6);
     //
     // FCutToolStripMenuItem
     //
     this.FCutToolStripMenuItem.Image = global::Alphora.Dataphor.Dataphoria.MenuImages.Cut;
     this.FCutToolStripMenuItem.Name  = "FCutToolStripMenuItem";
     this.FCutToolStripMenuItem.ShortcutKeyDisplayString = "Ctrl+X";
     this.FCutToolStripMenuItem.Size   = new System.Drawing.Size(164, 22);
     this.FCutToolStripMenuItem.Text   = "C&ut";
     this.FCutToolStripMenuItem.Click += new System.EventHandler(this.FMainMenuStrip_ItemClicked);
     //
     // FCopyToolStripMenuItem
     //
     this.FCopyToolStripMenuItem.Image = global::Alphora.Dataphor.Dataphoria.MenuImages.Copy;
     this.FCopyToolStripMenuItem.Name  = "FCopyToolStripMenuItem";
     this.FCopyToolStripMenuItem.ShortcutKeyDisplayString = "Ctrl+C";
     this.FCopyToolStripMenuItem.Size   = new System.Drawing.Size(164, 22);
     this.FCopyToolStripMenuItem.Text   = "&Copy";
     this.FCopyToolStripMenuItem.Click += new System.EventHandler(this.FMainMenuStrip_ItemClicked);
     //
     // FPasteToolStripMenuItem
     //
     this.FPasteToolStripMenuItem.Image = global::Alphora.Dataphor.Dataphoria.MenuImages.Paste;
     this.FPasteToolStripMenuItem.Name  = "FPasteToolStripMenuItem";
     this.FPasteToolStripMenuItem.ShortcutKeyDisplayString = "Ctrl+V";
     this.FPasteToolStripMenuItem.Size   = new System.Drawing.Size(164, 22);
     this.FPasteToolStripMenuItem.Text   = "&Paste";
     this.FPasteToolStripMenuItem.Click += new System.EventHandler(this.FMainMenuStrip_ItemClicked);
     //
     // toolStripMenuItem3
     //
     this.toolStripMenuItem3.Name = "toolStripMenuItem3";
     this.toolStripMenuItem3.Size = new System.Drawing.Size(161, 6);
     //
     // FSelectAllToolStripMenuItem
     //
     this.FSelectAllToolStripMenuItem.Image = global::Alphora.Dataphor.Dataphoria.MenuImages.SelectAll;
     this.FSelectAllToolStripMenuItem.Name  = "FSelectAllToolStripMenuItem";
     this.FSelectAllToolStripMenuItem.ShortcutKeyDisplayString = "Ctrl+A";
     this.FSelectAllToolStripMenuItem.Size   = new System.Drawing.Size(164, 22);
     this.FSelectAllToolStripMenuItem.Text   = "&Select All";
     this.FSelectAllToolStripMenuItem.Click += new System.EventHandler(this.FMainMenuStrip_ItemClicked);
     //
     // toolStripMenuItem4
     //
     this.toolStripMenuItem4.Name = "toolStripMenuItem4";
     this.toolStripMenuItem4.Size = new System.Drawing.Size(161, 6);
     //
     // FFindToolStripMenuItem
     //
     this.FFindToolStripMenuItem.Image = global::Alphora.Dataphor.Dataphoria.MenuImages.Find;
     this.FFindToolStripMenuItem.Name  = "FFindToolStripMenuItem";
     this.FFindToolStripMenuItem.ShortcutKeyDisplayString = "Ctrl+F";
     this.FFindToolStripMenuItem.Size   = new System.Drawing.Size(164, 22);
     this.FFindToolStripMenuItem.Text   = "&Find...";
     this.FFindToolStripMenuItem.Click += new System.EventHandler(this.FMainMenuStrip_ItemClicked);
     //
     // FReplaceToolStripMenuItem
     //
     this.FReplaceToolStripMenuItem.Image = global::Alphora.Dataphor.Dataphoria.MenuImages.Replace;
     this.FReplaceToolStripMenuItem.Name  = "FReplaceToolStripMenuItem";
     this.FReplaceToolStripMenuItem.ShortcutKeyDisplayString = "Ctrl+H";
     this.FReplaceToolStripMenuItem.Size   = new System.Drawing.Size(164, 22);
     this.FReplaceToolStripMenuItem.Text   = "R&eplace";
     this.FReplaceToolStripMenuItem.Click += new System.EventHandler(this.FMainMenuStrip_ItemClicked);
     //
     // FFindNextToolStripMenuItem
     //
     this.FFindNextToolStripMenuItem.Image = global::Alphora.Dataphor.Dataphoria.MenuImages.FindNext;
     this.FFindNextToolStripMenuItem.Name  = "FFindNextToolStripMenuItem";
     this.FFindNextToolStripMenuItem.ShortcutKeyDisplayString = "F3";
     this.FFindNextToolStripMenuItem.Size   = new System.Drawing.Size(164, 22);
     this.FFindNextToolStripMenuItem.Text   = "Find &Next";
     this.FFindNextToolStripMenuItem.Click += new System.EventHandler(this.FMainMenuStrip_ItemClicked);
     //
     // FViewToolStripMenuItem
     //
     this.FViewToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
         this.FSplitWindowToolStripMenuItem
     });
     this.FViewToolStripMenuItem.MergeAction = System.Windows.Forms.MergeAction.MatchOnly;
     this.FViewToolStripMenuItem.MergeIndex  = 20;
     this.FViewToolStripMenuItem.Name        = "FViewToolStripMenuItem";
     this.FViewToolStripMenuItem.Size        = new System.Drawing.Size(44, 20);
     this.FViewToolStripMenuItem.Text        = "&View";
     //
     // FSplitWindowToolStripMenuItem
     //
     this.FSplitWindowToolStripMenuItem.Image        = global::Alphora.Dataphor.Dataphoria.MenuImages.SplitWindow;
     this.FSplitWindowToolStripMenuItem.Name         = "FSplitWindowToolStripMenuItem";
     this.FSplitWindowToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift)
                                                                                     | System.Windows.Forms.Keys.D1)));
     this.FSplitWindowToolStripMenuItem.Size   = new System.Drawing.Size(216, 22);
     this.FSplitWindowToolStripMenuItem.Text   = "&Split Window";
     this.FSplitWindowToolStripMenuItem.Click += new System.EventHandler(this.FMainMenuStrip_ItemClicked);
     //
     // FToolStrip
     //
     this.FToolStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
         this.FSaveToolStripButton,
         this.FSaveAsFileToolStripButton,
         this.FSaveAsDocumentToolStripButton,
         this.toolStripSeparator1,
         this.FPrintToolStripButton,
         this.toolStripSeparator2,
         this.FCutToolStripButton,
         this.FCopyToolStripButton,
         this.FPasteToolStripButton,
         this.toolStripSeparator3,
         this.FFindToolStripButton,
         this.FReplaceToolStripButton,
         this.FFindNextToolStripButton,
         this.toolStripSeparator4,
         this.FUndoToolStripButton,
         this.FRedoToolStripButton
     });
     this.FToolStrip.Location = new System.Drawing.Point(0, 0);
     this.FToolStrip.Name     = "FToolStrip";
     this.FToolStrip.Size     = new System.Drawing.Size(455, 25);
     this.FToolStrip.TabIndex = 10;
     this.FToolStrip.Text     = "toolStrip1";
     this.FToolStrip.Visible  = false;
     //
     // FSaveToolStripButton
     //
     this.FSaveToolStripButton.DisplayStyle          = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
     this.FSaveToolStripButton.Image                 = global::Alphora.Dataphor.Dataphoria.MenuImages.Save;
     this.FSaveToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta;
     this.FSaveToolStripButton.Name   = "FSaveToolStripButton";
     this.FSaveToolStripButton.Size   = new System.Drawing.Size(23, 22);
     this.FSaveToolStripButton.Text   = "Save";
     this.FSaveToolStripButton.Click += new System.EventHandler(this.FMainMenuStrip_ItemClicked);
     //
     // FSaveAsFileToolStripButton
     //
     this.FSaveAsFileToolStripButton.DisplayStyle          = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
     this.FSaveAsFileToolStripButton.Image                 = global::Alphora.Dataphor.Dataphoria.MenuImages.SaveFile;
     this.FSaveAsFileToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta;
     this.FSaveAsFileToolStripButton.Name   = "FSaveAsFileToolStripButton";
     this.FSaveAsFileToolStripButton.Size   = new System.Drawing.Size(23, 22);
     this.FSaveAsFileToolStripButton.Text   = "Save as";
     this.FSaveAsFileToolStripButton.Click += new System.EventHandler(this.FMainMenuStrip_ItemClicked);
     //
     // FSaveAsDocumentToolStripButton
     //
     this.FSaveAsDocumentToolStripButton.DisplayStyle          = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
     this.FSaveAsDocumentToolStripButton.Image                 = global::Alphora.Dataphor.Dataphoria.MenuImages.SaveDocument;
     this.FSaveAsDocumentToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta;
     this.FSaveAsDocumentToolStripButton.Name   = "FSaveAsDocumentToolStripButton";
     this.FSaveAsDocumentToolStripButton.Size   = new System.Drawing.Size(23, 22);
     this.FSaveAsDocumentToolStripButton.Text   = "Save as document";
     this.FSaveAsDocumentToolStripButton.Click += new System.EventHandler(this.FMainMenuStrip_ItemClicked);
     //
     // toolStripSeparator1
     //
     this.toolStripSeparator1.Name = "toolStripSeparator1";
     this.toolStripSeparator1.Size = new System.Drawing.Size(6, 25);
     //
     // FPrintToolStripButton
     //
     this.FPrintToolStripButton.DisplayStyle          = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
     this.FPrintToolStripButton.Image                 = global::Alphora.Dataphor.Dataphoria.MenuImages.Print;
     this.FPrintToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta;
     this.FPrintToolStripButton.Name   = "FPrintToolStripButton";
     this.FPrintToolStripButton.Size   = new System.Drawing.Size(23, 22);
     this.FPrintToolStripButton.Text   = "Print";
     this.FPrintToolStripButton.Click += new System.EventHandler(this.FMainMenuStrip_ItemClicked);
     //
     // toolStripSeparator2
     //
     this.toolStripSeparator2.Name = "toolStripSeparator2";
     this.toolStripSeparator2.Size = new System.Drawing.Size(6, 25);
     //
     // FCutToolStripButton
     //
     this.FCutToolStripButton.DisplayStyle          = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
     this.FCutToolStripButton.Image                 = global::Alphora.Dataphor.Dataphoria.MenuImages.Cut;
     this.FCutToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta;
     this.FCutToolStripButton.Name   = "FCutToolStripButton";
     this.FCutToolStripButton.Size   = new System.Drawing.Size(23, 22);
     this.FCutToolStripButton.Text   = "Cut";
     this.FCutToolStripButton.Click += new System.EventHandler(this.FMainMenuStrip_ItemClicked);
     //
     // FCopyToolStripButton
     //
     this.FCopyToolStripButton.DisplayStyle          = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
     this.FCopyToolStripButton.Image                 = global::Alphora.Dataphor.Dataphoria.MenuImages.Copy;
     this.FCopyToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta;
     this.FCopyToolStripButton.Name   = "FCopyToolStripButton";
     this.FCopyToolStripButton.Size   = new System.Drawing.Size(23, 22);
     this.FCopyToolStripButton.Text   = "Copy";
     this.FCopyToolStripButton.Click += new System.EventHandler(this.FMainMenuStrip_ItemClicked);
     //
     // FPasteToolStripButton
     //
     this.FPasteToolStripButton.DisplayStyle          = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
     this.FPasteToolStripButton.Image                 = global::Alphora.Dataphor.Dataphoria.MenuImages.Paste;
     this.FPasteToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta;
     this.FPasteToolStripButton.Name   = "FPasteToolStripButton";
     this.FPasteToolStripButton.Size   = new System.Drawing.Size(23, 22);
     this.FPasteToolStripButton.Text   = "Paste";
     this.FPasteToolStripButton.Click += new System.EventHandler(this.FMainMenuStrip_ItemClicked);
     //
     // toolStripSeparator3
     //
     this.toolStripSeparator3.Name = "toolStripSeparator3";
     this.toolStripSeparator3.Size = new System.Drawing.Size(6, 25);
     //
     // FFindToolStripButton
     //
     this.FFindToolStripButton.DisplayStyle          = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
     this.FFindToolStripButton.Image                 = global::Alphora.Dataphor.Dataphoria.MenuImages.Find;
     this.FFindToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta;
     this.FFindToolStripButton.Name   = "FFindToolStripButton";
     this.FFindToolStripButton.Size   = new System.Drawing.Size(23, 22);
     this.FFindToolStripButton.Text   = "Find";
     this.FFindToolStripButton.Click += new System.EventHandler(this.FMainMenuStrip_ItemClicked);
     //
     // FReplaceToolStripButton
     //
     this.FReplaceToolStripButton.DisplayStyle          = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
     this.FReplaceToolStripButton.Image                 = global::Alphora.Dataphor.Dataphoria.MenuImages.Replace;
     this.FReplaceToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta;
     this.FReplaceToolStripButton.Name   = "FReplaceToolStripButton";
     this.FReplaceToolStripButton.Size   = new System.Drawing.Size(23, 22);
     this.FReplaceToolStripButton.Text   = "Replace";
     this.FReplaceToolStripButton.Click += new System.EventHandler(this.FMainMenuStrip_ItemClicked);
     //
     // FFindNextToolStripButton
     //
     this.FFindNextToolStripButton.DisplayStyle          = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
     this.FFindNextToolStripButton.Image                 = global::Alphora.Dataphor.Dataphoria.MenuImages.FindNext;
     this.FFindNextToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta;
     this.FFindNextToolStripButton.Name   = "FFindNextToolStripButton";
     this.FFindNextToolStripButton.Size   = new System.Drawing.Size(23, 22);
     this.FFindNextToolStripButton.Text   = "Find next";
     this.FFindNextToolStripButton.Click += new System.EventHandler(this.FMainMenuStrip_ItemClicked);
     //
     // toolStripSeparator4
     //
     this.toolStripSeparator4.Name = "toolStripSeparator4";
     this.toolStripSeparator4.Size = new System.Drawing.Size(6, 25);
     //
     // FUndoToolStripButton
     //
     this.FUndoToolStripButton.DisplayStyle          = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
     this.FUndoToolStripButton.Image                 = global::Alphora.Dataphor.Dataphoria.MenuImages.Undo;
     this.FUndoToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta;
     this.FUndoToolStripButton.Name   = "FUndoToolStripButton";
     this.FUndoToolStripButton.Size   = new System.Drawing.Size(23, 22);
     this.FUndoToolStripButton.Text   = "Undo";
     this.FUndoToolStripButton.Click += new System.EventHandler(this.FMainMenuStrip_ItemClicked);
     //
     // FRedoToolStripButton
     //
     this.FRedoToolStripButton.DisplayStyle          = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
     this.FRedoToolStripButton.Image                 = global::Alphora.Dataphor.Dataphoria.MenuImages.Redo;
     this.FRedoToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta;
     this.FRedoToolStripButton.Name   = "FRedoToolStripButton";
     this.FRedoToolStripButton.Size   = new System.Drawing.Size(23, 22);
     this.FRedoToolStripButton.Text   = "Redo";
     this.FRedoToolStripButton.Click += new System.EventHandler(this.FMainMenuStrip_ItemClicked);
     //
     // TextEditor
     //
     this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     this.CausesValidation    = false;
     this.ClientSize          = new System.Drawing.Size(455, 376);
     this.Controls.Add(this.FMenuStrip);
     this.Controls.Add(this.FToolStrip);
     this.Controls.Add(this.FDockPanel);
     this.Icon    = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
     this.Name    = "TextEditor";
     this.TabText = "Untitled";
     this.Controls.SetChildIndex(this.FBottomToolStripPanel, 0);
     this.Controls.SetChildIndex(this.FDockPanel, 0);
     this.Controls.SetChildIndex(this.FToolStrip, 0);
     this.Controls.SetChildIndex(this.FMenuStrip, 0);
     this.FMenuStrip.ResumeLayout(false);
     this.FMenuStrip.PerformLayout();
     this.FToolStrip.ResumeLayout(false);
     this.FToolStrip.PerformLayout();
     this.ResumeLayout(false);
     this.PerformLayout();
 }
예제 #57
0
        internal void SetDockState(bool isHidden, DockState visibleState, DockPane oldPane)
        {
            if (IsSuspendSetDockState)
            {
                return;
            }

            if (DockPanel == null && visibleState != DockState.Unknown)
            {
                throw new InvalidOperationException(Strings.DockContentHandler_SetDockState_NullPanel);
            }

            if (visibleState == DockState.Hidden || (visibleState != DockState.Unknown && !IsDockStateValid(visibleState)))
            {
                throw new InvalidOperationException(Strings.DockContentHandler_SetDockState_InvalidState);
            }

            DockPanel dockPanel = DockPanel;

            if (dockPanel != null)
            {
                dockPanel.SuspendLayout(true);
            }

            SuspendSetDockState();

            DockState oldDockState = DockState;

            if (m_isHidden != isHidden || oldDockState == DockState.Unknown)
            {
                m_isHidden = isHidden;
            }
            m_visibleState = visibleState;
            m_dockState    = isHidden ? DockState.Hidden : visibleState;

            if (visibleState == DockState.Unknown)
            {
                Pane = null;
            }
            else
            {
                m_isFloat = (m_visibleState == DockState.Float);

                if (Pane == null)
                {
                    Pane = DockPanel.DockPaneFactory.CreateDockPane(Content, visibleState, true);
                }
                else if (Pane.DockState != visibleState)
                {
                    if (Pane.Contents.Count == 1)
                    {
                        Pane.SetDockState(visibleState);
                    }
                    else
                    {
                        Pane = DockPanel.DockPaneFactory.CreateDockPane(Content, visibleState, true);
                    }
                }
            }

            if (Form.ContainsFocus)
            {
                if (DockState == DockState.Hidden || DockState == DockState.Unknown)
                {
                    if (!Win32Helper.IsRunningOnMono)
                    {
                        DockPanel.ContentFocusManager.GiveUpFocus(Content);
                    }
                }
            }

            SetPaneAndVisible(Pane);

            if (oldPane != null && !oldPane.IsDisposed && oldDockState == oldPane.DockState)
            {
                RefreshDockPane(oldPane);
            }

            if (Pane != null && DockState == Pane.DockState)
            {
                if ((Pane != oldPane) ||
                    (Pane == oldPane && oldDockState != oldPane.DockState))
                {
                    // Avoid early refresh of hidden AutoHide panes
                    if ((Pane.DockWindow == null || Pane.DockWindow.Visible || Pane.IsHidden) && !Pane.IsAutoHide)
                    {
                        RefreshDockPane(Pane);
                    }
                }
            }

            if (oldDockState != DockState)
            {
                if (DockState == DockState.Hidden || DockState == DockState.Unknown ||
                    DockHelper.IsDockStateAutoHide(DockState))
                {
                    if (!Win32Helper.IsRunningOnMono)
                    {
                        DockPanel.ContentFocusManager.RemoveFromList(Content);
                    }
                }
                else if (!Win32Helper.IsRunningOnMono)
                {
                    DockPanel.ContentFocusManager.AddToList(Content);
                }

                ResetAutoHidePortion(oldDockState, DockState);
                OnDockStateChanged(EventArgs.Empty);
            }

            ResumeSetDockState();

            if (dockPanel != null)
            {
                dockPanel.ResumeLayout(true, true);
            }
        }
예제 #58
0
 internal void PostApply(DockPanel dockPanel)
 {
     dockPanel.ResetAutoHideStripControl();
     dockPanel.ResetAutoHideStripWindow();
     dockPanel.ResetDockWindows();
 }
예제 #59
0
 public abstract void Apply(DockPanel dockPanel);
예제 #60
0
 public static void SaveAsXml(DockPanel dockPanel, string fileName)
 {
     SaveAsXml(dockPanel, fileName, Encoding.Unicode);
 }