Exemplo n.º 1
0
        public Content(XmlTextReader xmlIn, int formatVersion)
        {
            // Define the initial object state
            _control = null;
            _title = "";
            _fullTitle = "";
            _imageList = null;
            _icon = null;
            _imageIndex = -1;
            _manager = null;
            _parentWindowContent = null;
            _displaySize = new Size(_defaultDisplaySize, _defaultDisplaySize);
            _autoHideSize = new Size(_defaultAutoHideSize, _defaultAutoHideSize);
            _floatingSize = new Size(_defaultFloatingSize, _defaultFloatingSize);
            _displayLocation = new Point(_defaultLocation, _defaultLocation);
            _order = _counter++;
            _tag = null;
            _visible = false;
            _defaultRestore = null;
            _autoHideRestore = null;
            _floatingRestore = null;
            _dockingRestore = null;
            _autoHidePanel = null;
            _docked = true;
            _captionBar = true;
            _closeButton = true;
            _hideButton = true;
            _autoHidden = false;
            _closeOnHide = false;

            // Overwrite default with values read in
            LoadFromXml(xmlIn, formatVersion);
        }
Exemplo n.º 2
0
        public Window(DockingManager manager)
        {
            // Must provide a valid manager instance
            if (manager == null)
                throw new ArgumentNullException("DockingManager");

            // Default object state
            _state = State.Floating;
            _parentZone = null;
            _zoneArea = 100m;
            _minimalSize = new Size(0,0);
            _manager = manager;
            _autoDispose = true;
            _fullTitle = "";
            _redockAllowed = true;
            _floatingCaption = true;
            _contentCaption = true;

            // Create collection of window details
            _windowDetails = new WindowDetailCollection();

            // We want notification when window details are added/removed/cleared
            _windowDetails.Clearing += new CollectionClear(OnDetailsClearing);
            _windowDetails.Inserted += new CollectionChange(OnDetailInserted);
            _windowDetails.Removing += new CollectionChange(OnDetailRemoving);
        }
Exemplo n.º 3
0
        protected void InternalConstruct(Control callingControl, 
                                         Source source, 
                                         Content c, 
                                         WindowContent wc, 
                                         FloatingForm ff,
                                         DockingManager dm,
                                         Point offset)
        {
            // Store the starting state
            _callingControl = callingControl;
            _source = source;
            _content = c;
            _windowContent = wc;
            _dockingManager = dm;
            _container = _dockingManager.Container;
            _floatingForm = ff;
            _hotZones = null;
            _currentHotZone = null;
            _insideRect = new Rectangle();
            _outsideRect = new Rectangle();
            _offset = offset;

            // Begin tracking straight away
            EnterTrackingMode();
        }
Exemplo n.º 4
0
        public ManagerContentCollection(DockingManager manager)
        {
            // Must provide a valid manager instance
            if (manager == null)
                throw new ArgumentNullException("DockingManager");

            // Default the state
            _manager = manager;
        }
        public WindowDetail(DockingManager manager)
        {
            // Default the state
            _parentZone = null;
            _parentWindow = null;
            _manager = manager;

            // Get correct starting state from manager
            this.BackColor = _manager.BackColor;
            this.ForeColor = _manager.InactiveTextColor;
        }
