Sign in to follow this  
Followers 0
gte

Whjch command to use when setting up an 'on event' for clicking in a GUI date box?

17 posts in this topic

I know this is probably something easy, and I searched and probably didn't put the correct words in?

I want the below case called when I click in a date box (just click, not type)? I may also have the switch and case wrong, but those were my best guesses

Switch GUICtrlSetOnEvent($schtaskdate, _GUICtrlButton_GetState)
                    Case $BST_FOCUS 
                        if guictrlread($updatenoworcreateschtask) = 'Create a scheduled task for later' then 
                            Switch _GUICtrlButton_GetCheck($usernameinputcheckbox)
                                Case $BST_CHECKED
                                    If BitAnd(GUICtrlGetState($usernameinput), $GUI_DISABLE) Then GUICtrlSetState($usernameinput, $GUI_ENABLE)
                                Case $BST_UNCHECKED
                                    If BitAnd(GUICtrlGetState($usernameinput), $GUI_ENABLE) Then GUICtrlSetState($usernameinput, $GUI_DISABLE)
                            EndSwitch   
                        EndIf
                        if guictrlread($updatenoworcreateschtask) = 'Create a scheduled task for later' then 
                            Switch _GUICtrlButton_GetCheck($passwordinputcheckbox)
                                Case $BST_CHECKED
                                    If BitAnd(GUICtrlGetState($passwordinput), $GUI_DISABLE) Then GUICtrlSetState($passwordinput, $GUI_ENABLE)
                                Case $BST_UNCHECKED
                                    If BitAnd(GUICtrlGetState($passwordinput), $GUI_ENABLE) Then GUICtrlSetState($passwordinput, $GUI_DISABLE)
                            EndSwitch   
                        EndIf
                        if guictrlread($updatenoworcreateschtask) = 'Create a scheduled task for later' then 
                            Switch _GUICtrlButton_GetCheck($tableinputcheckbox)
                                Case $BST_CHECKED
                                    If BitAnd(GUICtrlGetState($tableinput), $GUI_DISABLE) Then GUICtrlSetState($tableinput, $GUI_ENABLE)
                                Case $BST_UNCHECKED
                                    If BitAnd(GUICtrlGetState($tableinput), $GUI_ENABLE) Then GUICtrlSetState($tableinput, $GUI_DISABLE)
                            EndSwitch   
                        EndIf                       
                    If BitAnd(GUICtrlGetState($sqldefaultinput), $GUI_DISABLE) Then GUICtrlSetState($sqldefaultinput, $GUI_ENABLE)
                    If BitAnd(GUICtrlGetState($newlibrarylistinput), $GUI_DISABLE) Then GUICtrlSetState($newlibrarylistinput, $GUI_ENABLE)
                    If BitAnd(GUICtrlGetState($usernameinputcheckbox), $GUI_DISABLE) Then GUICtrlSetState($usernameinputcheckbox, $GUI_ENABLE)
                    If BitAnd(GUICtrlGetState($passwordinputcheckbox), $GUI_DISABLE) Then GUICtrlSetState($passwordinputcheckbox, $GUI_ENABLE)
                    If BitAnd(GUICtrlGetState($tableinputcheckbox), $GUI_DISABLE) Then GUICtrlSetState($tableinputcheckbox, $GUI_ENABLE)
                    If BitAnd(GUICtrlGetState($sqldefaultcheckbox), $GUI_DISABLE) Then GUICtrlSetState($sqldefaultcheckbox, $GUI_ENABLE)
                    If BitAnd(GUICtrlGetState($newlibrarylistcheckbox), $GUI_DISABLE) Then GUICtrlSetState($newlibrarylistcheckbox, $GUI_ENABLE)
                EndSwitch

Share this post


Link to post
Share on other sites



I can't see how putting

GUIctrlSetOnEvent($schtaskdate, _enablefields)

Is going to make my switch work? Even if I define _enablefields as a full function? Isn't there an onclick event or something I can tie to the controlID of $schtaskdate, so that when it's clicked, a message box pops up?

Look at example in helpfile at GUICtrlSetOnEvent() how to work with it.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

#include <GUIConstantsEx.au3>
#include <DateTimeConstants.au3>

Opt('MustDeclareVars', 1)
Opt('GUIOnEventMode' , 1)
Example1()

; example1
Func Example1()
    Local $date, $msg

    GUICreate("My GUI get date", 200, 200, 800, 200)
    $date = GUICtrlCreateDate("1953/04/25", 10, 10, 185, 20)
    GUICtrlSetOnEvent($date,"test")
    GUISetOnEvent($GUI_EVENT_CLOSE , "quit")
    GUISetState()

    ; Run the GUI until the dialog is closed
    While True
        Sleep(100)
    WEnd
EndFunc   ;==>Example1
Func quit()
    Exit
EndFunc
Func test()
    MsgBox(0 , '' , "Id:"&@GUI_CtrlId& @CRLF &"Date:"&GUICtrlRead(@GUI_CtrlId))
EndFunc
in the helpfile

edit:oups :) used quick edit :party:

Edited by TheMadman

Only two things are infinite, the universe and human stupidity, and i'm not sure about the former -Alber EinsteinPractice makes perfect! but nobody's perfect so why practice at all?http://forum.ambrozie.ro

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

