Jump to content

Recommended Posts

  • Replies 41
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

I am getting the following results

Security Software To Remove If Any:  46test

 

$otherchkbox = GUICtrlCreateCheckbox("Other", 504, 112, 57, 17)
$Otherinputboxav = GUICtrlCreateInput("", 600, 112, 121, 21)
If GUICtrlRead($otherchkbox) = 1 Then
                $AVSelected = ($Otherinputboxav)
            EndIf

$output &= GUICtrlRead($AVtoRemove) & ' ' & $AVSelected & GUICtrlRead($Otherinputboxav)

 

Link to post
Share on other sites

If GUICtrlRead($otherchkbox) = 1 Then
                $AVSelected = GUICtrlRead($Otherinputboxav)
            EndIf

$output &= GUICtrlRead($AVtoRemove) & ' ' & $AVSelected & GUICtrlRead($Otherinputboxav)

 

Snips & Scripts


My Snips: graphCPUTemp ~ getENVvars
My Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4

Feel free to use any of my code for your own use.                                                                                                                                                           Forum FAQ

 

Link to post
Share on other sites

You're probably not using GUICtrlRead with the correct input Ctrl.

Edited by MikahS
grammar

Snips & Scripts


My Snips: graphCPUTemp ~ getENVvars
My Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4

Feel free to use any of my code for your own use.                                                                                                                                                           Forum FAQ

 

Link to post
Share on other sites

everything shows to be working fine

 

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

        case $CopyNotes


            If GUICtrlRead($SelectPC1) = 1 Then
                $PCsPurchased = 1
            ElseIf GUICtrlRead($SelectPC2) = 1 Then
                $PCsPurchased = 2
            ElseIf GUICtrlRead($SelectPC3) = 1 Then
                $PCsPurchased = 3
            EndIf

            if GUICtrlRead($Nortonckbox) = 1 Then
                $AVSelected = ('Norton Antivirus')
            EndIf
            If GUICtrlRead($Webrootckbox) = 1 Then
                $AVSelected = ('Webroot Antivirus')
            EndIf
            if GUICtrlRead($Kasperskyckbox) = 1 Then
                $AVSelected = ('Kaspersky Antivirus')
            EndIf
            If GUICtrlRead($TrendMicrockbox) = 1 Then
                $AVSelected = ('Trend Micro Antivirus')
            EndIf
            if GUICtrlRead($CaAVckbox) = 1 Then
                $AVSelected = ('CA Antivirus')
            EndIf
            If GUICtrlRead($Avirackbox) = 1 Then
                $AVSelected = ('Avrira Antivirus')
            EndIf
            if GUICtrlRead($Mcafeechkbox) = 1 Then
                $AVSelected = ('McAfee Antivirus')
            EndIf
            If GUICtrlRead($avgchkbox) = 1 Then
                $AVSelected = ('AVG Antivirus')
            EndIf
            if GUICtrlRead($Pandachkbox) = 1 Then
                $AVSelected = ('Panda Antivirus')
            EndIf
            If GUICtrlRead($Viprechkbox) = 1 Then
                $AVSelected = ('Vipre Antivirus')
            EndIf
            if GUICtrlRead($Comodochkbox) = 1 Then
                $AVSelected = ('Comodo Antivirus')
            EndIf
            If GUICtrlRead($Emisoftchkbox) = 1 Then
                $AVSelected = ('Emsisoft Antivirus')
            EndIf
            if GUICtrlRead($Avastchkbox) = 1 Then
                $AVSelected = ('Avast Antivirus')
            EndIf
            If GUICtrlRead($Esetchkbox) = 1 Then
                $AVSelected = ('Eset Antivirus')
            EndIf
            if GUICtrlRead($Sophoschkbox) = 1 Then
                $AVSelected = ('Sophos Antivirus')
            EndIf
            If GUICtrlRead($ZoneAlarmchkbox) = 1 Then
                $AVSelected = ('Zone Alarm')
            EndIf
            if GUICtrlRead($Fsecurechkbox) = 1 Then
                $AVSelected = ('F-Secure Antivirus')
            EndIf
            If GUICtrlRead($otherchkbox) = 1 Then
                $AVSelected = GUICtrlRead($Otherinputboxav)
            EndIf



                $output = GUICtrlRead($SalesAgentName) & ' ' & GUICtrlRead($InputAgentName) & @CRLF
                $output &= GUICtrlRead($CustomerFullName) & ' ' & GUICtrlRead($InputCustomerName) & @CRLF
                $output &= GUICtrlRead($CustomerEmailAdd) & ' ' & GUICtrlRead($InputCustomerEmailAdd) & @CRLF
                $output &= GUICtrlRead($PrimaryNumber) & ' ' & GUICtrlRead($InputCustomerPNumber) & @CRLF
                $output &= GUICtrlRead($SecondaryNumber) & ' ' & GUICtrlRead($InputCustomerSNumber) & @CRLF
                $output &= GUICtrlRead($PlanPurchased) & ' ' & GUICtrlRead($SelectPlan) & @CRLF
                $output &= GUICtrlRead($softwarepurchased) & GUICtrlRead($SelectSoftware) & @CRLF
                $output &= GUICtrlRead($OperatingSystem) & ' ' & GUICtrlRead($SelectOperatingSystem) & @CRLF
                $output &= GUICtrlRead($ComputersSignedUp) & ' ' & $PCsPurchased & @CRLF
                $output &= GUICtrlRead($TotalAmountPaid) & ' ' & GUICtrlRead($InputAmountPaid) & @CRLF
                $output &= GUICtrlRead($AVtoRemove) & ' ' & $AVSelected & GUICtrlRead($Otherinputboxav)


                ClipPut($output)
                ConsoleWrite(ClipGet() & @CRLF)


    EndSwitch
WEnd

 

Link to post
Share on other sites
  • Moderators

Are you just letting everyone know you're done, or did you have a further question?

One suggestion, if you want to simplify the code as you have it now, is to lose all the EndIf statements. You can do one-liner If statements like this:

if GUICtrlRead($Nortonckbox) = 1 Then $AVSelected = ('Norton Antivirus')
            If GUICtrlRead($Webrootckbox) = 1 Then $AVSelected = ('Webroot Antivirus')
            if GUICtrlRead($Kasperskyckbox) = 1 Then $AVSelected = ('Kaspersky Antivirus')
            If GUICtrlRead($TrendMicrockbox) = 1 Then $AVSelected = ('Trend Micro Antivirus')
            if GUICtrlRead($CaAVckbox) = 1 Then $AVSelected = ('CA Antivirus')
            If GUICtrlRead($Avirackbox) = 1 Then $AVSelected = ('Avrira Antivirus')
            if GUICtrlRead($Mcafeechkbox) = 1 Then $AVSelected = ('McAfee Antivirus')
            If GUICtrlRead($avgchkbox) = 1 Then $AVSelected = ('AVG Antivirus')
            if GUICtrlRead($Pandachkbox) = 1 Then $AVSelected = ('Panda Antivirus')
            If GUICtrlRead($Viprechkbox) = 1 Then $AVSelected = ('Vipre Antivirus')
            if GUICtrlRead($Comodochkbox) = 1 Then $AVSelected = ('Comodo Antivirus')
            If GUICtrlRead($Emisoftchkbox) = 1 Then $AVSelected = ('Emsisoft Antivirus')
            if GUICtrlRead($Avastchkbox) = 1 Then $AVSelected = ('Avast Antivirus')
            If GUICtrlRead($Esetchkbox) = 1 Then $AVSelected = ('Eset Antivirus')
            if GUICtrlRead($Sophoschkbox) = 1 Then $AVSelected = ('Sophos Antivirus')
            If GUICtrlRead($ZoneAlarmchkbox) = 1 Then $AVSelected = ('Zone Alarm')
            if GUICtrlRead($Fsecurechkbox) = 1 Then $AVSelected = ('F-Secure Antivirus')
            If GUICtrlRead($otherchkbox) = 1 Then $AVSelected = GUICtrlRead($Otherinputboxav)

