Exemple #1
0
        /** Creates a panel with textboxes to adjust effect specific parameters */
        private void cboxEffects_onEffectSelected(object sender, EventArgs e)
        {
            Guid effG = availableFFBEffects.ElementAt(cboxEffects.SelectedIndex).Guid;

            if (effG == EffectGuid.ConstantForce)
            {
                gbEffectSpec.Controls.Clear();
                efPanel = new ConstantForcePanel();
                gbEffectSpec.Controls.Add(efPanel);
            }
            else if (effG == EffectGuid.RampForce)
            {
                gbEffectSpec.Controls.Clear();
                efPanel = new RampForcePanel();
                gbEffectSpec.Controls.Add(efPanel);
            }
            else if (effG == EffectGuid.Sine || effG == EffectGuid.Triangle || effG == EffectGuid.Square ||
                     effG == EffectGuid.SawtoothUp || effG == EffectGuid.SawtoothDown)
            {
                gbEffectSpec.Controls.Clear();
                efPanel = new PeriodicForcePanel();
                gbEffectSpec.Controls.Add(efPanel);
            }
            else if (effG == EffectGuid.Friction || effG == EffectGuid.Inertia || effG == EffectGuid.Damper ||
                     effG == EffectGuid.Spring)
            {
                gbEffectSpec.Controls.Clear();
                efPanel = new ConditionForcePanel();
                gbEffectSpec.Controls.Add(efPanel);
            }
            else if (effG == EffectGuid.CustomForce)
            {
                gbEffectSpec.Controls.Clear();
                efPanel = null;
                return;
            }
            //Make sure all controls are visible
            efPanel.Size    = gbEffectSpec.Size;
            efPanel.Width  -= 10;
            efPanel.Height -= 20;
            efPanel.Top    += 15;
            efPanel.Left   += 5;
        }
Exemple #2
0
        /** Creates a panel with textboxes to adjust effect specific parameters */
        private void cboxEffects_onEffectSelected(object sender, EventArgs e)
        {
            Guid effG = availableFFBEffects.ElementAt(cboxEffects.SelectedIndex).Guid;

            if (effG == EffectGuid.ConstantForce)
            {
                gbEffectSpec.Controls.Clear();
                efPanel = new ConstantForcePanel();
                gbEffectSpec.Controls.Add(efPanel);
            }
            else if (effG == EffectGuid.RampForce)
            {
                gbEffectSpec.Controls.Clear();
                efPanel = new RampForcePanel();
                gbEffectSpec.Controls.Add(efPanel);
            }
            else if (effG == EffectGuid.Sine || effG == EffectGuid.Triangle || effG == EffectGuid.Square ||
                     effG == EffectGuid.SawtoothUp || effG == EffectGuid.SawtoothDown)
            {
                gbEffectSpec.Controls.Clear();
                efPanel = new PeriodicForcePanel();
                gbEffectSpec.Controls.Add(efPanel);
            }
            else if (effG == EffectGuid.Friction || effG == EffectGuid.Inertia || effG == EffectGuid.Damper ||
                     effG == EffectGuid.Spring)
            {
                gbEffectSpec.Controls.Clear();
                efPanel = new ConditionForcePanel();
                gbEffectSpec.Controls.Add(efPanel);
            }
            else if (effG == EffectGuid.CustomForce)
            {
                gbEffectSpec.Controls.Clear();
                efPanel = null;
                return;
            }
            //Make sure all controls are visible
            efPanel.Size = gbEffectSpec.Size;
            efPanel.Width -= 10;
            efPanel.Height -= 20;
            efPanel.Top += 15;
            efPanel.Left += 5;
        }