Exemplo n.º 6
0
        public FloatingForm(DockingManager dockingManager, Zone zone, ContextHandler contextHandler)
        {
            // The caller is responsible for setting our initial screen location
            this.StartPosition = FormStartPosition.Manual;

            // Not in task bar to prevent clutter
            this.ShowInTaskbar = false;

            // Make sure the main Form owns us
            this.Owner = dockingManager.Container.FindForm();

            // Need to know when the Zone is removed
            this.ControlRemoved += new ControlEventHandler(OnZoneRemoved);

            // Add the Zone as the only content of the Form
            Controls.Add(zone);

            // Default state
            _redocker = null;
            _intercept = false;
            _zone = zone;
            _dockingManager = dockingManager;

            // Assign any event handler for context menu
            if (contextHandler != null)
                this.Context += contextHandler;

            // Default color
            this.BackColor = _dockingManager.BackColor;
            this.ForeColor = _dockingManager.InactiveTextColor;

            // Monitor changes in the Zone content
            _zone.Windows.Inserted += new CollectionChange(OnWindowInserted);
            _zone.Windows.Removing += new CollectionChange(OnWindowRemoving);
            _zone.Windows.Removed += new CollectionChange(OnWindowRemoved);

            if (_zone.Windows.Count == 1)
            {
                // The first Window to be added. Tell it to hide details
                _zone.Windows[0].HideDetails();

                // Monitor change in window title
                _zone.Windows[0].FullTitleChanged += new EventHandler(OnFullTitleChanged);

                // Grab any existing title
                this.Text = _zone.Windows[0].FullTitle;
            }

            // Need to hook into message pump so that the ESCAPE key can be
            // intercepted when in redocking mode
            Application.AddMessageFilter(this);
        }
Exemplo n.º 7
0
        public WindowDetailCaption(DockingManager manager, 
                                   Size fixedSize, 
                                   EventHandler closeHandler, 
                                   EventHandler restoreHandler, 
                                   EventHandler invertAutoHideHandler, 
                                   ContextHandler contextHandler)
            : base(manager)
        {
            // Setup correct color remapping depending on initial colors
            DefineButtonRemapping();

            // Default state
            _maxButton = null;
            _hideButton = null;
            _maxInterface = null;
            _redocker = null;
            _showCloseButton = true;
            _showHideButton = true;
            _ignoreHideButton = false;
            _pinnedImage = false;
            
            // Prevent flicker with double buffering and all painting inside WM_PAINT
			SetStyle(ControlStyles.DoubleBuffer | 
					 ControlStyles.AllPaintingInWmPaint |
					 ControlStyles.UserPaint, true);

            // Our size is always fixed at the required length in both directions
            // as one of the sizes will be provided for us because of our docking
            this.Size = fixedSize;

            if (closeHandler != null)
                this.Close += closeHandler;	

            if (restoreHandler != null)
                this.Restore += restoreHandler;	

            if (invertAutoHideHandler != null)
                this.InvertAutoHide += invertAutoHideHandler;
    
            if (contextHandler != null)
                this.Context += contextHandler;	

            // Let derived classes override the button creation
            CreateButtons();

            // Need to hook into message pump so that the ESCAPE key can be 
            // intercepted when in redocking mode
            Application.AddMessageFilter(this);
        }
Exemplo n.º 8
0
        public WindowContent(DockingManager manager, VisualStyle vs)
            : base(manager)
        {
            // Remember state
            _style = vs;

            // Create collection of window details
            _contents = new ContentCollection();

            // We want notification when contents are added/removed/cleared
            _contents.Clearing += new CollectionClear(OnContentsClearing);
            _contents.Inserted += new CollectionChange(OnContentInserted);
            _contents.Removing += new CollectionChange(OnContentRemoving);
            _contents.Removed += new CollectionChange(OnContentRemoved);
        }
        public GameClientForm( )
        {
            InitializeComponent( );

            //	Write greeting
            AppLog.Info( "Beginning {0} at {1}", Assembly.GetCallingAssembly( ), DateTime.Now );
            AppLog.GetSource( Severity.Info ).WriteEnvironment( );

            //	Create the docking manager
            m_DockingManager = new DockingManager( this, VisualStyle.IDE );
            m_DockingManager.InnerControl = gameDisplay;
            m_DockingManager.OuterControl = this;

            ProfileViewer profileViewer1 = new ProfileViewer( );
            profileViewer1.RootSection = GameProfiles.Game;
            m_ProfileViewer1Content = m_DockingManager.Contents.Add( profileViewer1, "Profile Viewer 1" );
            m_DockingManager.AddContentWithState( m_ProfileViewer1Content, State.Floating );
            m_DockingManager.HideContent( m_ProfileViewer1Content );

            ProfileViewer profileViewer2 = new ProfileViewer( );
            profileViewer2.RootSection = GameProfiles.Game;
            m_ProfileViewer2Content = m_DockingManager.Contents.Add( profileViewer2, "Profile Viewer 2" );
            m_DockingManager.AddContentWithState( m_ProfileViewer2Content, State.Floating );
            m_DockingManager.HideContent( m_ProfileViewer2Content );

            PropertyGrid debugInfoProperties = CreateDebugInfoPropertyGrid( );
            m_DebugInfoContent = m_DockingManager.Contents.Add(debugInfoProperties, "Debug Info");
            m_DockingManager.AddContentWithState( m_DebugInfoContent, State.Floating );
            m_DockingManager.HideContent( m_DebugInfoContent );

            m_LogDisplayContent = m_DockingManager.Contents.Add( m_LogDisplay, "Log" );
            m_DockingManager.AddContentWithState( m_LogDisplayContent, State.DockBottom );

            if ( File.Exists( m_ClientSetupFile ) )
            {
                m_DockingManager.LoadConfigFromFile( m_ClientSetupFile );
            }
        }
