Exemple #1
0
        protected virtual void OnMozItemRemoved(MozItemEventArgs e)
        {
            if (Controls.Contains(e.MozItem))
            {
                Controls.Remove(e.MozItem);
            }

            // remove event listeners
            e.MozItem.ItemGotFocus -= MozItem_GotFocus;
            e.MozItem.ItemLostFocus -= MozItem_LostFocus;
            e.MozItem.ItemClick -= MozItem_Click;
            e.MozItem.ItemDoubleClick -= MozItem_DoubleClick;


            // update the layout of the controls
            DoLayout();

            if (ItemRemoved != null)
            {
                ItemRemoved(this, e);
            }
        }
Exemple #2
0
 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);
     }
 }
Exemple #3
0
        protected virtual void OnMozItemAdded(MozItemEventArgs e)
        {
            if (!Controls.Contains(e.MozItem))
            {
                Controls.Add(e.MozItem);
            }

            // tell the MozItem who's its daddy...
            e.MozItem.MozPane = this;

            // listen for events
            e.MozItem.ItemGotFocus += MozItem_GotFocus;
            e.MozItem.ItemLostFocus += MozItem_LostFocus;
            e.MozItem.ItemClick += MozItem_Click;
            e.MozItem.ItemDoubleClick += MozItem_DoubleClick;

            // update the layout of the controls

            DoLayout();

            if (ItemAdded != null)
            {
                ItemAdded(this, e);
            }
        }
Exemple #4
0
 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);
     }
 }