There are other ways to simplify your code, such as turning all these check boxes into a listview. But without seeing the final product in whole it is difficult to offer suggestions.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to post
Share on other sites

No i am having problem with one thing

i want to be able to select the check box that says other to be able to type in the input box for something that is not listed

but when i run the code everything works but the results i get is

"Security Software To Remove If Any:  testtest"

i could be writing that portion of the code all wrong but i'm not to sure, this is the only section, or if i should just have only the input box and get rid of the check box for other

Link to post
Share on other sites
  • Moderators

Can you post the total code as you have it now? I know you've been through several iterations.

 

Edit: And, would you expect the user/tech to only be selecting one check box under AV, or could you see the possibility of them selecting multiple at any time?

Edited by JLogan3o13

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to post
Share on other sites

Well for under AV yes I would be expecting them at times to maybe selecting more then one but it may be rare

and this is the full code as I have it right now, beginning to end

 

#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=c:\users\vince s\documents\form2.kxf
$Form2 = GUICreate("Form1", 820, 738, 437, 148)
$SalesAgentName = GUICtrlCreateLabel("Sales Agent Name", 56, 8, 124, 21)
GUICtrlSetFont(-1, 11, 800, 0, "Times New Roman")
$InputAgentName = GUICtrlCreateInput("", 8, 32, 249, 21)
$CustomerFullName = GUICtrlCreateLabel("Customer Full Name", 48, 64, 140, 21)
GUICtrlSetFont(-1, 11, 800, 0, "Times New Roman")
$InputCustomerName = GUICtrlCreateInput("", 8, 88, 249, 21)
$CustomerEmailAdd = GUICtrlCreateLabel("Customer E-Mail Address", 32, 120, 177, 21)
GUICtrlSetFont(-1, 11, 800, 0, "Times New Roman")
$InputCustomerEmailAdd = GUICtrlCreateInput("", 8, 144, 249, 21)
$CustomerNumber = GUICtrlCreateLabel("Customer Phone Number", 48, 176, 171, 21)
GUICtrlSetFont(-1, 11, 800, 0, "Times New Roman")
$PrimaryNumber = GUICtrlCreateLabel("Primary", 48, 208, 38, 17)
$SecondaryNumber = GUICtrlCreateLabel("Secondary", 168, 208, 55, 17)
$InputCustomerPNumber = GUICtrlCreateInput("", 8, 224, 121, 21)
$InputCustomerSNumber = GUICtrlCreateInput("", 136, 224, 121, 21)
$PlanPurchased = GUICtrlCreateLabel("Plan Purchased", 80, 256, 104, 21)
GUICtrlSetFont(-1, 11, 800, 0, "Times New Roman")
$SelectPlan = GUICtrlCreateCombo("", 8, 280, 249, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "1 Year Repair Service|1 Time Repair Service|Six Month Repair Service|Software Install Only")
$softwarepurchased = GUICtrlCreateLabel("Software Purchased", 72, 312, 132, 21)
GUICtrlSetFont(-1, 11, 800, 0, "Times New Roman")
$SelectSoftware = GUICtrlCreateCombo("", 8, 336, 249, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "Life Time Stopzilla|1 Year Stopzilla |No AV Purchased")
$OperatingSystem = GUICtrlCreateLabel("Operating System", 80, 368, 121, 21)
GUICtrlSetFont(-1, 11, 800, 0, "Times New Roman")
$SelectOperatingSystem = GUICtrlCreateCombo("", 8, 392, 249, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "Windows|MAC")
$ComputersSignedUp = GUICtrlCreateLabel("Computers Signed Up", 64, 424, 148, 21)
GUICtrlSetFont(-1, 11, 800, 0, "Times New Roman")
$TotalAmountPaid = GUICtrlCreateLabel("Total Amount Paid", 80, 488, 126, 21)
GUICtrlSetFont(-1, 11, 800, 0, "Times New Roman")
$InputAmountPaid = GUICtrlCreateInput("$", 80, 520, 121, 21)
$CopyNotes = GUICtrlCreateButton("Copy Notes", 8, 560, 91, 25)
$SelectPC1 = GUICtrlCreateRadio("1 PC", 48, 456, 49, 17)
$SelectPC2 = GUICtrlCreateRadio("2 PC", 120, 456, 49, 17)
$SelectPC3 = GUICtrlCreateRadio("3 PC", 184, 456, 49, 17)
$AVtoRemove = GUICtrlCreateLabel("Security Software To Remove If Any: ", 400, 8, 254, 21)
GUICtrlSetFont(-1, 11, 800, 0, "Times New Roman")
$Nortonckbox = GUICtrlCreateCheckbox("Norton", 288, 32, 65, 17)
$Webrootckbox = GUICtrlCreateCheckbox("Webroot", 288, 48, 65, 17)
$Kasperskyckbox = GUICtrlCreateCheckbox("Kaspersky", 288, 64, 81, 17)
$TrendMicrockbox = GUICtrlCreateCheckbox("Trend Micro", 288, 80, 81, 17)
$CaAVckbox = GUICtrlCreateCheckbox("CA Antivirus", 288, 96, 81, 17)
$Avirackbox = GUICtrlCreateCheckbox("Avrira", 288, 112, 57, 17)
$Mcafeechkbox = GUICtrlCreateCheckbox("McAfee", 400, 32, 65, 17)
$avgchkbox = GUICtrlCreateCheckbox("AVG", 400, 48, 97, 17)
$Pandachkbox = GUICtrlCreateCheckbox("Panda", 400, 64, 97, 17)
$Viprechkbox = GUICtrlCreateCheckbox("Vipre", 400, 80, 97, 17)
$Comodochkbox = GUICtrlCreateCheckbox("Comodo", 400, 96, 73, 17)
$Emisoftchkbox = GUICtrlCreateCheckbox("Emsisoft", 400, 112, 97, 17)
$Avastchkbox = GUICtrlCreateCheckbox("Avast", 504, 32, 97, 17)
$Esetchkbox = GUICtrlCreateCheckbox("Eset", 504, 48, 97, 17)
$Sophoschkbox = GUICtrlCreateCheckbox("Sophos", 504, 64, 97, 17)
$ZoneAlarmchkbox = GUICtrlCreateCheckbox("Zone Alarm", 504, 80, 97, 17)
$Fsecurechkbox = GUICtrlCreateCheckbox("F-Secure", 504, 96, 97, 17)
$otherchkbox = GUICtrlCreateCheckbox("Other", 504, 112, 57, 17)
$Otherinputboxav = GUICtrlCreateInput("", 600, 112, 121, 21)
$desiredhomepage = GUICtrlCreateLabel("Desired Home Page", 408, 160, 136, 21)
GUICtrlSetFont(-1, 11, 800, 0, "Times New Roman")
$googlechkbox = GUICtrlCreateCheckbox("Google.com", 288, 184, 97, 17)
$yahoochkbox = GUICtrlCreateCheckbox("Yahoo.com", 392, 184, 97, 17)
$bingchkbox = GUICtrlCreateCheckbox("Bing.com", 512, 184, 97, 17)
$aolchkbox = GUICtrlCreateCheckbox("Aol.com", 288, 208, 97, 17)
$msnchkbox = GUICtrlCreateCheckbox("MSN.com", 392, 208, 97, 17)
$otherchkbox2 = GUICtrlCreateCheckbox("Other", 512, 208, 81, 17)
$otherinput2browser = GUICtrlCreateInput("", 600, 208, 121, 21)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

        case $CopyNotes


            If GUICtrlRead($SelectPC1) = 1 Then
                $PCsPurchased = 1
            ElseIf GUICtrlRead($SelectPC2) = 1 Then
                $PCsPurchased = 2
            ElseIf GUICtrlRead($SelectPC3) = 1 Then
                $PCsPurchased = 3
            EndIf

            if GUICtrlRead($Nortonckbox) = 1 Then
                $AVSelected = ('Norton Antivirus')
            EndIf
            If GUICtrlRead($Webrootckbox) = 1 Then
                $AVSelected = ('Webroot Antivirus')
            EndIf
            if GUICtrlRead($Kasperskyckbox) = 1 Then
                $AVSelected = ('Kaspersky Antivirus')
            EndIf
            If GUICtrlRead($TrendMicrockbox) = 1 Then
                $AVSelected = ('Trend Micro Antivirus')
            EndIf
            if GUICtrlRead($CaAVckbox) = 1 Then
                $AVSelected = ('CA Antivirus')
            EndIf
            If GUICtrlRead($Avirackbox) = 1 Then
                $AVSelected = ('Avrira Antivirus')
            EndIf
            if GUICtrlRead($Mcafeechkbox) = 1 Then
                $AVSelected = ('McAfee Antivirus')
            EndIf
            If GUICtrlRead($avgchkbox) = 1 Then
                $AVSelected = ('AVG Antivirus')
            EndIf
            if GUICtrlRead($Pandachkbox) = 1 Then
                $AVSelected = ('Panda Antivirus')
            EndIf
            If GUICtrlRead($Viprechkbox) = 1 Then
                $AVSelected = ('Vipre Antivirus')
            EndIf
            if GUICtrlRead($Comodochkbox) = 1 Then
                $AVSelected = ('Comodo Antivirus')
            EndIf
            If GUICtrlRead($Emisoftchkbox) = 1 Then
                $AVSelected = ('Emsisoft Antivirus')
            EndIf
            if GUICtrlRead($Avastchkbox) = 1 Then
                $AVSelected = ('Avast Antivirus')
            EndIf
            If GUICtrlRead($Esetchkbox) = 1 Then
                $AVSelected = ('Eset Antivirus')
            EndIf
            if GUICtrlRead($Sophoschkbox) = 1 Then
                $AVSelected = ('Sophos Antivirus')
            EndIf
            If GUICtrlRead($ZoneAlarmchkbox) = 1 Then
                $AVSelected = ('Zone Alarm')
            EndIf
            if GUICtrlRead($Fsecurechkbox) = 1 Then
                $AVSelected = ('F-Secure Antivirus')
            EndIf
            if GUICtrlRead($otherchkbox) = 1 Then
                $AVSelected = $Otherinputboxav
            EndIf




                $output = GUICtrlRead($SalesAgentName) & ' ' & GUICtrlRead($InputAgentName) & @CRLF
                $output &= GUICtrlRead($CustomerFullName) & ' ' & GUICtrlRead($InputCustomerName) & @CRLF
                $output &= GUICtrlRead($CustomerEmailAdd) & ' ' & GUICtrlRead($InputCustomerEmailAdd) & @CRLF
                $output &= GUICtrlRead($PrimaryNumber) & ' ' & GUICtrlRead($InputCustomerPNumber) & @CRLF
                $output &= GUICtrlRead($SecondaryNumber) & ' ' & GUICtrlRead($InputCustomerSNumber) & @CRLF
                $output &= GUICtrlRead($PlanPurchased) & ' ' & GUICtrlRead($SelectPlan) & @CRLF
                $output &= GUICtrlRead($softwarepurchased) & GUICtrlRead($SelectSoftware) & @CRLF
                $output &= GUICtrlRead($OperatingSystem) & ' ' & GUICtrlRead($SelectOperatingSystem) & @CRLF
                $output &= GUICtrlRead($ComputersSignedUp) & ' ' & $PCsPurchased & @CRLF
                $output &= GUICtrlRead($AVtoRemove) & ' ' & $AVSelected & GUICtrlRead($Otherinputboxav) & @CRLF
                $output &= GUICtrlRead($TotalAmountPaid) & ' ' & GUICtrlRead($InputAmountPaid)



                ClipPut($output)
                ConsoleWrite(ClipGet() & @CRLF)


    EndSwitch