Exemplo n.º 10
0
        public MainForm()
        {
            InitializeComponent();

            ////////////////////////////////////////////////////////////////////////////////////////////
            // Open File Data and Program Database
            ////////////////////////////////////////////////////////////////////////////////////////////
            dat_conn = DatabaseConnection.getInstance();

            /////////////////////////////////////////////////////////////////////////////////////////////
            // MainTree and Table Tabpage
            /////////////////////////////////////////////////////////////////////////////////////////////
            //docking
            _manager = new DockingManager(this, VisualStyle.IDE);
            // Create Content which contains a RichTextBox
            c = _manager.Contents.Add(new TreeForm(), "tree menu");
            _manager.AddContentWithState(c, State.DockLeft);

            ////////////////////////////////////////////////////////////////////////////////////////////
            // Main WorkSpace - Show main working window - display model graphics
            ////////////////////////////////////////////////////////////////////////////////////////////

            // ShowModelGraphicWindow();
        }
Exemplo n.º 11
0
        public MainForm( )
        {
            InitializeComponent( );

            psDisplay.OnBeginRender += psDisplay_OnBeginPaint;

            //	Create the docking manager
            m_DockingManager = new DockingManager( this, VisualStyle.IDE );
            m_DockingManager.InnerControl = psDisplay;
            m_DockingManager.OuterControl = this;

            IParticleSystem ps = new ParticleSystem( );
            m_ParticleSystems.Add( new ParticleSystemEmitter( ps ) );

            //	BuilderControl psBuilder = new BuilderControl( );
            ParticleSystemEditor psBuilder = new ParticleSystemEditor( );
            psBuilder.ParticleSystem = ps;
            Content psBuilderContent = m_DockingManager.Contents.Add( psBuilder, "Particle System Builder" );
            m_DockingManager.AddContentWithState( psBuilderContent, State.DockLeft );

            RenderControl renderControl = new RenderControl( m_Method );
            Content renderControlContent = m_DockingManager.Contents.Add( renderControl, "Rendering" );
            m_DockingManager.AddContentWithState( renderControlContent, State.Floating );
        }
        public AutoHidePanel(DockingManager manager, DockStyle dockEdge)
        {
            // Define initial state
            _number = _num++;
            _defaultColor = true;
            _dismissRunning = false;
            _slideRunning = false;
            _ignoreDismiss = false;
            _killing = false;
            _manager = manager;
            _currentWCT = null;
            _currentPanel = null;
            _slideRect = new Rectangle();
            _rememberRect = new Rectangle();

            // Get the minimum vector length used for sizing
            int vector = TabStub.TabStubVector(this.Font);

            // Use for both directions, the appropriate one will be ignored because of docking style
            this.Size = new Size(vector, vector);

            // Dock ourself against requested position
            this.Dock = dockEdge;

            // We should be hidden until some Contents are added
            this.Hide();

            // We want to perform special action when container is resized
            _manager.Container.Resize += new EventHandler(OnContainerResized);

            // Add ourself to the application filtering list
            Application.AddMessageFilter(this);

            // Configuration timer objects
            CreateTimers();
        }
