/// <summary> /// Adds the 'Show Moves' button to the specified ShortcutBar /// </summary> /// <param name="shortcutBar">The ShortcutBar to add the button to</param> public static void AddShowMovesButtonToBar(Widgets.ShortcutBar shortcutBar) { Widgets.ShortcutButton button = new Widgets.ShortcutButton("showMovesButton"); button.BackColor = Color.Transparent; button.Image = Skins.SkinManager.LoadGuiElement("Game Window/ShortcutBar", "showmoves.png"); button.HighlightImage = Skins.SkinManager.LoadGuiElement("Game Window/ShortcutBar", "showmoves-h.png"); button.Click += new EventHandler<SdlDotNet.Widgets.MouseButtonEventArgs>(showMovesButton_Click); shortcutBar.AddButton(button); }
/// <summary> /// Adds the 'Show Moves' button to the specified ShortcutBar /// </summary> /// <param name="shortcutBar">The ShortcutBar to add the button to</param> public static void AddShowMovesButtonToBar(Widgets.ShortcutBar shortcutBar) { Widgets.ShortcutButton button = new Widgets.ShortcutButton("showMovesButton"); button.BackColor = Color.Transparent; button.Image = Skins.SkinManager.LoadGuiElement("Game Window/ShortcutBar", "showmoves.png"); button.HighlightImage = Skins.SkinManager.LoadGuiElement("Game Window/ShortcutBar", "showmoves-h.png"); button.Click += new EventHandler <SdlDotNet.Widgets.MouseButtonEventArgs>(showMovesButton_Click); shortcutBar.AddButton(button); }
public void AddButton(ShortcutButton button) { int totalWidth = 5; // Padding for (int i = 0; i < buttons.Count; i++) { totalWidth += buttons[i].Width + 5; } button.Location = new Point(this.Width - totalWidth - button.Width, 5); buttons.Add(button); this.AddWidget(button); }
public void AddButton(ShortcutButton button) { int totalWidth = 5; // Padding for (int i = 0; i < buttons.Count; i++) { totalWidth += buttons[i].Width + 5; } button.Location = new Point(this.Width - totalWidth - button.Width, 5); buttons.Add(button); this.AddWidget(button); }