Jump to content
amphoric

Allow Edit Checkbox / Radio Button that shows other buttons

Recommended Posts

Good Morning,

I hope someone can help, below is a stripped down version of my current .au3 file and there is a few bits I just cant for the life of me get to work;

1. I would like the 'Allow Edit' checkbox once checked to allow the user to edit the contents of the 'AD Group Name' input box

2. I would like the 'Other / Internal Use' radio button if checked to show the '$OtherInternalGroup' group of radio buttons

My current code.....

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <MsgBoxConstants.au3>
#include <WinAPIShellEx.au3>
#include <FileConstants.au3>
#include <WinAPIFiles.au3>
#include <WinAPI.au3> ; used for Lo/Hi word




; Declare Global variables for WM_COMMAND and '_GetAppName()' function.
Global $__iComboWrite = 9999, $__iInputValue = 9999, $__iInputWrite = 9999


#Region ### START GUI section ###
$Form1_1 = GUICreate("Packaging Wrapper", 435, 545, -1, -1)
GUISetIcon("C.ico", -1)
GUISetBkColor(0xFFFFFF)
Global $ApplicationNameInput = GUICtrlCreateInput("", 24, 168, 385, 21)
GUICtrlSetTip(-1, "EG: Corel_WinZip_21.0_0.1")
$ADGroupNameInput = GUICtrlCreateInput("", 24, 224, 385, 21)
$AllowEditChk = GUICtrlCreateCheckbox("Allow Edit", 344, 200, 65, 17, BitOR($GUI_SS_DEFAULT_CHECKBOX,$BS_RIGHT))
GUICtrlSetBkColor(-1, 0xE3E3E3)
$ApplicationTypeGroup = GUICtrlCreateGroup("", 24, 272, 185, 113)
$CatalogueAppChk = GUICtrlCreateRadio("Catalogue Application", 32, 288, 137, 17)
GUICtrlSetBkColor(-1, 0xE3E3E3)
$NonCatalogueAppChk = GUICtrlCreateRadio("Non-Catalogue Application", 32, 320, 161, 17)
GUICtrlSetBkColor(-1, 0xE3E3E3)
$OtherAppChk = GUICtrlCreateRadio("Other / Internal Use", 32, 352, 137, 17)
GUICtrlSetBkColor(-1, 0xE3E3E3)
GUICtrlCreateGroup("", -99, -99, 1, 1)
; $OtherInternalGroup = GUICtrlCreateGroup("", 216, 272, 193, 113)
$OSCoreApplicationChk = GUICtrlCreateRadio("OS Core Application", 224, 288, 129, 17)
GUICtrlSetState(-1, $GUI_HIDE)
GUICtrlSetBkColor(-1, 0xE3E3E3)
$InternalOnlyChk = GUICtrlCreateRadio("Internal ONLY Application", 224, 320, 161, 17)
GUICtrlSetState(-1, $GUI_HIDE)
GUICtrlSetBkColor(-1, 0xE3E3E3)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$OtherInternalLabel = GUICtrlCreateLabel("Other / Internal Use", 216, 256, 118, 17, BitOR($SS_CENTER, $SS_CENTERIMAGE))
GUICtrlSetState(-1, $GUI_HIDE)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x000000)
GUICtrlSetBkColor(-1, 0xE3E3E3)
$ConfirmGroup = GUICtrlCreateGroup("", 24, 392, 385, 89)
$Confirm = GUICtrlCreateCheckbox("I confirm all details are correct, and I wish to proceed", 48, 456, 329, 17, BitOR($GUI_SS_DEFAULT_CHECKBOX, $BS_CENTER))
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetBkColor(-1, 0xE3E3E3)
$ConfirmDesc = GUICtrlCreateEdit("", 32, 408, 361, 41, 0, 0)
GUICtrlSetData(-1, StringFormat("Please confirm that all entered information is correct, and the you wish to \r\nproceed with the creation of the " & Chr(39) & "Application Toolkit Wrapper" & Chr(39) & "."))
GUICtrlSetBkColor(-1, 0xE3E3E3)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$ProceedBtn = GUICtrlCreateButton("Proceed", 128, 488, 75, 25)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x008000)
$CancelBtn = GUICtrlCreateButton("Cancel", 240, 488, 75, 25)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xFF0000)
$CapitaLogo = GUICtrlCreatePic("Logo.jpg", 24, 8, 159, 33)
$PackagingWrapperLabel = GUICtrlCreateLabel("Packaging Wrapper", 224, 8, 187, 28)
GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x000000)
$CreatedByLabel = GUICtrlCreateLabel("...", 16, 528, 405, 15, $SS_CENTER)
GUICtrlSetFont(-1, 7, 400, 0, "MS Serif")
$VerLabel = GUICtrlCreateLabel("Ver. 1.0 ALPHA", 328, 40, 79, 17)
$Step1Label = GUICtrlCreateLabel("Please Enter The Following Information", 24, 80, 274, 20, BitOR($SS_CENTER, $SS_CENTERIMAGE))
GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x000080)
GUICtrlSetBkColor(-1, 0xE3E3E3)
$Graphic3 = GUICtrlCreateGraphic(16, 72, 404, 452, BitOR($GUI_SS_DEFAULT_GRAPHIC, $SS_SIMPLE))
GUICtrlSetColor(-1, 0xE3E3E3)
GUICtrlSetBkColor(-1, 0xE3E3E3)
$ApplicationNameDesc = GUICtrlCreateEdit("", 24, 128, 393, 33, 0, 0)
GUICtrlSetData(-1, StringFormat("Must be in the following format: Manufacturer_AppName_AppVersion_Rev\r\nEG: Corel_WinZip_21.0_01"))
GUICtrlSetBkColor(-1, 0xE3E3E3)
$ADGroupNameLabel = GUICtrlCreateLabel("AD Group Name", 24, 200, 95, 17, BitOR($SS_CENTER, $SS_CENTERIMAGE))
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x000000)
GUICtrlSetBkColor(-1, 0xE3E3E3)
$ApplicationNameLabel = GUICtrlCreateLabel("Application Name", 24, 112, 103, 17, BitOR($SS_CENTER, $SS_CENTERIMAGE))
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x000000)
GUICtrlSetBkColor(-1, 0xE3E3E3)
$ApplicationTypeLabel = GUICtrlCreateLabel("Application Type", 24, 256, 99, 17, BitOR($SS_CENTER, $SS_CENTERIMAGE))
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x000000)
GUICtrlSetBkColor(-1, 0xE3E3E3)
GUISetState(@SW_SHOW)
#EndRegion ### END GUI section ###

