.
Hello, i have 2 questions about this Gui:
For testing i used a msgbox but it showed up only with the first checkbox checked, once!
When i uncheck the first Checkbox, and check it again, it doesn't output msgbox anymore.
1: It isn't Continue to Gosub2 & 3 or Checkbox 2 & 3 and further.
It also doesn't arrive at Gui Destroy, because the Gui stays in place.
After pressing Add(Toevoegen) button
What am i doing wrong¿
2: Is there maybe a more elegant way to put 23 checkboxes in a Gui and perform actions upon Checked? didn't come across it with several forum searches.
i did tried
Code:
GuiControlGet, CheckBox1
If CheckBox1 = 1
But it did the opposite, it output every checkbox action at once
even when it isn't checked.
Thanks!
Sample of code:
Code:
#include COM.ahk
#include iWeb.ahk
COM_CoInitialize()
Gui, +AlwaysOnTop,
Gui, Font, s13 Cwhite w40, Arial BOLD
Gui, Add, CheckBox, x5 y67 w120 h32 Checked vCheckBox1, Lastname
Gui, Add, CheckBox, x5 y97 w120 h32 Checked vCheckBox2, First name
Gui, Add, CheckBox, x5 y127 w120 h32 Checked vCheckBox3, Middlename
Gui, Add, CheckBox, x5 y157 w130 h32 Checked vCheckBox4, Initials
Gui, Add, CheckBox, x5 y187 w120 h32 Checked vCheckBox5, Email werk
Gui, Add, CheckBox, x5 y217 w120 h32 Checked vCheckBox6, Assistant
Gui, Add, CheckBox, x5 y247 w140 h32 Checked vCheckBox7, Assistant Mail
Gui, Add, CheckBox, x5 y277 w140 h32 Checked vCheckBox8, Manager
Gui, Add, CheckBox, x145 y67 w130 h32 Checked vCheckBox9, Partner Naam
Gui, Add, CheckBox, x145 y97 w120 h32 Checked vCheckBox10, Titel
Gui, Add, CheckBox, x145 y127 w120 h32 Checked vCheckBox11, Suffix
Gui, Add, CheckBox, x145 y157 w130 h32 Checked vCheckBox12, Man
Gui, Add, CheckBox, x145 y187 w120 h32 vCheckBox13, Vrouw
Gui, Add, CheckBox, x145 y217 w140 h32 Checked vCheckBox14, Telefoon Werk
Gui, Add, CheckBox, x145 y247 w140 h32 Checked vCheckBox15, Fax
Gui, Add, CheckBox, x145 y277 w140 h32 Checked vCheckBox16, Mobiel Werk
Gui, Add, CheckBox, x285 y67 w150 h32 Checked vCheckBox17, Assistant Phone
Gui, Add, CheckBox, x285 y97 w150 h32 Checked vCheckBox18, Manager Phone
Gui, Add, CheckBox, x285 y127 w120 h32 vCheckBox19, Huisadres
Gui, Add, CheckBox, x285 y157 w130 h32 Checked vCheckBox20, Home Phone
Gui, Add, CheckBox, x285 y187 w120 h32 Checked vCheckBox21, Prive mobiel
Gui, Add, CheckBox, x285 y217 w140 h32 Checked vCheckBox22, Home Fax
Gui, Add, CheckBox, x285 y247 w140 h32 Checked vCheckBox23, Prive E-mail
Gui, Add, Button, x120 y340 w130 h30 gSelect, Selecteer Alles
Gui, Add, Button, x255 y340 w130 h30 gDeselect, Selecteer Niets
Gui, Add, Button, gGuiClose default x115 y10 w280 h50 gToevoegen, Toevoegen Maar ; Means: Add!!
Gui, Show, x0 y600 h380 w555 NoActivate, Veld selectie
Gui, Color, 63769b
Return
Select: ; select all checkboxes
Loop 50
GuiControl, , CheckBox%A_Index%, 1
return
Deselect: ; deselect all checkboxes
Loop 50
GuiControl, , CheckBox%A_Index%, 0
return
Toevoegen: ; add
gui submit,nohide
if(Checkbox1=1)
{
Gosub Check1
}
if(Checkbox2=1)
{
Gosub Check2
}
if(Checkbox3=1)
{
Gosub Check3
}
return
Check1:
msgbox, Test1 Passed!
COM_init()
iweb_init()
Clipboard:=
Clipboard:=lastname
WinWait, Invoeren persoon,
IfWinNotActive, Invoeren persoon, , WinActivate, Invoeren persoon ,
WinWaitActive, Invoeren persoon,
sleep 50
pwb:=iWeb_getwin("Invoeren persoon") ; create new pointer to 'Invoeren persoon'
COM_Invoke(pwb, "document.all.item[ctl00_K_H_MA_FA_IA_achterNaamEdit].focus"),
Send, {CtrlDown}v{CtrlUp} ; Couldn't use iwebsetDomObj it bypasses internal editbox javascripts in website
COM_Release(pwb) ; It accepts only clipboard input
iweb_Term()
Com_Term()
Check2:
msgbox, Test2 Passed!
COM_init()
iweb_init()
Clipboard:=
Clipboard:=firstname
WinWait, Invoeren persoon,
IfWinNotActive, Invoeren persoon, , WinActivate, Invoeren persoon ,
WinWaitActive, Invoeren persoon,
sleep 50
pwb:=iWeb_getwin("Invoeren persoon") ; create new pointer to 'Invoeren persoon'
COM_Invoke(pwb, "document.all.item[ctl00_K_H_MA_FA_IA_roepNaamEdit].focus"),
sleep 800
Send, {CtrlDown}v{CtrlUp}
COM_Release(pwb)
iweb_Term()
Com_Term()
Check3:
msgbox, Test3 Passed!
COM_init()
iweb_init()
Clipboard:=
Clipboard:=middlename
WinWait, Invoeren persoon,
IfWinNotActive, Invoeren persoon, , WinActivate, Invoeren persoon ,
WinWaitActive, Invoeren persoon,
sleep 50
pwb:=iWeb_getwin("Invoeren persoon") ; create new pointer to 'Invoeren persoon'
COM_Invoke(pwb, "document.all.item[ctl00_K_H_MA_FA_IA_tussenvoegselsEdit].focus"),
Send, {CtrlDown}v{CtrlUp}
COM_Release(pwb)
sleep 50
iweb_Term()
Com_Term()
; and checkbox 4..23 below
GuiClose:
Gui Destroy
Com_Term()