Jump to content
Sign in to follow this  
nacerbaaziz

question about the slider control with the screen readers

Recommended Posts

nacerbaaziz
Posted (edited)

Hi guys
I have a question about the slider  controle
There is a problem with screen readers, wen we Using a screen reader We usually move between GUI controls using the tab key.
But when you create a slider , beside to it there are  buttons and check boxes or any other controls, When I move between the GUI controls using the tab key I can not find the slider.
But if it were alone in the window, I would find it normally.
Is there a solution to Solve this problem please?
This is the code i tried

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <MsgBoxConstants.au3>
#include <SliderConstants.au3>
main()

Func main()
    GUICreate("slider", 200, 200, -1, -1)
GUICtrlCreateGroup("slider", 10, 10, 240, 50)
    Local $idSlider1 = GUICtrlCreateSlider(50, 30, 200, 20, BitOr($TBS_DOWNISLEFT, $TBS_BOTH))
    GUICtrlSetLimit(-1, 100, 0)

;GUIStartGroup("")
    Local $idButton = GUICtrlCreatebutton("Value?", 75, 70, 70, 20)
    GUISetState(@SW_SHOW)
    GUICtrlSetData($idSlider1, 10)
while 1
switch GUIGetMsg()
case $GUI_EVENT_CLOSE
exit

case $idButton
            MsgBox($MB_SYSTEMMODAL, "slider1", GUICtrlRead($idSlider1))
endSwitch
Wend
EndFunc

[Click and drag to move]

 

 

Edited by nacerbaaziz

Share this post


Link to post
Share on other sites
TheXman
Posted (edited)

@nacerbaaziz

By default, the slider does not have a tab stop.  If you want it to have a tab stop then look at the code below.  Note that $WS_TABSTOP was added to the definition of the slider control.

#include <Constants.au3>
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <SliderConstants.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=
Global $Form2 = GUICreate("Form2", 216, 121, 335, 192)
Global $Slider1 = GUICtrlCreateSlider(8, 16, 150, 45, BitOR($GUI_SS_DEFAULT_SLIDER,$WS_TABSTOP))
Global $Button1 = GUICtrlCreateButton("Button1", 16, 72, 75, 25)
#EndRegion ### END Koda GUI section ###

GUISetState(@SW_SHOW)
While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            ExitLoop
        Case $Slider1
            MsgBox($MB_SYSTEMMODAL, "slider1", GUICtrlRead($Slider1))
    EndSwitch
WEnd

 

Also, when showing code, could you please use the code tags?  It makes it much easier to read and it creates links to the help file for commands that are recognized.

 

image.png.1ecb1b0766ab60430a97b11b615b3a6e.png

 

Edited by TheXman
Added a little more clarity.

Share this post


Link to post
Share on other sites
nacerbaaziz

it's succeeded, my dear. Thank you very much for your quick response

and about  the code field
There is some difficulty for me as a screen readers user

the code field is conflicts with the screen reader
I hope the administration will address this problem

Share this post


Link to post
Share on other sites
TheXman
8 minutes ago, nacerbaaziz said:

There is some difficulty for me as a screen readers user

@nacerbaaziz

I understand now.  I thought that you were creating tools for people who use screen readers.  I didn't realize that you use a screen reader also.

  • Like 1

Share this post


Link to post
Share on other sites
nacerbaaziz

Thanks for your understanding dear

Are there any specific tags I can use in the editor to place the code?

Share this post


Link to post
Share on other sites
TheXman
Posted (edited)
51 minutes ago, nacerbaaziz said:

Are there any specific tags I can use in the editor to place the code?

@nacerbaaziz

Although you won't get the color-coding and links, you can wrap your code in the following tags to get it to format it in a code box:

You can place [code] at the beginning and [/code] at the end of the code snippet.

So it will look something like this: (hint: Press Shift+Enter for new line within code, if you are manually typing it)

[code]
local $a
$a += 1
[/code]

 

Then it will look like this:

local $a
$a += 1

 