;GLOBAL VARIABLES
Global $ApplicationName, $adstring1
Global $ADGroupName = $adstring1
Global $envSystemDrive = EnvGet("systemdrive")
Global $PackagingDirectory = "Packaging\???_Apps"
Global $FullDir = $envSystemDrive & "\" & $PackagingDirectory & "\" & $ApplicationName
Global $currentDate = @MDAY &"-"& @MON &"-"& @YEAR
Global $currentTime = @HOUR &":"& @MIN &":"& @SEC


; Register the WM_COMMAND to intercept when the value in the first input's value is changed.
    GUIRegisterMsg($WM_COMMAND, 'WM_COMMAND')


While 1
    $nMsg = GUIGetMsg()

    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

        Case $CancelBtn
            Exit

        Case $ProceedBtn
            ;Check Application Name Validity
            $ApplicationNameInputValid = StringSplit(GUICtrlRead($ApplicationNameInput), "_")
            If $ApplicationNameInputValid[0]<> 4 Then
            ConsoleWrite("Application Name - NOT Valid" & @CRLF)
            $ApplicationNameInputValidYes = 0
            MsgBox(0,"Are The Details Correct?", "Application Name NOT Valid.")
            GUICtrlSetState($ApplicationNameInput,$GUI_FOCUS)
            Elseif $ApplicationNameInputValid[0]= 4 Then
            ConsoleWrite("Application Name - Valid" & @CRLF)
            $ApplicationNameInputValidYes = 1
            EndIf

            ;Is Confirm Checkbox 'Checked'
            if GUICtrlRead($Confirm) = $GUI_CHECKED Then
                ConsoleWrite("$Confirm - ticked" & @CRLF)
                $ConfirmYes = 1
            Else
                $ConfirmYes = 0
                ConsoleWrite("$Confirm - NOT ticked" & @CRLF)
                MsgBox(0,"Are The Details Correct?", "Please complete confirmation.")
            EndIf

            ;Is $CatalogueAppChk 'Checked'
            if GUICtrlRead($CatalogueAppChk) = $GUI_CHECKED Then
                ConsoleWrite("$CatalogueAppChk - ticked" & @CRLF)
                $CatalogueAppChkYes = 1
            Else
                ConsoleWrite("$CatalogueAppChk - NOT ticked" & @CRLF)
                $CatalogueAppChkYes = 0
            EndIf

            ;Is $NonCatalogueAppChk 'Checked'
            if GUICtrlRead($NonCatalogueAppChk) = $GUI_CHECKED Then
                ConsoleWrite("$NonCatalogueAppChk -  ticked" & @CRLF)
                $NonCatalogueAppChkYes = 1
            Else
                ConsoleWrite("$NonCatalogueAppChk - NOT ticked" & @CRLF)
                $NonCatalogueAppChkYes = 0
            EndIf

            ;Is $OtherAppChk 'Checked'
            if GUICtrlRead($OtherAppChk) = $GUI_CHECKED Then
                ConsoleWrite("$OtherAppChk - ticked" & @CRLF)
                $OtherAppChkYes = 1
            Else
                ConsoleWrite("$OtherAppChk - NOT ticked" & @CRLF)
                $OtherAppChkYes = 0
            EndIf






 ConsoleWrite(@CRLF & "##### COMPLETED #####" & @CRLF)
    EndSwitch

WEnd

;Check for 'Application Name' update
Func _GetAppName()
    $adString = StringReplace(GUICtrlRead($ApplicationNameInput), "_", " ",2)
    $adstrings = StringSplit($adString, "_")
    Global $adString1 = $adstrings[1]
    Global $ApplicationName = GUICtrlRead($ApplicationNameInput)
        GUICtrlSetData($ADGroupNameInput, $adstring1)
EndFunc


;WM_COMMAND Function used for Auto Input of fields
Func WM_COMMAND($hWnd, $iMsg, $wParam, $lParam)
    #forceref $hWnd, $iMsg, $lParam

    Local $iHiWord = _WinAPI_HiWord($wParam) ; Control identification code.
    Local $iLoWord = _WinAPI_LoWord($wParam) ; Control identifier.
    Switch $iHiWord
        Case $EN_CHANGE ; When a change event is intercepted.
            Switch $iLoWord ; Retrieve the controlid.
                Case _GetAppName() ; If it matches the first input then call the custom function _GetInput.
                    ConsoleWrite("Debug: value was changed." & @CRLF)
                    _GetAppName()
            EndSwitch
    EndSwitch
    Return $GUI_RUNDEFMSG
EndFunc   ;==>WM_COMMAND

I hope all this makes sense.

Thanks in advance :)

Share this post


Link to post
Share on other sites

Something like this maybe:

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <MsgBoxConstants.au3>
#include <WinAPIShellEx.au3>
#include <FileConstants.au3>
#include <WinAPIFiles.au3>
#include <WinAPI.au3> ; used for Lo/Hi word

; Declare Global variables for WM_COMMAND and '_GetAppName()' function.
Global $__iComboWrite = 9999, $__iInputValue = 9999, $__iInputWrite = 9999
Global $bOtherInternalGroup = False

