Jump to content
Sign in to follow this  
nacerbaaziz

question about the slider control with the screen readers

Recommended Posts

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

@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

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
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.

Share this post


Link to post
Share on other sites
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  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By red0fireus
      #NoTrayIcon #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Res_Description=Rainmeter Suspend #AutoIt3Wrapper_Res_Fileversion=0.0.0.1 #AutoIt3Wrapper_Res_Fileversion_AutoIncrement=y #AutoIt3Wrapper_Res_ProductName=Rainmeter Suspend #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <WinAPI.au3> #include <WindowsConstants.au3> Opt("TrayAutoPause",0) while 1 sleep(5000) _IsFullScreen() WEnd Func _IsFullScreen () Local $hwnd = WinGetHandle ("[ACTIVE]") Local $aWinRect = WinGetPos ($hwnd) If ($aWinRect[2] >= _WinAPI_GetSystemMetrics($SM_CXSCREEN)) OR ($aWinRect[3] >= _WinAPI_GetSystemMetrics($SM_CYSCREEN)) Then _ProcessSuspend("rainmeter.exe") Else _ProcessResume("rainmeter.exe") EndIf EndFunc Func _ProcessSuspend($process) $processid = ProcessExists($process) If $processid Then $ai_Handle = DllCall("kernel32.dll", 'int', 'OpenProcess', 'int', 0x1f0fff, 'int', False, 'int', $processid) $i_sucess = DllCall("ntdll.dll","int","NtSuspendProcess","int",$ai_Handle[0]) DllCall('kernel32.dll', 'ptr', 'CloseHandle', 'ptr', $ai_Handle) If IsArray($i_sucess) Then Return 1 Else SetError(1) Return 0 Endif Else SetError(2) Return 0 Endif EndFunc Func _ProcessResume($process) $processid = ProcessExists($process) If $processid Then $ai_Handle = DllCall("kernel32.dll", 'int', 'OpenProcess', 'int', 0x1f0fff, 'int', False, 'int', $processid) $i_sucess = DllCall("ntdll.dll","int","NtResumeProcess","int",$ai_Handle[0]) DllCall('kernel32.dll', 'ptr', 'CloseHandle', 'ptr', $ai_Handle) If IsArray($i_sucess) Then Return 1 Else SetError(1) Return 0 Endif Else SetError(2) Return 0 Endif EndFunc  
      I'm getting this error when running my script: "Error: Subscript used on non-accessible variable" 
      I'm very confused because the script works 99% of the time and then I just get the random error. What am I missing?
    • By Spikemg1
      Is it possible to sign your script before compiling?
    • By DigiBox
      Hello!
      Please help me with this small problem I've encountered while learning to make GUI.
      I'm not able to get the set slider values out of sliders and I can't figure out why.
      The slider value in the example is preset to 1, but whatever I set the slider to, it returns the value 3 when I click Apply and I havn't set any value to 3.
      Where is that 3 coming from?
       
      #include <SliderConstants.au3> #include <MsgBoxConstants.au3> #include <GUIConstantsEx.au3> Global $LRSlider Opt("GUIOnEventMode", 1) Global $Form1 = GUICreate("test slider", 200, 200, -1, -1) Global $LRSlider = GUICtrlCreateSlider(50, 50, 100, 20, $TBS_TOOLTIPS) GUICtrlSetLimit($LRSlider, 50, 1) GUICtrlSetData($LRSlider, 1) GUISetOnEvent($GUI_EVENT_CLOSE, "Exit1") Global $ApplyButton = GUICtrlCreateButton("APPLY", 100, 150, 89, 17) GUICtrlSetOnEvent($ApplyButton, "Apply") GUISetState(@SW_SHOW) Func Apply() GUICtrlRead($LRSlider) MsgBox(0, 0, $LRSlider) GUICtrlSetData($LRSlider, $LRSlider) EndFunc ;==>Apply Func Exit1() Exit EndFunc ;==>Exit1 While 1 Sleep(200) WEnd  
    • 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  
    • 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
×
×
  • Create New...