WHAT IT IS?
---------------
sButton is a multipurpose control (initially created as a button, hence the name)
It can be used as:
-Button: with rounded border,shadow,caption,icon or font icon, and alpha for each element.
-Label: with multiline, alpha, rotation and autosize (width/height/both)
-Display a PNG: with rotation,effects,resize,alpha and stretch.
-To display Font Awesome icons (or any other font icon like webdings,etc.)
-To mimic a checkbox/option.
Can customize image/colors for normal,hover and disabled state.
Can animate changes in color for border,button,caption (configurable time).
New events: MouseEnter,MouseLeave,MouseHover (configurable time).
The control can be filled with 1 color, 2 colors in grandient with angle and alpha,
texture with position adjust and stretch or windows hatch patterns.
Can draw outside button area.
If using image icon, disabling the button auto grey image.
Support 2 ways of drawing text with effects: GDI Paths or GDI DrawStrings.
Can have preset or custom hover mousepointer.
It also include a FontManager class to use custom fonts without requiring
admin privilegies to install them.
It use MST for subclassing by wqweto
Dependecy: GDI+ installed (so that mean XP and up)
DOWNLOAD:
Attachment 174975
STABILITY/BUGS
------------------------
Tested on Windows 7 (32/64),8(64),10(64)
Stress checked for memory leaks loading and unloading forms with instances of sButton
thounsands of times. No memory leaks found and compiled program still run stable.
It 's not optimized but it was created for data driven apps and not games so
performance is perfectly aceptable.
This is my first take with GDI and pretty sure some things may be wrong.
BUG: Control dont autoextend for text rotation
FIX: Make the control bigger adding 'Button_padding'
VERSION HISTORY
--------------------------
v1.0
-Added basic Events: MouseEnter,MouseLeave,MouseMove,MouseHover(keep over x time)
-Tracking of Area is not interrupted by other controls over it.
-Rounded borders
-Caption draw using paths
-Caption text effects (predefined outlines and shadows)
-Support Font Awesome Icon (Icon size selected in font size)
-Support PNG icon for Normal/Hover/Disabled state
-Icon can be resized (option to keep Aspect Ratio)
(For Font icons use Icon_FA_Font size, for image icon use Icon_Img_SizeW and Icon_Img_SizeH)
-FA Icon/Other fonts icon selector with live preview (double click Icon_FA_selector property to open)
-Padding for Button, Text and Icon
(Button Padding is relative to usercontrol size, other paddings are relative to button area)
-Color transition animation for Button face,Border and Text
-Color transition animation selectable Time in MS
-Allow to set mouse hover pointer with custom and predefined images (.SetMouseHoverPointer)
-Icon/FA Rotation and Caption Rotation
-SetPicture/GetPicture methods to change images directly
-Gradient Fill (2 colors),Texture Fill, Hatched Fill
-Gradient and texture fill support rotation,displacement and alpha
-Presets
-Extra Tag2 and Tag3 for user defined data stored in properties
-Icon_Img_Opacity also control Font Icon opacity
-Caption Opacity
v1.1
-Added pixeloffset to Path drawing for clearer text
-Bugfix: icon selector (messed up with last minute changes in v1.0)
-Bugfix: Removed deleted functions call
-Changed SendMessage for SendNotifyMessage in FontManager
v1.2
-Added Accesskey (detected from caption like standard command button)
-Auto replace font 'MS Sans Serif' (Raster) with True Type version