#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("Slider Q & A", 800, 800) GUISetState(@SW_SHOW) $iSliderWidth = 260 $iSliderX = 5 ;left param $iSliderMax = 10 ;slide Ceilling $iSliderMin = 0 ; slide floor $iTicInterval = 1 ; incremental increase $iLabelPos = Floor(($iSliderWidth + 30) * $iTicInterval / ($iSliderMax - $iSliderMin)) ; subtract 45 from slider wdth to allow for non-used space at each end $iLabelCount = $iSliderMax - $iTicInterval $iLabelWidth = 20 For $i = 0 To $iLabelCount + 1 ; Clear overspill flag $bOverspill = False ; Calculate tic value $iLabelValue = $i * $iTicInterval ; Check if over max If $iLabelValue >= $iSliderMax Then $bOverspill = True $iLabelValue = $iSliderMax EndIf ; check for overspill If $bOverspill Then ExitLoop Next $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 _GUICtrlSlider_SetTipSide($cSlider, $TBTS_Bottom) GUICtrlCreateLabel($iLabelValue, $iSliderX + 10 + ($i * $iLabelPos), 30, $iLabelWidth, 15) ; Add 10 to allow for unused space at beginning of slider GUICtrlSetBkColor(-1, 0x0000ff) GUICtrlSetColor(-1, 0xffff01) GUICtrlSetFont(-1, 10, 900, 1, "Calibri") ;label with fileread to post questions to answer (To right of Slider) $cSlider2 = GUICtrlCreateSlider($iSliderX, 60, 260, 20, BitOR($TBS_AUTOTICKS, $TBS_TOOLTIPS)) _GUICtrlSlider_SetRange($cSlider2, 1, $iSliderMax) ; Set range _GUICtrlSlider_SetTicFreq($cSlider2, $iTicInterval) ; Set tic freq GUICtrlCreateLabel($iLabelValue, $iSliderX + 10 + ($i * $iLabelPos), 80, $iLabelWidth, 15) ; Add 10 to allow for unused space at beginning of slider ;label with fileread to post questions to answer (To right of Slider) $cSlider3 = GUICtrlCreateSlider($iSliderX, 110, 260, 20, BitOR($TBS_AUTOTICKS, $TBS_TOOLTIPS)) _GUICtrlSlider_SetRange($cSlider3, 1, $iSliderMax) ; Set range _GUICtrlSlider_SetTicFreq($cSlider3, $iTicInterval) ; Set tic freq GUICtrlCreateLabel($iLabelValue, $iSliderX + 10 + ($i * $iLabelPos), 130, $iLabelWidth, 15) ; Add 10 to allow for unused space at beginning of slider ;label with fileread to post questions to answer (To right of Slider) $cSlider4 = GUICtrlCreateSlider($iSliderX, 160, 260, 20, BitOR($TBS_AUTOTICKS, $TBS_TOOLTIPS)) _GUICtrlSlider_SetRange($cSlider4, 1, $iSliderMax) ; Set range _GUICtrlSlider_SetTicFreq($cSlider4, $iTicInterval) ; Set tic freq GUICtrlCreateLabel($iLabelValue, $iSliderX + 15 + ($i * $iLabelPos), 180, $iLabelWidth, 15) ; Add 10 to allow for unused space at beginning of slider ;label with fileread to post questions to answer (To right of Slider) $cSlider5 = GUICtrlCreateSlider($iSliderX, 210, 260, 20, BitOR($TBS_AUTOTICKS, $TBS_TOOLTIPS)) _GUICtrlSlider_SetRange($cSlider5, 1, $iSliderMax) ; Set range _GUICtrlSlider_SetTicFreq($cSlider5, $iTicInterval) ; Set tic freq GUICtrlCreateLabel($iLabelValue, $iSliderX + 10 + ($i * $iLabelPos), 230, $iLabelWidth, 15) ; Add 10 to allow for unused space at beginning of slider ;label with fileread to post questions to answer (To right of Slider) $cSlider6 = GUICtrlCreateSlider($iSliderX, 260, 260, 20, BitOR($TBS_AUTOTICKS, $TBS_TOOLTIPS)) _GUICtrlSlider_SetRange($cSlider6, 1, $iSliderMax) ; Set range _GUICtrlSlider_SetTicFreq($cSlider6, $iTicInterval) ; Set tic freq GUICtrlCreateLabel($iLabelValue, $iSliderX + 10 + ($i * $iLabelPos), 280, $iLabelWidth, 15) ; Add 10 to allow for unused space at beginning of slider ;label with fileread to post questions to answer (To right of Slider) $cSlider7 = GUICtrlCreateSlider($iSliderX, 310, 260, 20, BitOR($TBS_AUTOTICKS, $TBS_TOOLTIPS)) _GUICtrlSlider_SetRange($cSlider7, 1, $iSliderMax) ; Set range _GUICtrlSlider_SetTicFreq($cSlider7, $iTicInterval) ; Set tic freq GUICtrlCreateLabel($iLabelValue, $iSliderX + 10 + ($i * $iLabelPos), 330, $iLabelWidth, 15) ; Add 10 to allow for unused space at beginning of slider ;label with fileread to post questions to answer (To right of Slider) $cSlider8 = GUICtrlCreateSlider($iSliderX, 360, 260, 20, BitOR($TBS_AUTOTICKS, $TBS_TOOLTIPS)) _GUICtrlSlider_SetRange($cSlider8, 1, $iSliderMax) ; Set range _GUICtrlSlider_SetTicFreq($cSlider8, $iTicInterval) ; Set tic freq GUICtrlCreateLabel($iLabelValue, $iSliderX + 10 + ($i * $iLabelPos), 380, $iLabelWidth, 15) ; Add 10 to allow for unused space at beginning of slider ;label with fileread to post questions to answer (To right of Slider) $cSlider9 = GUICtrlCreateSlider($iSliderX, 410, 260, 20, BitOR($TBS_AUTOTICKS, $TBS_TOOLTIPS)) _GUICtrlSlider_SetRange($cSlider9, 1, $iSliderMax) ; Set range _GUICtrlSlider_SetTicFreq($cSlider9, $iTicInterval) ; Set tic freq GUICtrlCreateLabel($iLabelValue, $iSliderX + 10 + ($i * $iLabelPos), 430, $iLabelWidth, 15) ; Add 10 to allow for unused space at beginning of slider ;label with fileread to post questions to answer (To right of Slider) $cSlider10 = GUICtrlCreateSlider($iSliderX, 460, 260, 20, BitOR($TBS_AUTOTICKS, $TBS_TOOLTIPS)) _GUICtrlSlider_SetRange($cSlider10, 1, $iSliderMax) ; Set range _GUICtrlSlider_SetTicFreq($cSlider10, $iTicInterval) ; Set tic freq GUICtrlCreateLabel($iLabelValue, $iSliderX + 10 + ($i * $iLabelPos), 480, $iLabelWidth, 15) ; Add 10 to allow for unused space at beginning of slider ;label with fileread to post questions to answer (To right of Slider) $OKbutton = GUICtrlCreateButton("Answer", 145, 550, 60, 40) GUICtrlSetOnEvent($OKbutton, "_OKButton") GUICtrlSetColor(-1, 0x0000ff) 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 MsgBox($MB_SYSTEMMODAL, "Question Answer Value", " Your Answers Have Been Submited!") FileWrite("""FILE ON DESKTOP""", @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("""FILE ON DESKTOP""", @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 & "_______________________________________________________________________") Sleep(500) FileClose("""FILE ON DESKTOP""") FileClose("""FILE ON DESKTOP""") EndIf EndFunc ;==>_OKbutton 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