WEnd

 

Link to post
Share on other sites
  • Moderators

The issue looks to be your last guictrlread statement, you're saying if $otherchkbox is checked, AVSelected = $Otherinputboxav, rather than GUICtrlRead($Otherinputboxav). So at this point, AVSelected = 22 (The Control ID) Then in your $output stream, you are adding the value of AVSelected (22) plus GUICtrlRead($Otherinputboxav), whatever you typed. So if I type "MyAV" in that input box, I get 22MyAV as the output.

I would suggest doing it like this (I also grouped your various controls together for readability, and removed the unnecessary EndIf statements:

#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

$Form2 = GUICreate("Form1", 820, 738, 437, 148)
    GUISetFont(11, 800, Default, "Times New Roman")

#Region Labels===========================================================================
$SalesAgentName = GUICtrlCreateLabel("Sales Agent Name", 56, 8, 124, 21)
$CustomerFullName = GUICtrlCreateLabel("Customer Full Name", 48, 64, 140, 21)
$CustomerEmailAdd = GUICtrlCreateLabel("Customer E-Mail Address", 32, 120, 177, 21)
$CustomerNumber = GUICtrlCreateLabel("Customer Phone Number", 48, 176, 171, 21)
$PrimaryNumber = GUICtrlCreateLabel("Primary", 48, 208, 38, 17)
$SecondaryNumber = GUICtrlCreateLabel("Secondary", 168, 208, 55, 17)
$PlanPurchased = GUICtrlCreateLabel("Plan Purchased", 80, 256, 104, 21)
$softwarepurchased = GUICtrlCreateLabel("Software Purchased", 72, 312, 132, 21)
$OperatingSystem = GUICtrlCreateLabel("Operating System", 80, 368, 121, 21)
$ComputersSignedUp = GUICtrlCreateLabel("Computers Signed Up", 64, 424, 148, 21)
$TotalAmountPaid = GUICtrlCreateLabel("Total Amount Paid", 80, 488, 126, 21)
$desiredhomepage = GUICtrlCreateLabel("Desired Home Page", 408, 160, 136, 21)
$AVtoRemove = GUICtrlCreateLabel("Security Software To Remove If Any: ", 400, 8, 254, 21)
#EndRegion===============================================================================

#Region Inputs===========================================================================
$InputAgentName = GUICtrlCreateInput("", 8, 32, 249, 21)
$InputCustomerName = GUICtrlCreateInput("", 8, 88, 249, 21)
$InputCustomerEmailAdd = GUICtrlCreateInput("", 8, 144, 249, 21)
$InputCustomerPNumber = GUICtrlCreateInput("", 8, 224, 121, 21)
$InputCustomerSNumber = GUICtrlCreateInput("", 136, 224, 121, 21)
$InputAmountPaid = GUICtrlCreateInput("$", 80, 520, 121, 21)
$Otherinputboxav = GUICtrlCreateInput("", 600, 112, 121, 21)
$otherinput2browser = GUICtrlCreateInput("", 600, 208, 121, 21)
#EndRegion===============================================================================

#Region ComboBoxes=======================================================================
$SelectPlan = GUICtrlCreateCombo("", 8, 280, 249, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
    GUICtrlSetData(-1, "1 Year Repair Service|1 Time Repair Service|Six Month Repair Service|Software Install Only")
$SelectSoftware = GUICtrlCreateCombo("", 8, 336, 249, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
    GUICtrlSetData(-1, "Life Time Stopzilla|1 Year Stopzilla |No AV Purchased")
$SelectOperatingSystem = GUICtrlCreateCombo("", 8, 392, 249, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
    GUICtrlSetData(-1, "Windows|MAC")
#EndRegion===============================================================================

#Region CheckBoxes=======================================================================
$Nortonckbox = GUICtrlCreateCheckbox("Norton", 288, 32, 65, 17)
$Webrootckbox = GUICtrlCreateCheckbox("Webroot", 288, 48, 65, 17)
$Kasperskyckbox = GUICtrlCreateCheckbox("Kaspersky", 288, 64, 81, 17)
$TrendMicrockbox = GUICtrlCreateCheckbox("Trend Micro", 288, 80, 81, 17)
$CaAVckbox = GUICtrlCreateCheckbox("CA Antivirus", 288, 96, 81, 17)
$Avirackbox = GUICtrlCreateCheckbox("Avrira", 288, 112, 57, 17)
$Mcafeechkbox = GUICtrlCreateCheckbox("McAfee", 400, 32, 65, 17)
$avgchkbox = GUICtrlCreateCheckbox("AVG", 400, 48, 97, 17)
$Pandachkbox = GUICtrlCreateCheckbox("Panda", 400, 64, 97, 17)
$Viprechkbox = GUICtrlCreateCheckbox("Vipre", 400, 80, 97, 17)
$Comodochkbox = GUICtrlCreateCheckbox("Comodo", 400, 96, 73, 17)
$Emisoftchkbox = GUICtrlCreateCheckbox("Emsisoft", 400, 112, 97, 17)
$Avastchkbox = GUICtrlCreateCheckbox("Avast", 504, 32, 97, 17)
$Esetchkbox = GUICtrlCreateCheckbox("Eset", 504, 48, 97, 17)
$Sophoschkbox = GUICtrlCreateCheckbox("Sophos", 504, 64, 97, 17)
$ZoneAlarmchkbox = GUICtrlCreateCheckbox("Zone Alarm", 504, 80, 97, 17)
$Fsecurechkbox = GUICtrlCreateCheckbox("F-Secure", 504, 96, 97, 17)
$otherchkbox = GUICtrlCreateCheckbox("Other", 504, 112, 57, 17)
$googlechkbox = GUICtrlCreateCheckbox("Google.com", 288, 184, 97, 17)
$yahoochkbox = GUICtrlCreateCheckbox("Yahoo.com", 392, 184, 97, 17)
$bingchkbox = GUICtrlCreateCheckbox("Bing.com", 512, 184, 97, 17)
$aolchkbox = GUICtrlCreateCheckbox("Aol.com", 288, 208, 97, 17)
$msnchkbox = GUICtrlCreateCheckbox("MSN.com", 392, 208, 97, 17)
$otherchkbox2 = GUICtrlCreateCheckbox("Other", 512, 208, 81, 17)
#EndRegion===============================================================================

#Region RadioButtons=====================================================================
$SelectPC1 = GUICtrlCreateRadio("1 PC", 48, 456, 49, 17)
$SelectPC2 = GUICtrlCreateRadio("2 PC", 120, 456, 49, 17)
$SelectPC3 = GUICtrlCreateRadio("3 PC", 184, 456, 49, 17)
#EndRegion===============================================================================

$CopyNotes = GUICtrlCreateButton("Copy Notes", 8, 560, 91, 25)
GUISetState(@SW_SHOW)


While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        case $CopyNotes
            If GUICtrlRead($SelectPC1) = 1 Then
                $PCsPurchased = 1
            ElseIf GUICtrlRead($SelectPC2) = 1 Then
                $PCsPurchased = 2
            ElseIf GUICtrlRead($SelectPC3) = 1 Then
                $PCsPurchased = 3
            EndIf

            if GUICtrlRead($Nortonckbox) = 1 Then $AVSelected = ('Norton Antivirus')
            If GUICtrlRead($Webrootckbox) = 1 Then $AVSelected = ('Webroot Antivirus')
            if GUICtrlRead($Kasperskyckbox) = 1 Then $AVSelected = ('Kaspersky Antivirus')
            If GUICtrlRead($TrendMicrockbox) = 1 Then $AVSelected = ('Trend Micro Antivirus')
            if GUICtrlRead($CaAVckbox) = 1 Then $AVSelected = ('CA Antivirus')
            If GUICtrlRead($Avirackbox) = 1 Then $AVSelected = ('Avrira Antivirus')
            if GUICtrlRead($Mcafeechkbox) = 1 Then $AVSelected = ('McAfee Antivirus')
            If GUICtrlRead($avgchkbox) = 1 Then $AVSelected = ('AVG Antivirus')
            if GUICtrlRead($Pandachkbox) = 1 Then $AVSelected = ('Panda Antivirus')
            If GUICtrlRead($Viprechkbox) = 1 Then $AVSelected = ('Vipre Antivirus')
            if GUICtrlRead($Comodochkbox) = 1 Then $AVSelected = ('Comodo Antivirus')
            If GUICtrlRead($Emisoftchkbox) = 1 Then $AVSelected = ('Emsisoft Antivirus')
            if GUICtrlRead($Avastchkbox) = 1 Then $AVSelected = ('Avast Antivirus')
            If GUICtrlRead($Esetchkbox) = 1 Then $AVSelected = ('Eset Antivirus')
            if GUICtrlRead($Sophoschkbox) = 1 Then $AVSelected = ('Sophos Antivirus')
            If GUICtrlRead($ZoneAlarmchkbox) = 1 Then $AVSelected = ('Zone Alarm')
            if GUICtrlRead($Fsecurechkbox) = 1 Then $AVSelected = ('F-Secure Antivirus')
            if GUICtrlRead($otherchkbox) = 1 Then $AVSelected = GUICtrlRead($Otherinputboxav)

                $output = GUICtrlRead($SalesAgentName) & ' ' & GUICtrlRead($InputAgentName) & @CRLF
                $output &= GUICtrlRead($CustomerFullName) & ' ' & GUICtrlRead($InputCustomerName) & @CRLF
                $output &= GUICtrlRead($CustomerEmailAdd) & ' ' & GUICtrlRead($InputCustomerEmailAdd) & @CRLF
                $output &= GUICtrlRead($PrimaryNumber) & ' ' & GUICtrlRead($InputCustomerPNumber) & @CRLF
                $output &= GUICtrlRead($SecondaryNumber) & ' ' & GUICtrlRead($InputCustomerSNumber) & @CRLF
                $output &= GUICtrlRead($PlanPurchased) & ' ' & GUICtrlRead($SelectPlan) & @CRLF
                $output &= GUICtrlRead($softwarepurchased) & GUICtrlRead($SelectSoftware) & @CRLF
                $output &= GUICtrlRead($OperatingSystem) & ' ' & GUICtrlRead($SelectOperatingSystem) & @CRLF
                $output &= GUICtrlRead($ComputersSignedUp) & ' ' & $PCsPurchased & @CRLF
                $output &= GUICtrlRead($AVtoRemove) & ' ' & $AVSelected & @CRLF
                $output &= GUICtrlRead($TotalAmountPaid) & ' ' & GUICtrlRead($InputAmountPaid)

                ClipPut($output)
                ConsoleWrite(ClipGet() & @CRLF)
    EndSwitch
WEnd

So with these options:

MyOptions.thumb.png.2a4bae675abf9d7d9bef

I get this output:

Sales Agent Name John Smith
Customer Full Name Jane Doe
Customer E-Mail Address Jane.Doe@AOL.com
Primary 5172221212
Secondary 5175686135
Plan Purchased 1 Year Repair Service
Software PurchasedLife Time Stopzilla
Operating System Windows
Computers Signed Up 1
Security Software To Remove If Any:  My AntiVirus
Total Amount Paid $1500

Which Looks closer to what you are expecting

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to post
Share on other sites

Thank you very much i appeared to have just one little extra code in the output that was causing the double information

i have two more questions if you don't mind my asking

if i wanted to create a second button that says "new customer" and have it basically reset all the fields to blank can that be done?

and is there a way that after the information is copied

Sales Agent Name John Smith
Customer Full Name Jane Doe
Customer E-Mail Address Jane.Doe@AOL.com
Primary 5172221212
Secondary 5175686135
Plan Purchased 1 Year Repair Service
Software PurchasedLife Time Stopzilla
Operating System Windows
Computers Signed Up 1
Security Software To Remove If Any:  My AntiVirus
Total Amount Paid $1500

can i have it put like a line of "***********************************************" under the total amount paid?

Link to post
Share on other sites
  • Moderators

Yes, just create your new button the same as you did your current one, and place it where you want. Then add a case statement like so:

 

Case $NewCustomer
            ;Loop through all inputs and set them to blank with GUICtrlSetData

You would have to create a series of actions like so:

GUICtrlSetData($InputAgentName, "")
GUICtrlSetData($InputCustomerName, "")

;etc. etc. etc.

For the line at the end, just append your $output stream. After the Guictrlread($inputAmountPaid) put $ouput &= "***********************************"

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to post
Share on other sites
  • Moderators

BTW, the reason I asked before whether you would expect more than one AV to be on a machine is because it would simplify your code tremendously (by some 60 lines from your last posted code above) if you switched from all those checkboxes to a couple of ListViews. See this as an example. Just something to think about as you work on your project.

#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
 #include <GuiListView.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

$Form2 = GUICreate("Form1", 820, 738, 437, 148)
    GUISetFont(11, 800, Default, "Times New Roman")

#Region Labels===========================================================================
$SalesAgentName = GUICtrlCreateLabel("Sales Agent Name", 56, 8, 124, 21)
$CustomerFullName = GUICtrlCreateLabel("Customer Full Name", 48, 64, 140, 21)
$CustomerEmailAdd = GUICtrlCreateLabel("Customer E-Mail Address", 32, 120, 177, 21)
$CustomerNumber = GUICtrlCreateLabel("Customer Phone Number", 48, 176, 171, 21)
$PrimaryNumber = GUICtrlCreateLabel("Primary", 48, 208, 38, 17)
$SecondaryNumber = GUICtrlCreateLabel("Secondary", 168, 208, 55, 17)
$PlanPurchased = GUICtrlCreateLabel("Plan Purchased", 80, 256, 104, 21)
$softwarepurchased = GUICtrlCreateLabel("Software Purchased", 72, 312, 132, 21)
$OperatingSystem = GUICtrlCreateLabel("Operating System", 80, 368, 121, 21)
$ComputersSignedUp = GUICtrlCreateLabel("Computers Signed Up", 64, 424, 148, 21)
$TotalAmountPaid = GUICtrlCreateLabel("Total Amount Paid", 80, 488, 126, 21)
$desiredhomepage = GUICtrlCreateLabel("Desired Home Page", 530, 470, 136, 21)
$AVtoRemove = GUICtrlCreateLabel("Other AV Software", 530, 235, 254, 21)
#EndRegion===============================================================================

#Region Inputs===========================================================================
$InputAgentName = GUICtrlCreateInput("", 8, 32, 249, 21)
$InputCustomerName = GUICtrlCreateInput("", 8, 88, 249, 21)
$InputCustomerEmailAdd = GUICtrlCreateInput("", 8, 144, 249, 21)
$InputCustomerPNumber = GUICtrlCreateInput("", 8, 224, 121, 21)
$InputCustomerSNumber = GUICtrlCreateInput("", 136, 224, 121, 21)
$InputAmountPaid = GUICtrlCreateInput("$", 80, 520, 121, 21)
$Otherinputboxav = GUICtrlCreateInput("", 500, 255, 175, 25)
$otherinput2browser = GUICtrlCreateInput("", 500, 490, 175, 25)
#EndRegion===============================================================================

#Region ComboBoxes=======================================================================
$SelectPlan = GUICtrlCreateCombo("", 8, 280, 249, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
    GUICtrlSetData(-1, "1 Year Repair Service|1 Time Repair Service|Six Month Repair Service|Software Install Only")
$SelectSoftware = GUICtrlCreateCombo("", 8, 336, 249, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
    GUICtrlSetData(-1, "Life Time Stopzilla|1 Year Stopzilla |No AV Purchased")
$SelectOperatingSystem = GUICtrlCreateCombo("", 8, 392, 249, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
    GUICtrlSetData(-1, "Windows|MAC")
#EndRegion===============================================================================

#Region CheckBoxes=======================================================================
Local $aAV[] = ["Norton", "Webroot", "Kaspersky", "Trend Micro", "CA Antivirus", "Avrira", "McAfee", "AVG", "Panda", "Vipre", "Comodo", _
                "Emsisoft", "Avast", "Eset", "Sophos", "Zone Alarm", "F-Secure", "Other"]
$sListView1 = GUICtrlCreateListView("Select an AntiVirus", 288, 32, 199, 250)
    _GUICtrlListView_SetColumnWidth($sListView1, 0, 179)
    For $element In $aAV
        GUICtrlCreateListViewItem($element, $sListView1)
    Next

Local $aHomePage[] = ["Google", "Yahoo", "Bing", "Aol", "MSN", "Other"]

$sListView2 = GUICtrlCreateListView("Select a Home Page", 288, 300, 200, 217)
    _GUICtrlListView_SetColumnWidth($sListView2, 0, 196)
    For $element In $aHomePage
        GUICtrlCreateListViewItem($element, $sListView2)
    Next
#EndRegion===============================================================================

#Region RadioButtons=====================================================================
$SelectPC1 = GUICtrlCreateRadio("1 PC", 48, 456, 49, 17)
$SelectPC2 = GUICtrlCreateRadio("2 PC", 120, 456, 49, 17)
$SelectPC3 = GUICtrlCreateRadio("3 PC", 184, 456, 49, 17)
#EndRegion===============================================================================

$CopyNotes = GUICtrlCreateButton("Copy Notes", 8, 560, 91, 25)
GUISetState(@SW_SHOW)


While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        case $CopyNotes
            If GUICtrlRead($SelectPC1) = 1 Then
                $PCsPurchased = 1
            ElseIf GUICtrlRead($SelectPC2) = 1 Then
                $PCsPurchased = 2
            ElseIf GUICtrlRead($SelectPC3) = 1 Then
                $PCsPurchased = 3
            EndIf
        $sAV = _GUICtrlListView_GetItemTextString($sListView1, -1)
        $AVSelected = ($sAV = "Other") ? GUICtrlRead($Otherinputboxav) : $sAV

        $sHomePg = _GUICtrlListView_GetItemTextString($sListView2, -1)
        $HomePageSelected = ($sHomePg = "Other") ? GUICtrlRead($otherinput2browser) : $aHomePage

        $output = GUICtrlRead($SalesAgentName) & ' ' & GUICtrlRead($InputAgentName) & @CRLF
        $output &= GUICtrlRead($CustomerFullName) & ' ' & GUICtrlRead($InputCustomerName) & @CRLF
        $output &= GUICtrlRead($CustomerEmailAdd) & ' ' & GUICtrlRead($InputCustomerEmailAdd) & @CRLF
        $output &= GUICtrlRead($PrimaryNumber) & ' ' & GUICtrlRead($InputCustomerPNumber) & @CRLF
        $output &= GUICtrlRead($SecondaryNumber) & ' ' & GUICtrlRead($InputCustomerSNumber) & @CRLF
        $output &= GUICtrlRead($PlanPurchased) & ' ' & GUICtrlRead($SelectPlan) & @CRLF
        $output &= GUICtrlRead($softwarepurchased) & GUICtrlRead($SelectSoftware) & @CRLF
        $output &= GUICtrlRead($OperatingSystem) & ' ' & GUICtrlRead($SelectOperatingSystem) & @CRLF
        $output &= GUICtrlRead($ComputersSignedUp) & ' ' & $PCsPurchased & @CRLF
        $output &= GUICtrlRead($AVtoRemove) & ' ' & $AVSelected & @CRLF
        $output &= $HomePageSelected & @CRLF
        $output &= GUICtrlRead($TotalAmountPaid) & ' ' & GUICtrlRead($InputAmountPaid)

        ClipPut($output)
        ConsoleWrite(ClipGet() & @CRLF)
    EndSwitch
WEnd

 

Edited by JLogan3o13

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to post
Share on other sites

Okay guys i need a little bit more assistance if you all can help, and thank you again so far for all the support

i added two more radio buttons however they don't seem to be running correctly not sure if i did the if and elseif statements correct for them.

the below is the full coding that i have, the ones i am referenceing to is "did you get permission to remove AV" "yes or No" radio button

 

#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=c:\users\vince s\documents\form2.kxf
$Form2 = GUICreate("Form1", 820, 608, 971, 114)
    GUISetBkColor(0xC0C0C0)

#Region Lables====================================================================
$SalesAgentName = GUICtrlCreateLabel("Sales Agent Name: ", 8, 8, 245, 21, $SS_CENTER)
GUICtrlSetFont(-1, 11, 800, 0, "Times New Roman")
$CustomerFullName = GUICtrlCreateLabel("Customer Full Name: ", 8, 64, 245, 21, $SS_CENTER)
GUICtrlSetFont(-1, 11, 800, 0, "Times New Roman")
$CustomerEmailAdd = GUICtrlCreateLabel("Customer E-Mail Address: ", 8, 120, 250, 21, $SS_CENTER)
GUICtrlSetFont(-1, 11, 800, 0, "Times New Roman")
$CustomerNumber = GUICtrlCreateLabel("Customer Phone Number: ", 8, 176, 252, 21, $SS_CENTER)
GUICtrlSetFont(-1, 11, 800, 0, "Times New Roman")
$PrimaryNumber = GUICtrlCreateLabel("Primary: ", 48, 208, 44, 17)
$SecondaryNumber = GUICtrlCreateLabel("Secondary: ", 168, 208, 61, 17)
$PlanPurchased = GUICtrlCreateLabel("Plan Purchased: ", 8, 256, 249, 21, $SS_CENTER)
GUICtrlSetFont(-1, 11, 800, 0, "Times New Roman")
$softwarepurchased = GUICtrlCreateLabel("Software Purchased: ", 8, 312, 253, 21, $SS_CENTER)
GUICtrlSetFont(-1, 11, 800, 0, "Times New Roman")
$OperatingSystem = GUICtrlCreateLabel("Operating System: ", 8, 368, 250, 21, $SS_CENTER)
GUICtrlSetFont(-1, 11, 800, 0, "Times New Roman")
$ComputersSignedUp = GUICtrlCreateLabel("Computers Signed Up: ", 8, 424, 253, 21, $SS_CENTER)
GUICtrlSetFont(-1, 11, 800, 0, "Times New Roman")
$TotalAmountPaid = GUICtrlCreateLabel("Total Amount Paid: ", 8, 488, 255, 21, $SS_CENTER)
GUICtrlSetFont(-1, 11, 800, 0, "Times New Roman")
$AVtoRemove = GUICtrlCreateLabel("Security Software To Remove If Any: ", 272, 120, 315, 21, $SS_CENTER)
GUICtrlSetFont(-1, 11, 800, 0, "Times New Roman")
$desiredhomepage = GUICtrlCreateLabel("Desired Home Page: ", 600, 120, 193, 21, $SS_CENTER)
GUICtrlSetFont(-1, 11, 800, 0, "Times New Roman")
$permissiontoremoveav = GUICtrlCreateLabel("Did You Get Permission To Remove Current Antivirus: ", 344, 16, 200, 59)
GUICtrlSetFont(-1, 11, 800, 0, "Times New Roman")
$preferredbrowser = GUICtrlCreateLabel("Preferred Browser: ", 600, 16, 192, 21, $SS_CENTER)
GUICtrlSetFont(-1, 11, 800, 0, "Times New Roman")
$additionalnotes = GUICtrlCreateLabel("Additional Notes About Customer's Specfied Issues Or Repairs: ", 320, 368, 423, 17, $SS_CENTER)
#EndRegion=========================================================================

#Region Inputs=====================================================================
$InputAgentName = GUICtrlCreateInput("", 8, 32, 249, 21)
$InputCustomerName = GUICtrlCreateInput("", 8, 88, 249, 21)
$InputCustomerEmailAdd = GUICtrlCreateInput("", 8, 144, 249, 21)
$InputCustomerPNumber = GUICtrlCreateInput("", 8, 224, 121, 21)
$InputCustomerSNumber = GUICtrlCreateInput("", 136, 224, 121, 21)
$InputAmountPaid = GUICtrlCreateInput("$", 80, 520, 121, 21)
$Otherinputboxav = GUICtrlCreateInput("", 272, 312, 121, 21)
$otherinput2browser = GUICtrlCreateInput("", 600, 216, 121, 21)
$additionalnotesinput = GUICtrlCreateInput("", 320, 392, 425, 193)
#EndRegion===========================================================================

#Region ComboBoxes===================================================================
$SelectPlan = GUICtrlCreateCombo("", 8, 280, 249, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
    GUICtrlSetData(-1, "1 Year Repair Service|1 Time Repair Service|Six Month Repair Service|Software Install Only")
$SelectSoftware = GUICtrlCreateCombo("", 8, 336, 249, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
    GUICtrlSetData(-1, "Life Time Stopzilla|1 Year Stopzilla |No AV Purchased")
$SelectOperatingSystem = GUICtrlCreateCombo("", 8, 392, 249, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
    GUICtrlSetData(-1, "Windows|MAC")
#EndRegion===========================================================================

#Region Checkboxes===================================================================
$Nortonckbox = GUICtrlCreateCheckbox("Norton", 272, 144, 65, 17)
$Webrootckbox = GUICtrlCreateCheckbox("Webroot", 272, 168, 65, 17)
$Kasperskyckbox = GUICtrlCreateCheckbox("Kaspersky", 272, 192, 81, 17)
$TrendMicrockbox = GUICtrlCreateCheckbox("Trend Micro", 272, 216, 81, 17)
$CaAVckbox = GUICtrlCreateCheckbox("CA Antivirus", 272, 240, 81, 17)
$Avirackbox = GUICtrlCreateCheckbox("Avrira", 272, 264, 57, 17)
$Mcafeechkbox = GUICtrlCreateCheckbox("McAfee", 368, 144, 65, 17)
$avgchkbox = GUICtrlCreateCheckbox("AVG", 368, 168, 57, 17)
$Pandachkbox = GUICtrlCreateCheckbox("Panda", 368, 192, 65, 17)
$Viprechkbox = GUICtrlCreateCheckbox("Vipre", 368, 216, 57, 17)
$Comodochkbox = GUICtrlCreateCheckbox("Comodo", 368, 240, 73, 17)
$Emisoftchkbox = GUICtrlCreateCheckbox("Emsisoft", 368, 264, 65, 17)
$Avastchkbox = GUICtrlCreateCheckbox("Avast", 472, 144, 97, 17)
$Esetchkbox = GUICtrlCreateCheckbox("Eset", 472, 168, 97, 17)
$Sophoschkbox = GUICtrlCreateCheckbox("Sophos", 472, 192, 97, 17)
$ZoneAlarmchkbox = GUICtrlCreateCheckbox("Zone Alarm", 472, 216, 97, 17)
$Fsecurechkbox = GUICtrlCreateCheckbox("F-Secure", 472, 240, 97, 17)
$otherchkbox = GUICtrlCreateCheckbox("Other", 272, 288, 57, 17)
$googlechkbox = GUICtrlCreateCheckbox("Google.com", 600, 144, 97, 17)
$yahoochkbox = GUICtrlCreateCheckbox("Yahoo.com", 704, 144, 81, 17)
$bingchkbox = GUICtrlCreateCheckbox("Bing.com", 704, 192, 73, 17)
$aolchkbox = GUICtrlCreateCheckbox("Aol.com", 600, 168, 97, 17)
$msnchkbox = GUICtrlCreateCheckbox("MSN.com", 704, 168, 73, 17)
$otherchkbox2 = GUICtrlCreateCheckbox("Other", 600, 192, 81, 17)
$bitdefenderchkbox = GUICtrlCreateCheckbox("Bit Defender", 368, 288, 81, 17)
$nonechkbox = GUICtrlCreateCheckbox("None", 472, 264, 49, 17)
$removeallchkbox = GUICtrlCreateCheckbox("Remove All", 472, 288, 97, 17)
$iechkbox = GUICtrlCreateCheckbox("Internet Explorer", 600, 40, 97, 17)
$ffchkbox = GUICtrlCreateCheckbox("FireFox", 736, 40, 65, 17)
$gcchkbox = GUICtrlCreateCheckbox("Google Chrome", 600, 64, 97, 17)
$safarichkbox = GUICtrlCreateCheckbox("Safari", 736, 64, 57, 17)
$operachkbox = GUICtrlCreateCheckbox("Opera", 600, 88, 97, 17)
#EndRegion======================================================================

#Region RadioButtons============================================================
$SelectPC1 = GUICtrlCreateRadio("1 PC", 48, 456, 49, 17)
$SelectPC2 = GUICtrlCreateRadio("2 PC", 120, 456, 49, 17)
$SelectPC3 = GUICtrlCreateRadio("3 PC", 184, 456, 49, 17)
$premoveavyes = GUICtrlCreateRadio("Yes", 360, 72, 49, 17)
$premoveavno = GUICtrlCreateRadio("No", 456, 72, 57, 17)
#EndRegion======================================================================

$CopyNotes = GUICtrlCreateButton("Generate And Copy Notes", 8, 560, 131, 33)
$newcustomer = GUICtrlCreateButton("New Customer", 144, 560, 115, 33)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###


While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

        case $CopyNotes


            If GUICtrlRead($SelectPC1) = 1 Then
                $PCsPurchased = 1
            ElseIf GUICtrlRead($SelectPC2) = 1 Then
                $PCsPurchased = 2
            ElseIf GUICtrlRead($SelectPC3) = 1 Then
                $PCsPurchased = 3
            EndIf

            if GUICtrlRead($premoveavyes) = 1 Then
                $permission_av = 'Yes'
            ElseIf GUICtrlRead($premoveavno) = 1 Then
                $permission_av = 'No'
            EndIf



            if GUICtrlRead($Nortonckbox) = 1 Then $AVSelected = ('Norton Antivirus')
            If GUICtrlRead($Webrootckbox) = 1 Then $AVSelected = ('Webroot Antivirus')
            if GUICtrlRead($Kasperskyckbox) = 1 Then $AVSelected = ('Kaspersky Antivirus')
            If GUICtrlRead($TrendMicrockbox) = 1 Then $AVSelected = ('Trend Micro Antivirus')
            if GUICtrlRead($CaAVckbox) = 1 Then $AVSelected = ('CA Antivirus')
            If GUICtrlRead($Avirackbox) = 1 Then $AVSelected = ('Avrira Antivirus')
            if GUICtrlRead($Mcafeechkbox) = 1 Then $AVSelected = ('McAfee Antivirus')
            If GUICtrlRead($avgchkbox) = 1 Then $AVSelected = ('AVG Antivirus')
            if GUICtrlRead($Pandachkbox) = 1 Then $AVSelected = ('Panda Antivirus')
            If GUICtrlRead($Viprechkbox) = 1 Then $AVSelected = ('Vipre Antivirus')
            if GUICtrlRead($Comodochkbox) = 1 Then $AVSelected = ('Comodo Antivirus')
            If GUICtrlRead($Emisoftchkbox) = 1 Then $AVSelected = ('Emsisoft Antivirus')
            if GUICtrlRead($Avastchkbox) = 1 Then $AVSelected = ('Avast Antivirus')
            If GUICtrlRead($Esetchkbox) = 1 Then $AVSelected = ('Eset Antivirus')
            if GUICtrlRead($Sophoschkbox) = 1 Then $AVSelected = ('Sophos Antivirus')
            If GUICtrlRead($ZoneAlarmchkbox) = 1 Then $AVSelected = ('Zone Alarm')
            if GUICtrlRead($Fsecurechkbox) = 1 Then $AVSelected = ('F-Secure Antivirus')
            if GUICtrlRead($otherchkbox) = 1 Then $AVSelected = GUICtrlRead($Otherinputboxav)

            if GUICtrlRead($iechkbox) = 1 Then $browser_selected = ('Internet Explorer')
            if GUICtrlRead($gcchkbox) = 1 Then $browser_selected = ('Google Chrome')
            if GUICtrlRead($operachkbox) = 1 Then $browser_selected = ('Opera')
            if GUICtrlRead($ffchkbox) = 1 Then $browser_selected = ('FireFox')
            if GUICtrlRead($safarichkbox) = 1 Then $browser_selected = ('Safari')

            if GUICtrlRead($googlechkbox) = 1 Then $HPSelected = ('Google.com')
            if GUICtrlRead($yahoochkbox) = 1 Then $HPSelected = ('Yahoo.com')
            if GUICtrlRead($bingchkbox) = 1 Then $HPSelected = ('Bing.com')
            if GUICtrlRead($aolchkbox) = 1 Then $HPSelected = ('Aol.com')
            if GUICtrlRead($msnchkbox) = 1 Then $HPSelected = ('MSN.com')
            if GUICtrlRead($otherchkbox2) = 1 Then $HPSelected = GUICtrlRead($otherinput2browser)

                $output = GUICtrlRead($SalesAgentName) & ' ' & GUICtrlRead($InputAgentName) & @CRLF
                $output &= GUICtrlRead($CustomerFullName) & ' ' & GUICtrlRead($InputCustomerName) & @CRLF
                $output &= GUICtrlRead($CustomerEmailAdd) & ' ' & GUICtrlRead($InputCustomerEmailAdd) & @CRLF
                $output &= GUICtrlRead($PrimaryNumber) & ' ' & GUICtrlRead($InputCustomerPNumber) & @CRLF
                $output &= GUICtrlRead($SecondaryNumber) & ' ' & GUICtrlRead($InputCustomerSNumber) & @CRLF
                $output &= GUICtrlRead($PlanPurchased) & ' ' & GUICtrlRead($SelectPlan) & @CRLF
                $output &= GUICtrlRead($softwarepurchased) & GUICtrlRead($SelectSoftware) & @CRLF
                $output &= GUICtrlRead($TotalAmountPaid) & ' ' & GUICtrlRead($InputAmountPaid) & @CRLF
                $output &= GUICtrlRead($OperatingSystem) & ' ' & GUICtrlRead($SelectOperatingSystem) & @CRLF
                $output &= GUICtrlRead($ComputersSignedUp) & ' ' & $PCsPurchased & @CRLF
                $output &= GUICtrlRead($permissiontoremoveav) & ' ' & $permission_av & @CRLF
                $output &= GUICtrlRead($AVtoRemove) & ' ' & $AVSelected & @CRLF
                $output &= GUICtrlRead($preferredbrowser) & ' ' & $browser_selected & @CRLF
                $output &= GUICtrlRead($desiredhomepage) & ' ' & $HPSelected & @CRLF
                $output &= GUICtrlRead($additionalnotes) & ' ' & GUICtrlRead($additionalnotesinput)



                ClipPut($output)
                ConsoleWrite(ClipGet() & @CRLF)

 

Link to post
Share on other sites
  • Moderators

The problem is that you have 5 radio buttons, in two areas of your GUI. By default, all radio buttons will be treated as though they are in a single group. To test this, check the 1 PC option, and then check No for permission to remove AV. You'll see you can only select one of them. The way around this would be to group certain radio buttons together so you can impose separate logic on them. Something like this in your radio button section:

 

#Region RadioButtons============================================================
GUICtrlCreateGroup("", 10, 440, 250, 37)
    $SelectPC1 = GUICtrlCreateRadio("1 PC", 48, 456, 49, 17)
        GUICtrlSetState(-1, $GUI_CHECKED)
    $SelectPC2 = GUICtrlCreateRadio("2 PC", 120, 456, 49, 17)
    $SelectPC3 = GUICtrlCreateRadio("3 PC", 184, 456, 49, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)


$premoveavyes = GUICtrlCreateRadio("Yes", 360, 72, 49, 17)
$premoveavno = GUICtrlCreateRadio("No", 456, 72, 57, 17)
    GUICtrlSetState(-1, $GUI_CHECKED)

#EndRegion======================================================================

Something else, as you continue along. You are going to have to start thinking about what to do if someone doesn't select something you expect them to. For example, if I open the code (with my piece above added in) and select nothing, it fails with the following error:

"C:\Users\JLogan3o13\Desktop\Test.au3" (180) : ==> Variable used without being declared.:
$output &= GUICtrlRead($AVtoRemove) & ' ' & $AVSelected & @CRLF

...because I didn't select a checkbox, $AVSelected doesn't exist. You'll have to think through what you want to do to guide your users down the golden path. You can do a couple different things: 

  • force one of the checkboxes to be selected on startup using GuiCtrlSetState like I did in the snippet above
  • initialize the variables at the top of your script and set the value to blank (Local $AVSelected = "").
  • Set some check in your If statement, in case no checkboxes are selected, prompt the user to select one before continuing.

In my mind, the first option would be your easiest for the time being.

Edited by JLogan3o13

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...