#Region ### START GUI section ###
$Form1_1 = GUICreate("Packaging Wrapper", 435, 545, -1, -1)
GUISetIcon("C.ico", -1)
GUISetBkColor(0xFFFFFF)
Global $ApplicationNameInput = GUICtrlCreateInput("", 24, 168, 385, 21)
GUICtrlSetTip(-1, "EG: Corel_WinZip_21.0_0.1")
$ADGroupNameInput = GUICtrlCreateInput("", 24, 224, 385, 21)
GUICtrlSetState($ADGroupNameInput, $GUI_DISABLE)
$AllowEditChk = GUICtrlCreateCheckbox("Allow Edit", 344, 200, 65, 17, BitOR($GUI_SS_DEFAULT_CHECKBOX,$BS_RIGHT))
GUICtrlSetBkColor(-1, 0xE3E3E3)
$ApplicationTypeGroup = GUICtrlCreateGroup("", 24, 272, 185, 113)
$CatalogueAppChk = GUICtrlCreateRadio("Catalogue Application", 32, 288, 137, 17)
GUICtrlSetBkColor(-1, 0xE3E3E3)
$NonCatalogueAppChk = GUICtrlCreateRadio("Non-Catalogue Application", 32, 320, 161, 17)
GUICtrlSetBkColor(-1, 0xE3E3E3)
$OtherAppChk = GUICtrlCreateRadio("Other / Internal Use", 32, 352, 137, 17)
GUICtrlSetBkColor(-1, 0xE3E3E3)
GUICtrlCreateGroup("", -99, -99, 1, 1)
; $OtherInternalGroup = GUICtrlCreateGroup("", 216, 272, 193, 113)
$OSCoreApplicationChk = GUICtrlCreateRadio("OS Core Application", 224, 288, 129, 17)
GUICtrlSetState(-1, $GUI_HIDE)
GUICtrlSetBkColor(-1, 0xE3E3E3)
$InternalOnlyChk = GUICtrlCreateRadio("Internal ONLY Application", 224, 320, 161, 17)
GUICtrlSetState(-1, $GUI_HIDE)
GUICtrlSetBkColor(-1, 0xE3E3E3)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$OtherInternalLabel = GUICtrlCreateLabel("Other / Internal Use", 216, 256, 118, 17, BitOR($SS_CENTER, $SS_CENTERIMAGE))
GUICtrlSetState(-1, $GUI_HIDE)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x000000)
GUICtrlSetBkColor(-1, 0xE3E3E3)

$ConfirmGroup = GUICtrlCreateGroup("", 24, 392, 385, 89)
$Confirm = GUICtrlCreateCheckbox("I confirm all details are correct, and I wish to proceed", 48, 456, 329, 17, BitOR($GUI_SS_DEFAULT_CHECKBOX, $BS_CENTER))
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetBkColor(-1, 0xE3E3E3)
$ConfirmDesc = GUICtrlCreateEdit("", 32, 408, 361, 41, 0, 0)
GUICtrlSetData(-1, StringFormat("Please confirm that all entered information is correct, and the you wish to \r\nproceed with the creation of the " & Chr(39) & "Application Toolkit Wrapper" & Chr(39) & "."))
GUICtrlSetBkColor(-1, 0xE3E3E3)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$ProceedBtn = GUICtrlCreateButton("Proceed", 128, 488, 75, 25)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x008000)
$CancelBtn = GUICtrlCreateButton("Cancel", 240, 488, 75, 25)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xFF0000)
$CapitaLogo = GUICtrlCreatePic("Logo.jpg", 24, 8, 159, 33)
$PackagingWrapperLabel = GUICtrlCreateLabel("Packaging Wrapper", 224, 8, 187, 28)
GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x000000)
$CreatedByLabel = GUICtrlCreateLabel("...", 16, 528, 405, 15, $SS_CENTER)
GUICtrlSetFont(-1, 7, 400, 0, "MS Serif")
$VerLabel = GUICtrlCreateLabel("Ver. 1.0 ALPHA", 328, 40, 79, 17)
$Step1Label = GUICtrlCreateLabel("Please Enter The Following Information", 24, 80, 274, 20, BitOR($SS_CENTER, $SS_CENTERIMAGE))
GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x000080)
GUICtrlSetBkColor(-1, 0xE3E3E3)
$Graphic3 = GUICtrlCreateGraphic(16, 72, 404, 452, BitOR($GUI_SS_DEFAULT_GRAPHIC, $SS_SIMPLE))
GUICtrlSetColor(-1, 0xE3E3E3)
GUICtrlSetBkColor(-1, 0xE3E3E3)
$ApplicationNameDesc = GUICtrlCreateEdit("", 24, 128, 393, 33, 0, 0)
GUICtrlSetData(-1, StringFormat("Must be in the following format: Manufacturer_AppName_AppVersion_Rev\r\nEG: Corel_WinZip_21.0_01"))
GUICtrlSetBkColor(-1, 0xE3E3E3)
$ADGroupNameLabel = GUICtrlCreateLabel("AD Group Name", 24, 200, 95, 17, BitOR($SS_CENTER, $SS_CENTERIMAGE))
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x000000)
GUICtrlSetBkColor(-1, 0xE3E3E3)
$ApplicationNameLabel = GUICtrlCreateLabel("Application Name", 24, 112, 103, 17, BitOR($SS_CENTER, $SS_CENTERIMAGE))
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x000000)
GUICtrlSetBkColor(-1, 0xE3E3E3)
$ApplicationTypeLabel = GUICtrlCreateLabel("Application Type", 24, 256, 99, 17, BitOR($SS_CENTER, $SS_CENTERIMAGE))
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x000000)
GUICtrlSetBkColor(-1, 0xE3E3E3)
GUISetState(@SW_SHOW)
#EndRegion ### END GUI section ###

;GLOBAL VARIABLES
Global $ApplicationName, $adstring1
Global $ADGroupName = $adstring1
Global $envSystemDrive = EnvGet("systemdrive")
Global $PackagingDirectory = "Packaging\???_Apps"
Global $FullDir = $envSystemDrive & "\" & $PackagingDirectory & "\" & $ApplicationName
Global $currentDate = @MDAY &"-"& @MON &"-"& @YEAR
Global $currentTime = @HOUR &":"& @MIN &":"& @SEC

AdlibRegister("_GetAppName")