Edited by TheXman

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  

  • Similar Content

    • AndyS01
      By AndyS01
      I want to create a slider that has values representing colors, like the slider on the _ChooseColor() GUI in the Misc.au3 UDF, but the max value for a slider is 32767.  
      Here is my test code:
      #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <SliderConstants.au3> #include <Misc.au3> $hGUI = GUICreate("Test", 100, 560) $BtnID = GUICtrlCreateButton("Choose", 10, 10, 50, 25) ;~ GUICtrlSetOnEvent($BtnID, "handle_choose_btn") $flags = BitOR($TBS_AUTOTICKS, $TBS_VERT) $iSliderID = GUICtrlCreateSlider(10, 50, 40, 420, $flags) $hSlider_hWnd = GUICtrlGetHandle($iSliderID) $iMaxVal = 32767 GUICtrlSetLimit($iSliderID, $iMaxVal, 0) ; change min/max value GUISetState() GUIRegisterMsg($WM_VSCROLL, "WM_V_Slider") While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $GUI_EVENT_PRIMARYUP ToolTip("") case $BtnID handle_choose_btn() EndSwitch WEnd ; React to a slider movement Func WM_V_Slider($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $wParam If $lParam = $hSlider_hWnd Then $iValue = GUICtrlRead($iSliderID) ConsoleWrite("+++: $iValue = " & $iValue & @CRLF) ToolTip(getRGB($iValue)) EndIf Return $GUI_RUNDEFMSG EndFunc ;==>WM_V_Slider ; Extract the RGB components from the color value Func getRGB($iColorVal) Local $hexstr, $b, $g, $r, $rgb $hexstr = StringFormat("%06X", $iColorVal) $r = StringMid($hexstr, 1, 2) $g = StringMid($hexstr, 3, 2) $b = StringMid($hexstr, 5, 2) $rgb = StringFormat("" & $iColorVal & " - rgb: %02s %02s %02s", $r, $g, $b) Return ($rgb) EndFunc ;==>getRGB Func handle_choose_btn() $color = _ChooseColor(2, 255, 0, $hGUI) ConsoleWrite("+++: $color = " & Hex($color, 8) & @CRLF) EndFunc ;==>handle_choose_btn  
    • nacerbaaziz
      By nacerbaaziz
      Hello all
      I have a question please
      Is there a way to request the script for administrator privileges if a particular condition is met??
      example
      local $path = RegRead("HKEY_CURRENT_USER\Software\test", "fullpath")
      if $fullPath = @scriptFullPath then
      Request for administrator privileges
      main()
      else
      main()
      endIf
      I hope to find a solution here
      Greetings to all
    • b9k
      By b9k
      Hi, I am stuck on a GUI problem and would like your help to solve it.
      I am trying to automate the SoundWire Server app to match my current system volume level while it is minimized to the notification area (so no clicking or stealing focus),
      I can already get the handle and alter the tracker position by sending a WM_SETPOS message, but somehow the actual volume is not changed: I think I need to do something else to trigger the event handler for the value change and propagate it correctly.
      This is the control summary from Au3 info:
      >>>> Window <<<< Title: SoundWire Server Class: #32770 Position: 441, 218 Size: 566, 429 Style: 0x94CA00C4 ExStyle: 0x00050101 Handle: 0x0000000000510E12 >>>> Control <<<< Class: msctls_trackbar32 Instance: 4 ClassnameNN: msctls_trackbar324 Name: Advanced (Class): [CLASS:msctls_trackbar32; INSTANCE:4] ID: 6002 Text: Position: 51, 222 Size: 47, 126 ControlClick Coords: 1, 101 Style: 0x5001000A ExStyle: 0x00000000 Handle: 0x00000000001234C8 >>>> Mouse <<<< Position: 496, 567 Cursor ID: 2 Color: 0xF0F0F0 >>>> StatusBar <<<< >>>> ToolsBar <<<< >>>> Visible Text <<<< Default multimedia device Tray on Start Static Server Address: 192.168.1.8 Status: Connected to B9K~OP3 Audio Output Audio Input Level Record to File Input Select: 44.1 kHz Minimize to Master Volume Mute >>>> Hidden Text <<<< Slider2 Mute OK Cancel Label Balance Slider1 Volume Front L/R Fr C/LFE Side L/R Back L/R
      I am attaching the program in question so you don't have to install it (i don't know if it is portable enough, tough): 

      SoundWire Server_files.zip

      Thanks in advance and I hope I didn't post in the wrong section
    • FroVN
      By FroVN
      Hello, i have a problem, first i create two gui , first gui use Fuction Soundplay to play the music, if the music playing in the end, it auto change a new song like playlist on soundcloud, but the problem that while i press a button in gui 1 to open gui 2 , the song when it end it not change to a new song, wait for gui 2 close then begin change a new song, have anyway to make gui 1 still working while gui 2 is working too?
    • Elzie
      By Elzie
      Hi I am trying to make a gui that uses a slide to change pictures and uses internet-read from  guinness function.
      Thanks for your help.
      Ok found the issue
      #include <GUIConstantsEx.au3> #include <SliderConstants.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <WinAPI.au3> #include <WinAPIRes.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 229, 165, 2392, 436) $Slider = GUICtrlCreateSlider(32, 128, 150, 29) GUICtrlSetLimit($Slider, 2, 1) GUICtrlSetData($Slider, 1) GUICtrlSetBkColor($Slider, 0x0099FF) GUICtrlSetColor(-1, 0xA6CAF0) $hSlider_Handle = GUICtrlGetHandle(-1) $sFile1 = _GetURLImage("http://www.pendriveapps.com/wp-content/uploads/autoit.jpg ", @TempDir) $sFile2 = _GetURLImage("http://domoticx.com/wp-content/uploads/autoit-logo-200x154.jpg ", @TempDir) $Hpic1 = GUICtrlCreatePic($sFile1, 56, 8, 108, 108, BitOR($SS_NOTIFY, $WS_GROUP, $WS_CLIPSIBLINGS)) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Slider $a = GUICtrlRead($Slider) If $a = 2 Then GUICtrlDeleteImage($Hpic1) $Hpic2 = GUICtrlCreatePic($sFile2, 56, 8, 108, 108, BitOR($SS_NOTIFY, $WS_GROUP, $WS_CLIPSIBLINGS)) ElseIf $a = 1 Then GUICtrlDeleteImage($hpic2) $Hpic1 = GUICtrlCreatePic($sFile1, 56, 8, 108, 108, BitOR($SS_NOTIFY, $WS_GROUP, $WS_CLIPSIBLINGS)) EndIf EndSwitch WEnd Func _GetURLImage($sURL, $sDirectory = @ScriptDir) ; Author ........: guinness Local $hDownload, $sFile $sFile = StringRegExpReplace($sURL, "^.*/", "") If @error Then Return SetError(1, 0, $sFile) EndIf If StringRight($sDirectory, 1) <> "\" Then $sDirectory = $sDirectory & "\" EndIf $sDirectory = $sDirectory & $sFile If FileExists($sDirectory) Then Return $sDirectory EndIf $hDownload = InetGet($sURL, $sDirectory, 17, 1) While InetGetInfo($hDownload, 2) = 0 If InetGetInfo($hDownload, 4) <> 0 Then InetClose($hDownload) Return SetError(1, 0, $sDirectory) EndIf Sleep(105) WEnd InetClose($hDownload) Return $sDirectory EndFunc ;==>_GetURLImage Func GUICtrlDeleteImage($iCtrlID) ; Author ........: guinness Local Const $STM_SETIMAGE = 0x0172 Local $aSetImage = 0, _ $bReturn = True, _ $iMsg = 0 Switch _WinAPI_GetClassName($iCtrlID) Case 'Button' ; button, checkbox, groupbox, radiobutton. Local $aButton = [$IMAGE_BITMAP, $IMAGE_ICON] $aSetImage = $aButton $aButton = 0 Case 'Static' ; icon, label, picture. Local $aStatic = [$IMAGE_BITMAP, $IMAGE_CURSOR, $IMAGE_ICON] $aSetImage = $aStatic $aStatic = 0 $iMsg = $STM_SETIMAGE Case Else $bReturn = False EndSwitch If $bReturn Then $bReturn = False Local $hImage = 0 For $i = 0 To UBound($aSetImage) - 1 $hImage = GUICtrlSendMsg($iCtrlID, $iMsg, $aSetImage[$i], 0) If $hImage <> 0 Then Switch $aSetImage[$i] Case $IMAGE_BITMAP $bReturn = _WinAPI_DeleteObject($hImage) Case $IMAGE_CURSOR $bReturn = _WinAPI_DeleteObject($hImage) If Not $bReturn Then $bReturn = _WinAPI_DestroyCursor($hImage) > 0 EndIf Case $IMAGE_ICON $bReturn = _WinAPI_DeleteObject($hImage) If Not $bReturn Then $bReturn = _WinAPI_DestroyIcon($hImage) > 0 EndIf EndSwitch ExitLoop EndIf Next If Not $bReturn Then $bReturn = GUICtrlSetImage($iCtrlID, 'shell32.dll', -50) > 0 EndIf EndIf Return $bReturn EndFunc ;==>GUICtrlDeleteImage  
×