Jump to content

Action depended on two actions


Recommended Posts

i'm sorry again but i can't figure this out i paste my gui code here please help me if you can

thanks in advance

#region --- GuiBuilder code Start ---
; Script generated by AutoBuilder 0.6 Prototype

#include <GuiConstants.au3>

$1 = GuiCreate("MutilTool Page 1" , 392, 323,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS))

$READ = GUICTRLREAD(10)
$Group1 = GUICtrlCreateGroup ("Choose Your Action", 60, 30, 280, 110 )
$Radio_1 = GuiCtrlCreateRadio("1", 90, 50, 130, 20)
[/quote]$Radio_2 = GuiCtrlCreateRadio("2", 90, 80, 130, 20)
$Radio_4 = GuiCtrlCreateRadio("3", 90, 110, 130, 20)
$Group1 = GUICtrlCreateGroup ("",-99,-99,1,1) ;close group

GUICtrlSetState($Radio_4,$GUI_DISABLE)
GUICtrlSetState($Radio_2,$GUI_DISABLE)
GUICtrlSetState($Radio_1,$GUI_DISABLE)

$Checkbox_5 = GuiCtrlCreateCheckbox("4", 60, 10, 180, 10)
$Checkbox_6 = GuiCtrlCreateCheckbox("5", 60, 150, 220, 10)
$Checkbox_7 = GuiCtrlCreateCheckbox("6", 60, 180, 210, 20)
$Button_2 = GuiCtrlCreateButton("&OK", 150, 280, 90, 30)
GUICtrlSetState($Button_2,$GUI_FOCUS)  


GuiSetState()
While 1
    $msg = GuiGetMsg()
    Select

    Case $msg = $Button_2
        
    
    Case Else
        if GUICtrlRead($Checkbox_5) = 1 Then 
            GUICtrlSetState($Radio_4,$GUI_ENABLE)
            GUICtrlSetState($Radio_2,$GUI_ENABLE)
            gUICtrlSetState($Radio_1,$GUI_ENABLE)
            
        ElseIf GUICtrlRead($Checkbox_5) = 4 Then
            GUICtrlSetState($Radio_4,$GUI_DISABLE)
            GUICtrlSetState($Radio_2,$GUI_DISABLE)
            GUICtrlSetState($Radio_1,$GUI_DISABLE)
        EndIf
    EndSelect
WEnd
Exit

i need to make it close the gui after i checked the box in "$Checkbox_7" and click "$Button_2"

only after these two conditions the gui should close

Link to comment
Share on other sites

  • Moderators

i'm sorry again but i can't figure this out i paste my gui code here please help me if you can

thanks in advance

#region --- GuiBuilder code Start ---
; Script generated by AutoBuilder 0.6 Prototype

#include <GuiConstants.au3>

$1 = GuiCreate("MutilTool Page 1" , 392, 323,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS))

$READ = GUICTRLREAD(10)
$Group1 = GUICtrlCreateGroup ("Choose Your Action", 60, 30, 280, 110 )
$Radio_1 = GuiCtrlCreateRadio("1", 90, 50, 130, 20)
[/quote]$Radio_2 = GuiCtrlCreateRadio("2", 90, 80, 130, 20)
$Radio_4 = GuiCtrlCreateRadio("3", 90, 110, 130, 20)
$Group1 = GUICtrlCreateGroup ("",-99,-99,1,1);close group

GUICtrlSetState($Radio_4,$GUI_DISABLE)
GUICtrlSetState($Radio_2,$GUI_DISABLE)
GUICtrlSetState($Radio_1,$GUI_DISABLE)

$Checkbox_5 = GuiCtrlCreateCheckbox("4", 60, 10, 180, 10)
$Checkbox_6 = GuiCtrlCreateCheckbox("5", 60, 150, 220, 10)
$Checkbox_7 = GuiCtrlCreateCheckbox("6", 60, 180, 210, 20)
$Button_2 = GuiCtrlCreateButton("&OK", 150, 280, 90, 30)
GUICtrlSetState($Button_2,$GUI_FOCUS)  
GuiSetState()
While 1
    $msg = GuiGetMsg()
    Select

    Case $msg = $Button_2
        
    
    Case Else
        if GUICtrlRead($Checkbox_5) = 1 Then 
            GUICtrlSetState($Radio_4,$GUI_ENABLE)
            GUICtrlSetState($Radio_2,$GUI_ENABLE)
            gUICtrlSetState($Radio_1,$GUI_ENABLE)
            
        ElseIf GUICtrlRead($Checkbox_5) = 4 Then
            GUICtrlSetState($Radio_4,$GUI_DISABLE)
            GUICtrlSetState($Radio_2,$GUI_DISABLE)
            GUICtrlSetState($Radio_1,$GUI_DISABLE)
        EndIf
    EndSelect
