Sign in to follow this  
Followers 0
jlorenz1

Controls on Children window doesn't works

5 posts in this topic

(The last try with my old account. I was logged in as jlorenz1(it is 1 year old) but posted as janrenzlow) :)

I have written a GUI-Application converting au3.-scripts into htm.-files with colored syntax. It wasnt easy, but works properly.

My problem may be simple, but studying the new help (gratulations for the progress!) didnt give me a solution. Helpfile: Obviously the more windows and controls you create the more complicated it gets - indeed

At the end of converting the files on a mainwindow appears a subwindow (not a messagebox) reporting about the results and with one checkbox as option to view the files afterwards with an internet browser.

My problem is that the OK button of the subwindow doesnt execute any code. (neither in OnEvent mode nor in MessageLoop mode), Here a simplified dump script, which concern my problem:

[COLOR=blue]
Opt("GUIOnEventMode", 1)

#include <GUIConstants.au3>

Local $MainWindow=GUICreate(" Medea",830,460)

    Dim $Bttn1=GUICtrlCreateButton ("&Converting", 725, 400, 100,35,-1)

    GUICtrlSetOnEvent(-1, "_ConvertX")

    GUISetState (@SW_SHOW,$MainWindow)

 

While 1

      Sleep(1000)

Wend

 

Func _ConvertX()

    ;after converting

     _Report()

EndFunc

 

Func _Report()

Dim $SubWindow=GUICreate("Medea SubWindow",450,180,-1,-1,0,0) 

      GUISetOnEvent($GUI_EVENT_CLOSE, "_XYZ") 

      GUICtrlCreateLabel(" Success",60,20,380,40)

      Local $Chck=GUICtrlCreateCheckbox("View files with browser",60,70,380,20)

      Dim $rt=GUICtrlCreateButton("&OK",175,110,100,30)

            GUICtrlSetOnEvent(-1, "_XYZ")

      GUISetState(@SW_DISABLE,$MainWindow)

      GUISwitch($SubWindow)

      GUISetState (@SW_SHOW,$SubWindow)   

      

      While 1

            $msg = GUIGetMsg()

      Wend

EndFunc

 

Func _XYZ()

      GUISetState(@SW_ENABLE,$MainWindow)

      If GUICtrlRead($Chck)==1 then _ViewFiles()

      WinClose("Medea SubWindow");or Exit for SubWindow

      MsgBox(4144,"Here I am","");dummy statement 

EndFunc

 

Func _ViewFiles()

      MsgBox(4144,"Pink Floyd","Wish you were here");dummy statement

EndFunc

ColoredDumpScript.htm


Johannes LorenzBensheim, Germanyjlorenz1@web.de[post="12602"]Highlightning AutoIt Syntax in Notepad++ - Just copy in your Profile/application data/notepad++[/post]

Share this post


Link to post
Share on other sites



you were basically calling a function "set on event" in the middle of a function... does'nt work 8)

This does

#include <GUIConstants.au3>
#include <File.au3>
#include <Array.au3>
#include <String.au3>

Dim $Chck
;[COLOR=blue]sdf

Opt("GUIOnEventMode", 1)

; main window
$MainWindow=GUICreate(" Medea",830,460)
$Bttn1=GUICtrlCreateButton ("&Converting", 725, 400, 100,35,-1)
GUICtrlSetOnEvent(-1, "_ConvertX")

GUISetState (@SW_SHOW,$MainWindow)

; sub window
$SubWindow=GUICreate("Medea SubWindow",450,180,-1,-1,0,0) 
GUISetOnEvent($GUI_EVENT_CLOSE, "_Dumb") 
GUICtrlCreateLabel(" Success",60,20,380,40)
$Chck=GUICtrlCreateCheckbox("View files with browser",60,70,380,20)
$rt=GUICtrlCreateButton("&OK",175,110,100,30)
GUICtrlSetOnEvent(-1, "_Dumb")

GUISetState (@SW_HIDE,$SubWindow)    




While 1

    Sleep(100)

Wend



Func _ConvertX()

   ;after converting

     _Report()