[edit]

Thanks, I'll try and apply this ... is there a way to get the calendar to auto populate today's date?

#include <GUIConstantsEx.au3>
#include <DateTimeConstants.au3>

Opt('MustDeclareVars', 1)
Opt('GUIOnEventMode' , 1)
Example1()

; example1
Func Example1()
    Local $date, $msg

    GUICreate("My GUI get date", 200, 200, 800, 200)
    $date = GUICtrlCreateDate("1953/04/25", 10, 10, 185, 20)
    GUICtrlSetOnEvent($date,"test")
    GUISetOnEvent($GUI_EVENT_CLOSE , "quit")
    GUISetState()

    ; Run the GUI until the dialog is closed
    While True
        Sleep(100)
    WEnd
EndFunc   ;==>Example1
Func quit()
    Exit
EndFunc
Func test()
    MsgBox(0 , '' , "Id:"&@GUI_CtrlId& @CRLF &"Date:"&GUICtrlRead(@GUI_CtrlId))
EndFunc
in the helpfile
Edited by gte

Share this post


Link to post
Share on other sites

Hi

I ran this code and I'm not getting an 'onevent' msgbox pop up?

It looks as if I'm supposed to get it when I do something with the $date variable (aka the calendar)

What should happen?

when you choose a date it will occur

Only two things are infinite, the universe and human stupidity, and i'm not sure about the former -Alber EinsteinPractice makes perfect! but nobody's perfect so why practice at all?http://forum.ambrozie.ro

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

[edit]

Thanks, I'll try and apply this ... is there a way to get the calendar to auto populate today's date?

Guictrlcreatedate(_NowCalcDate()..)

edit: sorry for double posting :)

Edited by TheMadman

Only two things are infinite, the universe and human stupidity, and i'm not sure about the former -Alber EinsteinPractice makes perfect! but nobody's perfect so why practice at all?http://forum.ambrozie.ro

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

Hi,

I got it to work, thanks, but I want to have it enable and disable fields now, which have to be done in my while statement and as you know, a function won't work in a while statement.

Any ideas?

[edit]

I think I can use this, but I need to get the function ID correct?

if GUICtrlSetOnEvent($schtaskdate, ????? ) then
                    
;~                      if guictrlread($updatenoworcreateschtask) = 'Create a scheduled task for later' then 
                    MsgBox(0 , 'test' , 'Do not forget to enter in the registry key field values')  
                            Switch _GUICtrlButton_GetCheck($usernameinputcheckbox)
                                Case $BST_CHECKED
                                    If BitAnd(GUICtrlGetState($usernameinput), $GUI_DISABLE) Then GUICtrlSetState($usernameinput, $GUI_ENABLE)
                                Case $BST_UNCHECKED
                                    If BitAnd(GUICtrlGetState($usernameinput), $GUI_ENABLE) Then GUICtrlSetState($usernameinput, $GUI_DISABLE)
                            EndSwitch   
                        EndIf

when you choose a date it will occur

Edited by gte

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

#include <GUIConstantsEx.au3>
#include <DateTimeConstants.au3>

Opt('MustDeclareVars', 1)
Opt('GUIOnEventMode' , 1)
Example1()

; example1
Func Example1()
    Local $date, $msg

    GUICreate("My GUI get date", 200, 200, 800, 200)
    $date = GUICtrlCreateDate("1953/04/25", 10, 10, 185, 20)
    GUICtrlSetOnEvent($date,"test")
    GUISetOnEvent($GUI_EVENT_CLOSE , "quit")
    GUISetState()

    ; Run the GUI until the dialog is closed
    While True
        Sleep(100)
    WEnd
EndFunc   ;==>Example1
Func quit()
    Exit
EndFunc
Func test()
    MsgBox(0 , 'test' , 'Do not forget to enter in the registry key field values')    
    Switch _GUICtrlButton_GetCheck($usernameinputcheckbox)
        Case $BST_CHECKED
            If BitAnd(GUICtrlGetState($usernameinput), $GUI_DISABLE) Then GUICtrlSetState($usernameinput, $GUI_ENABLE)
        Case $BST_UNCHECKED
            If BitAnd(GUICtrlGetState($usernameinput), $GUI_ENABLE) Then GUICtrlSetState($usernameinput, $GUI_DISABLE)
    EndSwitch    
EndFunc

Edited by Xand3r

Only two things are infinite, the universe and human stupidity, and i'm not sure about the former -Alber EinsteinPractice makes perfect! but nobody's perfect so why practice at all?http://forum.ambrozie.ro

Share this post


Link to post
Share on other sites

Hi Xand3r and thanks for the reply

I tried this, and it works, except for that since the switch/case part for these buttons are not in the while statement, their functionality of being enabled and disabled via a gui checkbox does not work ... any ideas on that?

#include <GUIConstantsEx.au3>
#include <DateTimeConstants.au3>

Opt('MustDeclareVars', 1)
Opt('GUIOnEventMode' , 1)
Example1()

; example1
Func Example1()
    Local $date, $msg

    GUICreate("My GUI get date", 200, 200, 800, 200)
    $date = GUICtrlCreateDate("1953/04/25", 10, 10, 185, 20)
    GUICtrlSetOnEvent($date,"test")
    GUISetOnEvent($GUI_EVENT_CLOSE , "quit")
    GUISetState()

    ; Run the GUI until the dialog is closed
    While True
        Sleep(100)
    WEnd