Exemplo n.º 13
0
 public Content(DockingManager manager, Control control)
 {
     InternalConstruct(manager, control, "", null, -1, null);
 }
Exemplo n.º 14
0
 public Content(DockingManager manager)
 {
     InternalConstruct(manager, null, "", null, -1, null);
 }
Exemplo n.º 15
0
        protected void InternalConstruct(DockingManager manager, State state)
        {
            // Must provide a valid manager instance
            if (manager == null)
                throw new ArgumentNullException("DockingManager");

            // Remember initial state
            _state = state;
            _manager = manager;
            _autoDispose = true;

            // Get correct starting state from manager
            this.BackColor = _manager.BackColor;
            this.ForeColor = _manager.InactiveTextColor;

            // Create collection of windows
            _windows = new WindowCollection();

            // We want notification when contents are added/removed/cleared
            _windows.Clearing += new CollectionClear(OnWindowsClearing);
            _windows.Inserted += new CollectionChange(OnWindowInserted);
            _windows.Removing += new CollectionChange(OnWindowRemoving);
            _windows.Removed += new CollectionChange(OnWindowRemoved);
        }
Exemplo n.º 16
0
 public Zone(DockingManager manager)
 {
     InternalConstruct(manager, State.DockLeft);
 }
Exemplo n.º 17
0
        protected virtual void InitializeDockingControls( )
        {
            //	Create the docking manager
            m_DockingManager = new DockingManager( this, VisualStyle.IDE );
            m_DockingManager.InnerControl = display;
            m_DockingManager.OuterControl = statusStrip;

            //	Add log, property editor, and edit mode controls to the docking manager
            m_LogDisplayContent = m_DockingManager.Contents.Add( m_LogDisplay, "Log" );
            m_PropertyEditorContent = m_DockingManager.Contents.Add( new ObjectPropertyEditor( ), "Property Editor" );
            m_SelectionContent = m_DockingManager.Contents.Add( new SelectionControl( ), "Selection" );

            m_DockingManager.AddContentWithState( m_LogDisplayContent, State.DockBottom );
            m_DockingManager.AddContentWithState( m_SelectionContent, State.DockRight );
            m_DockingManager.AddContentWithState( m_PropertyEditorContent, State.DockLeft );

            m_EditModesContent = m_DockingManager.Contents.Add( new EditModesControl( ), Resources.EditModes );
            m_DockingManager.AddContentToZone( m_EditModesContent, m_SelectionContent.ParentWindowContent.ParentZone, 0 );
        }
Exemplo n.º 18
0
 public Zone(DockingManager manager, State state)
 {
     InternalConstruct(manager, state);
 }