While 1
    $nMsg = GUIGetMsg()
    If BitAND(GUICtrlRead($OtherAppChk), $GUI_CHECKED) = $GUI_CHECKED And $bOtherInternalGroup = False Then
        GUICtrlSetState($OSCoreApplicationChk, $GUI_SHOW)
        GUICtrlSetState($InternalOnlyChk, $GUI_SHOW)
        GUICtrlSetState($OtherInternalLabel, $GUI_SHOW)
        $bOtherInternalGroup = True
    ElseIf BitAND(GUICtrlRead($OtherAppChk), $GUI_UNCHECKED) = $GUI_UNCHECKED And $bOtherInternalGroup = True Then
        GUICtrlSetState($OSCoreApplicationChk, $GUI_HIDE)
        GUICtrlSetState($InternalOnlyChk, $GUI_HIDE)
        GUICtrlSetState($OtherInternalLabel, $GUI_HIDE)
        $bOtherInternalGroup = False
    EndIf
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $CancelBtn
            Exit
        Case $AllowEditChk
            If GUICtrlRead($AllowEditChk) = $GUI_CHECKED Then
                GUICtrlSetState($ADGroupNameInput, $GUI_ENABLE)
                AdlibUnRegister("_GetAppName")
            Else
                GUICtrlSetState($ADGroupNameInput, $GUI_DISABLE)
                AdlibRegister("_GetAppName")
            EndIf
        Case $ProceedBtn
            ;Check Application Name Validity
            $ApplicationNameInputValid = StringSplit(GUICtrlRead($ApplicationNameInput), "_")
            If $ApplicationNameInputValid[0]<> 4 Then
            ConsoleWrite("Application Name - NOT Valid" & @CRLF)
            $ApplicationNameInputValidYes = 0
            MsgBox(0,"Are The Details Correct?", "Application Name NOT Valid.")
            GUICtrlSetState($ApplicationNameInput,$GUI_FOCUS)
            Elseif $ApplicationNameInputValid[0]= 4 Then
            ConsoleWrite("Application Name - Valid" & @CRLF)
            $ApplicationNameInputValidYes = 1
            EndIf

            ;Is Confirm Checkbox 'Checked'
            if GUICtrlRead($Confirm) = $GUI_CHECKED Then
                ConsoleWrite("$Confirm - ticked" & @CRLF)
                $ConfirmYes = 1
            Else
                $ConfirmYes = 0
                ConsoleWrite("$Confirm - NOT ticked" & @CRLF)
                MsgBox(0,"Are The Details Correct?", "Please complete confirmation.")
            EndIf

            ;Is $CatalogueAppChk 'Checked'
            if GUICtrlRead($CatalogueAppChk) = $GUI_CHECKED Then
                ConsoleWrite("$CatalogueAppChk - ticked" & @CRLF)
                $CatalogueAppChkYes = 1
            Else
                ConsoleWrite("$CatalogueAppChk - NOT ticked" & @CRLF)
                $CatalogueAppChkYes = 0
            EndIf

            ;Is $NonCatalogueAppChk 'Checked'
            if GUICtrlRead($NonCatalogueAppChk) = $GUI_CHECKED Then
                ConsoleWrite("$NonCatalogueAppChk -  ticked" & @CRLF)
                $NonCatalogueAppChkYes = 1
            Else
                ConsoleWrite("$NonCatalogueAppChk - NOT ticked" & @CRLF)
                $NonCatalogueAppChkYes = 0
            EndIf

            ;Is $OtherAppChk 'Checked'
            if GUICtrlRead($OtherAppChk) = $GUI_CHECKED Then
                ConsoleWrite("$OtherAppChk - ticked" & @CRLF)
                $OtherAppChkYes = 1
            Else
                ConsoleWrite("$OtherAppChk - NOT ticked" & @CRLF)
                $OtherAppChkYes = 0
            EndIf

 ConsoleWrite(@CRLF & "##### COMPLETED #####" & @CRLF)
    EndSwitch

WEnd

;Check for 'Application Name' update
Func _GetAppName()
    $adString = StringReplace(GUICtrlRead($ApplicationNameInput), "_", " ",2)
    $adstrings = StringSplit($adString, "_")
    Global $adString1 = $adstrings[1]
    Global $ApplicationName = GUICtrlRead($ApplicationNameInput)
        GUICtrlSetData($ADGroupNameInput, $adstring1)
EndFunc

 

Edited by Subz

Share this post


Link to post
Share on other sites

Hey Subz,