EndFunc   ;==>Example1
Func quit()
    Exit
EndFunc
Func test()
    MsgBox(0 , 'test' , 'Do not forget to enter in the registry key field values')    
    Switch _GUICtrlButton_GetCheck($usernameinputcheckbox)
        Case $BST_CHECKED
            If BitAnd(GUICtrlGetState($usernameinput), $GUI_DISABLE) Then GUICtrlSetState($usernameinput, $GUI_ENABLE)
        Case $BST_UNCHECKED
            If BitAnd(GUICtrlGetState($usernameinput), $GUI_ENABLE) Then GUICtrlSetState($usernameinput, $GUI_DISABLE)
    EndSwitch    
EndFunc

Share this post


Link to post
Share on other sites

if you want to disable an input with a checkbox then you should use

guictrlsetonevent($usernameinputcheckbox , "setstate")
func setstate()
    Switch _GUICtrlButton_GetCheck($usernameinputcheckbox)
        Case $BST_CHECKED
            If BitAnd(GUICtrlGetState($usernameinput), $GUI_DISABLE) Then GUICtrlSetState($usernameinput, $GUI_ENABLE)
        Case $BST_UNCHECKED
            If BitAnd(GUICtrlGetState($usernameinput), $GUI_ENABLE) Then GUICtrlSetState($usernameinput, $GUI_DISABLE)
    EndSwitch
endfunc

Only two things are infinite, the universe and human stupidity, and i'm not sure about the former -Alber EinsteinPractice makes perfect! but nobody's perfect so why practice at all?http://forum.ambrozie.ro

Share this post


Link to post
Share on other sites

I have the functionality of the input box being enabled/disabled already working

It just does not work correctly when I take it out of my while statement and put it into a function as you suggested, and the function will not work inside of the while statement correctly.

Do you have any ideas on how to make the two work?

if you want to disable an input with a checkbox then you should use

guictrlsetonevent($usernameinputcheckbox , "setstate")
func setstate()
    Switch _GUICtrlButton_GetCheck($usernameinputcheckbox)
        Case $BST_CHECKED
            If BitAnd(GUICtrlGetState($usernameinput), $GUI_DISABLE) Then GUICtrlSetState($usernameinput, $GUI_ENABLE)
        Case $BST_UNCHECKED
            If BitAnd(GUICtrlGetState($usernameinput), $GUI_ENABLE) Then GUICtrlSetState($usernameinput, $GUI_DISABLE)
    EndSwitch
endfunc

Share this post


Link to post
Share on other sites

I'm actually not sure this is possible

The problem is that there is no default state for the combobox after a menu item is selected and it enables some buttons in this while statement.

So when you click on the menu again (before making another choice) there is no way to disable what the first selection has done, without making another selection first.

Share this post


Link to post
Share on other sites

I have the functionality of the input box being enabled/disabled already working

It just does not work correctly when I take it out of my while statement and put it into a function as you suggested, and the function will not work inside of the while statement correctly.

Do you have any ideas on how to make the two work?

please post the part of the code that you are refering to... because i think you got things messed up

for example (i saw it earlyer)

you can't use

while $var=$cond
 if GUICtrlSetOnEventoÝ÷ ÚÚºÚ"µÍÚ[H    ÌÍÝIÌÍØÛÛ[È^Y[Ê
