private void MozItem_LostFocus(object sender, MozItemEventArgs e) { // check if item is selected if (e.MozItem.state != MozItemState.Selected) { // if not set its state to normal e.MozItem.state = MozItemState.Normal; m_mouseOverItem = null; if (ItemLostFocus != null) ItemLostFocus(this,e); } }
protected virtual void OnMozItemRemoved(MozItemEventArgs e) { if (this.Controls.Contains(e.MozItem)) { this.Controls.Remove(e.MozItem); } // remove event listeners e.MozItem.ItemGotFocus -=new MozItemEventHandler(MozItem_GotFocus); e.MozItem.ItemLostFocus -= new MozItemEventHandler(MozItem_LostFocus); e.MozItem.ItemClick -=new MozItemClickEventHandler(MozItem_Click); e.MozItem.ItemDoubleClick -= new MozItemClickEventHandler(MozItem_DoubleClick); // update the layout of the controls this.DoLayout(); if (ItemRemoved != null) { ItemRemoved(this, e); } }
private void MozItem_GotFocus(object sender, MozItemEventArgs e) { //Check if item is selected if (e.MozItem.state != MozItemState.Selected) { // if not set its state to focus e.MozItem.state = MozItemState.Focus; m_mouseOverItem = e.MozItem; if (ItemGotFocus != null) ItemGotFocus(this,e); } }
protected virtual void OnMozItemAdded(MozItemEventArgs e) { if (!this.Controls.Contains(e.MozItem)) { this.Controls.Add(e.MozItem); } // tell the MozItem who's its daddy... e.MozItem.MozPane = this; // listen for events e.MozItem.ItemGotFocus +=new MozItemEventHandler(MozItem_GotFocus); e.MozItem.ItemLostFocus +=new MozItemEventHandler(MozItem_LostFocus); e.MozItem.ItemClick +=new MozItemClickEventHandler(MozItem_Click); e.MozItem.ItemDoubleClick += new MozItemClickEventHandler(MozItem_DoubleClick); // update the layout of the controls this.DoLayout(); if (ItemAdded != null) { ItemAdded(this, e); } }