Exemplo n.º 19
0
		private void Load_Form(object sender, System.EventArgs e)
		{
			#region Magic Controls workarounds

			// Setting this using designer causes a Code Generation Error
			MainTabs.Appearance = Crownwood.Magic.Controls.TabControl.VisualAppearance.MultiDocument;
			// Setting this using designer appears to have no affect
			MainTabs.IDEPixelBorder = true;

			// Order is important for docking to work.  This isn't really a Magic Controls
			// issue, but related to how Winforms processes docking events.
			// Since InitializeComponent is GENERATED code, the form control collection gets cleared
			// and then the controls are added in the correct order;
			this.Controls.Clear();

			this.Controls.Add(MainTabs);
			this.Controls.Add(MainStatus);
			this.Controls.Add(MainMenu);
			
			#endregion

			#region Magic Controls Initialisation

			DockingManager = new DockingManager(this, VisualStyle.IDE);
			
			DockingManager.InnerControl = MainTabs;
			DockingManager.OuterControl = MainStatus;

			#endregion

			#region Our Initialisation
			CurrentChannelManager = new Channels.ChannelManager(DockingManager);
			
			#region RenderContainer

			RenderTarget.Left = GameTab.Left;
			RenderTarget.Top = GameTab.Top;
			RenderTarget.Height = GameTab.Height;
			RenderTarget.Width = GameTab.Width;

			#endregion

			#region Add our windows


			// Connection
//			Content connectionWindow = DockingManager.Contents.Add(new ChildWindows.Connection(), "Connection", Icons.IconManager.GlobalImageList, (int)Icons.AvailableIcons.Connection);
//			connectionWindow.DisplaySize = new Size(200, GameTab.Height);
//			connectionWindow.CaptionBar = true;
//			connectionWindow.CloseButton = false;
//			DockingManager.AddContentWithState(connectionWindow, State.DockLeft);
			// Log
			Content logWindow = DockingManager.Contents.Add(new ChildWindows.Log(), "Log", Icons.IconManager.GlobalImageList, (int)Icons.AvailableIcons.Log);
			DockingManager.AddContentWithState(logWindow, State.DockBottom);
			// Who
			Content whoWindow = DockingManager.Contents.Add(new ChildWindows.WhoList(), "Who's online", Icons.IconManager.GlobalImageList,-1);
			DockingManager.AddContentWithState(whoWindow, State.DockRight);
			// Command
			Content commandWindow = DockingManager.Contents.Add(new ChildWindows.Command(), "Command", Icons.IconManager.GlobalImageList, (int)Icons.AvailableIcons.Command);
			DockingManager.AddContentWithState(commandWindow, State.DockBottom);
			// Chat
			Content chatWindow = DockingManager.Contents.Add(new ChildWindows.Chat(), "Chat", Icons.IconManager.GlobalImageList, (int)Icons.AvailableIcons.Chat);
			DockingManager.AddContentWithState(chatWindow, State.DockBottom);
			// MiniMap
			miniMap = new ChildWindows.MiniMap();
			Content mapWindow = DockingManager.Contents.Add(miniMap, "Mini Map", Icons.IconManager.GlobalImageList,-1);
			DockingManager.AddContentWithState(mapWindow, State.DockBottom);

			
			
			this.Navigate("http://www.strive3d.net");


			#endregion

			loadSettings();

			#region Events
			RenderTarget.LostFocus += new EventHandler( RenderTarget_LostFocus );
			RenderTarget.Click += new EventHandler( RenderTarget_Click );
			#endregion


			#endregion		
		}
 public WindowDetailCaptionIDE(DockingManager manager, 
     EventHandler closeHandler,
     EventHandler restoreHandler,
     EventHandler invertAutoHideHandler,
     ContextHandler contextHandler)
     : base(manager, 
            new Size(_fixedLength, _fixedLength), 
            closeHandler, 
            restoreHandler, 
            invertAutoHideHandler,
            contextHandler)
 {
     // Use specificed font in the caption
     UpdateCaptionHeight(manager.CaptionFont);
 }
        public WindowDetailCaptionPlain(DockingManager manager, 
            EventHandler closeHandler,
            EventHandler restoreHandler,
            EventHandler invertAutoHideHandler,
            ContextHandler contextHandler)
            : base(manager, 
                   new Size(_fixedLength, _fixedLength), 
                   closeHandler, 
                   restoreHandler, 
                   invertAutoHideHandler, 
                   contextHandler)
        {
            // Default to thinking we are docked on a left edge
            _dockLeft = true;

            // Modify painting to prevent overwriting the button control
            _buttonOffset = 1 + (_buttonWidth + _insetButton) * 2;
        }
Exemplo n.º 22
0
 /// <summary>
 /// 初始化DockingManager
 /// </summary>
 protected void initDockingManager()
 {
     dockingManager = new Crownwood.Magic.Docking.DockingManager(this, VisualStyle.IDE);
 }
