Exemplo n.º 1
0
 void ChildSelector_OnSelectionModified(string arg, Entry entry)
 {
     CurrentValue = entry;
     OnSelectionModified.Invoke(arg);
     Parent.RemoveChild(this);
     IsDead = true;
     InputManager.MouseClickedCallback -= InputManager_MouseClickedCallback;
     GUI.FocusComponent = null;
 }
Exemplo n.º 2
0
 private void InputManager_MouseClickedCallback(InputManager.MouseButton button)
 {
     if (ClickTimer.HasTriggered && !IsDead)
     {
         OnSelectionModified.Invoke(CurrentValue);
         Parent.RemoveChild(this);
         Box.Selector = null;
         IsDead       = true;
         InputManager.MouseClickedCallback -= InputManager_MouseClickedCallback;
     }
 }
Exemplo n.º 3
0
 private void InputManager_MouseClickedCallback(InputManager.MouseButton button)
 {
     if (ClickTimer.HasTriggered && !IsDead)
     {
         if (CurrentValue != null && (CurrentValue.Children == null || CurrentValue.Children.Count == 0))
         {
             OnSelectionModified.Invoke(CurrentValue.GlobalName);
             Parent.RemoveChild(this);
             IsDead = true;
             InputManager.MouseClickedCallback -= InputManager_MouseClickedCallback;
         }
         else if (CurrentValue != null)
         {
             if (CurrentValue.ChildSelector == null || CurrentValue.ChildSelector.IsDead)
             {
                 MouseState mouse = Mouse.GetState();
                 CurrentValue.ChildSelector = new ComboBoxSelector(GUI, Box, CurrentValue.Children, mouse.X - Box.GlobalBounds.X, mouse.Y - Box.GlobalBounds.Y);
                 GUI.FocusComponent         = CurrentValue.ChildSelector;
                 Entry value = CurrentValue;
                 CurrentValue.ChildSelector.OnSelectionModified += (string arg) => ChildSelector_OnSelectionModified(arg, value);
             }
         }
     }
 }
Exemplo n.º 4
0
 public void InvokeSelectionModified()
 {
     OnSelectionModified.Invoke(CurrentValue);
 }
Exemplo n.º 5
0
 private void Selector_OnSelectionModified(string value)
 {
     CurrentIndex = Values.IndexOf(value);
     OnSelectionModified.Invoke(value);
     Selector = null;
 }
Exemplo n.º 6
0
 private void Selector_OnSelectionModified(string value)
 {
     CurrentIndex = Selector.GetCurrentIndex();
     OnSelectionModified.Invoke(value);
 }