Results 1 to 36 of 36

Thread: [VB6] sButton Multipurpose Control (last update: 31/03/2021)

Threaded View

  1. #1

    Thread Starter
    Addicted Member shagratt's Avatar
    Join Date
    Jul 2019
    Location
    Argentina
    Posts
    198

    Post [VB6] sButton Multipurpose Control (last update: 31/03/2021)

    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.
    -As a magnifier glass.
    -To add Zoom / Translucency effect.

    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


    Everything on the screenshots is made with sButton's
    Name:  sB_Demo0.jpg
Views: 1824
Size:  25.7 KBName:  sB_Demo1.jpg
Views: 2125
Size:  37.4 KBName:  sB_Demo2.jpg
Views: 1751
Size:  27.3 KBName:  sB_Demo4.jpg
Views: 2049
Size:  25.3 KB


    Dependecy: GDI+ installed (so that mean XP and up)

    DOWNLOAD: sButton_v1.8.zip




    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

    v1.3 (02/03/2020)
    -Added Icon_Img_Scale
    -Icon_Img_AutoResize (resize or stretch img when control is resized)

    v1.4
    -Show focus underlining caption (if TabStop=true and not locked/disabled).
    if there is no caption it will simulate a mousehover


    v1.5
    -Added variable Blur effect (Based on Acrylic blur by Leandro Ascierto)
    -Added variable Zoom effect: Values between 0 and 1 are zoom out.
    Negative values disable tiling filling for zoom out.
    -Font Icon and Caption are not blured/zoomed (intended)
    -Updated Demo 2, Added Demo 5
    -New presets for TextureFill,Blur and Zoom
    -New sub setGlobalOpacity(x) for fast switching of all transparencies (except shadows)
    -Avoid showing focus when form is loaded

    v1.6
    -Not happy with the focus handling I removed code for "Avoid showing focus when form is loaded" from v1.5
    -Added prop ShowFocusType wich control when and how to show focus.
    It can be set to:
    None = 0 'Never show focus
    Tab_Underline = 1 '[DEFAULT] Underline caption text (only if focus is gained pressing TAB key)
    Tab_Over = 2 'Simulate mouse over (only if focus is gained pressing TAB key)
    Always_Underline = 3 'Underline caption text (no matter how it got the focus)
    Always_Over = 4 'Simulate mouse over (no matter how it got the focus)
    Set to Always... when you want to show focus on form load or Tab... when only changing focus with Tab key

    v1.7b)
    -DESIGN MODE: Caption updates as you type
    -Cursor Hand No more hardcoded, now is taken from system (should be DPI aware.Not tested)


    v1.8
    -Added GlobalQualityGFX, GlobalQualityTXT (only affects Caption draw on mode2)
    -Force to not draw using antialias for small img icons when there is no effect (<64px and square AR)
    -Caption Draw Mode names changed to reflect quality type used for each mode:
    now are eS_GFX_Paths and eS_TXT_DrawString wich are affected by diferent Global Quality modes
    -Fixed Bug when disabling button when mouse was over it
    -Fixed Bug when a msgbox was inside click event causing sButton not drawing
    -Fixed Bug when form unload was set on sButton events
    -Fixed and reworked mouse events logic:
    -Hover dont raise if mouse is pressed
    -No more intermitent hover colors when moving with mouse pressed
    -Faster repeated single clicks (thanks Leandro Ascierto for the tip)
    -Added DblClick event

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width