Jump to content

Slider & Report "Help!"


Recommended Posts

I am attempting to use sliders to create a Q&A report that outputs a log/txt  file on a PC/Server...at least I got that to work.

I have the sliders set, however I cannot get the number range to show on the GUI correctly. Could use some guidance here.

When I output the value of each slider into a log file, the values are really goofed. Could use some more guidance here too.

Any help would be greatly appreciated. I am a noob, take pity. I have self abused already!

test1.au3

Link to comment
Share on other sites

 

Maybe something like this. 

#include <GUIConstantsEx.au3>

test()

Func test()
    Local $slider, $button, $label, $currentNum, $holdNum

    GUICreate("slider", 220, 300, 100, 200)
    $slider = GUICtrlCreateSlider(10, 10, 200, 20)
    GUICtrlSetLimit(-1, 10, 0);|Sets the min / Max
    $label = GUICtrlCreateLabel("" & $currentNum, 75, 100, 100, 20) ;|Label displays current slider num
    GUISetState()
    GUICtrlSetData($slider, 0) ;|Begin at 0

    While 1
        $currentNum = GUICtrlRead($slider);
        If $currentNum <> $holdNum Then
            GUICtrlSetData($label, $currentNum)
            $holdNum = $currentNum
        EndIf
    WEnd
EndFunc   ;==>test

 

Link to comment
Share on other sites

Func _OKbutton()

    $aTics = GUICtrlRead($cSlider)
    $aTics2 = GUICtrlRead($cSlider2)
    $aTics3 = GUICtrlRead($cSlider3)
    $aTics4 = GUICtrlRead($cSlider4)
    $aTics5 = GUICtrlRead($cSlider5)
    $aTics6 = GUICtrlRead($cSlider6)
    $aTics7 = GUICtrlRead($cSlider7)
    $aTics8 = GUICtrlRead($cSlider8)
    $aTics9 = GUICtrlRead($cSlider9)
    $aTics10 = GUICtrlRead($cSlider10)

    If $aTics = 0 Or $aTics2 = 0 Or $aTics3 = 0 Or $aTics4 = 0 Or $aTics5 = 0 Or $aTics6 = 0 Or $aTics7 = 0 Or $aTics8 = 0 Or $aTics9 = 0 Or $aTics10 = 0 Then
        MsgBox($MB_SYSTEMMODAL, "Question Error", "There can not be a zero value.")
    ElseIf $aTics > 0 Then
        $hFile = FileOpen('Answer.txt',1) ;1 =append 2=overwrite <============= change if needed
        MsgBox($MB_SYSTEMMODAL, "Question Answer Value", " Your Answers Have Been Submited!")
        FileWrite($hFile, @CRLF & GUICtrlRead($cSlider) & @CRLF & _GUICtrlSlider_GetNumTics($cSlider2) & @CRLF & _GUICtrlSlider_GetNumTics($cSlider3) & @CRLF & _GUICtrlSlider_GetNumTics($cSlider4) & @CRLF & _GUICtrlSlider_GetNumTics($cSlider5) & @CRLF & _GUICtrlSlider_GetNumTics($cSlider6) & @CRLF & _GUICtrlSlider_GetNumTics($cSlider7) & @CRLF & _GUICtrlSlider_GetNumTics($cSlider8) & @CRLF & _GUICtrlSlider_GetNumTics($cSlider9) & @CRLF & _GUICtrlSlider_GetNumTics($cSlider10) & @CRLF & @CRLF & "****" & @HOUR & ":" & @MIN & " " & @MON & "/" & @MDAY & " " & "****" & @CRLF & "_______________________________________________________________________")
        FileWrite($hFile, @CRLF & GUICtrlRead($aTics) & @CRLF & _GUICtrlSlider_GetNumTics($aTics2) & @CRLF & _GUICtrlSlider_GetNumTics($aTics3) & @CRLF & _GUICtrlSlider_GetNumTics($aTics4) & @CRLF & _GUICtrlSlider_GetNumTics($aTics5) & @CRLF & _GUICtrlSlider_GetNumTics($aTics6) & @CRLF & _GUICtrlSlider_GetNumTics($aTics7) & @CRLF & _GUICtrlSlider_GetNumTics($aTics8) & @CRLF & _GUICtrlSlider_GetNumTics($aTics9) & @CRLF & _GUICtrlSlider_GetNumTics($aTics10) & @CRLF & @CRLF & "****" & @HOUR & ":" & @MIN & " " & @MON & "/" & @MDAY & " " & "****" & @CRLF & "_______________________________________________________________________")
        FileClose($hFile)
    EndIf

EndFunc   ;==>_OKbutton

i think this works as you wan't.

And i want to have the link for PowerPoint.au3.

Link to comment
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
 Share

×
×
  • Create New...