Yes like that!! Although this still doesn't allow the user to edit the contents of the input box... I haven't a clue how to make the radiobutton show the other radio buttons either :( 

 

Thanks

Share this post


Link to post
Share on other sites

Updated post above, I'm a little confused with regards to WM_COMMAND (which was stopping you from editing the input box), what were trying to do with this?

Share this post


Link to post
Share on other sites

The wmcommand basically allows for the update of the AD Group box when entering the Application name. if you enter a application name it also populates the AD Group box stripping out the ' _ ' (Underscore) character.

 

Unfortunately this new code has stopped that functionality, it no longer auto populates the AD Group input box :(

Edited by amphoric
Update of information

Share this post


Link to post
Share on other sites

Have updated the post above, the WMCommand was being used incorrectly which is why I asked, I've now removed it and added AdLibRegister which uses the same _GetAppName function, when checking/unchecking "Allow Edit" this will enable/disable the _GetAppName function.  Hope that makes sense.

Share this post


Link to post
Share on other sites

OMG SUBZ! You are my HERO!!!!!!

Thank you so much, you don't know how long I've been looking at trying to do this!

Can you please explain the changes and why they were required? I would like to learn how/where I went wrong

 

Thanks

Share this post


Link to post
Share on other sites

Have added a few comments to the code, changed function global declarations to local, shouldn't declare global variables within functions.  Anyway I hope it makes sense, sorry documentation isn't my forte :)

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <MsgBoxConstants.au3>
#include <WinAPIShellEx.au3>
#include <FileConstants.au3>
#include <WinAPIFiles.au3>
#include <WinAPI.au3> ; used for Lo/Hi word

; Declare Global variables for WM_COMMAND and '_GetAppName()' function.
Global $__iComboWrite = 9999, $__iInputValue = 9999, $__iInputWrite = 9999
;~ Boolean to determine if changes to $bOtherInternalGroup has occurred
Global $bOtherInternalGroup = False

#Region ### START GUI section ###
$Form1_1 = GUICreate("Packaging Wrapper", 435, 545, -1, -1)
GUISetIcon("C.ico", -1)
GUISetBkColor(0xFFFFFF)
Global $ApplicationNameInput = GUICtrlCreateInput("", 24, 168, 385, 21)
GUICtrlSetTip(-1, "EG: Corel_WinZip_21.0_0.1")
$ADGroupNameInput = GUICtrlCreateInput("", 24, 224, 385, 21)
GUICtrlSetState($ADGroupNameInput, $GUI_DISABLE)
$AllowEditChk = GUICtrlCreateCheckbox("Allow Edit", 344, 200, 65, 17, BitOR($GUI_SS_DEFAULT_CHECKBOX,$BS_RIGHT))
GUICtrlSetBkColor(-1, 0xE3E3E3)
$ApplicationTypeGroup = GUICtrlCreateGroup("", 24, 272, 185, 113)
$CatalogueAppChk = GUICtrlCreateRadio("Catalogue Application", 32, 288, 137, 17)
GUICtrlSetBkColor(-1, 0xE3E3E3)
$NonCatalogueAppChk = GUICtrlCreateRadio("Non-Catalogue Application", 32, 320, 161, 17)
GUICtrlSetBkColor(-1, 0xE3E3E3)
$OtherAppChk = GUICtrlCreateRadio("Other / Internal Use", 32, 352, 137, 17)
GUICtrlSetBkColor(-1, 0xE3E3E3)
GUICtrlCreateGroup("", -99, -99, 1, 1)
; $OtherInternalGroup = GUICtrlCreateGroup("", 216, 272, 193, 113)
$OSCoreApplicationChk = GUICtrlCreateRadio("OS Core Application", 224, 288, 129, 17)
GUICtrlSetState(-1, $GUI_HIDE)
GUICtrlSetBkColor(-1, 0xE3E3E3)
$InternalOnlyChk = GUICtrlCreateRadio("Internal ONLY Application", 224, 320, 161, 17)
GUICtrlSetState(-1, $GUI_HIDE)
GUICtrlSetBkColor(-1, 0xE3E3E3)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$OtherInternalLabel = GUICtrlCreateLabel("Other / Internal Use", 216, 256, 118, 17, BitOR($SS_CENTER, $SS_CENTERIMAGE))
GUICtrlSetState(-1, $GUI_HIDE)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x000000)
GUICtrlSetBkColor(-1, 0xE3E3E3)

$ConfirmGroup = GUICtrlCreateGroup("", 24, 392, 385, 89)
$Confirm = GUICtrlCreateCheckbox("I confirm all details are correct, and I wish to proceed", 48, 456, 329, 17, BitOR($GUI_SS_DEFAULT_CHECKBOX, $BS_CENTER))
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetBkColor(-1, 0xE3E3E3)
$ConfirmDesc = GUICtrlCreateEdit("", 32, 408, 361, 41, 0, 0)
GUICtrlSetData(-1, StringFormat("Please confirm that all entered information is correct, and the you wish to \r\nproceed with the creation of the " & Chr(39) & "Application Toolkit Wrapper" & Chr(39) & "."))
GUICtrlSetBkColor(-1, 0xE3E3E3)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$ProceedBtn = GUICtrlCreateButton("Proceed", 128, 488, 75, 25)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x008000)
$CancelBtn = GUICtrlCreateButton("Cancel", 240, 488, 75, 25)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xFF0000)
$CapitaLogo = GUICtrlCreatePic("Logo.jpg", 24, 8, 159, 33)
$PackagingWrapperLabel = GUICtrlCreateLabel("Packaging Wrapper", 224, 8, 187, 28)
GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x000000)
$CreatedByLabel = GUICtrlCreateLabel("...", 16, 528, 405, 15, $SS_CENTER)
GUICtrlSetFont(-1, 7, 400, 0, "MS Serif")
$VerLabel = GUICtrlCreateLabel("Ver. 1.0 ALPHA", 328, 40, 79, 17)
$Step1Label = GUICtrlCreateLabel("Please Enter The Following Information", 24, 80, 274, 20, BitOR($SS_CENTER, $SS_CENTERIMAGE))
GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x000080)
GUICtrlSetBkColor(-1, 0xE3E3E3)
$Graphic3 = GUICtrlCreateGraphic(16, 72, 404, 452, BitOR($GUI_SS_DEFAULT_GRAPHIC, $SS_SIMPLE))
GUICtrlSetColor(-1, 0xE3E3E3)
GUICtrlSetBkColor(-1, 0xE3E3E3)
$ApplicationNameDesc = GUICtrlCreateEdit("", 24, 128, 393, 33, 0, 0)
GUICtrlSetData(-1, StringFormat("Must be in the following format: Manufacturer_AppName_AppVersion_Rev\r\nEG: Corel_WinZip_21.0_01"))
GUICtrlSetBkColor(-1, 0xE3E3E3)
$ADGroupNameLabel = GUICtrlCreateLabel("AD Group Name", 24, 200, 95, 17, BitOR($SS_CENTER, $SS_CENTERIMAGE))
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x000000)
GUICtrlSetBkColor(-1, 0xE3E3E3)
$ApplicationNameLabel = GUICtrlCreateLabel("Application Name", 24, 112, 103, 17, BitOR($SS_CENTER, $SS_CENTERIMAGE))
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x000000)
GUICtrlSetBkColor(-1, 0xE3E3E3)
$ApplicationTypeLabel = GUICtrlCreateLabel("Application Type", 24, 256, 99, 17, BitOR($SS_CENTER, $SS_CENTERIMAGE))
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x000000)
GUICtrlSetBkColor(-1, 0xE3E3E3)
GUISetState(@SW_SHOW)
#EndRegion ### END GUI section ###

;GLOBAL VARIABLES
Global $ApplicationName, $adstring1
Global $ADGroupName = $adstring1
Global $envSystemDrive = EnvGet("systemdrive")
Global $PackagingDirectory = "Packaging\???_Apps"
Global $FullDir = $envSystemDrive & "\" & $PackagingDirectory & "\" & $ApplicationName
Global $currentDate = @MDAY &"-"& @MON &"-"& @YEAR
Global $currentTime = @HOUR &":"& @MIN &":"& @SEC

