コード例 #1
0
 /// <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);
 }
コード例 #2
0
 /// <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);
 }
コード例 #3
0
 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);
 }
コード例 #4
0
ファイル: ShortcutBar.cs プロジェクト: MystikalPooka/PJOFiles
        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);
        }