diff --git a/src/BetterControls/BetterToolbar/Items/BetterToolbarToggleButton.NativeStructures.cs b/src/BetterControls/BetterToolbar/Items/BetterToolbarToggleButton.NativeStructures.cs new file mode 100644 index 0000000..8d680d4 --- /dev/null +++ b/src/BetterControls/BetterToolbar/Items/BetterToolbarToggleButton.NativeStructures.cs @@ -0,0 +1,34 @@ +namespace BetterControls +{ + /// + /// Represents a toolbar item that is a toggle button. + /// + partial class BetterToolbarToggleButton + { + /// + /// + /// + /// + internal override NativeMethods.TBBUTTON ComputeTbButton() + { + NativeMethods.TBBUTTON button = base.ComputeTbButton(); + + button.fsStyle = NativeMethods.TBSTYLE_CHECK | 0x0010; + + return button; + } + + /// + /// + /// + /// + internal override NativeMethods.TBBUTTONINFO ComputeTbButtonInfo() + { + NativeMethods.TBBUTTONINFO button = base.ComputeTbButtonInfo(); + + button.fsStyle = NativeMethods.TBSTYLE_CHECK | 0x0010; + + return button; + } + } +} \ No newline at end of file diff --git a/src/BetterControls/BetterToolbar/Items/BetterToolbarToggleButton.cs b/src/BetterControls/BetterToolbar/Items/BetterToolbarToggleButton.cs new file mode 100644 index 0000000..4553428 --- /dev/null +++ b/src/BetterControls/BetterToolbar/Items/BetterToolbarToggleButton.cs @@ -0,0 +1,57 @@ +namespace BetterControls +{ + /// + /// Represents a toolbar item that is a toggle button. + /// + public partial class BetterToolbarToggleButton : BetterToolbarClickableButton + { + /// + /// Initialize a new instance of . + /// + public BetterToolbarToggleButton() { } + + /// + /// Initialize a new instance of . + /// + /// The text of the button. + public BetterToolbarToggleButton(string text) + : base(text) + { } + + /// + /// Initialize a new instance of . + /// + /// The text of the button. + /// The description of the button. + public BetterToolbarToggleButton(string text, string description) + : base(text, description) + { } + + /// + /// Initialize a new instance of . + /// + /// The text of the button. + /// The index of the image from the toolbar image list to be shown in the button. + public BetterToolbarToggleButton(string text, int imageIndex) + : base(text, imageIndex) + { } + + /// + /// Initialize a new instance of . + /// + /// The text of the button. + /// The description of the button. + /// The index of the image from the toolbar image list to be shown in the button. + public BetterToolbarToggleButton(string text, string description, int imageIndex) + : base(text, description, imageIndex) + { } + + /// + /// Initialize a new instance of . + /// + /// The owner toolbar as an instance of . + private protected BetterToolbarToggleButton(BetterToolbar ownerToolbar) + : base(ownerToolbar) + { } + } +} \ No newline at end of file