Exemplo n.º 23
0
        private void Load_Form(object sender, System.EventArgs e)
        {
            #region Magic Controls workarounds

            // Setting this using designer causes a Code Generation Error
            MainTabs.Appearance = Crownwood.Magic.Controls.TabControl.VisualAppearance.MultiDocument;
            // Setting this using designer appears to have no affect
            MainTabs.IDEPixelBorder = true;

            // Order is important for docking to work.  This isn't really a Magic Controls
            // issue, but related to how Winforms processes docking events.
            // Since InitializeComponent is GENERATED code, the form control collection gets cleared
            // and then the controls are added in the correct order;
            this.Controls.Clear();

            this.Controls.Add(MainTabs);
            this.Controls.Add(MainStatus);
            this.Controls.Add(MainMenu);

            #endregion

            #region Magic Controls Initialisation

            DockingManager = new DockingManager(this, VisualStyle.IDE);

            DockingManager.InnerControl = MainTabs;
            DockingManager.OuterControl = MainStatus;

            #endregion

            #region Our Initialisation
            CurrentChannelManager = new Channels.ChannelManager(DockingManager);

            #region RenderContainer

            RenderTarget.Left   = GameTab.Left;
            RenderTarget.Top    = GameTab.Top;
            RenderTarget.Height = GameTab.Height;
            RenderTarget.Width  = GameTab.Width;

            #endregion

            #region Add our windows


            // Connection
//			Content connectionWindow = DockingManager.Contents.Add(new ChildWindows.Connection(), "Connection", Icons.IconManager.GlobalImageList, (int)Icons.AvailableIcons.Connection);
//			connectionWindow.DisplaySize = new Size(200, GameTab.Height);
//			connectionWindow.CaptionBar = true;
//			connectionWindow.CloseButton = false;
//			DockingManager.AddContentWithState(connectionWindow, State.DockLeft);
            // Log
            Content logWindow = DockingManager.Contents.Add(new ChildWindows.Log(), "Log", Icons.IconManager.GlobalImageList, (int)Icons.AvailableIcons.Log);
            DockingManager.AddContentWithState(logWindow, State.DockBottom);
            // Who
            Content whoWindow = DockingManager.Contents.Add(new ChildWindows.WhoList(), "Who's online", Icons.IconManager.GlobalImageList, -1);
            DockingManager.AddContentWithState(whoWindow, State.DockRight);
            // Command
            Content commandWindow = DockingManager.Contents.Add(new ChildWindows.Command(), "Command", Icons.IconManager.GlobalImageList, (int)Icons.AvailableIcons.Command);
            DockingManager.AddContentWithState(commandWindow, State.DockBottom);
            // Chat
            Content chatWindow = DockingManager.Contents.Add(new ChildWindows.Chat(), "Chat", Icons.IconManager.GlobalImageList, (int)Icons.AvailableIcons.Chat);
            DockingManager.AddContentWithState(chatWindow, State.DockBottom);
            // MiniMap
            miniMap = new ChildWindows.MiniMap();
            Content mapWindow = DockingManager.Contents.Add(miniMap, "Mini Map", Icons.IconManager.GlobalImageList, -1);
            DockingManager.AddContentWithState(mapWindow, State.DockBottom);



            this.Navigate("http://www.strive3d.net");


            #endregion

            loadSettings();

            #region Events
            RenderTarget.LostFocus += new EventHandler(RenderTarget_LostFocus);
            RenderTarget.Click     += new EventHandler(RenderTarget_Click);
            #endregion


            #endregion
        }