B[[ÂÙ[oÝ÷ Ú+l¥u·¬¢g­)à)¶¬jëh×6guicreate();create the gui
guisetonevent($some_gui_event,"some_func");set gui events like close,minimize,etc...
guictrlsetonevent($control,"another_func"); this case it's guictrlsetonevent($usernameinputcheckbox , "setstate") , set the control events
guisetstate(); show the gui
while $loopcondition;do your stuff
  ;do the tool stuff
wend

Only two things are infinite, the universe and human stupidity, and i'm not sure about the former -Alber EinsteinPractice makes perfect! but nobody's perfect so why practice at all?http://forum.ambrozie.ro

Share this post


Link to post
Share on other sites

I hope this isn't too long :)

;-- Set include statements:
    #include <ButtonConstants.au3>
    #include <ComboConstants.au3>
    #include <DateTimeConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #include <GuiComboBox.au3>
    #include <EventLog.au3>
    #include <File.au3>
    #include <GuiConstants.au3>
    #Include <GuiButton.au3>




;-- Set opt statements:
    Opt("GUIOnEventMode", 1) ; Change to OnEvent mode



; - START VARIABLES


;-- Set Global Variables:
    
    Global $server = ""
    Global $sLogPath = '\\' & $server & '\D$\dma\logfiles\librarylistchange.log'
    
;-- Delete Logfile if it already exists:
    if FileExists($sLogPath) Then 
        FileOpen($sLogPath,1)
    EndIf

;-- Define GUI parameters and then Draw GUI window:
    $GUI = GUICreate("Library List Changer", 1002, 726, 1490, 168)
        $hostname = GUICtrlCreateEdit("", 168, 51, 145, 145)
            GUICtrlSetData(-1, "")
        $getcurrentLlistbutton = GUICtrlCreateButton("Get Current Library Lists", 24, 56, 91, 41, BitOR($BS_CENTER,$BS_MULTILINE))
        $updatenoworcreateschtask = GUICtrlCreateCombo('', 264, 232, 209, 50)
            GUICtrlSetData(-1, 'Make update NOW in real time|Create a scheduled task for later')
            _GUICtrlComboBox_SetEditText($updatenoworcreateschtask, "Update NOW or create a task for later?")
        $usernameinput = GUICtrlCreateEdit("", 204, 291, 105, 25, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETURN))
            GUICtrlSetData(-1, "")
            GUICtrlSetState($usernameinput, $gui_disable)
        $usernameinputcheckbox = GUICtrlCreateCheckbox("", 336, 296, 41, 17, BitOR($BS_CHECKBOX,$BS_AUTOCHECKBOX))
        GUICtrlSetState(-1, $gui_disable)
        $passwordinput = GUICtrlCreateEdit("", 204, 323, 105, 25, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETURN))
            GUICtrlSetData(-1, "")
            GUICtrlSetState($passwordinput, $gui_disable)
        $passwordinputcheckbox = GUICtrlCreateCheckbox("", 336, 328, 41, 17)
        GUICtrlSetState(-1, $gui_disable)
        $tableinput = GUICtrlCreateEdit("", 204, 355, 105, 25, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETURN))
            GUICtrlSetData(-1, "")
            GUICtrlSetState($tableinput, $gui_disable)
        $tableinputcheckbox = GUICtrlCreateCheckbox("", 336, 360, 41, 17)
        GUICtrlSetState(-1, $gui_disable)
        $sqldefaultinput = GUICtrlCreateEdit("", 204, 386, 105, 25, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETURN))
            GUICtrlSetData(-1, "")
            GUICtrlSetState(-1, $gui_disable)
        $sqldefaultcheckbox = GUICtrlCreateCheckbox("", 336, 392, 41, 17)
            GUICtrlSetState(-1, $GUI_CHECKED)
            GUICtrlSetState(-1, $gui_disable)
        $newlibrarylistinput = GUICtrlCreateEdit("", 204, 417, 105, 25, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETURN))
            GUICtrlSetData(-1, "")
            GUICtrlSetState(-1, $gui_disable)
        $newlibrarylistcheckbox = GUICtrlCreateCheckbox("", 336, 424, 41, 17)
            GUICtrlSetState(-1, $GUI_CHECKED)
            GUICtrlSetState(-1, $gui_disable)
        $updatelibrarylistbutton = GUICtrlCreateButton("Update Server Library Lists NOW", 24, 288, 91, 41, BitOR($BS_CENTER,$BS_MULTILINE))
            GUICtrlSetState($updatelibrarylistbutton, $gui_disable)
        $schtaskdate = GUICtrlCreateDate("2009/01/01 08:17:4", 520, 296, 122, 21, $DTS_Shortdateformat)
        GUICtrlSetState(-1, $gui_disable)
        $hoursdropdownboxinput = GUICtrlCreateCombo("", 720, 296, 41, 25)
            GUICtrlSetData(-1, '01|02|03|04|05|06|07|08|09|10|11|12')
            _GUICtrlComboBox_SetEditText($hoursdropdownboxinput, "HH")
            GUISetState()
            GUICtrlSetState(-1, $gui_disable)
        $minutesdropdownboxinput = GUICtrlCreateCombo("", 768, 296, 41, 25)
            GUICtrlSetData(-1, '00|05|10|15|20|25|30|35|40|45|50|55')
            _GUICtrlComboBox_SetEditText($minutesdropdownboxinput, "MM")
            GUISetState()
            GUICtrlSetState(-1, $gui_disable)
        $secondsdropdownboxinput = GUICtrlCreateCombo("", 816, 296, 41, 25)
            GUICtrlSetData(-1, '00|10|20|30|40|50')
            _GUICtrlComboBox_SetEditText($secondsdropdownboxinput, "00")
            GUISetState()
            GUICtrlSetState(-1, $gui_disable)
        $schtaskampmmenu = GUICtrlCreateCombo("", 864, 296, 81, 25)
            GUICtrlSetData(-1, "AM|PM")
            _GUICtrlComboBox_SetEditText($schtaskampmmenu, "AM or PM?")
            GUISetState()
            GUICtrlSetState(-1, $gui_disable)
        $schtaskusernameinputbox = GUICtrlCreateInput("ba\", 624, 368, 121, 21)
        GUICtrlSetState(-1, $gui_disable)
        $schtaskpasswordinputbox = GUICtrlCreateInput("", 624, 400, 121, 21, BitOR($ES_PASSWORD,$ES_AUTOHSCROLL))
        GUICtrlSetState(-1, $gui_disable)
        
        $check_notificationlaterdate = GUICtrlCreateCheckbox("Start notification on a later date", 448, 432, 185, 17)
        GUICtrlSetState(-1, $gui_disable)
        $drop_calendarnotif = GUICtrlCreateDate("2009/01/01 08:17:4", 520, 456, 122, 21,  $DTS_Shortdateformat)
        GUICtrlSetState(-1, $gui_disable)
        $drop_hournotif = GUICtrlCreateCombo("", 720, 456, 41, 25)
        GUICtrlSetData(-1, '01|02|03|04|05|06|07|08|09|10|11|12')
        _GUICtrlComboBox_SetEditText($drop_hournotif, "HH")
        GUISetState()
        GUICtrlSetState(-1, $gui_disable)
        $drop_minutesnotif = GUICtrlCreateCombo("", 768, 456, 41, 25)
        GUICtrlSetData(-1, '00|05|10|15|20|25|30|35|40|45|50|55')
        _GUICtrlComboBox_SetEditText($drop_minutesnotif, "MM")
        GUISetState()
        GUICtrlSetState(-1, $gui_disable)
        $drop_secondsnotif = GUICtrlCreateCombo("", 816, 456, 41, 25)
        GUICtrlSetData(-1, '00|10|20|30|40|50')
        _GUICtrlComboBox_SetEditText($drop_secondsnotif, "00")
        GUISetState()
        GUICtrlSetState(-1, $gui_disable)
        $drop_ampmnotif = GUICtrlCreateCombo("", 864, 456, 81, 25)
        GUICtrlSetData(-1, "AM|PM")
        _GUICtrlComboBox_SetEditText($drop_ampmnotif, "AM or PM?")
        GUISetState()
        GUICtrlSetState(-1, $gui_disable)
        $aedibemailcheckbox = GUICtrlCreateCheckbox("Email #DCS OTSO DSUSF when done?", 520, 600, 217, 17)
            GUICtrlSetState(-1, $GUI_CHECKED)
        $ccemailcheckbox = GUICtrlCreateCheckbox("CC any additional email addresses?", 520, 632, 193, 17)
        $ccemailinput = GUICtrlCreateEdit("", 732, 627, 217, 25, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETURN))
            GUICtrlSetData(-1, "")
        $currentlibrarylistinputbox = GUICtrlCreateEdit("", 364, 51, 281, 145)
            GUICtrlSetData(-1, "")
        $currentsqlsettingsinputbox = GUICtrlCreateEdit("", 690, 51, 273, 145)
            GUICtrlSetData(-1, "")
        $cancelbutton = GUICtrlCreateButton("Cancel", 24, 656, 91, 41)
        $hostnamelabel = GUICtrlCreateLabel("Enter Server  Here", 192, 24, 115, 17)
        $usernameinputlabel = GUICtrlCreateLabel("User Name", 136, 296, 57, 17)
        $passwordinputlabel = GUICtrlCreateLabel("Password", 136, 328, 50, 17)
        $tableinputlabel = GUICtrlCreateLabel("Table", 136, 360, 39, 17)
        $newlibrarylistinputlabel = GUICtrlCreateLabel("Library List", 136, 424, 54, 17)
        $currentlibrarylistlabel = GUICtrlCreateLabel("Current Server Library List Settings", 408, 24, 166, 17)
        $currentlibrarylistinputbox = GUICtrlCreateEdit("", 364, 51, 281, 145)
            GUICtrlSetData(-1, "")
        $sqldefaultinputlabel = GUICtrlCreateLabel("SQL Default", 136, 392, 62, 17)
        $currentsqlsettingsinputbox = GUICtrlCreateEdit("", 690, 51, 273, 145)
            GUICtrlSetData(-1, "")
        $currentsqlsettingslabel = GUICtrlCreateLabel("Current SQL Settings", 754, 24, 103, 17)
        $schtaskusernamelabel = GUICtrlCreateLabel("Domain\username", 520, 368, 91, 17)
        $schtaskpasswordlabel = GUICtrlCreateLabel("Password", 520, 408, 50, 17)
        $schtasktimelabel = GUICtrlCreateLabel("Enter as HH:MM:SS", 744, 272, 100, 17)
        $createtaskbutton = GUICtrlCreateButton("Create a task for later", 416, 288, 83, 41, $BS_MULTILINE)
            GUICtrlSetState($createtaskbutton, $gui_disable)
            
        $group_updatenow = GUICtrlCreateGroup("Update Now", 16, 264, 353, 225)
            GUICtrlCreateGroup("", -99, -99, 1, 1)      
        $group_schtask = GUICtrlCreateGroup("Create a scheduled task", 400, 264, 585, 225)
            GUICtrlCreateGroup("", -99, -99, 1, 1)
            