;~ Registers _GetAppName as an Adlib function, checks every 250ms (default)
AdlibRegister("_GetAppName")

While 1
    $nMsg = GUIGetMsg()
    ;~ Check if radio button ($OtherAppChk) is selected and hide/show hidden radio buttons
    ;~ Uses $bOtherInternalGroup (Boolean) to stop flickering
    If BitAND(GUICtrlRead($OtherAppChk), $GUI_CHECKED) = $GUI_CHECKED And $bOtherInternalGroup = False Then
        GUICtrlSetState($OSCoreApplicationChk, $GUI_SHOW)
        GUICtrlSetState($InternalOnlyChk, $GUI_SHOW)
        GUICtrlSetState($OtherInternalLabel, $GUI_SHOW)
        $bOtherInternalGroup = True
    ElseIf BitAND(GUICtrlRead($OtherAppChk), $GUI_UNCHECKED) = $GUI_UNCHECKED And $bOtherInternalGroup = True Then
        GUICtrlSetState($OSCoreApplicationChk, $GUI_HIDE)
        GUICtrlSetState($InternalOnlyChk, $GUI_HIDE)
        GUICtrlSetState($OtherInternalLabel, $GUI_HIDE)
        $bOtherInternalGroup = False
    EndIf
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $CancelBtn
            Exit
        Case $AllowEditChk
            ;~ Check if $AllowEditChk Checkbox is checked or not:
            ;~ Enables/Disabled $ADGroupNameInput
            ;~ Register/Unregister _GetAppName function
            If GUICtrlRead($AllowEditChk) = $GUI_CHECKED Then
                GUICtrlSetState($ADGroupNameInput, $GUI_ENABLE)
                AdlibUnRegister("_GetAppName")
            Else
                GUICtrlSetState($ADGroupNameInput, $GUI_DISABLE)
                AdlibRegister("_GetAppName")
            EndIf
        Case $ProceedBtn
            ;Check Application Name Validity
            $ApplicationNameInputValid = StringSplit(GUICtrlRead($ApplicationNameInput), "_")
            If $ApplicationNameInputValid[0]<> 4 Then
            ConsoleWrite("Application Name - NOT Valid" & @CRLF)
            $ApplicationNameInputValidYes = 0
            MsgBox(0,"Are The Details Correct?", "Application Name NOT Valid.")
            GUICtrlSetState($ApplicationNameInput,$GUI_FOCUS)
            Elseif $ApplicationNameInputValid[0]= 4 Then
            ConsoleWrite("Application Name - Valid" & @CRLF)
            $ApplicationNameInputValidYes = 1
            EndIf

            ;Is Confirm Checkbox 'Checked'
            if GUICtrlRead($Confirm) = $GUI_CHECKED Then
                ConsoleWrite("$Confirm - ticked" & @CRLF)
                $ConfirmYes = 1
            Else
                $ConfirmYes = 0
                ConsoleWrite("$Confirm - NOT ticked" & @CRLF)
                MsgBox(0,"Are The Details Correct?", "Please complete confirmation.")
            EndIf

            ;Is $CatalogueAppChk 'Checked'
            if GUICtrlRead($CatalogueAppChk) = $GUI_CHECKED Then
                ConsoleWrite("$CatalogueAppChk - ticked" & @CRLF)
                $CatalogueAppChkYes = 1
            Else
                ConsoleWrite("$CatalogueAppChk - NOT ticked" & @CRLF)
                $CatalogueAppChkYes = 0
            EndIf

            ;Is $NonCatalogueAppChk 'Checked'
            if GUICtrlRead($NonCatalogueAppChk) = $GUI_CHECKED Then
                ConsoleWrite("$NonCatalogueAppChk -  ticked" & @CRLF)
                $NonCatalogueAppChkYes = 1
            Else
                ConsoleWrite("$NonCatalogueAppChk - NOT ticked" & @CRLF)
                $NonCatalogueAppChkYes = 0
            EndIf

            ;Is $OtherAppChk 'Checked'
            if GUICtrlRead($OtherAppChk) = $GUI_CHECKED Then
                ConsoleWrite("$OtherAppChk - ticked" & @CRLF)
                $OtherAppChkYes = 1
            Else
                ConsoleWrite("$OtherAppChk - NOT ticked" & @CRLF)
                $OtherAppChkYes = 0
            EndIf

 ConsoleWrite(@CRLF & "##### COMPLETED #####" & @CRLF)
    EndSwitch

WEnd

;Check for 'Application Name' update
Func _GetAppName()
    Local  $adString = StringReplace(GUICtrlRead($ApplicationNameInput), "_", " ",2)
    Local $adstrings = StringSplit($adString, "_")
    Local $adString1 = $adstrings[1]
    Local $ApplicationName = GUICtrlRead($ApplicationNameInput)
        GUICtrlSetData($ADGroupNameInput, $adstring1)
