Share the finished AutoHotkey v2 Scripts and libraries you made here. Please put the current version of AutoHotkey v2 you used in Square Brackets at the start of the topic title.
The goal with this class script is simplicity. You can still exercise lots of granular control manually, but I wanted to make this toolbar in a way that would reflect a legit toolbar supported in AutoHotkey where the user can apply minimal script code in order to create a toolbar and manage its events.
Extensive docs are on GitHub. The included example script is displayed in the animated preview above.
Fixed improper reference to g.hwnd, corrected to this._gui.hwnd
Separated out example script, and tested to ensure there are no other "anomalies".
2020/11/09
Added enhancements to Easy Mode.
Now MixedButtons, List, and Flat Styles/ExStyles are automatically applied to the toolbar. This allows a mixture of only-icon buttons, only-text buttons, and icon+text buttons (where text is to the right of the icon).
Added ability to disable MixedButtons mode when calling tb.New()
Added ability to disable Easy Mode when calling tb.New() (automatically disables MixedButtons mode).
Added automatic spacing added in front of button text, but ONLY when user specified icon:-1 during tb.Add(). This causes text-only button text to appear centered. Otherwise the text would be flush with left button edge. User can change this if needed with tb.txtSpacing := x, where x is number of spaces to insert to the left of button text. Default is 2 spaces.
2020/11/05
Added .checked property to dataObj parameter in callback function.
Added 2-state check buttons with icons for the example.
Now MixedButtons, List, and Flat Styles/ExStyles are automatically applied to the toolbar. This allows a mixture of only-icon buttons, only-text buttons, and icon+text buttons (where text is to the right of the icon).
Added ability to disable MixedButtons mode when calling tb.New()
Added ability to disable Easy Mode when calling tb.New() (automatically disables MixedButtons mode).
Added automatic spacing added in front of button text, but ONLY when user specified icon:-1 during tb.Add(). This causes text-only button text to appear centered. Otherwise the text would be flush with left button edge. User can change this if needed with tb.txtSpacing := x, where x is number of spaces to insert to the left of button text. Default is 2 spaces.