;-- Display the GUI
    GUISetState(@SW_SHOW)
        GUIctrlSetOnEvent($cancelbutton, "_cancel")
        GUICtrlSetOnEvent($getcurrentLlistbutton, "_getcurrentLlist")
        GUICtrlSetOnEvent($updatelibrarylistbutton, "_updatelibrarylist")
        GUICtrlSetOnEvent($createtaskbutton, "_createtask")
        GUICtrlSetOnEvent($createtaskbutton, "_createtask")
        GUISetOnEvent($GUI_EVENT_CLOSE, "_X")




; - END VARIABLES




While 1
    $nMsg = GUIGetMsg($GUI);-- Updated this to include your previously defined functions.
If $GUI = $GUI_EVENT_CLOSE Then Exit


;~  Switch GuiCtrlRead($updatenoworcreateschtask)
;~      Case 'Make update NOW in real time'
;~          GUICtrlSetState($updatelibrarylistbutton, $GUI_ENABLE)
;~          GUICtrlSetState($createtaskbutton, $gui_disable)
;~              Sleep(500)
;~      Case 'Create a scheduled task for later'
;~          GUICtrlSetState($createtaskbutton, $GUI_ENABLE)
;~          GUICtrlSetState($updatelibrarylistbutton, $gui_disable)
;~              Sleep(500)
;~              
;~  EndSwitch



    Switch _GUICtrlComboBox_GetEditText($updatenoworcreateschtask)
        Case "Make update NOW in real time"
            If BitAnd(GUICtrlGetState($updatelibrarylistbutton), $GUI_DISABLE) Then GUICtrlSetState($updatelibrarylistbutton, $GUI_ENABLE)
                if guictrlread($updatenoworcreateschtask) = 'Make update NOW in real time' then 
                    Switch _GUICtrlButton_GetCheck($usernameinputcheckbox)
                        Case $BST_CHECKED
                            If BitAnd(GUICtrlGetState($usernameinput), $GUI_DISABLE) Then GUICtrlSetState($usernameinput, $GUI_ENABLE)
                        Case $BST_UNCHECKED
                            If BitAnd(GUICtrlGetState($usernameinput), $GUI_ENABLE) Then GUICtrlSetState($usernameinput, $GUI_DISABLE)
                    EndSwitch   
                EndIf
                if guictrlread($updatenoworcreateschtask) = 'Make update NOW in real time' then 
                    Switch _GUICtrlButton_GetCheck($passwordinputcheckbox)
                        Case $BST_CHECKED
                            If BitAnd(GUICtrlGetState($passwordinput), $GUI_DISABLE) Then GUICtrlSetState($passwordinput, $GUI_ENABLE)
                        Case $BST_UNCHECKED
                            If BitAnd(GUICtrlGetState($passwordinput), $GUI_ENABLE) Then GUICtrlSetState($passwordinput, $GUI_DISABLE)
                    EndSwitch   
                EndIf
                if guictrlread($updatenoworcreateschtask) = 'Make update NOW in real time' then 
                    Switch _GUICtrlButton_GetCheck($tableinputcheckbox)
                        Case $BST_CHECKED
                            If BitAnd(GUICtrlGetState($tableinput), $GUI_DISABLE) Then GUICtrlSetState($tableinput, $GUI_ENABLE)
                        Case $BST_UNCHECKED
                            If BitAnd(GUICtrlGetState($tableinput), $GUI_ENABLE) Then GUICtrlSetState($tableinput, $GUI_DISABLE)
                    EndSwitch   
                EndIf                       
            If BitAnd(GUICtrlGetState($sqldefaultinput), $GUI_DISABLE) Then GUICtrlSetState($sqldefaultinput, $GUI_ENABLE)
            If BitAnd(GUICtrlGetState($newlibrarylistinput), $GUI_DISABLE) Then GUICtrlSetState($newlibrarylistinput, $GUI_ENABLE)
            If BitAnd(GUICtrlGetState($usernameinputcheckbox), $GUI_DISABLE) Then GUICtrlSetState($usernameinputcheckbox, $GUI_ENABLE)
            If BitAnd(GUICtrlGetState($passwordinputcheckbox), $GUI_DISABLE) Then GUICtrlSetState($passwordinputcheckbox, $GUI_ENABLE)
            If BitAnd(GUICtrlGetState($tableinputcheckbox), $GUI_DISABLE) Then GUICtrlSetState($tableinputcheckbox, $GUI_ENABLE)
            If BitAnd(GUICtrlGetState($sqldefaultcheckbox), $GUI_DISABLE) Then GUICtrlSetState($sqldefaultcheckbox, $GUI_ENABLE)
            If BitAnd(GUICtrlGetState($newlibrarylistcheckbox), $GUI_DISABLE) Then GUICtrlSetState($newlibrarylistcheckbox, $GUI_ENABLE)
            If BitAnd(GUICtrlGetState($createtaskbutton), $GUI_ENABLE)  Then GUICtrlSetState($createtaskbutton, $GUI_DISABLE)
            If BitAnd(GUICtrlGetState($schtaskdate), $GUI_ENABLE)  Then GUICtrlSetState($schtaskdate, $GUI_DISABLE)
            If BitAnd(GUICtrlGetState($hoursdropdownboxinput), $GUI_ENABLE)  Then GUICtrlSetState($hoursdropdownboxinput, $GUI_DISABLE)
            If BitAnd(GUICtrlGetState($minutesdropdownboxinput), $GUI_ENABLE)  Then GUICtrlSetState($minutesdropdownboxinput, $GUI_DISABLE)
            If BitAnd(GUICtrlGetState($secondsdropdownboxinput), $GUI_ENABLE)  Then GUICtrlSetState($secondsdropdownboxinput, $GUI_DISABLE)
            If BitAnd(GUICtrlGetState($schtaskusernameinputbox), $GUI_ENABLE)  Then GUICtrlSetState($schtaskusernameinputbox, $GUI_DISABLE)
            If BitAnd(GUICtrlGetState($schtaskpasswordinputbox), $GUI_ENABLE)  Then GUICtrlSetState($schtaskpasswordinputbox, $GUI_DISABLE)
            If BitAnd(GUICtrlGetState($schtaskampmmenu), $GUI_ENABLE)  Then GUICtrlSetState($schtaskampmmenu, $GUI_DISABLE)
            If BitAnd(GUICtrlGetState($check_notificationlaterdate), $GUI_ENABLE)  Then GUICtrlSetState($check_notificationlaterdate, $GUI_DISABLE)
            If BitAnd(GUICtrlGetState($drop_calendarnotif), $GUI_ENABLE)  Then GUICtrlSetState($drop_calendarnotif, $GUI_DISABLE)
            If BitAnd(GUICtrlGetState($drop_hournotif), $GUI_ENABLE)  Then GUICtrlSetState($drop_hournotif, $GUI_DISABLE)
            If BitAnd(GUICtrlGetState($drop_minutesnotif), $GUI_ENABLE)  Then GUICtrlSetState($drop_minutesnotif, $GUI_DISABLE)
            If BitAnd(GUICtrlGetState($drop_secondsnotif), $GUI_ENABLE)  Then GUICtrlSetState($drop_secondsnotif, $GUI_DISABLE)
            If BitAnd(GUICtrlGetState($drop_ampmnotif), $GUI_ENABLE)  Then GUICtrlSetState($drop_ampmnotif, $GUI_DISABLE)