EndFunc

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Similar Content

    • By TheSaint
      TeraCopy Timer - A program of mine, front end really, that I have been working on (on & off) for some time, but not shared here before, that I recall. Third party program TeraCopy is required.
      Many of you will be familiar with TeraCopy, and it has been discussed here at AF on several occasions, in various sub forums, including Chat.
      BE ADVISED - I still use an older version of TeraCopy (v2.27), a goody but an oldy, so have only tested my program with that. It may work with the newer v3.xx, or may be easily adjusted to do so, but I have not yet gone that route. Likewise, I only use it with Win 7 and Win XP, but I don't imagine there should be any issues with newer Windows. Add to that, my program being devised and created in AutoIt v3.3.0.0.
      So what is TeraCopy Timer and why might you need it?
      --------------------------------------------------------------------------------------
      Those familiar with TeraCopy use, know you can run multiple copy or move jobs either simultaneously or concurrently (one immediately after another has finished). With the free version at least, you have no control over precise order or timing, and no way to deal (without manual interaction) with the pesky Thumbs.db files in Win XP. TeraCopy Timer allows you to do all those things, and in a batch fashion.
      --------------------------------------------------------------------------------------
      Some screenshots and brief explanation
      Main Window
      Minimalist Window
      This new WAIT feature is the simplest and best way to use the program generally (in my view) ... but check out the following, as it is not always the case.
      Advanced Delay Window
      WARNING - It should go without saying, that you take all the usual precautions. For instance, don't use move with the only copy you have of precious files. BACKUP BACKUP BACKUP! Don't hold me liable for anything, except for being a nice guy who likes to share.
      TeraCopy Timer v3.1.zip  (see detail at Post #37)
      Enjoy!
      OLDER DOWNLOADS
      P.S. I am not affiliated in any way with those who created and provide the excellent third party program - TeraCopy.
    • By Earthshine
      This is pretty useful to me at least, I hope to others. Whenever you need to poke a button or such on a GUI, you can just make calls to this UDF and instruct it how long to wait, 0 is forever, anyway, let the code to the explaining. Feel free to help expand this UDF. I plan to create new ones as I go along that support all the Win32 and .NET Controls. Ultimately, I would like to be able to fully control any type of control, this works well with most. Just an example of what you can do.
       
      The test installs and can uninstall 7-Zip 15.14 (x64) Setup.exe
      NOTE: Logger Author(s) .....: Michael Mims (zorphnog)
      ;                    the logging script can be obtained here
      ;                   https://www.autoitscript.com/forum/topic/156196-log4a-a-logging-udf/
       
       
       
       
       
       
      WaitForControls.au3
    • By ozymandius257
      I'm trying to check the status of the checkbox for sharing a folder that you see when you right-click on a  folder, go to the sharing tab, then click on Advanced Sharing.

      The check box is labelled Share this folder, and looking at it using AutoIt window info, I get the following information..
      >>>> Control <<<<
      Class:    Button
      Instance:    1
      ClassnameNN:    Button1
      Name:    
      Advanced (Class):    [CLASS:Button; INSTANCE:1]
      ID:    1020
      Text:    &Share this folder
      Position:    15, 16
      Size:    306, 13
      ControlClick Coords:    57, 4
      Style:    0x50010003
      ExStyle:    0x00000004
      Handle:    0x0000000000420A52
      I'm using the following code..
      If ControlCommand("Sharing","","[CLASS:Button; INSTANCE:1]","IsChecked","") = 0 Then
          MsgBox(0, "", "not checked")
      Else
          MsgBox(0, "", "checked")
      EndIf
      But this insists the check box isn't checked when it is.  I have also tried ControlCommand("Sharing","","[ID:1020]","IsChecked","") and ControlCommand("Sharing","","Share this folder","IsChecked","") and ControlCommand("Sharing","","&Share this folder","IsChecked",""), with no joy.
       
      Any ideas?
    • By stick3r
      Hi, I have this script and I need to reset all checkboxes to UNCHECKED when button is pressed.
      #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= Global $Form = GUICreate("Checklist", 190, 407, 1233, 178) Global $text = "" Global $CheckBox GUICtrlCreateTab(1, 1, 190, 365) GUICtrlCreateTabItem("TAB 1") Global $InputCaseID1 = GUICtrlCreateInput($text, 80, 25, 80, 21) Global $lblCaseID = GUICtrlCreateLabel("Case ID", 8, 30, 68, 18) Global $CheckBox1 = GUICtrlCreateCheckbox("1111111", 8, 48, 110, 17) Global $CheckBox2 = GUICtrlCreateCheckbox("2222222", 8, 72, 110, 17) Global $CheckBox3 = GUICtrlCreateCheckbox("333333333", 8, 96, 110, 17) Global $CheckBox4 = GUICtrlCreateCheckbox("444444444", 8, 120, 110, 17) Global $CheckBox5 = GUICtrlCreateCheckbox("55555555", 8, 144, 110, 17) Global $CheckBox6 = GUICtrlCreateCheckbox("666666666", 8, 168, 110, 17) Global $CheckBox7 = GUICtrlCreateCheckbox("77777777", 8, 192, 150, 17) Global $CheckBox8 = GUICtrlCreateCheckbox("888888888", 8, 216, 150, 17) Global $CheckBox9 = GUICtrlCreateCheckbox("99999999", 8, 240, 110, 17) Global $CheckBox10 = GUICtrlCreateCheckbox("45646", 8, 264, 110, 17) Global $CheckBox11 = GUICtrlCreateCheckbox("4345634", 8, 288, 97, 17) Global $CheckBox12 = GUICtrlCreateCheckbox("4563456", 8, 312, 97, 17) Global $CheckBox13 = GUICtrlCreateCheckbox("456456", 8, 336, 97, 17) GUICtrlCreateTabItem("TAB 2") Global $InputCaseID2 = GUICtrlCreateInput("", 80, 25, 80, 21) Global $lblCaseID = GUICtrlCreateLabel("Case ID", 8, 30, 68, 18) Global $CheckBox14 = GUICtrlCreateCheckbox("AAAAAAA", 8, 48, 110, 17) Global $CheckBox15 = GUICtrlCreateCheckbox("PPPPPPPPP", 8, 72, 110, 17) Global $CheckBox16 = GUICtrlCreateCheckbox("BBBBBBBB", 8, 96, 110, 17) Global $CheckBox17 = GUICtrlCreateCheckbox("CCCCCCCCCCCCC", 8, 120, 110, 17) Global $CheckBox18 = GUICtrlCreateCheckbox("DDDDDDDDDDDDD", 8, 144, 110, 17) Global $CheckBox19 = GUICtrlCreateCheckbox("EEEEEEEEEE", 8, 168, 110, 17) Global $CheckBox20 = GUICtrlCreateCheckbox("FFFFFFFFFFF", 8, 192, 150, 17) Global $CheckBox21 = GUICtrlCreateCheckbox("GGGGGGGGGG", 8, 216, 150, 17) Global $CheckBox22 = GUICtrlCreateCheckbox("HHHHHHHHH", 8, 240, 110, 17) Global $CheckBox23 = GUICtrlCreateCheckbox("IIIIIIIII", 8, 264, 110, 17) Global $CheckBox24 = GUICtrlCreateCheckbox("JJJJJJJ", 8, 288, 97, 17) Global $CheckBox25 = GUICtrlCreateCheckbox("KKKKKKKKKKK", 8, 312, 97, 17) Global $CheckBox26 = GUICtrlCreateCheckbox("LLLLLLLLL", 8, 336, 97, 17) GUICtrlCreateTabItem("") Global $CheckBoxAlwaysOnTop = GUICtrlCreateCheckbox("Always on Top", 8, 380, 97, 17) Global $btnReset = GUICtrlCreateButton("RESET", 104, 365, 75, 41) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $CheckBoxAlwaysOnTop _SetAlwaysOnTop() Case $btnReset For $i = 7 To 19 Step 1 ;Remove checked CheckBoxes GUICtrlSetState($CheckBox&$i, $GUI_UNCHECKED) Next For $i = 23 To 35 Step 1 GUICtrlSetState($CheckBox&$i, $GUI_UNCHECKED) Next GUICtrlSetData($InputCaseID1, "") GUICtrlSetData($InputCaseID2, "") EndSwitch WEnd Func _SetAlwaysOnTop() If GUICtrlRead($CheckBoxAlwaysOnTop) = $GUI_CHECKED Then WinSetOnTop($Form, "", 1) ;On top Else WinSetOnTop($Form, "", 0) ;Not on top EndIf EndFunc ;==>_SetAlwaysOnTop My question is:
      Why this  For loop for GUICtrlSetState($CheckBox&$i, $GUI_UNCHECKED) does not work properly
      I have $CheckBox1, $CheckBox2.......till $CheckBox26 and with For $i = 1 To 26 it does not work. It only unchecks few of them, but not all.
      Later I have discovered that For $i = 7 To 19 removes  $CheckBox1 to  $CheckBox13 and For $i = 23 To 35 removes  $CheckBox14 to  $CheckBox26
      Any idea why?
    • By OneSolution
      Hi guys! I have these checkbox that I'm trying to click on. They have the same inner-text string but a different ID. Sometime there can be as many as 4 checkbox
      with the same string but the ID is always different. I tried a few methods down below but I'm unable to make any real results. Any suggestions or solutions I would
      appreciate it very much.
      <ul><li class="cx-list-item-wrapper" data-day="Aug 2 2018 07:27:37 GMT-0700 (Pacific Daylight Time)"><div class=""><div class="cx-list-item-container"><div class="cx-list-item cx-item-icon-2 pointer-cursor"><div class="cx-item-contents cx-item-time col-md-2"><!-- react-text: 675 -->Morning<!-- /react-text --><!-- react-text: 676 -->&nbsp;<!-- /react-text --></div><div class="cx-item-contents col-md-1"><!-- react-text: 678 -->OTHER<!-- /react-text --><!-- react-text: 679 -- >&nbsp;<!-- /react-text --></div><div class="cx-item-contents col-md-2"><!-- react-text: 681 -->8:30 AM<!-- /react-text --><!-- react-text: 682 -->&nbsp;<!-- /react-text --></div><div class="cx-item-contents col-md-2"><!-- react-text: 684 -->10:30 AM<!-- /react-text --><!-- react-text: 685 -->&nbsp;<!-- /react-text -- ></div><div class="cx-item-contents col-md-1"><!-- react-text: 687 -->SRV<!-- /react-text --><!-- react-text: 688 -->&nbsp;<!-- /react-text --></div></div></div><div class="pull-right cx-listitem-chk"><div><input id="cx_checkbox1" class="cx-fa-chk cx-selfschedule-chk" value="on" type="checkbox"><label for="cx_checkbox1"></label></div></div></div></li><li class="cx-list-item-wrapper" data-day="Aug 2 2018 07:27:37 GMT-0700 (Pacific Daylight Time)"><div class=""><div class="cx-list-item-container"><div class="cx-list-item cx-item-icon-2 pointer-cursor"><div class="cx-item-contents cx-item-time col-md-1"><!-- react-text: 698 -- >Morning<!-- /react-text --><!-- react-text: 699 -->&nbsp;<!-- /react-text --></div><div class="cx-item-contents col-md-1"><!-- react-text: 701 -->OTHER<!-- /react- text --><!-- react-text: 702 -->&nbsp;<!-- /react-text --></div><div class="cx-item-contents col-md-2"><!-- react-text: 704 -->8:30 AM<!-- /react-text --><!-- react-text: 705 -->&nbsp;<!-- /react-text --></div><div class="cx-item-contents col-md-2"><!-- react-text: 707 -->2:30 PM<!-- /react-text --><!-- react-text: 708 -- >&nbsp;<!-- /react-text --></div><div class="cx-item-contents col-md-1"><!-- react-text: 710 -->SRV<!-- /react-text --><!-- react-text: 711 -->&nbsp;<!-- /react-text --></div></div></div><div class="pull-right cx-listitem-chk"><div><input id="cx_checkbox2" class="cx-fa-chk cx-selfschedule-chk" value="on" type="checkbox"><label for="cx_checkbox2"></label></div></div></div></li></ul> I tried the _IETagNameGetCollection() but it only check the box but doesn't fire the event! And I'm unable to submit that without a click action.
      Func _Box1() $oInputs = _IETagNameGetCollection($oIE, "input") For $oInput In $oInputs If $oInput.id == "cx_checkbox1" Then $oInput.checked = true Next Sleep(10) ToolTip('box1') EndFunc ;==>_Box1 I also tried click by text.The boxes do get check by a click but the problem with that is it will select every box that has the same string. I'm allowed only to check 1 box selection at a time per day for the submit button to work.  Any preference to select only the second box and bypass the other?
      Func _Morning() For $a In _IETagNameGetCollection($oIE, "div") If StringInStr(_IEPropertyGet($a, "innerText"), "Morning") Then _IEAction($a, "click") EndIf Next Sleep(10) ToolTip('Morning selected') EndFunc ;==>Morning The last method I tried was _IEGetObjById(). It doesn't click or respond to the checkbox.
      Func _Click1() $oChk = _IEGetObjById($oIE, "cx_checkbox1") _IEAction($oChk, 'click') Sleep(20) ToolTip('box1') EndFunc ;==>_Click1  
×
×
  • Create New...