public MultiCommandEditor() { InitializeComponent(); Pandora.Localization.LocalizeControl( this ); m_Def = new MultiCommandDef(); }
public MultiCommandEditor() { InitializeComponent(); Pandora.Localization.LocalizeControl(this); m_Def = new MultiCommandDef(); }
/// <summary> /// CANCEL /// </summary> private void bCancel_Click(object sender, EventArgs e) { if (m_Backup != null) { m_Def = m_Backup; } else { m_Def = null; } DialogResult = DialogResult.Cancel; Close(); }
public object Clone() { var mcd = new MultiCommandDef(); mcd.m_DefaultIndex = m_DefaultIndex; foreach (var mc in m_Commands) { // Issue 10 - Update the code to Net Framework 3.5 - http://code.google.com/p/pandorasbox3/issues/detail?id=10 - Smjert mcd.m_Commands.Add(mc.Clone() as MenuCommand); // Issue 10 - End } return(mcd); }
/// <summary> /// Creates the def object /// </summary> private void DoDef() { m_Def = new MultiCommandDef(); foreach (TreeNode node in Tree.Nodes) { var mc = node.Tag as MenuCommand; m_Def.Commands.Add(mc); if (node.Checked) { m_Def.DefaultIndex = Tree.Nodes.IndexOf(node); } } }
/// <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; } } } }
/// <summary> /// CANCEL /// </summary> private void bCancel_Click(object sender, System.EventArgs e) { if ( m_Backup != null ) m_Def = m_Backup; else m_Def = null; DialogResult = DialogResult.Cancel; Close(); }
/// <summary> /// Creates the def object /// </summary> private void DoDef() { m_Def = new MultiCommandDef(); foreach ( TreeNode node in Tree.Nodes ) { MenuCommand mc = node.Tag as MenuCommand; m_Def.Commands.Add( mc ); if ( node.Checked ) m_Def.DefaultIndex = Tree.Nodes.IndexOf( node ); } }
public object Clone() { MultiCommandDef mcd = new MultiCommandDef(); mcd.m_DefaultIndex = m_DefaultIndex; foreach ( MenuCommand mc in this.m_Commands ) { // Issue 10 - Update the code to Net Framework 3.5 - http://code.google.com/p/pandorasbox3/issues/detail?id=10 - Smjert mcd.m_Commands.Add( mc.Clone() as MenuCommand ); // Issue 10 - End } return mcd; }