;~          If BitAnd(GUICtrlGetState(), $GUI_ENABLE)  Then GUICtrlSetState(, $GUI_DISABLE)

    

    
        
        Case "Create a scheduled task for later"

            If BitAnd(GUICtrlGetState($createtaskbutton), $GUI_DISABLE) Then GUICtrlSetState($createtaskbutton, $GUI_ENABLE)
            If BitAnd(GUICtrlGetState($updatelibrarylistbutton), $GUI_ENABLE)  Then GUICtrlSetState($updatelibrarylistbutton, $GUI_DISABLE)
            If BitAnd(GUICtrlGetState($schtaskdate), $GUI_DISABLE)  Then GUICtrlSetState($schtaskdate, $GUI_ENABLE)
            If BitAnd(GUICtrlGetState($hoursdropdownboxinput), $GUI_DISABLE)  Then GUICtrlSetState($hoursdropdownboxinput, $GUI_ENABLE)
            If BitAnd(GUICtrlGetState($minutesdropdownboxinput), $GUI_DISABLE)  Then GUICtrlSetState($minutesdropdownboxinput, $GUI_ENABLE)
            If BitAnd(GUICtrlGetState($secondsdropdownboxinput), $GUI_DISABLE)  Then GUICtrlSetState($secondsdropdownboxinput, $GUI_ENABLE)
            If BitAnd(GUICtrlGetState($schtaskampmmenu), $GUI_DISABLE)  Then GUICtrlSetState($schtaskampmmenu, $GUI_ENABLE)
            If BitAnd(GUICtrlGetState($schtaskusernameinputbox), $GUI_DISABLE)  Then GUICtrlSetState($schtaskusernameinputbox, $GUI_ENABLE)
            If BitAnd(GUICtrlGetState($schtaskpasswordinputbox), $GUI_DISABLE)  Then GUICtrlSetState($schtaskpasswordinputbox, $GUI_ENABLE)
            If BitAnd(GUICtrlGetState($check_notificationlaterdate), $GUI_DISABLE)  Then GUICtrlSetState($check_notificationlaterdate, $GUI_ENABLE)
                If guictrlread($updatenoworcreateschtask) = 'Create a scheduled task for later' then
                                ;~              if guictrlread($check_notificationlaterdate) = $gui_checked Then
                    Switch _GUICtrlButton_GetCheck($check_notificationlaterdate)
                        Case $BST_CHECKED
                            If BitAnd(GUICtrlGetState($drop_calendarnotif), $GUI_DISABLE) Then GUICtrlSetState($drop_calendarnotif, $GUI_ENABLE)
                            If BitAnd(GUICtrlGetState($drop_hournotif), $GUI_DISABLE) Then GUICtrlSetState($drop_hournotif, $GUI_ENABLE)
                            If BitAnd(GUICtrlGetState($drop_minutesnotif), $GUI_DISABLE) Then GUICtrlSetState($drop_minutesnotif, $GUI_ENABLE)
                            If BitAnd(GUICtrlGetState($drop_secondsnotif), $GUI_DISABLE) Then GUICtrlSetState($drop_secondsnotif, $GUI_ENABLE)
                            If BitAnd(GUICtrlGetState($drop_ampmnotif), $GUI_DISABLE) Then GUICtrlSetState($drop_ampmnotif, $GUI_ENABLE)
                        Case $BST_UNCHECKED
                            If BitAnd(GUICtrlGetState($drop_calendarnotif), $GUI_ENABLE) Then GUICtrlSetState($drop_calendarnotif, $GUI_DISABLE)
                            If BitAnd(GUICtrlGetState($drop_hournotif), $GUI_ENABLE) Then GUICtrlSetState($drop_hournotif, $GUI_DISABLE)
                            If BitAnd(GUICtrlGetState($drop_minutesnotif), $GUI_ENABLE) Then GUICtrlSetState($drop_minutesnotif, $GUI_DISABLE)
                            If BitAnd(GUICtrlGetState($drop_secondsnotif), $GUI_ENABLE) Then GUICtrlSetState($drop_secondsnotif, $GUI_DISABLE)
                            If BitAnd(GUICtrlGetState($drop_ampmnotif), $GUI_ENABLE) Then GUICtrlSetState($drop_ampmnotif, $GUI_DISABLE)
                        EndSwitch
                        
                        
                        
                EndIf
                        

            If guictrlread($updatenoworcreateschtask) = 'Create a scheduled task for later' then 
                            Switch _GUICtrlButton_GetCheck($usernameinputcheckbox)
                                Case $BST_CHECKED
                                    If BitAnd(GUICtrlGetState($usernameinput), $GUI_DISABLE) Then GUICtrlSetState($usernameinput, $GUI_ENABLE)
                                Case $BST_UNCHECKED
                                    If BitAnd(GUICtrlGetState($usernameinput), $GUI_ENABLE) Then GUICtrlSetState($usernameinput, $GUI_DISABLE)
                            EndSwitch   
                        EndIf
                        if guictrlread($updatenoworcreateschtask) = 'Create a scheduled task for later' then 
                            Switch _GUICtrlButton_GetCheck($passwordinputcheckbox)
                                Case $BST_CHECKED
                                    If BitAnd(GUICtrlGetState($passwordinput), $GUI_DISABLE) Then GUICtrlSetState($passwordinput, $GUI_ENABLE)
                                Case $BST_UNCHECKED
                                    If BitAnd(GUICtrlGetState($passwordinput), $GUI_ENABLE) Then GUICtrlSetState($passwordinput, $GUI_DISABLE)
                            EndSwitch   
                        EndIf
                        if guictrlread($updatenoworcreateschtask) = 'Create a scheduled task for later' then 
                            Switch _GUICtrlButton_GetCheck($tableinputcheckbox)
                                Case $BST_CHECKED
                                    If BitAnd(GUICtrlGetState($tableinput), $GUI_DISABLE) Then GUICtrlSetState($tableinput, $GUI_ENABLE)
                                Case $BST_UNCHECKED
                                    If BitAnd(GUICtrlGetState($tableinput), $GUI_ENABLE) Then GUICtrlSetState($tableinput, $GUI_DISABLE)
                            EndSwitch   
                        EndIf                       
            If BitAnd(GUICtrlGetState($sqldefaultinput), $GUI_DISABLE) Then GUICtrlSetState($sqldefaultinput, $GUI_ENABLE)
            If BitAnd(GUICtrlGetState($newlibrarylistinput), $GUI_DISABLE) Then GUICtrlSetState($newlibrarylistinput, $GUI_ENABLE)
            If BitAnd(GUICtrlGetState($usernameinputcheckbox), $GUI_DISABLE) Then GUICtrlSetState($usernameinputcheckbox, $GUI_ENABLE)
            If BitAnd(GUICtrlGetState($passwordinputcheckbox), $GUI_DISABLE) Then GUICtrlSetState($passwordinputcheckbox, $GUI_ENABLE)
            If BitAnd(GUICtrlGetState($tableinputcheckbox), $GUI_DISABLE) Then GUICtrlSetState($tableinputcheckbox, $GUI_ENABLE)
            If BitAnd(GUICtrlGetState($sqldefaultcheckbox), $GUI_DISABLE) Then GUICtrlSetState($sqldefaultcheckbox, $GUI_ENABLE)
            If BitAnd(GUICtrlGetState($newlibrarylistcheckbox), $GUI_DISABLE) Then GUICtrlSetState($newlibrarylistcheckbox, $GUI_ENABLE)
                    

    EndSwitch




    Switch _GUICtrlButton_GetCheck($ccemailcheckbox)
        Case $BST_CHECKED
            If BitAnd(GUICtrlGetState($ccemailinput), $GUI_DISABLE) Then GUICtrlSetState($ccemailinput, $GUI_ENABLE)
        
        Case $BST_UNCHECKED
            If BitAnd(GUICtrlGetState($ccemailinput), $GUI_ENABLE) Then GUICtrlSetState($ccemailinput, $GUI_DISABLE)
    EndSwitch


    
        
    
WEnd

Share this post


Link to post
Share on other sites

:) are you serious ??? :P:party::idea:

i really don't have the time or the will to correct your script for you... but some pointers...

1.

$nMsg = GUIGetMsg($GUI)oÝ÷ ÚX¤ydźǬ¢g®¶²²Úv'-Ú¯*+²¶§|!z|¨ºëjëh×6GUICtrlSetOnEvent($control_id,"some_func")oÝ÷ Ú(h¥ëajÝý±©eæZ(¦ËajÚî«©ÞÙr².Û¬¹©eʯy«­¢+ÙM±À ÄÀ¤í½Èͽµ½Ñ¡ÈÙ±ÕoÝ÷ ÚÊ&{^­è§¶¦j)ۡܨ~Ø^)²§²×vÚºÚ"µÍÚ[HYBÙ×ÜÛÛYWÝÙ[Ü×ÜÝY
BÙ[

Only two things are infinite, the universe and human stupidity, and i'm not sure about the former -Alber EinsteinPractice makes perfect! but nobody's perfect so why practice at all?http://forum.ambrozie.ro

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  
Followers 0