示例#1
0
 public void RemoveElement(IIntegrableMenu pElement)
 {
     base.RemoveElement((Element)pElement);
     // Non non, cette ligne n'est pas inutile !
     // Quand on supprime un élément, si la CurrentSelection pointait vers le dernier élément, la CurrentSelection doit être recalculée.
     // Voir dans le setter de CurrentSelection.
     CurrentSelection = CurrentSelection;
 }
示例#2
0
 public void RefreshColors()
 {
     for (int i = 0; i < Elements.Count; i++)
     {
         IIntegrableMenu integrable = (IIntegrableMenu)Elements[i];
         integrable.ApplyColor(UnselectedTextColor, UnselectedTextColorBck);
         integrable.Color_Selected    = SelectedTextColor;
         integrable.ColorBck_Selected = SelectedTextColorBck;
     }
 }
示例#3
0
 private void RefreshSelection()
 {
     if (Elements.Count > 0)
     {
         for (int i = 0; i < Elements.Count; i++)
         {
             IIntegrableMenu e = (IIntegrableMenu)Elements[i];
             e.Selected = (i == CurrentSelection);
         }
     }
 }
示例#4
0
 public void AddElement(IIntegrableMenu pElement)
 {
     base.AddElement((Element)pElement);
     RefreshColors();
 }