Sign in to follow this  
Followers 0
megahyperion

Slider Focus

6 posts in this topic

I put a slider control in a new project im working on.

Man I love this thing and dont know why I didnt see it before.

Here is the slider by itself

$slider1 = GuiCtrlCreateSlider (10,10,200,40)
GUICtrlSetLimit(-1,3,1)

Its a 3 position slider with the minimum position representing 1 and max 3, 2 is obviously in the center.

Is there a way to bring focus to the 2, or the center of the slider?

Right now when I load up my gui is always fosuces to the far left, so right now it starts up fosued on the 1.

Also why is the max height at something around 40? after you increase the height any further the slider doesnt get any bigger.

Thanks

Share this post


Link to post
Share on other sites



$slider1 = GuiCtrlCreateSlider (10,10,200,60)

GUICtrlSetLimit(-1,3,1)

GUICtrlSetData(-1,2)

will set the slider to the middle position....

The Height of the control does get bigger but not the slider itself... don't know if thats an internal thing or not.


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Yeah I noticed it will take up more room but the slider itself stays the same size.

Thanks for speedy reply

Share this post


Link to post
Share on other sites

BIG SLIDER:

Global $WM_USER = 0x400;
Global $TBM_SETTHUMBLENGTH = $WM_USER + 27
Global $TBS_FIXEDLENGTH = 0x40

GuiCreate("foo")
$slider1 = GuiCtrlCreateSlider (10,10,200,60, $TBS_FIXEDLENGTH)
GUICtrlSetLimit(-1,3,1) 
GuiCtrlSetData($slider1, 2)

GuiSendMsg($slider1, $TBM_SETTHUMBLENGTH, 50, 0)

GuiSetState()
While GUIGetMsg() <> -3
wend

Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

Share this post


Link to post
Share on other sites

Here's a wrapper function to create "big" sliders.... I'm working on some other wrappers for slider controls.

$gui = GuiCreate("Example Sliders")
$sliderNormal = GUICtrlCreateSlider(10, 10, 200, 60, -1)
$sliderBig = _GUICtrlCreateSlider(10, 100, 200, 60, -1)

GuiSetState()
While GUIGetMsg() <> -3
WEnd

; Overcome the "feature" that the thumb does not automatically
;   resize larger than approx. 30 pixels by deault
Func _GuiCtrlCreateSlider($left, $top, $width, $height, $style)
   Local $ref = GuiCtrlCreateSlider($left, $top, $width, $height)
   If $style <= 0 Then $style = 0x50020001;the deault style
   GuiCtrlSetStyle($ref, BitOr($style,0x40));TBS_FIXEDLENGTH
   GuiSendMsg($ref, 27+0x400, $height - 10, 0);TBS_SETTHUMBLENGTH
   Return $ref
EndFunc

Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

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