They will either be granted some of the dates (never all) or will be declined all of the dates.
After submit I want it to display all dates that has been applied and also all dates that has been rejected. If there's more then 1 date picked I want it to add a "and" before the last date:
Below is the gui + the loop I had in mindYou have applied for date1 to date2, date3 to date4 and date5 to date6.
Declined dates: date1 to date2 and date5 to date6.
Code: Select all
#NoEnv
#Singleinstance, Force
Periods := "1"
loop, 5 ; Change based on how many Dropdownlist values should be shown
DDLCount .= A_Index "|"
TopOfScript:
Gui, KAnf:Color, AAAAAA
Gui, KAnF:Add, text, cblack section xm w200, Pick a value
Gui, KAnF:Add, DropDownList, w200 vChosenValue R4 choose1, Name|A user|Setting|Dog|Cat|Animal
Gui, KAnF:Add, text, ys cblack w250 vRedanFatt, Have the user applied before?
Gui, KAnF:Add, DropDownList, w250 vFaettErsatt R2 choose1, Applied|Application sent
Gui, KAnF:Add, text, section xm cblack w200 vKonsekvens, What's the consequence?
Gui, KAnF:Add, DropDownList, w200 vHelDelDecline gToggle R2 choose1, Total Decline|Part Decline
Gui, KAnF:Add, text, ys cblack w200, What is the applicants name?
Gui, KAnF:Add, edit, w250 vApplicantName
Gui, KAnF:add, Text, section xm cblack, How many periods (Decline):
Gui, KAnF:add, DropDownList, ys-3 gOK2 choose%Periods% vPeriods w50, %DDLCount%
loop, %Periods%
{
Gui, KAnF:add, Text, section xm cblack, Period %A_Index%:
Gui, KAnF:add, DateTime, section xm w160 vPeriodA%A_Index%
Gui, KAnF:add, text, ys+3 cblack, to
Gui, KAnF:add, DateTime, ys w160 vPeriodB%A_Index%
Gui, KAnF:add, CheckBox, ys cblack vCheckbox%A_Index%, Decline?
}
Gui, KAnF:add, dropdownlist, vJournal choose1 section xm y+15 w405, Word Journal|Send a letter|Nothing
Gui, KAnF:add, button, section xm vOK gOK default, OK
Gui, KAnF:add, button, ys, Reload
Gui, KAnF:Show,autosize, Some testing
return
KAnFGuiClose:
KAnFGuiEsc:
ExitApp
return
KAnFButtonReload:
reload
return
Toggle:
Gui, KAnF: Submit, NoHide
if (HelDelDecline = "Total Decline") {
GuiControl, KAnF: disabled, PeriodssattText
GuiControl, KAnF: disabled, Periodssatt
} else {
GuiControl, KAnF: enabled, PeriodssattText
GuiControl, KAnF: enabled, Periodssatt
}
return
OK2:
OK3:
Gui, KAnF: Submit
Gui, KAnF: destroy
Goto, TopOfScript
return
OK:
Gui, KAnF: Submit
ExitApp
Code: Select all
Periods := "4"
Checkbox1 := "1"
Checkbox2 := "0"
Checkbox3 := "1"
Checkbox4 := "0"
loop, %Periods%
{
PeriodA%A_Index% := "2018-02-1" . A_Index
PeriodB%A_Index% := "2018-02-2" . A_Index
}
loop, %Periods%
{
AllPeriods .= PeriodA%A_Index% " to " PeriodB%A_Index%
If % Checkbox%A_Index% = 1
PeriodsDecline .= PeriodA%A_Index% " to " PeriodB%A_Index%
else
PeriodsGranted .= PeriodA%A_Index% " to " PeriodB%A_Index%
}
Msgbox % AllPeriods
Msgbox % PeriodsDecline
Msgbox % PeriodsGranted