WEnd
Exit

i need to make it close the gui after i checked the box in "$Checkbox_7" and click "$Button_2"

only after these two conditions the gui should close

I can't make heads or tails of what your trying to do with the group and radio on top of the check boxes... can you walk through what your trying to accomplish with this? Take a look at this and tell me if this is the track your trying to be on:
#region --- GuiBuilder code Start ---
; Script generated by AutoBuilder 0.6 Prototype

#include <GuiConstants.au3>

$1 = GuiCreate("MutilTool Page 1" , 392, 400,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS))

$Group1 = GUICtrlCreateGroup ("Choose Your Action", 60, 210, 280, 110 )
$Radio_1 = GuiCtrlCreateRadio("1", 90, 230, 130, 20)
$Radio_2 = GuiCtrlCreateRadio("2", 90, 260, 130, 20)
$Radio_4 = GuiCtrlCreateRadio("3", 90, 290, 130, 20)
$Group1 = GUICtrlCreateGroup ("",-99,-99,1,1);close group

GUICtrlSetState($Radio_4,$GUI_DISABLE)
GUICtrlSetState($Radio_2,$GUI_DISABLE)
GUICtrlSetState($Radio_1,$GUI_DISABLE)

$Checkbox_5 = GuiCtrlCreateCheckbox("4", 60, 120, 25, 20)
$Checkbox_6 = GuiCtrlCreateCheckbox("5", 60, 150, 25, 20)
$Checkbox_7 = GuiCtrlCreateCheckbox("6", 60, 180, 25, 20)
$Button_2 = GuiCtrlCreateButton("&OK", 150, 350, 90, 30, $BS_DEFPUSHBUTTON); $BS_DEFPUSHBUTTON GIVES THE BUTTON FOCUS ON START UP


GuiSetState()
While 1
    $msg = GuiGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            Exit
        Case $msg = $Button_2 And GUICtrlRead($Checkbox_7) = 1
            Exit
    EndSelect
    If $msg = $Checkbox_5 And GUICtrlRead($Checkbox_5) = 1 Then
        GUICtrlSetState($Radio_4,$GUI_ENABLE)
        GUICtrlSetState($Radio_2,$GUI_ENABLE)
        GUICtrlSetState($Radio_1,$GUI_ENABLE)
    ElseIf $msg = $Checkbox_5 And GUICtrlRead($Checkbox_5) = 4 Then
        GUICtrlSetState($Radio_4,$GUI_DISABLE)
        GUICtrlSetState($Radio_2,$GUI_DISABLE)
        GUICtrlSetState($Radio_1,$GUI_DISABLE)
    EndIf
WEnd
Edit:

Noticed that you have tried to set focus on the button, so I showed how you could do that with a style in the GUICtrlCreateButton() function.

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Thank you very very much

one more thing if you can insted of exit in "Case $msg = $Button_2 And GUICtrlRead($Checkbox_7) = 1" i want to point to another script page can i do it ?

Edited by Lior Berezinski
Link to comment
Share on other sites

  • Moderators

Thank you very very much

one more thing if you can insted of exit in "Case $msg = $Button_2 And GUICtrlRead($Checkbox_7) = 1" i want to point to another script page can i do it ?

Script Page? Like another script or .exe all together? If so, yes it can be done.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

If you want to run another script, then you are better compiling them both seperatly and using the FileInstall function to add the second file to the first.

If you want to access function in a second au3 file to do some extra stuff, then you should use the #include command. Then compiling the first au3 will compile the second au3 file as well.

“Give a man a script; you have helped him for today. Teach a man to script; and you will not have to hear him whine for help.”AutoIt4UE - Custom AutoIt toolbar and wordfile for UltraEdit/UEStudio users.AutoIt Graphical Debugger - A graphical debugger for AutoIt.SimMetrics COM Wrapper - Calculate string similarity.

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...