Exemplo n.º 24
0
        public WindowContentTabbed(DockingManager manager, VisualStyle vs)
            : base(manager, vs)
        {
            _redocker = null;
            _activeContent = null;
            
            // Create the TabControl used for viewing the Content windows
            _tabControl = new Magic.Controls.TabControl();

            // It should always occupy the remaining space after all details
            _tabControl.Dock = DockStyle.Fill;

            // Show tabs only if two or more tab pages exist
            _tabControl.HideTabsMode = Magic.Controls.TabControl.HideTabsModes.HideUsingLogic;
            
            // Hook into the TabControl notifications
            _tabControl.GotFocus += new EventHandler(OnTabControlGotFocus);
            _tabControl.LostFocus += new EventHandler(OnTabControlLostFocus);
            _tabControl.PageGotFocus += new EventHandler(OnTabControlGotFocus);
            _tabControl.PageLostFocus += new EventHandler(OnTabControlLostFocus);
            _tabControl.SelectionChanged += new EventHandler(OnSelectionChanged);
            _tabControl.PageDragStart += new MouseEventHandler(OnPageDragStart);
            _tabControl.PageDragMove += new MouseEventHandler(OnPageDragMove);
            _tabControl.PageDragEnd += new MouseEventHandler(OnPageDragEnd);
            _tabControl.PageDragQuit += new MouseEventHandler(OnPageDragQuit);
            _tabControl.DoubleClickTab += new Magic.Controls.TabControl.DoubleClickTabHandler(OnDoubleClickTab);
			_tabControl.Font = manager.TabControlFont;
            _tabControl.BackColor = manager.BackColor;
            _tabControl.ForeColor = manager.InactiveTextColor;

            // Define the visual style required
            _tabControl.Style = vs;

			// Allow developers a chance to override default settings
			manager.OnTabControlCreated(_tabControl);

            switch(vs)
            {
                case VisualStyle.IDE:
                    Controls.Add(_tabControl);
                    break;
                case VisualStyle.Plain:
                    // Only the border at the pages edge and not around the whole control
                    _tabControl.InsetBorderPagesOnly = !_manager.PlainTabBorder;

                    // We want a border around the TabControl so it is indented and looks consistent
                    // with the Plain look and feel, so use the helper Control 'BorderForControl'
                    BorderForControl bfc = new BorderForControl(_tabControl, _plainBorder);

                    // It should always occupy the remaining space after all details
                    bfc.Dock = DockStyle.Fill;

                    // Define the default border border
                    bfc.BackColor = _manager.BackColor;

                    // When in 'VisualStyle.Plain' we need to 
                    Controls.Add(bfc);
                    break;
            }

            // Need to hook into message pump so that the ESCAPE key can be 
            // intercepted when in redocking mode
            Application.AddMessageFilter(this);
        }
Exemplo n.º 25
0
 public Content(DockingManager manager, Control control, string title, ImageList imageList, int imageIndex)
 {
     InternalConstruct(manager, control, title, imageList, imageIndex, null);
 }
            public AutoHostPanel(DockingManager manager, AutoHidePanel autoHidePanel, Edge borderEdge)
            {
                // Remember parameters
                _manager = manager;
                _autoHidePanel = autoHidePanel;
                _borderEdge = borderEdge;

                Direction direction;

                if ((borderEdge == Edge.Left) || (borderEdge == Edge.Right))
                    direction = Direction.Horizontal;
                else
                    direction = Direction.Vertical;

                // Create a resizing bar
                _resizeAutoBar = new ResizeAutoBar(direction, this);

                // Add to the display
                Controls.Add(_resizeAutoBar);

                // Define correct position based on Edge
                switch(_borderEdge)
                {
                    case Edge.Left:
                        _resizeAutoBar.Dock = DockStyle.Left;
                        break;
                    case Edge.Right:
                        _resizeAutoBar.Dock = DockStyle.Right;
                        break;
                    case Edge.Top:
                        _resizeAutoBar.Dock = DockStyle.Top;
                        break;
                    case Edge.Bottom:
                        _resizeAutoBar.Dock = DockStyle.Bottom;
                        break;
                }
            }
Exemplo n.º 27
0
 public Content(DockingManager manager, Control control, string title, Icon icon)
 {
     InternalConstruct(manager, control, title, null, -1, icon);
 }
Exemplo n.º 28
0
 public ZoneSequence(DockingManager manager)
     : base(manager)
 {
     InternalConstruct(VisualStyle.IDE, Direction.Vertical, true);
 }
