Sign in to follow this  
Followers 0
avery

GUI inside GUI

4 posts in this topic

I have a script I've been working on using au3 and I've run into some odd problems that I, so far, can't located answered for.

I will try to give as much example as I can.. Please excuse my amature skills as I just started working with au3.

When I call the select_mark1() function it works but when I Exit it closes both windows. I need to make a new window, display a dropdown list and then return that value to the main function.

edit: Sorry it doesn't line up right :)

LaunchPad()
Func LaunchPad()
    GUICreate("MD5 Trusted Download Tool " & $ver, 500, 350)
    
    ...
    ...
               GUISetState(@SW_SHOW)
EndFunc

; Loop the GUI
While 1
    $msg = GUIGetMsg()

    Select
        Case $msg = $file1_button
            select_file1()
            select_mark1()
                

        
        Case $msg = $GUI_EVENT_CLOSE
            Exit
    EndSelect
    
WEnd

Func select_file1()
        $file1 = FileOpenDialog("Select Source File", "", "All (*.*)", 1 + 4)
        GUICtrlSetData($file1_input,$file1)
        
    ;$file1a = StringSplit($file1, "\")
    ;MsgBox(4, "MD5", $file1a[ubound($file1a)-1] & @CRLF & $file1a[1])
        
        $plH = PluginOpen(@ScriptDir & '\' & "MD5Hash.dll")
            $file1_md5_l = MD5Hash($file1, 1, True)
            GUICtrlSetData($file1_md5,$file1_md5_l)
            GUICtrlSetBkColor($file1_md5, "0x99CCFF")
        PluginClose($plH)
    
        status_md5()
        Return
EndFunc
    
Func select_mark1()
    Local $msg
    GUICreate("SELECT SOURCE MARKINGS", 200, 100)  

    GUICtrlCreateCombo("item1", 0, 0, 200); create first item
    GUICtrlSetData(-1, "item2|item3", "item3"); add other item snd set a new default

    $mark1_ok = GUICtrlCreateButton("OK", 50, 50, 100, 25)
    
    GUISetState()

; Run the GUI until the dialog is closed
    While 1
                                $msg = GUIGetMsg()
        
        If $msg = $mark1_ok Then
        ; tried Return, Next, Exitloop ????
        EndIf
            
                               If $msg = $GUI_EVENT_CLOSE Then ExitLoop;(tried Return)
        
               WEnd
EndFunc

www.abox.orgAvery HowellVisit My AutoIt Websitehttp://www.abox.org

Share this post


Link to post
Share on other sites



Look at GUISwitch()


George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

$GUI_PARENT = guicreate....

$GUI_CHILD = guicreate....

_WinAPI_SetParent($GUI_CHILD, $GUI_PARENT)

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
Sign in to follow this  
Followers 0