Пример #1
0
 private void SetSelectionGUI(bool isChecked)
 {
     // sets the GUI into the selected (or not) state.  Does not update
     if (this.DesignMode)
     {
         return;
     }
     if (isChecked == m_Checked)
     {
         return;
     }
     m_Checked = isChecked;
     if (!Animate || Utilities.Low_Graphics_Safe())
     {
         m_SelectionDisplayPercentage = m_Checked ? 100 : 0;
     }
     else
     {
         AnimationController.EnsureNoAnimation(this);
         if (isChecked)
         {
             AnimationLinear.CreateStart(this, 100, SELECTANIMATIONSTEP, 0);
         }
         else
         {
             AnimationLinear.CreateStart(this, 0, -SELECTANIMATIONSTEP, 0);
         }
     }
 }
Пример #2
0
 protected virtual void SetSelectionGUI(bool selected)
 {
     // sets the GUI into the selected (or not) state.  Does not update
     if (selected == m_Selected)
     {
         return;
     }
     AnimationController.EnsureNoAnimation(this);
     m_Selected = selected;
     if (Utilities.Low_Graphics_Safe() || !Visible)
     {
         m_SelectionDisplayFraction = m_Selected ? 255 : 0;
         Invalidate();
     }
     else
     {
         if (selected)
         {
             AnimationLinear.CreateStart(this, 255, SELECTANIMATIONSTEP);
         }
         else
         {
             AnimationLinear.CreateStart(this, 0, -SELECTANIMATIONSTEP);
         }
     }
 }
Пример #3
0
 public void Trigger()
 {
     // Called when we are switching to this control due to something other than a mouse click
     AnimationController.EnsureNoAnimation(this);
     Open         = true;
     LastAccessed = DateTime.Now;
     // focus now done by caller
 }
Пример #4
0
 private void SetSelectionGUI(int index)
 {
     if (index >= 0)
     {
         m_Current = m_Colours[index];
     }
     AnimationController.EnsureNoAnimation(this);
     GenerateMoreBitmap();
     Invalidate(ColourRectangle(TRANSPARENTBUTTON));
 }
Пример #5
0
 private bool m_IgnoreClick = false;         // is set to true when right clicking
 private void Accordion_Click(object sender, EventArgs e)
 {
     if (this.DesignMode)
     {
         return;
     }
     if (m_IgnoreClick)
     {
         m_IgnoreClick = false;
         return;
     }
     AnimationController.EnsureNoAnimation(this);
     Open         = !m_Open;
     LastAccessed = DateTime.Now;
     // not sure why this was used: it makes number keypad, for example, problematic (NumberGrid loses focus)
     //If Not AM.CurrentConfig.Separate_Cursor Then Me.Controls(0).Focus()
 }
Пример #6
0
 private void ChangePrompts(List <Shape.Prompt> value)        //Handles Globals.CurrentPromptsChanged
 {
     if (this.DesignMode)
     {
         return;
     }
     if (value != null)
     {
         int index = 0;
         while (index < value.Count)
         {
             if (value[index] == null)
             {
                 value.RemoveAt(index);
             }
             else
             {
                 index += 1;
             }
         }
     }
     if (Shape.Prompt.ListsEqual(value, m_Prompts))
     {
         return;
     }
     m_Prompts = value;
     Invalidate();
     if (m_Prompts != null && m_Prompts.Count == 1 && m_Prompts[0].Verbs == Shape.ShapeVerbs.Warning)
     {
         // If there is a warning it is always a single prompt
         StartWarningAnimation();
     }
     else
     {
         AnimationController.EnsureNoAnimation(this);
         this.BackColor = Color.White;
     }
 }