#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include Opt("GUIOnEventMode", 1) ; Change to OnEvent mode Local $hMainGUI = GUICreate("Q & A Sensory ( 1 is bad. 10 is Good!)", 830, 830) GUISetState(@SW_SHOW) GUICtrlSetBkColor(-1, 0x0000ff) GUICtrlSetColor(-1, 0xffff01) GUICtrlSetFont(-1, 10, 900, 1, "Calibri") $iSliderWidth = 260 $iSliderX = 5;left param $iSliderMax = 11 ;slide Ceilling $iSliderMin = 1 ;slide floor $iTicInterval = 1 ; incremental increase $iLabelPos = Floor(($iSliderWidth - 15) * $iTicInterval / ($iSliderMax - $iSliderMin)) $iLabelCount = $iSliderMax - $iTicInterval $iLabelWidth = 25 For $i = 1 To $iLabelCount + 1 $bOverspill = False ; Clear overspill flag $iLabelValue = $i * $iTicInterval; Calculate tic value If $iLabelValue >= $iSliderMax Then ; Check if over max $bOverspill = True $iLabelValue = $iSliderMax EndIf If $bOverspill Then ExitLoop ; check for overspill $cSlider = GUICtrlCreateSlider($iSliderX, 10, 260, 20, BitOR($TBS_AUTOTICKS, $TBS_TOOLTIPS)) _GUICtrlSlider_SetRange($cSlider, 1, $iSliderMax) ; Set range _GUICtrlSlider_SetTicFreq($cSlider, $iTicInterval) ; Set tic freq GUICtrlCreateLabel($iLabelValue, $iSliderX - 18 + ($i * $iLabelPos), 30, $iLabelWidth, 15) ; Add 10 to allow for unused space at beginning of slider ;$Question_01 = GUICtrlCreateLabel(FileRead(("\\Desktop\test Q Doc.txt")), 270, 10, 400, 75, $SS_left) $cSlider2 = GUICtrlCreateSlider($iSliderX, 90, 260, 20, BitOR($TBS_AUTOTICKS, $TBS_TOOLTIPS)) _GUICtrlSlider_SetRange($cSlider2, 1, $iSliderMax) ; Set range _GUICtrlSlider_SetTicFreq($cSlider2, $iTicInterval) ; Set tic freq GUICtrlCreateLabel($iLabelValue, $iSliderX - 18 + ($i * $iLabelPos), 110, $iLabelWidth, 15) ; Add 10 to allow for unused space at beginning of slider ;$Question_02 = GUICtrlCreateLabel(FileRead(("\\Desktop\test Q Doc.txt")), 270, 90, 400, 75, $SS_left) $cSlider3 = GUICtrlCreateSlider($iSliderX, 170, 260, 20, BitOR($TBS_AUTOTICKS, $TBS_TOOLTIPS)) _GUICtrlSlider_SetRange($cSlider3, 1, $iSliderMax) ; Set range _GUICtrlSlider_SetTicFreq($cSlider3, $iTicInterval) ; Set tic freq GUICtrlCreateLabel($iLabelValue, $iSliderX - 18 + ($i * $iLabelPos), 190, $iLabelWidth, 15) ; Add 10 to allow for unused space at beginning of slider ;$Question_03 = GUICtrlCreateLabel(FileRead(("\\Desktop\test Q Doc.txt")), 270, 170, 400, 75, $SS_left) $cSlider4 = GUICtrlCreateSlider($iSliderX, 250, 260, 20, BitOR($TBS_AUTOTICKS, $TBS_TOOLTIPS)) _GUICtrlSlider_SetRange($cSlider4, 1, $iSliderMax) ; Set range _GUICtrlSlider_SetTicFreq($cSlider4, $iTicInterval) ; Set tic freq GUICtrlCreateLabel($iLabelValue, $iSliderX - 18 + ($i * $iLabelPos), 270, $iLabelWidth, 15) ; Add 10 to allow for unused space at beginning of slider ;$Question_04 = GUICtrlCreateLabel(FileRead(("\\Desktop\test Q Doc.txt")), 270, 250, 400, 75, $SS_left) $cSlider5 = GUICtrlCreateSlider($iSliderX, 330, 260, 20, BitOR($TBS_AUTOTICKS, $TBS_TOOLTIPS)) _GUICtrlSlider_SetRange($cSlider5, 1, $iSliderMax) ; Set range _GUICtrlSlider_SetTicFreq($cSlider5, $iTicInterval) ; Set tic freq GUICtrlCreateLabel($iLabelValue, $iSliderX - 18 + ($i * $iLabelPos), 350, $iLabelWidth, 15) ; Add 10 to allow for unused space at beginning of slider ;$Question_05 = GUICtrlCreateLabel(FileRead(("\\Desktop\test Q Doc.txt")), 270, 330, 400, 75, $SS_left) $cSlider6 = GUICtrlCreateSlider($iSliderX, 410, 260, 20, BitOR($TBS_AUTOTICKS, $TBS_TOOLTIPS)) _GUICtrlSlider_SetRange($cSlider6, 1, $iSliderMax) ; Set range _GUICtrlSlider_SetTicFreq($cSlider6, $iTicInterval) ; Set tic freq GUICtrlCreateLabel($iLabelValue, $iSliderX - 18 + ($i * $iLabelPos), 430, $iLabelWidth, 15) ; Add 10 to allow for unused space at beginning of slider ;$Question_06 = GUICtrlCreateLabel(FileRead(("\\Desktop\test Q Doc.txt")), 270, 410, 400, 75, $SS_left) $cSlider7 = GUICtrlCreateSlider($iSliderX, 490, 260, 20, BitOR($TBS_AUTOTICKS, $TBS_TOOLTIPS)) _GUICtrlSlider_SetRange($cSlider7, 1, $iSliderMax) ; Set range _GUICtrlSlider_SetTicFreq($cSlider7, $iTicInterval) ; Set tic freq GUICtrlCreateLabel($iLabelValue, $iSliderX - 18 + ($i * $iLabelPos), 510, $iLabelWidth, 15) ; Add 10 to allow for unused space at beginning of slider ;$Question_07 = GUICtrlCreateLabel(FileRead(("\\Desktop\test Q Doc.txt")), 270, 490, 400, 75, $SS_left) $cSlider8 = GUICtrlCreateSlider($iSliderX, 570, 260, 20, BitOR($TBS_AUTOTICKS, $TBS_TOOLTIPS)) _GUICtrlSlider_SetRange($cSlider8, 1, $iSliderMax) ; Set range _GUICtrlSlider_SetTicFreq($cSlider8, $iTicInterval) ; Set tic freq GUICtrlCreateLabel($iLabelValue, $iSliderX - 18 + ($i * $iLabelPos), 590, $iLabelWidth, 15) ; Add 10 to allow for unused space at beginning of slider ;$Question_08 = GUICtrlCreateLabel(FileRead(("\\Desktop\test Q Doc.txt")), 270, 570, 400, 75, $SS_left) $cSlider9 = GUICtrlCreateSlider($iSliderX, 650, 260, 20, BitOR($TBS_AUTOTICKS, $TBS_TOOLTIPS)) _GUICtrlSlider_SetRange($cSlider9, 1, $iSliderMax) ; Set range _GUICtrlSlider_SetTicFreq($cSlider9, $iTicInterval) ; Set tic freq GUICtrlCreateLabel($iLabelValue, $iSliderX - 18 + ($i * $iLabelPos), 670, $iLabelWidth, 15) ; Add 10 to allow for unused space at beginning of slider ;$Question_09 = GUICtrlCreateLabel(FileRead(("\\Desktop\test Q Doc.txt")), 270, 650, 400, 75, $SS_left) $cSlider10 = GUICtrlCreateSlider($iSliderX, 730, 260, 20, BitOR($TBS_AUTOTICKS, $TBS_TOOLTIPS)) _GUICtrlSlider_SetRange($cSlider10, 1, $iSliderMax) ; Set range _GUICtrlSlider_SetTicFreq($cSlider10, $iTicInterval) ; Set tic freq GUICtrlCreateLabel($iLabelValue, $iSliderX - 18 + ($i * $iLabelPos), 750, $iLabelWidth, 15) ; Add 10 to allow for unused space at beginning of slider ;$Question_10 = GUICtrlCreateLabel(FileRead(("\\Desktop\test Q Doc.txt")), 270, 730, 400, 75, $SS_left) $SubmitBTN = GUICtrlCreateButton("Submit Answer", 680, 3, 120, 20) GUICtrlSetOnEvent($SubmitBTN, "_SubmitBTN") GUICtrlSetBkColor(-1, 0xce3500) Next Func _SubmitBTN() $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 MsgBox($MB_SYSTEMMODAL, "Question Answer Value", " Your Answers Have Been Submited!") FileOpen('\\Desktop\test_slider.log') FileWrite("\\Desktop\test_slider.log", @CRLF & "_______________________________________________________________________" & @CRLF & @UserName & @CRLF & GUICtrlRead($cSlider) & @CRLF & GUICtrlRead($cSlider2) & @CRLF & GUICtrlRead($cSlider3) & @CRLF & GUICtrlRead($cSlider4) & @CRLF & GUICtrlRead($cSlider5) & @CRLF & GUICtrlRead($cSlider6) & @CRLF & GUICtrlRead($cSlider7) & @CRLF & GUICtrlRead($cSlider8) & @CRLF & GUICtrlRead($cSlider9) & @CRLF & GUICtrlRead($cSlider10) & @CRLF & @CRLF & "****" & @HOUR & ":" & @MIN & " " & @MON & "/" & @MDAY & " " & "****" & @CRLF & "_______________________________________________________________________") FileClose("\\Desktop\test_slider.log") EndIf EndFunc ;==>_SubmitBTN GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEButton") Func CLOSEButton() ;MsgBox($MB_OK, "GUI Event", "You selected CLOSE! Exiting...") Exit EndFunc ;==>CLOSEButton While 1 Sleep(100) ; Sleep to reduce CPU usage WEnd