Sign in to follow this  
Followers 0
ChrisA

Multiple Child Windows

3 posts in this topic

Hi everyone,

I'm sure that this is an old question, but I'm not finding anything with my search for child windows...

I have an app that has 2 child windows.

The first, depending on a checkbox, will display a list of server's log files to choose from.

The second will show the results of all the data gathering of the main window.

The problem is that I need the first child window to pop-up and not allow the script to continue until after it has recieved its input.

Instead it's popping up fillowed by the second window.

Here is the code that is being called:

CODE
Case $a_GMsg[0] = $bt_Mn_Create

;Create a Label and use it...

_DoLabel('Gathering Information...')

_GetComponentInfo()

_GetEditData()

_DoLabel('Gathering Server Log Information...')

If GUICtrlRead($b_SrvLog) = $GUI_CHECKED Then

_CreateLog() <-- This is the call to the first window

GUISetState(@SW_SHOW, $gui_Log)

;_GetServerLogs()

EndIf

If GUICtrlRead($b_CliLog) = $GUI_CHECKED Then

_GetClientLogs()

EndIf

_DoLabel(' ')

;Put it all together...

_PieceDataTogether() <-- This is the call to the Second window

_ResetEditBoxes()

GUISetState(@SW_ENABLE, $gui_Main)

;Close Button

Here are the functions taht are called for those two items:

CODE

Func _PieceDataTogether()

$s_BreadCrumbs = $s_Component

$i_Count = StringInStr($s_Component, ' - ')

$s_FirstComp = StringLeft($s_Component, $i_Count - 1)

$s_Component = StringRight($s_Component, StringLen($s_Component) - ($i_Count + 2))

$i_Count = StringInStr($s_Component, ' - ')

If $i_Count > 0 Then

$s_SecondComp = StringLeft($s_Component, $i_Count - 1)

$s_Component = StringRight($s_Component, StringLen($s_Component) - ($i_Count + 2))

EndIf

If $i_Count > 0 Then

$i_Count = StringInStr($s_Component, ' - ')

$s_ThirdComp = StringLeft($s_Component, $i_Count - 1)

EndIf

$s_BreadCrumbs = $s_BreadCrumbs & ' - '

$s_PopUpData = ''

$s_PopUpData = $s_PopUpData & $s_BreadCrumbs & $s_BDescr & @CRLF & @CRLF

$s_PopUpData = $s_PopUpData & $s_BDescr & @CRLF & @CRLF & $s_FDescr & @CRLF & @CRLF

$s_PopUpData = $s_PopUpData & 'Environment : ' & $s_Env & @CRLF

$s_PopUpData = $s_PopUpData & 'Data : ' & $s_Data & @CRLF

$s_PopUpData = $s_PopUpData & 'Server Name : ' & $s_ServerName & @CRLF

$s_PopUpData = $s_PopUpData & 'Server Build Date : ' & $s_SrvDate & @CRLF

$s_PopUpData = $s_PopUpData & 'Server Build Ver : ' & $s_SrvVer & @CRLF

$s_PopUpData = $s_PopUpData & 'Client Name : ' & $s_ClientName & @CRLF

$s_PopUpData = $s_PopUpData & 'Client Build Date : ' & $s_CliDate & @CRLF

$s_PopUpData = $s_PopUpData & 'Client Build Ver : ' & $s_CliVer & @CRLF

$s_PopUpData = $s_PopUpData & 'Main Component : ' & $s_FirstComp & @CRLF

$s_PopUpData = $s_PopUpData & 'Sub-Component : ' & $s_SecondComp & @CRLF

$s_PopUpData = $s_PopUpData & 'Other Component : ' & $s_ThirdComp & @CRLF

$s_PopUpData = $s_PopUpData & 'OPS Database : ' & $s_OPSDB & @CRLF

$s_PopUpData = $s_PopUpData & 'CPC Database : ' & $s_CPCDB & @CRLF

$s_PopUpData = $s_PopUpData & 'UserID Used : ' & $s_UserID & @CRLF

$s_PopUpData = $s_PopUpData & 'Password Used : ' & $s_Password & @CRLF & @CRLF

$s_PopUpData = $s_PopUpData & 'Server Logs : ' & @CRLF

$s_PopUpData = $s_PopUpData & 'None ' & @CRLF & @CRLF

$s_PopUpData = $s_PopUpData & 'Client Logs : ' & @CRLF

$s_PopUpData = $s_PopUpData & 'None ' & @CRLF & @CRLF

$s_PopUpData = $s_PopUpData & 'Recreate Steps : ' & @CRLF

$s_PopUpData = $s_PopUpData & $s_Recreate & @CRLF

_CreatePopUp()

GUISetState(@SW_SHOW, $gui_PopUp)

EndFunc ; _PieceDataTogether()

Func _CreatePopUp()

$gui_PopUp = GUICreate('JIRA Data for New Issue', 600, 400, -1, -1, BitOR($WS_CAPTION, $WS_SYSMENU), -1, $gui_Main)

$s_PopupHnd = _GUICtrlEdit_Create($gui_PopUp, $s_PopUpData, 8, 8, 580, 360)

$bt_PU_Close = GUICtrlCreateButton('&Close', 250, 372, 75, 25)

EndFunc ; _CreatePopUp

Func _CreateLog()

$gui_Log = GUICreate('Server Logs to View', 350, 162 + $i_mn_Height, -1, -1, BitOR($WS_CAPTION, $WS_SYSMENU, $DS_MODALFRAME), -1, $gui_Main)

$bt_Log_Close = GUICtrlCreateButton('&Close', 180, 110 + $i_mn_Height, 165, 25)

EndFunc ; _CreateLog

Any ideas how to make the second child window wait until the first has been closed?

Big thanks in advance

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Hi everyone,

Any ideas how to make the second child window wait until the first has been closed?

Big thanks in advance

One way would be to simply leave this line

GUISetState(@SW_SHOW, $gui_PopUp)

untill the first form had been closed.

Edited by martin

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

One way would be to simply leave this line

GUISetState(@SW_SHOW, $gui_PopUp)

untill the first form had been closed.

Thanks,

I saw where I was showing the $gui_PopUp prior to exiting the $gui_Log.

This resolved it. muttley

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