Jump to content

inputbox $GUI_ENABLE with for next


tbaror
 Share

Recommended Posts

Hello All,

i am writing GUIOnEventMode style utility

in the GUI i have 8 input box that should be $GUI_ENABLE according to combo box with option from 1 to 8

that part i don't know how to implement is to loop with the value retrieved from combo-box and enable input-box according to value from combo-box.

please advise

thanks

Link to comment
Share on other sites

Hello All,

i am writing GUIOnEventMode style utility

in the GUI i have 8 input box that should be $GUI_ENABLE according to combo box with option from 1 to 8

that part i don't know how to implement is to loop with the value retrieved from combo-box and enable input-box according to value from combo-box.

please advise

thanks

Would you have some code? :)
Link to comment
Share on other sites

Hello All,

i am writing GUIOnEventMode style utility

in the GUI i have 8 input box that should be $GUI_ENABLE according to combo box with option from 1 to 8

that part i don't know how to implement is to loop with the value retrieved from combo-box and enable input-box according to value from combo-box.

please advise

thanks

this is the relevant part of the code i hope.

thanks

Dim $ManTest [10] [3]

$CheckTrheads1 = GUICtrlCreateCheckbox("# of Threads -t (throughput mode)", 6, 429, 185, 17)
GUICtrlSetOnEvent($CheckTrheads1, "CheckTrheads1Click")

$ReadyM = GUICtrlCreateButton("Ready", 8, 536, 90, 22, $BS_FLAT)
GUICtrlSetFont($ReadyM, 8, 400, 0, "Arial")
GUICtrlSetBkColor($ReadyM, 0xC0C0C0)
GUICtrlSetOnEvent($ReadyM, "ReadyMClick")


$Thread4 = GUICtrlCreateInput("Thread4", 69, 472, 169, 22)
GUICtrlSetFont($Thread4, 8, 400, 0, "Arial")
GUICtrlSetOnEvent($Thread4, "Thread4Change")
GUICtrlSetState($Thread4, $GUI_DISABLE)
$Thread3 = GUICtrlCreateInput("Thread3", 69, 427, 169, 22)
GUICtrlSetFont($Thread3, 8, 400, 0, "Arial")
GUICtrlSetOnEvent($Thread3, "Thread3Change")
GUICtrlSetState($Thread3, $GUI_DISABLE)
$Thread2 = GUICtrlCreateInput("Thread2", 68, 390, 169, 22)
GUICtrlSetFont($Thread2, 8, 400, 0, "Arial")
GUICtrlSetOnEvent($Thread2, "Thread2Change")
GUICtrlSetState($Thread2, $GUI_DISABLE)
$Thread1 = GUICtrlCreateInput("Thread1", 69, 352, 169, 22)
GUICtrlSetFont($Thread1, 8, 400, 0, "Arial")
GUICtrlSetOnEvent($Thread1, "Thread1Change")
GUICtrlSetState($Thread1, $GUI_DISABLE)
$Thread5 = GUICtrlCreateInput("Thread5", 320, 352, 169, 22)
GUICtrlSetFont($Thread5, 8, 400, 0, "Arial")
GUICtrlSetOnEvent($Thread5, "Thread5Change")
GUICtrlSetState($Thread5, $GUI_DISABLE)
$Thread6 = GUICtrlCreateInput("Thread6", 320, 390, 169, 22)
GUICtrlSetFont($Thread6, 8, 400, 0, "Arial")
GUICtrlSetOnEvent($Thread6, "Thread6Change")
GUICtrlSetState($Thread6, $GUI_DISABLE)
$Thread7 = GUICtrlCreateInput("Thread7", 320, 427, 169, 22)
GUICtrlSetFont($Thread7, 8, 400, 0, "Arial")
GUICtrlSetOnEvent($Thread7, "Thread7Change")
GUICtrlSetState($Thread7, $GUI_DISABLE)
$Tread8 = GUICtrlCreateInput("Thread8", 320, 472, 169, 22)
GUICtrlSetFont($Tread8, 8, 400, 0, "Arial")
GUICtrlSetOnEvent($Tread8, "Tread8Change")
GUICtrlSetState($Tread8, $GUI_DISABLE)