Exemplo n.º 29
0
        protected void InternalConstruct(DockingManager manager, 
            Control control,
            string title,
            ImageList imageList,
            int imageIndex,
            Icon icon)
        {
            // Must provide a valid manager instance
            if (manager == null)
                throw new ArgumentNullException("DockingManager");

            // Define the initial object state
            _control = control;
            _title = title;
            _imageList = imageList;
            _imageIndex = imageIndex;
            _icon = icon;
            _manager = manager;
            _parentWindowContent = null;
            _order = _counter++;
            _visible = false;
            _displaySize = new Size(_defaultDisplaySize, _defaultDisplaySize);
            _autoHideSize = new Size(_defaultAutoHideSize, _defaultAutoHideSize);
            _floatingSize = new Size(_defaultFloatingSize, _defaultFloatingSize);
            _displayLocation = new Point(_defaultLocation, _defaultLocation);
            _defaultRestore = new RestoreContentState(State.DockLeft, this);
            _floatingRestore = new RestoreContentState(State.Floating, this);
            _autoHideRestore = new RestoreAutoHideState(State.DockLeft, this);
            _dockingRestore = _defaultRestore;
            _autoHidePanel = null;
            _tag = null;
            _docked = true;
            _captionBar = true;
            _closeButton = true;
            _hideButton = true;
            _autoHidden = false;
            _closeOnHide = false;
            _fullTitle = title;
        }
Exemplo n.º 30
0
 public ZoneSequence(DockingManager manager, State state, VisualStyle style, Direction direction, bool zoneMinMax)
     : base(manager, state)
 {
     InternalConstruct(style, direction, zoneMinMax);
 }
Exemplo n.º 31
0
        private void AddDocking()
        {
            _dockingManager = new DockingManager(this, VisualStyle.IDE);
            _dockingManager.InnerControl = pnlBody;
            _dockingManager.OuterControl = tBarMain;
            Content ouBar = new Content(_dockingManager);

            _dockingManager.Contents.Add(ouBar);
            ouBar.Title = "Navigation";
            ouBar.FullTitle = "Navigation";
            ouBar.CaptionBar = true;
            ouBar.CloseButton = false;
            ouBar.DisplaySize = new Size(100, 410);
            ouBar.Control = pnlNavBar;
            ouBar.ImageList = imlMain;
            ouBar.ImageIndex = 3;

            _dockingManager.ShowContent(_dockingManager.Contents["Navigation"]);
            _dockingManager.AddContentWithState(ouBar, State.DockLeft);
        }
Exemplo n.º 32
0
		public void Attach(IWorkbench currentWorkbench)
		{
			workbench = (DefaultWorkbench)currentWorkbench;
			workbench.Controls.Clear();
			
			tabControl.Style = (Crownwood.Magic.Common.VisualStyle)propertyService.GetProperty("NetFocus.DataStructure.Gui.VisualStyle", Crownwood.Magic.Common.VisualStyle.IDE);
			tabControl.Dock = DockStyle.Fill;
			tabControl.ShrinkPagesToFit = true;
			tabControl.ShowArrows = false;
			tabControl.Appearance = Crownwood.Magic.Controls.TabControl.VisualAppearance.MultiBox;
			workbench.Controls.Add(tabControl);
			tabControl.Visible = false;
			
			dockManager = new DockingManager(workbench, VisualStyle.IDE);

			IStatusBarService statusBarService = (IStatusBarService)ServiceManager.Services.GetService(typeof(IStatusBarService));
			workbench.Controls.Add(statusBarService.Control);

			workbench.Menu = null;

			workbench.AddMenuAndToolbarControls();

			dockManager.InnerControl = tabControl;
			dockManager.OuterControl = statusBarService.Control;
			
			foreach (IViewContent content in workbench.ViewContentCollection) 
			{
				ShowView(content);
			}

			contentVisibleHandler = new DockingManager.ContentHandler(RefreshMainMenu);
			dockManager.ContentHidden += contentVisibleHandler;
			dockManager.ContentShown  += contentVisibleHandler; 

		}