Example #1
0
        /// <summary>
        /// Single command
        /// </summary>
        private void mSingleCommand_Click(object sender, System.EventArgs e)
        {
            if (ConfirmErase())
            {
                SimpleCommand sc = new SimpleCommand();

                if (sc.ShowDialog() == DialogResult.OK)
                {
                    MenuCommand mc = new MenuCommand();
                    mc.Command   = sc.Command;
                    mc.UsePrefix = sc.UsePrefix;

                    if (m_EditLeft)
                    {
                        m_Def.Left    = mc;
                        linkLeft.Text = Pandora.Localization.TextProvider["Buttons.Single"];
                    }
                    else
                    {
                        m_Def.Right    = mc;
                        linkRight.Text = Pandora.Localization.TextProvider["Buttons.Single"];
                    }
                }
            }
        }
Example #2
0
        /// <summary>
        ///     New modifiers command
        /// </summary>
        private void mModifiersCommand_Click(object sender, EventArgs e)
        {
            if (ConfirmErase())
            {
                var sc = new SimpleCommand(true);

                if (sc.ShowDialog() == DialogResult.OK)
                {
                    var mc = new ModifierCommand();
                    mc.Command = sc.Command;

                    if (m_EditLeft)
                    {
                        m_Def.Left    = mc;
                        linkLeft.Text = Pandora.Localization.TextProvider["Buttons.Modifiers"];
                    }
                    else
                    {
                        m_Def.Right    = mc;
                        linkRight.Text = Pandora.Localization.TextProvider["Buttons.Modifiers"];
                    }
                }
            }
        }
Example #3
0
        /// <summary>
        /// Edits the existing item on a button slot
        /// </summary>
        private void EditDef()
        {
            IButtonFunction function = null;

            if (m_EditLeft)
            {
                function = m_Def.Left;
            }
            else
            {
                function = m_Def.Right;
            }

            if (function is MenuCommand)
            {
                MenuCommand mc = function as MenuCommand;

                // Single command
                SimpleCommand sc = new SimpleCommand();

                sc.Command   = mc.Command;
                sc.UsePrefix = mc.UsePrefix;

                if (sc.ShowDialog() == DialogResult.OK)
                {
                    mc.Command   = sc.Command;
                    mc.UsePrefix = sc.UsePrefix;
                }
            }
            else if (function is ModifierCommand)
            {
                ModifierCommand mc = function as ModifierCommand;

                SimpleCommand sc = new SimpleCommand(true);

                sc.Command = mc.Command;

                if (sc.ShowDialog() == DialogResult.OK)
                {
                    mc.Command = sc.Command;
                }
            }
            else if (function is MenuDef)
            {
                MenuDef md = function as MenuDef;

                // Menu
                BoxMenuEditor me = new BoxMenuEditor();
                me.MenuDefinition = md;

                if (me.ShowDialog() == DialogResult.OK)
                {
                    if (m_EditLeft)
                    {
                        m_Def.Left = me.MenuDefinition;
                    }
                    else
                    {
                        m_Def.Right = me.MenuDefinition;
                    }
                }
            }
            else if (function is MultiCommandDef)
            {
                MultiCommandDef mcd = function as MultiCommandDef;

                // Multi Command
                MultiCommandEditor mce = new MultiCommandEditor();
                mce.MultiDef = mcd;

                if (mce.ShowDialog() == DialogResult.OK)
                {
                    if (m_EditLeft)
                    {
                        m_Def.Left = mce.MultiDef;
                    }
                    else
                    {
                        m_Def.Right = mce.MultiDef;
                    }
                }
            }
        }
Example #4
0
		/// <summary>
		/// New modifiers command
		/// </summary>
		private void mModifiersCommand_Click(object sender, System.EventArgs e)
		{
			if ( ConfirmErase() )
			{
				SimpleCommand sc = new SimpleCommand( true );

				if ( sc.ShowDialog() == DialogResult.OK )
				{
					ModifierCommand mc = new ModifierCommand();
					mc.Command = sc.Command;

					if ( m_EditLeft )
					{
						m_Def.Left = mc;
						linkLeft.Text = Pandora.Localization.TextProvider[ "Buttons.Modifiers" ];
					}
					else
					{
						m_Def.Right = mc;
						linkRight.Text = Pandora.Localization.TextProvider[ "Buttons.Modifiers" ];
					}
				}
			}
		}
Example #5
0
		/// <summary>
		/// Edits the existing item on a button slot
		/// </summary>
		private void EditDef()
		{
			IButtonFunction function = null;

			if ( m_EditLeft )
				function = m_Def.Left;
			else
				function = m_Def.Right;

			if ( function is MenuCommand )
			{
				MenuCommand mc = function as MenuCommand;

				// Single command
				SimpleCommand sc = new SimpleCommand();

				sc.Command = mc.Command;
				sc.UsePrefix = mc.UsePrefix;

				if ( sc.ShowDialog() == DialogResult.OK )
				{
					mc.Command = sc.Command;
					mc.UsePrefix = sc.UsePrefix;
				}
			}
			else if ( function is ModifierCommand )
			{
				ModifierCommand mc = function as ModifierCommand;

				SimpleCommand sc = new SimpleCommand( true );

				sc.Command = mc.Command;

				if ( sc.ShowDialog() == DialogResult.OK )
				{
					mc.Command = sc.Command;
				}
			}
			else if ( function is MenuDef )
			{
				MenuDef md = function as MenuDef;

				// Menu
				BoxMenuEditor me = new BoxMenuEditor();
				me.MenuDefinition = md;

				if ( me.ShowDialog() == DialogResult.OK )
				{
					if ( m_EditLeft )
						m_Def.Left = me.MenuDefinition;
					else
						m_Def.Right = me.MenuDefinition;
				}
			}
			else if ( function is MultiCommandDef )
			{
				MultiCommandDef mcd = function as MultiCommandDef;

				// Multi Command
				MultiCommandEditor mce = new MultiCommandEditor();
				mce.MultiDef = mcd;

				if ( mce.ShowDialog() == DialogResult.OK )
				{
					if ( m_EditLeft )
						m_Def.Left = mce.MultiDef;
					else
						m_Def.Right = mce.MultiDef;
				}
			}
		}