EndFunc



Func _Report()

    
    GUISetState (@SW_SHOW,$SubWindow)    
        
    GUISetState(@SW_DISABLE,$MainWindow)

    ;GUISwitch($SubWindow)

EndFunc



Func _Dumb()
        GUISwitch($MainWindow)
        
      GUISetState(@SW_ENABLE,$MainWindow)

      If GUICtrlRead($Chck)==1 then _ViewFiles()

      WinClose("Medea SubWindow");or Exit for SubWindow

      MsgBox(4144,"Here I am","");dummy statement 

EndFunc



Func _ViewFiles()

      MsgBox(4144,"Pink Floyd","Wish you were here");dummy statement

EndFunc

I had to play with it to find the errors.... the "dumb" function doesn't mean anything

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

Bingo excellent JUPIEEEE it works thanks. How can I thank you .... Johannes :evil::D:D:mad::D:D

(The last try with my old account. I was logged in as jlorenz1(it is 1 year old) but posted as janrenzlow) :)

I have written a GUI-Application converting au3.-scripts into htm.-files with colored syntax. It wasnt easy, but works properly.

My problem may be simple, but studying the new help (gratulations for the progress!) didnt give me a solution. Helpfile: Obviously the more windows and controls you create the more complicated it gets  - indeed

At the end of converting the files on a mainwindow appears a subwindow (not a messagebox) reporting about the results and with one checkbox as option to view the files afterwards with an internet browser.

My problem is that the OK button of the subwindow doesnt execute any code. (neither in OnEvent mode nor in MessageLoop mode), Here a simplified dump script, which concern my problem:

[COLOR=blue]
Opt("GUIOnEventMode", 1)

#include <GUIConstants.au3>

Local $MainWindow=GUICreate(" Medea",830,460)

    Dim $Bttn1=GUICtrlCreateButton ("&Converting", 725, 400, 100,35,-1)

    GUICtrlSetOnEvent(-1, "_ConvertX")

    GUISetState (@SW_SHOW,$MainWindow)

 

While 1

      Sleep(1000)

Wend

 

Func _ConvertX()

    ;after converting

     _Report()

EndFunc

 

Func _Report()

Dim $SubWindow=GUICreate("Medea SubWindow",450,180,-1,-1,0,0) 

      GUISetOnEvent($GUI_EVENT_CLOSE, "_XYZ") 

      GUICtrlCreateLabel(" Success",60,20,380,40)

      Local $Chck=GUICtrlCreateCheckbox("View files with browser",60,70,380,20)

      Dim $rt=GUICtrlCreateButton("&OK",175,110,100,30)

            GUICtrlSetOnEvent(-1, "_XYZ")

      GUISetState(@SW_DISABLE,$MainWindow)

      GUISwitch($SubWindow)

      GUISetState (@SW_SHOW,$SubWindow)      

      

      While 1

            $msg = GUIGetMsg()

      Wend

EndFunc

 

Func _XYZ()

      GUISetState(@SW_ENABLE,$MainWindow)

      If GUICtrlRead($Chck)==1 then _ViewFiles()

      WinClose("Medea SubWindow");or Exit for SubWindow

      MsgBox(4144,"Here I am","");dummy statement 

EndFunc

 

Func _ViewFiles()

      MsgBox(4144,"Pink Floyd","Wish you were here");dummy statement

EndFunc

<{POST_SNAPBACK}>


Johannes LorenzBensheim, Germanyjlorenz1@web.de[post="12602"]Highlightning AutoIt Syntax in Notepad++ - Just copy in your Profile/application data/notepad++[/post]

Share this post


Link to post
Share on other sites

Early Birthday present... lol

Happy Birthday

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

Yes, that is really one of the birthday present, which gave me joy & fun. Johannes

Early Birthday present... lol

Happy Birthday

8)

<{POST_SNAPBACK}>


Johannes LorenzBensheim, Germanyjlorenz1@web.de[post="12602"]Highlightning AutoIt Syntax in Notepad++ - Just copy in your Profile/application data/notepad++[/post]

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