Sign in to follow this  
Followers 0
Aceguy

LIVE sliders.

4 posts in this topic

these sliders behave the exactly the way i want them to....

but is there a way to make them LIVE, Update while dragging.?

#include <GUIConstants.au3>

$Form1 = GUICreate("Form1", 335, 105, 612, 524, -1, BitOR($WS_EX_TOOLWINDOW,$WS_EX_WINDOWEDGE))
$Progress1 = GUICtrlCreateProgress(184, 8, 137, 17, BitOR($PBS_SMOOTH,$WS_BORDER))
$Slider1 = GUICtrlCreateSlider(176, 32, 153, 17,$TBS_NOTICKS)
GUICtrlSetData(-1,85)
$Slider2 = GUICtrlCreateSlider(176, 56, 153, 17,$TBS_NOTICKS)
GUICtrlSetData(-1,60)
$Slider3 = GUICtrlCreateSlider(176, 80, 153, 17,$TBS_NOTICKS)
GUICtrlSetData(-1,25)
GUISetState(@SW_SHOW)

While 1
    $msg = GUIGetMsg()
    Select
        Case $msg =$GUI_EVENT_CLOSE
            Exit

        case $msg = $Slider1
            if guictrlread($Slider2) > guictrlread($slider1)-10 Then
                GUICtrlSetData($Slider2,guictrlread($slider1)-10)
            EndIf
            if guictrlread($slider2) < guictrlread($slider3)+10 Then
                guictrlsetdata($slider3,GUICtrlRead($slider2)-10)
            EndIf
        
    case $msg = $slider2
    if guictrlread($slider2) > guictrlread($slider1)-10 Then
        guictrlsetdata($slider2,guictrlread($slider1)-10)
    elseif guictrlread($slider2) < guictrlread($slider3) Then
        guictrlsetdata($slider3, guictrlread($slider2)-10)
        EndIf
case $msg = $Slider3
    if guictrlread($slider3) > guictrlread($slider2)-10 Then
        GUICtrlSetData($slider3,guictrlread($slider2)-10)
        EndIf
    EndSelect
WEnd

:)

Share this post


Link to post
Share on other sites



Hi, here is working example:

#include <GuiConstants.au3>

;Global Const $WM_HSCROLL = 0x0114
;Global Const $WM_VSCROLL = 0x0115

$Gui = GuiCreate("Slider Update Demo", 250, 200)

GUIRegisterMsg($WM_HSCROLL, "WM_HVSCROLL")
GUIRegisterMsg($WM_VSCROLL, "WM_HVSCROLL")

$Vertical_Label = GUICtrlCreateLabel("Vertical Slider Read: 0", 20, 20, 200)
$Horizontal_Label = GUICtrlCreateLabel("Horizontal Slider Read: 0", 80, 120, 200)

$Vertical_Slider = GUICtrlCreateSlider(20, 50, 30, 120, BitOr($GUI_SS_DEFAULT_SLIDER, $TBS_VERT))
$Horizontal_Slider = GUICtrlCreateSlider(60, 150, 160, 30)

GUISetState()

While 1
    $Msg = GUIGetMsg()
    Switch $Msg
        Case -3
            Exit
    EndSwitch
WEnd

Func WM_HVSCROLL($hWndGUI, $MsgID, $WParam, $LParam)
    Switch $LParam
        Case GUICtrlGetHandle($Vertical_Slider)
            GUICtrlSetData($Vertical_Label, "Vertical Slider Read: " & GUICtrlRead($Vertical_Slider))
        Case GUICtrlGetHandle($Horizontal_Slider)
            GUICtrlSetData($Horizontal_Label, "Horizontal Slider Read: " & GUICtrlRead($Horizontal_Slider))
    EndSwitch
EndFunc

 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Share this post


Link to post
Share on other sites

WOW, SPOT ON, :P thanks MsCreatoR.

And a HAPPY NEW YEAR :P:blink::wub:

Your wellcome :D

and Happy New Year to you to! :)


 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0