Func CheckTrheads1Click()
    
    $menustate  = GUICtrlRead($CheckTrheads1)
    If $menustate = $GUI_CHECKED Then
    GUICtrlSetState ($ComboThreads1, $GUI_ENABLE)
    GUICtrlSetState ($CheckFILE1, $GUI_DISABLE)
    GUICtrlSetState ($Flocation, $GUI_DISABLE)
    GUICtrlSetState ($Fname, $GUI_DISABLE)
    GUICtrlSetState ($CheckFILE2, $GUI_ENABLE)
    GUICtrlSetState ($CheckFILE2, $GUI_CHECKED)
    $ManTest [6] [0]= "-t"
    $ManTest [6] [1]= ""
    $ManTest [9] [0]= "-F"
    $ManTest [9] [1]= ""
    

ElseIf $menustate = $GUI_UNCHECKED Then
    
    GUICtrlSetState ($CheckFILE2, $GUI_UNCHECKED)
    GUICtrlSetState ($ComboThreads1, $GUI_DISABLE)
    GUICtrlSetState ($CheckFILE1, $GUI_ENABLE)
    GUICtrlSetState ($Flocation, $GUI_ENABLE)
    GUICtrlSetState ($Fname, $GUI_ENABLE)
    GUICtrlSetState ($CheckFILE2, $GUI_DISABLE)
    $ManTest [6] [0]= ""
    $ManTest [6] [1]= ""
    $ManTest [9] [0]= ""
    $ManTest [9] [1]= ""
    
    EndIf
    
EndFunc

Func ReadyMClick()

;########### start -t thread test######################################

If  $ManTest [6] [0]= "-t" And GUICtrlRead ($ComboThreads1) = "" Then
        MsgBox(16, "Error","Nuber of Thread MUST BE Selected")
        Return
        
        
    ElseIf $ManTest [6] [0]= "-t" And GUICtrlRead ($ComboThreads1) <> "" Then
        $ManTest [6] [1] = GUICtrlRead ($ComboThreads1)
        $log = "$Thread"
        $T = Number($ManTest [6] [1])
        for $y = 0 to $T
        GUICtrlSetState ($log & $y, $GUI_ENABLE)
        MsgBox(16, "",$log & $y)
    Next
    
    EndIf   





;########### End -t thread test######################################
 
 
 
EndFunc  ;==>Click
Link to comment
Share on other sites

Func CheckTrheads1Click()
    
    If _IsChecked($CheckTrheads1) Then
    GUICtrlSetState ($ComboThreads1, $GUI_ENABLE)
    GUICtrlSetState ($CheckFILE1, $GUI_DISABLE)
    GUICtrlSetState ($Flocation, $GUI_DISABLE)
    GUICtrlSetState ($Fname, $GUI_DISABLE)
    GUICtrlSetState ($CheckFILE2, $GUI_ENABLE)
    GUICtrlSetState ($CheckFILE2, $GUI_CHECKED)
    $ManTest [6] [0]= "-t"
    $ManTest [6] [1]= ""
    $ManTest [9] [0]= "-F"
    $ManTest [9] [1]= ""
    

Else
    
    GUICtrlSetState ($CheckFILE2, $GUI_UNCHECKED)
    GUICtrlSetState ($ComboThreads1, $GUI_DISABLE)
    GUICtrlSetState ($CheckFILE1, $GUI_ENABLE)
    GUICtrlSetState ($Flocation, $GUI_ENABLE)
    GUICtrlSetState ($Fname, $GUI_ENABLE)
    GUICtrlSetState ($CheckFILE2, $GUI_DISABLE)
    $ManTest [6] [0]= ""
    $ManTest [6] [1]= ""
    $ManTest [9] [0]= ""
    $ManTest [9] [1]= ""
    
EndIf
    
EndFunc

Func _IsChecked($control)
   Return BitAnd(GUICtrlRead($control),$GUI_CHECKED) = $GUI_CHECKED
EndFunc

EDIT......

8)

Edited by Valuater

NEWHeader1.png

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...