Beispiel #1
0
		private void InitializeComponent(IContainer cont)
		{
			m_TopDockSite=null;
			m_BottomDockSite=null;
			m_LeftDockSite=null;
			m_RightDockSite=null;
			//m_MsgHandler=null;
			m_Bars=new Bars(this);
			m_WereVisible=new ArrayList();
			m_Items=new Items(this);
			m_ShortcutTable=new Hashtable();
			m_FilterInstalled=false;
			m_frmCustomize=null;
			m_DisabledControls=null;
			m_FocusItem=null;
			m_ExpandedItem=null;
			m_RegisteredPopups=new ArrayList();
			m_MdiHandler=null;
			m_ActiveMdiChild=null;
			m_IgnoreSysKeyUp=false;
			m_ImageList=null;
			m_ParentForm=null;
			m_ContextMenus=new ContextMenusCollection(this);

			if(cont!=null)
				cont.Add(this);

			if(!ColorFunctions.ColorsLoaded)
			{
				NativeFunctions.RefreshSettings();
				NativeFunctions.OnDisplayChange();
				ColorFunctions.LoadColors();
			}

			m_AutoDispatchShortcuts=new ShortcutsCollection(null);
			m_ColorScheme=new ColorScheme(m_Style);
		}
Beispiel #2
0
		private void ParentHandleCreated(object sender, EventArgs e)
		{
            if (!this.DesignMode)
            {
                if (m_ParentForm.IsMdiChild && m_ParentForm.MdiParent != null)
                    RegisterParentMsgHandler(this, m_ParentForm.MdiParent);
                else
                    RegisterParentMsgHandler(this, m_ParentForm);

                if (m_MdiHandler != null)
                {
                    m_MdiHandler.MdiSetMenu -= this.OnMdiSetMenu;
                    m_MdiHandler.ReleaseHandle();
                    m_MdiHandler = null;
                    System.Windows.Forms.MdiClient client = ((IOwner)this).GetMdiClient(m_ParentForm);
                    if (client != null)
                    {
                        SetupMdiHandler(client);
                    }
                }
            }

			//if(!this.DesignMode)
				BarStreamLoad(true);
		}
Beispiel #3
0
		private void SetupClientMsgHandler(System.Windows.Forms.MdiClient client)
		{
			if(client==null)
				return;
			if(m_MdiHandler!=null)
			{
                m_MdiHandler.MdiSetMenu -= this.OnMdiSetMenu;
				m_MdiHandler.ReleaseHandle();
				m_MdiHandler=null;
			}
			m_MdiHandler=new MDIClientMsgHandler();
            m_MdiHandler.MdiSetMenu += new EventHandler(this.OnMdiSetMenu);
			m_MdiHandler.AssignHandle(client.Handle);
			if(m_MdiClientHandleCreatedHandled)
			{
				client.HandleCreated-=new EventHandler(this.MdiClientHandleCreates);
				m_MdiClientHandleCreatedHandled=false;
			}
		}
Beispiel #4
0
		private void OnParentChanged()
		{
			// We always create docking sites on top level controls
			if(m_ParentForm==null)
				return;

            if(!this.DesignMode)
			    UnRegisterParentMsgHandler(this,m_ParentForm);

			if(m_ParentForm.IsHandleCreated && !this.DesignMode)
			{
				if(m_ParentForm.IsMdiChild && m_ParentForm.MdiParent!=null)
				{
					RegisterParentMsgHandler(this,m_ParentForm.MdiParent);
				}
				else
				{
                    RegisterParentMsgHandler(this,m_ParentForm);					
				}
			}

			m_ParentForm.HandleDestroyed+=new System.EventHandler(this.ParentHandleDestroyed);
			m_ParentForm.HandleCreated+=new System.EventHandler(this.ParentHandleCreated);
			if(!this.DesignMode)
			{
				m_ParentForm.Activated+=new System.EventHandler(this.ParentActivated);
				m_ParentForm.Deactivate+=new System.EventHandler(this.ParentDeactivate);
				m_ParentForm.Load+=new System.EventHandler(this.ParentLoad);
				m_ParentForm.VisibleChanged+=new System.EventHandler(this.ParentVisibleChanged);
				m_ParentForm.Resize+=new System.EventHandler(this.ParentResize);
			}

			if(!this.DesignMode)
			{
				if(!m_FilterInstalled && !m_UseHook)
				{
					MessageHandler.RegisterMessageClient(this);
					m_FilterInstalled=true;
				}
				else if(m_UseHook && m_Hook==null)
				{
					m_Hook=new Hook(this);
				}
			}

			// MDI Parent Handling
			if(m_MdiHandler!=null)
			{
                m_MdiHandler.MdiSetMenu -= this.OnMdiSetMenu;
				m_MdiHandler.ReleaseHandle();
				m_MdiHandler=null;
			}

			// MDI Handling...
			System.Windows.Forms.MdiClient client=((IOwner)this).GetMdiClient(m_ParentForm);
			if(client!=null)
			{
				SetupMdiHandler(client);
			}
			else
			{
				// Watch for its creation to catch it early
				m_ParentForm.ControlAdded+=new ControlEventHandler(ParentControlAdded);
				m_EventControlAdded=true;
			}

			// Try to load bar stream if possible
			//if(!this.DesignMode)
				BarStreamLoad();
		}