jbsoccerbrit Posted May 25, 2014 Share Posted May 25, 2014 (edited) This is probably a very newbie like question. But I am having an issue adding some functionality to a script I have, every time I try and add the code from the second script it appears to be disabling some functionality (changing label color) of the first script. Could someone please help me with combining both scripts without losing functionality, thank you for any help in advance. First Script expandcollapse popup#include <ButtonConstants.au3> #include <ComboConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <GuiIPAddress.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <GUIToolTip.au3> #include <ColorConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("ModemApp - UPD Installer", 1300, 543, 192, 124) ;Install all modem apps 2 $Button14 = GUICtrlCreateButton("Install All Apps", 530, 360, 160, 25) GUICtrlSetState($Button14, $GUI_DISABLE) $Checkbox2 = GUICtrlCreateCheckbox("Confirm", 530, 385, 97, 17) GUICtrlSetState($Checkbox2, $GUI_unCheckED) ;Set font to bold for all GUISetFont (8, 700) ;Row Labels - Modem 1 $Modem1IPLabel = GUICtrlCreateLabel("IP Address", 30, 36, 100, 20) $Modem1IPLabelasterix = GUICtrlCreateLabel("*", 85, 36, 90, 20) GUICtrlSetColor($Modem1IPLabelasterix, 0xff0000) $Approwlabel1 = GuiCtrlCreateLabel("Apps", 148, 36, 50, 20) $StaticLocation1Label = GuiCtrlCreateLabel("App Root 1", 260, 36, 60, 20) $StaticLocation2Label = GuiCtrlCreateLabel("App Root 2", 350, 36, 60, 20) $StaticLocation3Label = GuiCtrlCreateLabel("App Root 3", 440, 36, 60, 20) $StaticLocation4Label = GuiCtrlCreateLabel("UPD File Path Location", 530, 36, 150, 20) ;Row Labels - Modem 2 $Modem2IPLabel = GUICtrlCreateLabel("IP Address", 30,246, 100, 20) $Modem2IPLabelasterix = GUICtrlCreateLabel("*", 85, 246, 90, 20) GUICtrlSetColor($Modem2IPLabelasterix, 0xff0000) $Approwlabel2 = GuiCtrlCreateLabel("Apps", 148, 246, 50, 20) $StaticLocation5Label = GuiCtrlCreateLabel("App Root 1", 260, 246, 60, 20) $StaticLocation6Label = GuiCtrlCreateLabel("App Root 2", 350, 246, 60, 20) $StaticLocation7Label = GuiCtrlCreateLabel("App Root 3", 440, 246, 60, 20) $StaticLocation8Label = GuiCtrlCreateLabel("UPD File Path Location", 530, 246, 150, 20) ;App Labels $Label1 = GUICtrlCreateLabel("Mpp App", 148, 53, 90, 20, BitOR($SS_CENTER,$SS_SUNKEN,$WS_BORDER)) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") GUICtrlSetBkColor($Label1, 0xEEE8CD) GUICtrlSetTip( -1, "MppApp - Handles reporting and programs") $Label2 = GUICtrlCreateLabel("Trans App", 148, 85, 90, 20, BitOR($SS_CENTER,$SS_SUNKEN,$WS_BORDER)) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") GUICtrlSetBkColor($Label2, 0xF2EDD7) GUICtrlSetTip( -1, "MppTransApp - Handles all transactions") $Label3 = GUICtrlCreateLabel("Monitor App", 148, 121, 90, 20, BitOR($SS_CENTER,$SS_SUNKEN,$WS_BORDER)) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") GUICtrlSetBkColor($Label3, 0xF5F1E2) GUICtrlSetTip( -1, "Monitor App - Is used for mBox information") $Label4 = GUICtrlCreateLabel("Mpp App", 148, 261, 90, 20, BitOR($SS_CENTER,$SS_SUNKEN,$WS_BORDER)) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") GUICtrlSetBkColor($Label4, 0xEEE8CD) GUICtrlSetTip( -1, "MppApp - Handles reporting and programs") $Label5 = GUICtrlCreateLabel("Trans App", 148, 293, 90, 20, BitOR($SS_CENTER,$SS_SUNKEN,$WS_BORDER)) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") GUICtrlSetBkColor($Label5, 0xF2EDD7) GUICtrlSetTip( -1, "MppTransApp - Handles all transactions") $Label6 = GUICtrlCreateLabel("Monitor App", 148, 329, 90, 20, BitOR($SS_CENTER,$SS_SUNKEN,$WS_BORDER)) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") GUICtrlSetBkColor($Label6, 0xF5F1E2) GUICtrlSetTip( -1, "Monitor App - Is used for mBox information") $Label7 = GUICtrlCreateLabel("All fields marked with an * are required.", 20, 510, 400, 17) GUICtrlSetColor($Label7, 0xff0000) ;1st row inputs and buttons $Input1 = GUICtrlCreateInput("Input1", 260, 50, 65, 21, $ES_READONLY) GUICtrlSetBkColor($Input1,0xBCED91) GUICtrlSetTip( -1, "Field is read only") $Input2 = GUICtrlCreateInput("Input2", 350, 50, 65, 21, $ES_READONLY) GUICtrlSetBkColor($Input2,0xBCED91) GUICtrlSetTip( -1, "Field is read only") $Input3 = GUICtrlCreateInput("Input3", 440, 50, 65, 21, $ES_READONLY) GUICtrlSetBkColor($Input3,0xBCED91) GUICtrlSetTip( -1, "Field is read only") $Input4 = GUICtrlCreateInput("Input4", 530, 50, 250, 21) GUICtrlSetBkColor($Input4, 0xFDDF5B) $Path = GUICtrlCreateGroup("Install Path || Modem One", 16, 8, 865, 201, $WS_BORDER, $WS_EX_CLIENTEDGE) GUICtrlSetBkColor($Path, 0xBFCDDB) $IPAddress1 = _GUICtrlIpAddress_Create($Form1, 26, 53, 110, 25) _GUICtrlIpAddress_Set($IPAddress1, "0.0.0.0") $Button1 = GUICtrlCreateButton("Browse", 792, 50, 73, 21) GUICtrlSetBkColor($Button1, 0xAFE2EB) ;ECR Selection Modem 1 $Combo1 = GUICtrlCreateCombo("Select ECR Type", 26, 88, 110, 25) GUICtrlSetData($Combo1, "ER-280|SPS-300|SPS-500|ER-900|2000", "Select ECR Type") GUICtrlSetFont(-1, 5, 400, 0, "MS Sans Serif") ;2nd row inputs and buttons $Input5 = GUICtrlCreateInput("Input5", 260, 85, 65, 21, $ES_READONLY) GUICtrlSetBkColor($Input5,0xBCED91) GUICtrlSetTip( -1, "Field is read only") $Input6 = GUICtrlCreateInput("Input6", 350, 85, 65, 21, $ES_READONLY) GUICtrlSetBkColor($Input6,0xBCED91) GUICtrlSetTip( -1, "Field is read only") $Input7 = GUICtrlCreateInput("Input7", 440, 85, 65, 21, $ES_READONLY) GUICtrlSetBkColor($Input7,0xBCED91) GUICtrlSetTip( -1, "Field is read only") $Input8 = GUICtrlCreateInput("Input8", 530, 85, 250, 21) GUICtrlSetBkColor($Input8, 0xFDDF5B) $Button2 = GUICtrlCreateButton("Browse", 792, 85, 73, 21) GUICtrlSetBkColor($Button2, 0xAFE2EB) ;Install App Buttons for Modem 1 $Button7 = GUICtrlCreateButton("Install MppApp", 260, 153, 65, 46, $BS_MULTILINE) $Button8 = GUICtrlCreateButton("Install MppTrans App", 350, 153, 65, 46, $BS_MULTILINE) $Button9 = GUICtrlCreateButton("Install Monitor App", 440, 153, 65, 46, $BS_MULTILINE) ;3rd row inputs and buttons $Input9 = GUICtrlCreateInput("Input9", 260, 121, 65, 21, $ES_READONLY) GUICtrlSetBkColor($Input9,0xBCED91) GUICtrlSetTip( -1, "Field is read only") $Input10 = GUICtrlCreateInput("Input10", 350, 121, 65, 21, $ES_READONLY) GUICtrlSetBkColor($Input10,0xBCED91) GUICtrlSetTip( -1, "Field is read only") $Input11 = GUICtrlCreateInput("Input11", 440, 121, 65, 21, $ES_READONLY) GUICtrlSetBkColor($Input11,0xBCED91) GUICtrlSetTip( -1, "Field is read only") $Input12 = GUICtrlCreateInput("Input12", 530, 121, 250, 21) GUICtrlSetBkColor($Input12, 0xFDDF5B) $Button3 = GUICtrlCreateButton("Browse", 792, 121, 73, 21) GUICtrlSetBkColor($Button3, 0xAFE2EB) ;4th row inputs and buttons $Input13 = GUICtrlCreateInput("Input13", 260, 260, 65, 21, $ES_READONLY) GUICtrlSetBkColor($Input13,0xBCED91) GUICtrlSetTip( -1, "Field is read only") $Input14 = GUICtrlCreateInput("Input14", 350, 260, 65, 21, $ES_READONLY) GUICtrlSetBkColor($Input14,0xBCED91) GUICtrlSetTip( -1, "Field is read only") $Input15 = GUICtrlCreateInput("Input15", 440, 260, 65, 21, $ES_READONLY) GUICtrlSetBkColor($Input15,0xBCED91) GUICtrlSetTip( -1, "Field is read only") $Input16 = GUICtrlCreateInput("Input16", 530, 260, 250, 21) GUICtrlSetBkColor($Input16, 0xFDDF5B) ;Border for modem 2 install $Path2 = GUICtrlCreateGroup("Install Path || Modem Two", 16, 218, 865, 201, $WS_BORDER, $WS_EX_CLIENTEDGE) GUICtrlSetBkColor($Path2, 0xD4DEE9) $IPAddress2 = _GUICtrlIpAddress_Create($Form1, 26, 260, 110, 25) _GUICtrlIpAddress_Set($IPAddress2, "0.0.0.0") $Button4 = GUICtrlCreateButton("Browse", 792, 260, 73, 21) GUICtrlSetBkColor($Button4, 0xAFE2EB) ;ECR Selection Modem 2 $Combo2 = GUICtrlCreateCombo("Select ECR Type", 26, 293, 110, 25) GUICtrlSetData($Combo2, "ER-280|SPS-300|SPS-500|ER-900|2000", "Select ECR Type") GUICtrlSetFont(-1, 5, 400, 0, "MS Sans Serif") ;5th row inputs and buttons $Input17 = GUICtrlCreateInput("Input17", 260, 293, 65, 21, $ES_READONLY) GUICtrlSetBkColor($Input17,0xBCED91) GUICtrlSetTip( -1, "Field is read only") $Input18 = GUICtrlCreateInput("Input18", 350, 293, 65, 21, $ES_READONLY) GUICtrlSetBkColor($Input18,0xBCED91) GUICtrlSetTip( -1, "Field is read only") $Input19 = GUICtrlCreateInput("Input19", 440, 293, 65, 21, $ES_READONLY) GUICtrlSetBkColor($Input19,0xBCED91) GUICtrlSetTip( -1, "Field is read only") $Input20 = GUICtrlCreateInput("Input20", 530, 293, 250, 21) GUICtrlSetBkColor($Input20, 0xFDDF5B) $Button5 = GUICtrlCreateButton("Browse", 792, 293, 73, 21) GUICtrlSetBkColor($Button5, 0xAFE2EB) ;6th row inputs and buttons $Input21 = GUICtrlCreateInput("Input21", 260, 329, 65, 21, $ES_READONLY) GUICtrlSetBkColor($Input21,0xBCED91) GUICtrlSetTip( -1, "Field is read only") $Input22 = GUICtrlCreateInput("Input22", 350, 329, 65, 21, $ES_READONLY) GUICtrlSetBkColor($Input22,0xBCED91) GUICtrlSetTip( -1, "Field is read only") $Input23 = GUICtrlCreateInput("Input23", 440, 329, 65, 21, $ES_READONLY) GUICtrlSetBkColor($Input23,0xBCED91) GUICtrlSetTip( -1, "Field is read only") $Input24 = GUICtrlCreateInput("Input24", 530, 329, 250, 21) GUICtrlSetBkColor($Input24, 0xFDDF5B) $Button6 = GUICtrlCreateButton("Browse", 792, 329, 73, 21) GUICtrlSetBkColor($Button6, 0xAFE2EB) ;Install App Buttons for Modem 1 $Button10 = GUICtrlCreateButton("Install MppApp", 260, 360, 65, 46, $BS_MULTILINE) $Button11 = GUICtrlCreateButton("Install MppTrans App", 350, 360, 65, 46, $BS_MULTILINE) $Button12 = GUICtrlCreateButton("Install Monitor App", 440, 360, 65, 46, $BS_MULTILINE) ;Toolbar $ToolbarGroup = GUICtrlCreateGroup("Toolbar", 16, 432, 1240, 73, $WS_BORDER, $WS_EX_CLIENTEDGE) GUICtrlSetBkColor ($ToolbarGroup, 0xBFCDDB) ;Enviroment config $EnvGroup = GUICtrlCreateGroup("Enviroment Config", 912, 8, 345, 410, $WS_BORDER, $WS_EX_CLIENTEDGE) GUICtrlSetBkColor ($EnvGroup, 0xBFCDDB) ;Function for file path of file path for MppApp - Modem 1 MppAppBrowseModem1() Func MppAppBrowseModem1() GUISetState() $msg = 0 While $msg <> $GUI_EVENT_CLOSE $msg = GUIGetMsg() Select Case $msg = $Button1 $File2open = FileOpenDialog ("Sterling Payment App Search", @DesktopDir, "Sterling Payment File (*.upd)") ;returns the file path GUICtrlSetData($Input4, $File2open) ;set mpp app modem 1 EndSelect Select Case $msg = $Button2 $File2open = FileOpenDialog ("Sterling Payment App Search", @DesktopDir , "Sterling Payment File (*.upd)") ;returns the file path GUICtrlSetData($Input8, $File2open) ;set mpp trans app modem 1 EndSelect Select Case $msg = $Button3 $File2open = FileOpenDialog ("Sterling Payment App Search", @DesktopDir , "Sterling Payment File (*.upd)") ;returns the file path GUICtrlSetData($Input12, $File2open) ;set monitor app modem 1 EndSelect Select Case $msg = $Button4 $File2open = FileOpenDialog ("Sterling Payment App Search", @DesktopDir , "Sterling Payment File (*.upd)") ;returns the file path GUICtrlSetData($Input16, $File2open) ;set mpp app modem 2 EndSelect Select Case $msg = $Button5 $File2open = FileOpenDialog ("Sterling Payment App Search", @DesktopDir , "Sterling Payment File (*.upd)") ;returns the file path GUICtrlSetData($Input20, $File2open) ;set mpp trans app modem 2 EndSelect Select Case $msg = $Button6 $File2open = FileOpenDialog ("Sterling Payment App Search", @DesktopDir , "Sterling Payment File (*.upd)") ;returns the file path GUICtrlSetData($Input24, $File2open) ;set mpp monitor app modem 2 EndSelect Select Case $msg = $Button7 GUICtrlSetBkColor ($label1, 0xCD5555) ;change color of Mpp App for Modem 1 when Install MppApp button is pressed EndSelect Select Case $msg = $Button8 GUICtrlSetBkColor ($label2, 0xCD5555) ;change color of Mpp App for Modem 1 when Install MppApp button is pressed EndSelect Select Case $msg = $Button9 GUICtrlSetBkColor ($label3, 0xCD5555) ;change color of Mpp App for Modem 1 when Install MppApp button is pressed EndSelect Select Case $msg = $Button10 GUICtrlSetBkColor ($label4, 0xCD5555) ;change color of Mpp App for Modem 1 when Install MppApp button is pressed EndSelect Select Case $msg = $Button11 GUICtrlSetBkColor ($label5, 0xCD5555) ;change color of Mpp App for Modem 1 when Install MppApp button is pressed EndSelect Select Case $msg = $Button12 GUICtrlSetBkColor ($label6, 0xCD5555) ;change color of Mpp App for Modem 1 when Install MppApp button is pressed EndSelect WEnd EndFunc #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Exit WEnd Second Script  expandcollapse popup$button_enabled = 1 While 1 If GUICtrlRead($Input16) = "" And $button_enabled = 1 Then GUICtrlSetState($Button14, $GUI_DISABLE) $button_enabled = 0 ElseIf GUICtrlRead($Input20) = "" And $button_enabled = 1 Then GUICtrlSetState($Button14, $GUI_DISABLE) $button_enabled = 0 ElseIf GUICtrlRead($Input24) = "" And $button_enabled = 1 Then GUICtrlSetState($Button14, $GUI_DISABLE) $button_enabled = 0 Elseif BitAnd(GUICtrlRead($Checkbox2),$GUI_UNCHECKED) = $GUI_UNCHECKED and $button_enabled = 1 Then GUICtrlSetState($Button14, $GUI_DISABLE) $button_enabled = 0 ElseIf $button_enabled = 0 And BitAnd(GUICtrlRead($Checkbox2),$GUI_CHECKED) = $GUI_CHECKED And GUICtrlRead($Input16) <> "" And GUICtrlRead($Input20) <> "" And GUICtrlRead($Input24) <> "" Then GUICtrlSetState($Button14, $GUI_ENABLE) $button_enabled = 1 EndIf $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button14 ; do your thing EndSwitch WEnd Edited May 25, 2014 by jbsoccerbrit Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 25, 2014 Moderators Share Posted May 25, 2014 jbsoccerbrit,Just insert the second script inside the While...WEnd loop of the first: expandcollapse popup#include <ButtonConstants.au3> #include <ComboConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <GuiIPAddress.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <GUIToolTip.au3> #include <ColorConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("ModemApp - UPD Installer", 1300, 543, 192, 124) ;Install all modem apps 2 $Button14 = GUICtrlCreateButton("Install All Apps", 530, 360, 160, 25) GUICtrlSetState($Button14, $GUI_DISABLE) $Checkbox2 = GUICtrlCreateCheckbox("Confirm", 530, 385, 97, 17) GUICtrlSetState($Checkbox2, $GUI_unCheckED) ;Set font to bold for all GUISetFont(8, 700) ;Row Labels - Modem 1 $Modem1IPLabel = GUICtrlCreateLabel("IP Address", 30, 36, 100, 20) $Modem1IPLabelasterix = GUICtrlCreateLabel("*", 85, 36, 90, 20) GUICtrlSetColor($Modem1IPLabelasterix, 0xff0000) $Approwlabel1 = GUICtrlCreateLabel("Apps", 148, 36, 50, 20) $StaticLocation1Label = GUICtrlCreateLabel("App Root 1", 260, 36, 60, 20) $StaticLocation2Label = GUICtrlCreateLabel("App Root 2", 350, 36, 60, 20) $StaticLocation3Label = GUICtrlCreateLabel("App Root 3", 440, 36, 60, 20) $StaticLocation4Label = GUICtrlCreateLabel("UPD File Path Location", 530, 36, 150, 20) ;Row Labels - Modem 2 $Modem2IPLabel = GUICtrlCreateLabel("IP Address", 30, 246, 100, 20) $Modem2IPLabelasterix = GUICtrlCreateLabel("*", 85, 246, 90, 20) GUICtrlSetColor($Modem2IPLabelasterix, 0xff0000) $Approwlabel2 = GUICtrlCreateLabel("Apps", 148, 246, 50, 20) $StaticLocation5Label = GUICtrlCreateLabel("App Root 1", 260, 246, 60, 20) $StaticLocation6Label = GUICtrlCreateLabel("App Root 2", 350, 246, 60, 20) $StaticLocation7Label = GUICtrlCreateLabel("App Root 3", 440, 246, 60, 20) $StaticLocation8Label = GUICtrlCreateLabel("UPD File Path Location", 530, 246, 150, 20) ;App Labels $Label1 = GUICtrlCreateLabel("Mpp App", 148, 53, 90, 20, BitOR($SS_CENTER, $SS_SUNKEN, $WS_BORDER)) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") GUICtrlSetBkColor($Label1, 0xEEE8CD) GUICtrlSetTip(-1, "MppApp - Handles reporting and programs") $Label2 = GUICtrlCreateLabel("Trans App", 148, 85, 90, 20, BitOR($SS_CENTER, $SS_SUNKEN, $WS_BORDER)) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") GUICtrlSetBkColor($Label2, 0xF2EDD7) GUICtrlSetTip(-1, "MppTransApp - Handles all transactions") $Label3 = GUICtrlCreateLabel("Monitor App", 148, 121, 90, 20, BitOR($SS_CENTER, $SS_SUNKEN, $WS_BORDER)) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") GUICtrlSetBkColor($Label3, 0xF5F1E2) GUICtrlSetTip(-1, "Monitor App - Is used for mBox information") $Label4 = GUICtrlCreateLabel("Mpp App", 148, 261, 90, 20, BitOR($SS_CENTER, $SS_SUNKEN, $WS_BORDER)) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") GUICtrlSetBkColor($Label4, 0xEEE8CD) GUICtrlSetTip(-1, "MppApp - Handles reporting and programs") $Label5 = GUICtrlCreateLabel("Trans App", 148, 293, 90, 20, BitOR($SS_CENTER, $SS_SUNKEN, $WS_BORDER)) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") GUICtrlSetBkColor($Label5, 0xF2EDD7) GUICtrlSetTip(-1, "MppTransApp - Handles all transactions") $Label6 = GUICtrlCreateLabel("Monitor App", 148, 329, 90, 20, BitOR($SS_CENTER, $SS_SUNKEN, $WS_BORDER)) GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif") GUICtrlSetBkColor($Label6, 0xF5F1E2) GUICtrlSetTip(-1, "Monitor App - Is used for mBox information") $Label7 = GUICtrlCreateLabel("All fields marked with an * are required.", 20, 510, 400, 17) GUICtrlSetColor($Label7, 0xff0000) ;1st row inputs and buttons $Input1 = GUICtrlCreateInput("Input1", 260, 50, 65, 21, $ES_READONLY) GUICtrlSetBkColor($Input1, 0xBCED91) GUICtrlSetTip(-1, "Field is read only") $Input2 = GUICtrlCreateInput("Input2", 350, 50, 65, 21, $ES_READONLY) GUICtrlSetBkColor($Input2, 0xBCED91) GUICtrlSetTip(-1, "Field is read only") $Input3 = GUICtrlCreateInput("Input3", 440, 50, 65, 21, $ES_READONLY) GUICtrlSetBkColor($Input3, 0xBCED91) GUICtrlSetTip(-1, "Field is read only") $Input4 = GUICtrlCreateInput("Input4", 530, 50, 250, 21) GUICtrlSetBkColor($Input4, 0xFDDF5B) $Path = GUICtrlCreateGroup("Install Path || Modem One", 16, 8, 865, 201, $WS_BORDER, $WS_EX_CLIENTEDGE) GUICtrlSetBkColor($Path, 0xBFCDDB) $IPAddress1 = _GUICtrlIpAddress_Create($Form1, 26, 53, 110, 25) _GUICtrlIpAddress_Set($IPAddress1, "0.0.0.0") $Button1 = GUICtrlCreateButton("Browse", 792, 50, 73, 21) GUICtrlSetBkColor($Button1, 0xAFE2EB) ;ECR Selection Modem 1 $Combo1 = GUICtrlCreateCombo("Select ECR Type", 26, 88, 110, 25) GUICtrlSetData($Combo1, "ER-280|SPS-300|SPS-500|ER-900|2000", "Select ECR Type") GUICtrlSetFont(-1, 5, 400, 0, "MS Sans Serif") ;2nd row inputs and buttons $Input5 = GUICtrlCreateInput("Input5", 260, 85, 65, 21, $ES_READONLY) GUICtrlSetBkColor($Input5, 0xBCED91) GUICtrlSetTip(-1, "Field is read only") $Input6 = GUICtrlCreateInput("Input6", 350, 85, 65, 21, $ES_READONLY) GUICtrlSetBkColor($Input6, 0xBCED91) GUICtrlSetTip(-1, "Field is read only") $Input7 = GUICtrlCreateInput("Input7", 440, 85, 65, 21, $ES_READONLY) GUICtrlSetBkColor($Input7, 0xBCED91) GUICtrlSetTip(-1, "Field is read only") $Input8 = GUICtrlCreateInput("Input8", 530, 85, 250, 21) GUICtrlSetBkColor($Input8, 0xFDDF5B) $Button2 = GUICtrlCreateButton("Browse", 792, 85, 73, 21) GUICtrlSetBkColor($Button2, 0xAFE2EB) ;Install App Buttons for Modem 1 $Button7 = GUICtrlCreateButton("Install MppApp", 260, 153, 65, 46, $BS_MULTILINE) $Button8 = GUICtrlCreateButton("Install MppTrans App", 350, 153, 65, 46, $BS_MULTILINE) $Button9 = GUICtrlCreateButton("Install Monitor App", 440, 153, 65, 46, $BS_MULTILINE) ;3rd row inputs and buttons $Input9 = GUICtrlCreateInput("Input9", 260, 121, 65, 21, $ES_READONLY) GUICtrlSetBkColor($Input9, 0xBCED91) GUICtrlSetTip(-1, "Field is read only") $Input10 = GUICtrlCreateInput("Input10", 350, 121, 65, 21, $ES_READONLY) GUICtrlSetBkColor($Input10, 0xBCED91) GUICtrlSetTip(-1, "Field is read only") $Input11 = GUICtrlCreateInput("Input11", 440, 121, 65, 21, $ES_READONLY) GUICtrlSetBkColor($Input11, 0xBCED91) GUICtrlSetTip(-1, "Field is read only") $Input12 = GUICtrlCreateInput("Input12", 530, 121, 250, 21) GUICtrlSetBkColor($Input12, 0xFDDF5B) $Button3 = GUICtrlCreateButton("Browse", 792, 121, 73, 21) GUICtrlSetBkColor($Button3, 0xAFE2EB) ;4th row inputs and buttons $Input13 = GUICtrlCreateInput("Input13", 260, 260, 65, 21, $ES_READONLY) GUICtrlSetBkColor($Input13, 0xBCED91) GUICtrlSetTip(-1, "Field is read only") $Input14 = GUICtrlCreateInput("Input14", 350, 260, 65, 21, $ES_READONLY) GUICtrlSetBkColor($Input14, 0xBCED91) GUICtrlSetTip(-1, "Field is read only") $Input15 = GUICtrlCreateInput("Input15", 440, 260, 65, 21, $ES_READONLY) GUICtrlSetBkColor($Input15, 0xBCED91) GUICtrlSetTip(-1, "Field is read only") $Input16 = GUICtrlCreateInput("Input16", 530, 260, 250, 21) GUICtrlSetBkColor($Input16, 0xFDDF5B) ;Border for modem 2 install $Path2 = GUICtrlCreateGroup("Install Path || Modem Two", 16, 218, 865, 201, $WS_BORDER, $WS_EX_CLIENTEDGE) GUICtrlSetBkColor($Path2, 0xD4DEE9) $IPAddress2 = _GUICtrlIpAddress_Create($Form1, 26, 260, 110, 25) _GUICtrlIpAddress_Set($IPAddress2, "0.0.0.0") $Button4 = GUICtrlCreateButton("Browse", 792, 260, 73, 21) GUICtrlSetBkColor($Button4, 0xAFE2EB) ;ECR Selection Modem 2 $Combo2 = GUICtrlCreateCombo("Select ECR Type", 26, 293, 110, 25) GUICtrlSetData($Combo2, "ER-280|SPS-300|SPS-500|ER-900|2000", "Select ECR Type") GUICtrlSetFont(-1, 5, 400, 0, "MS Sans Serif") ;5th row inputs and buttons $Input17 = GUICtrlCreateInput("Input17", 260, 293, 65, 21, $ES_READONLY) GUICtrlSetBkColor($Input17, 0xBCED91) GUICtrlSetTip(-1, "Field is read only") $Input18 = GUICtrlCreateInput("Input18", 350, 293, 65, 21, $ES_READONLY) GUICtrlSetBkColor($Input18, 0xBCED91) GUICtrlSetTip(-1, "Field is read only") $Input19 = GUICtrlCreateInput("Input19", 440, 293, 65, 21, $ES_READONLY) GUICtrlSetBkColor($Input19, 0xBCED91) GUICtrlSetTip(-1, "Field is read only") $Input20 = GUICtrlCreateInput("Input20", 530, 293, 250, 21) GUICtrlSetBkColor($Input20, 0xFDDF5B) $Button5 = GUICtrlCreateButton("Browse", 792, 293, 73, 21) GUICtrlSetBkColor($Button5, 0xAFE2EB) ;6th row inputs and buttons $Input21 = GUICtrlCreateInput("Input21", 260, 329, 65, 21, $ES_READONLY) GUICtrlSetBkColor($Input21, 0xBCED91) GUICtrlSetTip(-1, "Field is read only") $Input22 = GUICtrlCreateInput("Input22", 350, 329, 65, 21, $ES_READONLY) GUICtrlSetBkColor($Input22, 0xBCED91) GUICtrlSetTip(-1, "Field is read only") $Input23 = GUICtrlCreateInput("Input23", 440, 329, 65, 21, $ES_READONLY) GUICtrlSetBkColor($Input23, 0xBCED91) GUICtrlSetTip(-1, "Field is read only") $Input24 = GUICtrlCreateInput("Input24", 530, 329, 250, 21) GUICtrlSetBkColor($Input24, 0xFDDF5B) $Button6 = GUICtrlCreateButton("Browse", 792, 329, 73, 21) GUICtrlSetBkColor($Button6, 0xAFE2EB) ;Install App Buttons for Modem 1 $Button10 = GUICtrlCreateButton("Install MppApp", 260, 360, 65, 46, $BS_MULTILINE) $Button11 = GUICtrlCreateButton("Install MppTrans App", 350, 360, 65, 46, $BS_MULTILINE) $Button12 = GUICtrlCreateButton("Install Monitor App", 440, 360, 65, 46, $BS_MULTILINE) ;Toolbar $ToolbarGroup = GUICtrlCreateGroup("Toolbar", 16, 432, 1240, 73, $WS_BORDER, $WS_EX_CLIENTEDGE) GUICtrlSetBkColor($ToolbarGroup, 0xBFCDDB) ;Enviroment config $EnvGroup = GUICtrlCreateGroup("Enviroment Config", 912, 8, 345, 410, $WS_BORDER, $WS_EX_CLIENTEDGE) GUICtrlSetBkColor($EnvGroup, 0xBFCDDB) ;Function for file path of file path for MppApp - Modem 1 MppAppBrowseModem1() Func MppAppBrowseModem1() GUISetState() $msg = 0 While $msg <> $GUI_EVENT_CLOSE $msg = GUIGetMsg() Select Case $msg = $Button1 $File2open = FileOpenDialog("Sterling Payment App Search", @DesktopDir, "Sterling Payment File (*.upd)") ;returns the file path GUICtrlSetData($Input4, $File2open) ;set mpp app modem 1 EndSelect Select Case $msg = $Button2 $File2open = FileOpenDialog("Sterling Payment App Search", @DesktopDir, "Sterling Payment File (*.upd)") ;returns the file path GUICtrlSetData($Input8, $File2open) ;set mpp trans app modem 1 EndSelect Select Case $msg = $Button3 $File2open = FileOpenDialog("Sterling Payment App Search", @DesktopDir, "Sterling Payment File (*.upd)") ;returns the file path GUICtrlSetData($Input12, $File2open) ;set monitor app modem 1 EndSelect Select Case $msg = $Button4 $File2open = FileOpenDialog("Sterling Payment App Search", @DesktopDir, "Sterling Payment File (*.upd)") ;returns the file path GUICtrlSetData($Input16, $File2open) ;set mpp app modem 2 EndSelect Select Case $msg = $Button5 $File2open = FileOpenDialog("Sterling Payment App Search", @DesktopDir, "Sterling Payment File (*.upd)") ;returns the file path GUICtrlSetData($Input20, $File2open) ;set mpp trans app modem 2 EndSelect Select Case $msg = $Button6 $File2open = FileOpenDialog("Sterling Payment App Search", @DesktopDir, "Sterling Payment File (*.upd)") ;returns the file path GUICtrlSetData($Input24, $File2open) ;set mpp monitor app modem 2 EndSelect Select Case $msg = $Button7 GUICtrlSetBkColor($Label1, 0xCD5555) ;change color of Mpp App for Modem 1 when Install MppApp button is pressed EndSelect Select Case $msg = $Button8 GUICtrlSetBkColor($Label2, 0xCD5555) ;change color of Mpp App for Modem 1 when Install MppApp button is pressed EndSelect Select Case $msg = $Button9 GUICtrlSetBkColor($Label3, 0xCD5555) ;change color of Mpp App for Modem 1 when Install MppApp button is pressed EndSelect Select Case $msg = $Button10 GUICtrlSetBkColor($Label4, 0xCD5555) ;change color of Mpp App for Modem 1 when Install MppApp button is pressed EndSelect Select Case $msg = $Button11 GUICtrlSetBkColor($Label5, 0xCD5555) ;change color of Mpp App for Modem 1 when Install MppApp button is pressed EndSelect Select Case $msg = $Button12 GUICtrlSetBkColor($Label6, 0xCD5555) ;change color of Mpp App for Modem 1 when Install MppApp button is pressed EndSelect ; New code inserted here <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Local $button_enabled = 1 If GUICtrlRead($Input16) = "" And $button_enabled = 1 Then GUICtrlSetState($Button14, $GUI_DISABLE) $button_enabled = 0 ElseIf GUICtrlRead($Input20) = "" And $button_enabled = 1 Then GUICtrlSetState($Button14, $GUI_DISABLE) $button_enabled = 0 ElseIf GUICtrlRead($Input24) = "" And $button_enabled = 1 Then GUICtrlSetState($Button14, $GUI_DISABLE) $button_enabled = 0 ElseIf BitAND(GUICtrlRead($Checkbox2), $GUI_UNCHECKED) = $GUI_UNCHECKED And $button_enabled = 1 Then GUICtrlSetState($Button14, $GUI_DISABLE) $button_enabled = 0 ElseIf $button_enabled = 0 And BitAND(GUICtrlRead($Checkbox2), $GUI_CHECKED) = $GUI_CHECKED And GUICtrlRead($Input16) <> "" And GUICtrlRead($Input20) <> "" And GUICtrlRead($Input24) <> "" Then GUICtrlSetState($Button14, $GUI_ENABLE) $button_enabled = 1 EndIf WEnd EndFunc ;==>MppAppBrowseModem1 #EndRegion ### END Koda GUI section ###And why not use sensible names for the controls so that you can easily remember which does what? Just numbering them means you need a crib sheet when you have a many as you have in that GUI. M23  Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area  Link to comment Share on other sites More sharing options...
jbsoccerbrit Posted May 25, 2014 Author Share Posted May 25, 2014 (edited) Melba23, thank you so much for the help and much agreed my naming convention is pretty terrible. This more a learning curve project as I still consider myself very new to Autoit and programming/scripting in general. The script still has an issue when checking the check box, the button does not become active? Edited May 25, 2014 by jbsoccerbrit Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 25, 2014 Moderators Share Posted May 25, 2014 jbsoccerbrit, The script still has an issue when checking the check box, the button does not become active?Which check box and which button? M23  Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area  Link to comment Share on other sites More sharing options...
jbsoccerbrit Posted May 25, 2014 Author Share Posted May 25, 2014 The checkbox is $checbox2 The button is $Button14 When Inputs 16, 20, 24 are all filled and the checkbox ($checkbox2) is checked then $button14 should become enabled. Currently the button just blinks alot and checking the checkbox makes it stop blinking but the button itself never becomes enabled. Â Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 25, 2014 Moderators Share Posted May 25, 2014 jbsoccerbrit,Entirely my fault - move this line:Local $button_enabled = 1to the top of the function outside the While...WEnd loop. M23  Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area  Link to comment Share on other sites More sharing options...
jbsoccerbrit Posted May 25, 2014 Author Share Posted May 25, 2014 (edited) MppAppBrowseModem1() Func MppAppBrowseModem1() GUISetState() $msg = 0 Local $button_enabled = 1 While $msg <> $GUI_EVENT_CLOSE $msg = GUIGetMsg() That did it, you're a scholar and a gent sir... again thank you. Edited May 25, 2014 by jbsoccerbrit Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 25, 2014 Moderators Share Posted May 25, 2014 jbsoccerbrit,Sorry I got it wrong the first time. And as you are creating inputs with text already in place - are you aware of cuebanners? #include <GUIConstantsEX.au3> #include <EditConstants.au3> $hGui = GUICreate("", 500, 300) GUICtrlCreateLabel("Info", 10, 5) Local $aInput[6][2] = [[0, "Name"],[0, "Address"],[0, "Home Phone"],[0, "Mobile Phone"],[0, "Password"],[0, "Town"]] For $i = 0 To UBound($aInput) - 1 $aInput[$i][0] = GUICtrlCreateInput("", 10, (20 * ($i + 1)), 140, 20) GUICtrlSendMsg(-1, $EM_SETCUEBANNER, True, $aInput[$i][1]) Next GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd ;Does not work for edit controls with $ES_MULTILINE style. ;In XP, the banner disappears when the edit has focus (cursor in edit) ;In Vista/7 the banner can optionally still appear when the edit has focus (cursor in edit) ;(third parameter = True/False)M23  Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area  Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now