Jump to content
Sign in to follow this  
Wombat

A bug I cannot figure out, any idea?

Recommended Posts

Wombat

Hi, I've missed you all.

I've been trying to avoid asking for halp and pushing myself to find the answers using google + the help file while working on my projects. I've come to a point where google is failing me and I either do not know where to look in the help file or it's such a unique bug  (in my program not in autoit) that it's not covered in the helpfile.

Here is my code that is producing the bug:

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=..\..\Pictures\Xex_Res\Xex.ico
#AutoIt3Wrapper_Outfile=Xex Launcher.exe
#AutoIt3Wrapper_UseUpx=y
#AutoIt3Wrapper_Res_Description=Xex Launcher
#AutoIt3Wrapper_Res_Fileversion=0.0.0.2
#AutoIt3Wrapper_Res_ProductVersion=0.0.2
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

#Region Includes
; ----------------------------------------------------Included scripts:
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <GUICtrlOnHover.au3>
#include <WinAPI.au3>
#include <InetConstants.au3>
#include <GDIPlus.au3>
#include <Array.au3>
#include <Inet.au3>
#include <IE.au3>
#include <File.au3>
#include <APIGdiConstants.au3>
#include <WinAPIGdi.au3>

; NOTE: Here we declare scripts to be use with this script

;................................
#EndRegion

Opt("GUIResizeMode", $GUI_DOCKALL)

#Region FileInstall
; ----------------------------------------------Files to include in the program:
_WinAPI_AddFontResourceEx(@ScriptDir & "\res\fnt\WebSymbols-Regular.otf")

; NOTE: Here we collect the images that will be compiled into the executable which will help keep the program as close to "standalone" state as possible

;...........................
#EndRegion

#Region Var
; ------------------------------------------------------Variables:
; Globals
Global $pC, $pC2, $hHover_CtrlID = 0, $MainGUI_H, $MainGUI_W, $MainGUI_POS, $SettingsGUI, $SetGUI_Title, $Server_TAB=0, _
        $SetGUI_Graphic1, $SetGUI_Graphic2, $SetBtn_close, $AboutGUI, $AbtGUI_Title, $AbtGUI_Graphic1, $AbtGUI_Graphic2, $AbtBtn_close, $SrvGUI

; NOTE: Here we declare variables for later use

;~ _Erase_Srv_Files()
;~ _GetSrvData()

;~ _ArrayDisplay($ServerAddresses)
;.........
#EndRegion

#Region MainGUI
; ------------------------------------------------------GUI code:

; Main GUI

$MainGUI = GUICreate("XexLauncher  version 0.0.2", 1275, 834, Default, Default, BitOR($WS_POPUP, $WS_BORDER))
GUISetBkColor(0x000000)
$MainGUI_POS=WinGetPos("XexLauncher  version 0.0.2", "")
$MainGUI_H = $MainGUI_POS[3]
$MainGUI_W = $MainGUI_POS[2]
;.................................................................................................................

; GUI imgs


$Pic1 = GUICtrlCreatePic(@ScriptDir & "\res\img\Xex_splash_img_1d73c0.jpg", 8, 8, 340, 85, -1, $GUI_WS_EX_PARENTDRAG)

$Graphic1 = GUICtrlCreateGraphic(0, 136, 1275, 834) ; White background
GUICtrlSetState(-1, $GUI_DISABLE)
GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0x000000, 0xFFFFFF)
GUICtrlSetGraphic(-1, $GUI_GR_RECT, 0, 0, 1275, 834)

$Graphic2 = GUICtrlCreateGraphic(0, 96, 1275, 50) ; Blue menu box

GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0x000000, 0x1d73c0)
GUICtrlSetGraphic(-1, $GUI_GR_RECT, 0, 0, 1275, 45)
GUICtrlSetState(-1, $GUI_DISABLE)
;..................................................................................................................

; Buttons

#Region
$MainGUI_Title = GUICtrlCreateLabel('XEX LAUNCHER', $MainGUI_W/2-210, -10, 520, 90, -1, $GUI_WS_EX_PARENTDRAG) ; Main GUI title
;~ GUICtrlSetResizing(-1, $GUI_DOCKALL)
GUICtrlSetFont(-1, 45, 200, 1, 'Segoe UI', 4)
GUICtrlSetColor(-1, 0xFFFFFF)

$MainGUI_version = GUICtrlCreateLabel('Alpha Build: v 0.0.2', $MainGUI_W-52-32-45-45-155-10, 2, 155, 20) ; Main GUI version
;~ GUICtrlSetResizing(-1, $GUI_DOCKSIZE)
GUICtrlSetFont(-1, 10, 200, 2)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetStyle(-1, $GUI_WS_EX_PARENTDRAG)

$Button_Help = GUICtrlCreateLabel("Help", $MainGUI_W-52-32-45-45-5, 0, 45, 20, $SS_CENTER)
GUICtrlSetFont(-1, 8, 200, 0)
GUICtrlSetCursor(-1, 0)
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlSetColor(-1, 0xFFFFFF)
_GUICtrl_SetOnHover(-1, "_Hover", "_Hover_Leave")

$Button_About = GUICtrlCreateLabel("About", $MainGUI_W-52-32-45-5, 0, 45, 20, $SS_CENTER)
GUICtrlSetFont(-1, 8, 200, 0)
GUICtrlSetCursor(-1, 0)
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlSetColor(-1, 0xFFFFFF)
_GUICtrl_SetOnHover(-1, "_Hover", "_Hover_Leave")

$Button_close = GUICtrlCreateLabel(" x ", $MainGUI_W-52, 0, 52, 25, $SS_CENTER)
GUICtrlSetFont(-1, 12, 800, 0, 'Segoe UI', 4)
GUICtrlSetCursor(-1, 0)
GUICtrlSetBkColor(-1, 0x353535)
GUICtrlSetColor(-1, 0xFFFFFF)
_GUICtrl_SetOnHover(-1, "_Hover", "_Hover_Leave")

$Button_mini = GUICtrlCreateLabel("-", $MainGUI_W-32-52-1, 0, 32, 25, $SS_CENTER)
GUICtrlSetFont(-1, 14, 700, 0)
GUICtrlSetCursor(-1, 0)
GUICtrlSetBkColor(-1, 0x353535)
GUICtrlSetColor(-1, 0xFFFFFF)
_GUICtrl_SetOnHover(-1, "_Hover", "_Hover_Leave")

$Button_Servers = GUICtrlCreateLabel(" SERVERS ", 0, 97, 200, 43, $SS_CENTER)
GUICtrlSetFont(-1, 20, 200, 0, 'Segoe UI', 4)
GUICtrlSetCursor(-1, 0)
GUICtrlSetBkColor(-1, 0x1d73c0)
GUICtrlSetColor(-1, 0xFFFFFF)
_GUICtrl_SetOnHover(-1, "_Hover", "_Hover_Leave")

$Button_MODS = GUICtrlCreateLabel(" MODS ", 200, 97, 200, 43, $SS_CENTER)
GUICtrlSetFont(-1, 20, 200, 0, 'Segoe UI', 4)
GUICtrlSetCursor(-1, 0)
GUICtrlSetBkColor(-1, 0x1d73c0)
GUICtrlSetColor(-1, 0xFFFFFF)
_GUICtrl_SetOnHover(-1, "_Hover", "_Hover_Leave")

$Button_WiKi = GUICtrlCreateLabel(" WiKi ", 400, 97, 200, 43, $SS_CENTER)
GUICtrlSetFont(-1, 20, 200, 0, 'Segoe UI', 4)
GUICtrlSetCursor(-1, 0)
GUICtrlSetBkColor(-1, 0x1d73c0)
GUICtrlSetColor(-1, 0xFFFFFF)
_GUICtrl_SetOnHover(-1, "_Hover", "_Hover_Leave")

$Button_Donor = GUICtrlCreateLabel(" DONATE ", 600, 97, 200, 43, $SS_CENTER)
GUICtrlSetFont(-1, 20, 200, 0, 'Segoe UI', 4)
GUICtrlSetCursor(-1, 0)
GUICtrlSetBkColor(-1, 0x1d73c0)
GUICtrlSetColor(-1, 0xFFFFFF)
_GUICtrl_SetOnHover(-1, "_Hover", "_Hover_Leave")

$Button_Forum = GUICtrlCreateLabel(" FORUM ", 800, 97, 200, 43, $SS_CENTER)
GUICtrlSetFont(-1, 20, 200, 0, 'Segoe UI', 4)
GUICtrlSetCursor(-1, 0)
GUICtrlSetBkColor(-1, 0x1d73c0)
GUICtrlSetColor(-1, 0xFFFFFF)
_GUICtrl_SetOnHover(-1, "_Hover", "_Hover_Leave")

$Button_Settings = GUICtrlCreateLabel(" S ", 1000, 97, 200, 43, $SS_CENTER)
GUICtrlSetFont(-1, 25, 200, 0, 'Web Symbols', 4)
GUICtrlSetCursor(-1, 0)
GUICtrlSetBkColor(-1, 0x1d73c0)
GUICtrlSetColor(-1, 0xFFFFFF)
_GUICtrl_SetOnHover(-1, "_Hover", "_Hover_Leave")

$Button_Refresh = GUICtrlCreateLabel(" J ", 1200, 97, 75, 43, $SS_CENTER)
GUICtrlSetFont(-1, 25, 200, 0, 'Web Symbols', 4)
GUICtrlSetCursor(-1, 0)
GUICtrlSetBkColor(-1, 0x1d73c0)
GUICtrlSetColor(-1, 0xFFFFFF)
_GUICtrl_SetOnHover(-1, "_Hover", "_Hover_Leave")

#EndRegion
;..................................................................................................................
#EndRegion



GUISetState(@SW_SHOW)
;~ GUIRegisterMsg($WM_NCHITTEST, 'WM_NCHITTEST')



While 1

    Switch GUIGetMsg()
        Case $Button_close
            Sleep(100)
            Exit
        Case $Button_mini
            _MinimizeGUI()
        Case $Button_Settings
            Settings_GUI()
        Case $Button_About
;~          GUISetState(@SW_HIDE, $MainGUI)
            About_GUI()
        Case $Button_Servers
            _Server_gui()
        Case $Button_Refresh
            _Refresh_Srv()
        Case $GUI_EVENT_RESTORE
            _GUIrestore()


    EndSwitch

;~  _Position_Child()
WEnd

Func _Refresh_Srv()
    Local $count=0
    Local $exit=0

    For $i=10 To 1 Step -1
        Do
            $count=$count+1
            Guictrlsetdata($Button_Refresh, $count)
            Sleep(100)
            $nMsg = GUIGetMsg()
            Switch $nMsg
                Case $Button_close
                    $exit=$exit+2
                    ExitLoop(2)
                Case $Button_mini
                    $exit=$exit+1
                    ExitLoop(2)

            EndSwitch
        Until $count=7
        $count=0
    Next
    If $exit>1 Then
        Exit
    Elseif $exit=1 Then
        _MinimizeGUI()
    EndIf
    Guictrlsetdata($Button_Refresh, " J ")

EndFunc

Func _Erase_Srv_Files()
    FileDelete(@ScriptDir & "\res\srv_data\")
    DirCreate(@ScriptDir & "\res\srv_data\")
EndFunc

Func _MinimizeGUI()
    GUISetState(@SW_MINIMIZE, $MainGUI)


EndFunc

Func _GUIrestore()
    Local $test=WinExists("Servers", "")
    If $test=1 then MsgBox(0, "TEST", "YES")


EndFunc

Func _Get_Server_Info()


EndFunc

Func _GetSrvData()
Local $ServerArrayRead[6]=[IniRead(@ScriptDir & "\XL_Config.cfg", "server_address_gt", "op_chernarus_eu", Default), _
                        IniRead(@ScriptDir & "\XL_Config.cfg", "server_address_gt", "op_chernarus_us", Default), _
                        IniRead(@ScriptDir & "\XL_Config.cfg", "server_address_gt", "op_namalsk_eu", Default), _
                        IniRead(@ScriptDir & "\XL_Config.cfg", "server_address_gt", "op_namalsk_us", Default), _
                        IniRead(@ScriptDir & "\XL_Config.cfg", "server_address_gt", "op_napf_eu", Default), _
                        IniRead(@ScriptDir & "\XL_Config.cfg", "server_address_gt", "op_napf_us", Default)]

Local $Count=0
Local $Server_name=1
Local $String, $oIE, $HTMLtext, $Text, $LineNum, $Data, $newSTRING

For $i=6 To 1 Step -1
    $oIE = _IECreate($ServerArrayRead[$Count], 0, 0)
    $HTMLtext=_IEBodyReadText($oIE)
    _IEQuit($oIE)
    FileWrite(@ScriptDir & "\res\srv_data\OPSRV" & $Server_name & ".txt", $HTMLtext)
    For $x = 113 To 1 Step -1
        _FileWriteToLine(@ScriptDir & "\res\srv_data\OPSRV" & $Server_name & ".txt", 1, "", 1)
    Next
    $Text = FileRead(@ScriptDir & "\res\srv_data\OPSRV" & $Server_name & ".txt")
    $LineNum = StringInStr($Text, "Server Summary")
    For $z = 6 To 1 Step -1
        $Data=FileReadLine(@ScriptDir & "\res\srv_data\OPSRV" & $Server_name & ".txt", $LineNum)
        $LineNum=$LineNum+1
        $String=$String & $Data & @CRLF
    Next
    $newSTRING=StringReplace($String, "  (claim server) ", "")
    $stripGARBAGE=StringStripWS($newSTRING, 4)
    $finalSTRING=StringReplace($stripGARBAGE, " ", @CRLF)
    FileDelete(@ScriptDir & "\res\srv_data\OPSRV" & $Server_name & ".txt")
    FileWrite(@ScriptDir & "\res\srv_data\OPSRV" & $Server_name & ".xgl", $finalSTRING)

    $Server_name=$Server_name+1
    $Count=$Count+1
    $String=""
Next
EndFunc

; If you want the GUI to be moved as well.
;Func WM_NCHITTEST($hWnd, $iMsg, $wParam, $lParam)
;    #forceref $hWnd, $iMsg, $wParam, $lParam
;    Return $HTCAPTION
;EndFunc   ;==>WM_NCHITTEST

Func _Server_gui()
    $SrvGUI = GUICreate("Servers", 1261, 681, 6, 146, BitOR($WS_POPUP, $WS_BORDER))
    _WinAPI_SetParent($SrvGUI, $MainGUI)
    GUISetBkColor(0x353535)
    GUISetState(@SW_SHOW, $SrvGUI)
;~  _Position_Child()
EndFunc

Func _Hover($ctrlID)

    If $ctrlID=$Button_close then GUICtrlSetBkColor($ctrlID, 0xf03535); sets MainGUI's close button to it's active state

    If $ctrlID=$Button_mini then GUICtrlSetBkColor($ctrlID, 0x1d73c0); sets MainGUI's minimize button to it's active state

    If $ctrlID=$Button_Servers then
        GUICtrlSetBkColor($ctrlID, 0x308DE0); sets MainGUI's Servers button to it's active state
    EndIf

    If $ctrlID=$Button_MODS then GUICtrlSetBkColor($ctrlID, 0x308DE0); sets MainGUI's Mods button to it's active state

    If $ctrlID=$Button_WiKi then GUICtrlSetBkColor($ctrlID, 0x308DE0); sets MainGUI's WiKi button to it's active state

    If $ctrlID=$Button_Donor then GUICtrlSetBkColor($ctrlID, 0x308DE0); sets MainGUI's DOnor button to it's active state

    If $ctrlID=$Button_Forum then GUICtrlSetBkColor($ctrlID, 0x308DE0); sets MainGUI's Forum button to it's active state

    If $ctrlID=$Button_Settings then GUICtrlSetBkColor($ctrlID, 0x308DE0); sets MainGUI's Settings button to it's active state

    If $ctrlID=$Button_Refresh then GUICtrlSetBkColor($ctrlID, 0x308DE0); sets MainGUI's Settings button to it's active state

    If $ctrlID=$Button_Help then GUICtrlSetFont($ctrlID, 8, 200, 4); sets MainGUI's Help button to it's active state

    If $ctrlID=$Button_About then GUICtrlSetFont($ctrlID, 8, 200, 4); sets MainGUI's About button to it's active state

    If $ctrlID=$SetBtn_close then GUICtrlSetBkColor($ctrlID, 0xf03535)

    If $ctrlID=$AbtBtn_close then GUICtrlSetBkColor($ctrlID, 0xf03535)

;~  If $ctrlID=$Button_set_u then ; sets $MainGUI's settings button to it's active state
;~      GUICtrlSetState($Button_set_u, $GUI_HIDE)
;~      GUICtrlSetState($Button_set_a, $GUI_SHOW)
;~  EndIf
EndFunc

Func _Hover_Leave($ctrlID)

    If $ctrlID=$Button_close Or $ctrlID=$Button_mini Or $ctrlID=$SetBtn_close Then ; sets MainGUI's buttons to their inactive state
        GUICtrlSetBkColor($ctrlID, 0x353535)
        GUICtrlSetColor($ctrlID, 0xFFFFFF)
    EndIf

    If $ctrlID=$Button_Servers Then ; sets MainGUI's menu buttons to their inactive state
;~      GUICtrlSetFont($SrvbtnID, 10, 800, 0)
        GUICtrlSetBkColor($ctrlID, 0x1d73c0)
    EndIf

    If $ctrlID=$Button_MODS Then ; sets MainGUI's menu buttons to their inactive state
;~      GUICtrlSetFont($SrvbtnID, 10, 800, 0)
        GUICtrlSetBkColor($ctrlID, 0x1d73c0)
        GUICtrlSetColor($ctrlID, 0xFFFFFF)
    EndIf

    If $ctrlID=$Button_WiKi Then ; sets MainGUI's menu buttons to their inactive state
;~      GUICtrlSetFont($SrvbtnID, 10, 800, 0)
        GUICtrlSetBkColor($ctrlID, 0x1d73c0)
        GUICtrlSetColor($ctrlID, 0xFFFFFF)
    EndIf

    If $ctrlID=$Button_Donor Then ; sets MainGUI's menu buttons to their inactive state
;~      GUICtrlSetFont($SrvbtnID, 10, 800, 0)
        GUICtrlSetBkColor($ctrlID, 0x1d73c0)
        GUICtrlSetColor($ctrlID, 0xFFFFFF)
    EndIf

    If $ctrlID=$Button_Forum Then ; sets MainGUI's menu buttons to their inactive state
;~      GUICtrlSetFont($SrvbtnID, 10, 800, 0)
        GUICtrlSetBkColor($ctrlID, 0x1d73c0)
        GUICtrlSetColor($ctrlID, 0xFFFFFF)
    EndIf

    If $ctrlID=$Button_Settings Then ; sets MainGUI's menu buttons to their inactive state
;~      GUICtrlSetFont($SrvbtnID, 10, 800, 0)
        GUICtrlSetBkColor($ctrlID, 0x1d73c0)
        GUICtrlSetColor($ctrlID, 0xFFFFFF)
    EndIf

    If $ctrlID=$Button_Refresh Then ; sets MainGUI's menu buttons to their inactive state
;~      GUICtrlSetFont($SrvbtnID, 10, 800, 0)
        GUICtrlSetBkColor($ctrlID, 0x1d73c0)
        GUICtrlSetColor($ctrlID, 0xFFFFFF)
    EndIf

    If $ctrlID=$Button_Help Then ; sets MainGUI's Help button to it's inactive state
        GUICtrlSetFont($ctrlID, 8, 200, 0)
    EndIf

    If $ctrlID=$Button_About Then ; sets MainGUI's About button to it's inactive state
        GUICtrlSetFont($ctrlID, 8, 200, 0)
    EndIf

    If $ctrlID=$SetBtn_close Then ; sets $SettingsGUI's close button to it's inactive state
        GUICtrlSetBkColor($ctrlID, 0x353535)
        GUICtrlSetColor($ctrlID, 0xFFFFFF)
    EndIf

    If $ctrlID=$AbtBtn_close Then ; sets $SettingsGUI's close button to it's inactive state
        GUICtrlSetBkColor($ctrlID, 0x353535)
        GUICtrlSetColor($ctrlID, 0xFFFFFF)
    EndIf

;~  If $ctrlID=$Button_set_a Then ; sets $MainGUI's settings button to it's inactive state
;~      GUICtrlSetState($Button_set_u, $GUI_SHOW)
;~      GUICtrlSetState($Button_set_a, $GUI_HIDE)
;~  EndIf

EndFunc

Func Settings_GUI()


EndFunc

Func About_GUI()
    Local $About_text = 'Software Published - 2014' & @CRLF & _
                        ' ' & @CRLF & _
                        'Xex Game Launcher Developed By' & @CRLF & _
                        'JohnPaul Niswonger' & @CRLF & _
                        ' ' & @CRLF & _
                        'Distributed under the GNU GPL license' & @CRLF & _
                        ' ' & @CRLF & _
                        'COPYRIGHT 2014 JohnPaul Niswonger'

    $AboutGUI = GUICreate("About Xex Launcher", 361, 261, Default, Default, BitOR($WS_BORDER, $WS_POPUP), BitOR($WS_EX_NOACTIVATE, $WS_EX_TOPMOST))
;~  GUISetFont(20, Default, Default, 'Segoe UI')
    GUISetBkColor(0x000000)

    Local $AboutGUI_POS=WinGetPos("About Xex Launcher", "")
    Local $AboutGUI_H = $AboutGUI_POS[3]
    Local $AboutGUI_W = $AboutGUI_POS[2]

    $AbtGUI_Title = GUICtrlCreateLabel("ABOUT", $AboutGUI_W-215, 15, 150, 40)
    GUICtrlSetColor(-1, 0xFFFFFF)
    GUICtrlSetFont(-1, 20, 400, Default, 'Segoe UI', 4)
    GUICtrlSetStyle(-1, $GUI_WS_EX_PARENTDRAG)

    $AbtBtn_close = GUICtrlCreateLabel(" x ", $AboutGUI_W-50, 0, 50, 25, $SS_CENTER)
    GUICtrlSetFont(-1, 12, 800, 0, 'Segoe UI', 4)
    GUICtrlSetCursor(-1, 0)
    GUICtrlSetBkColor(-1, 0x353535)
    GUICtrlSetColor(-1, 0xFFFFFF)
    _GUICtrl_SetOnHover(-1, "_Hover", "_Hover_Leave")

    $AbtGUI_Graphic1 = GUICtrlCreateGraphic(0, 100, 379, 450)
    GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0x000000, 0xFFFFFF)
    GUICtrlSetGraphic(-1, $GUI_GR_RECT, 0, 0, 400, 450)
    GUICtrlSetState(-1, $GUI_DISABLE)


    $AbtGUI_Graphic2 = GUICtrlCreateGraphic(0, 64, 460, 40)
    GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0x000000, 0x1d73c0)
    GUICtrlSetGraphic(-1, $GUI_GR_RECT, 0, 0, 460, 40)
    GUICtrlSetState(-1, $GUI_DISABLE)

    $AbtGUI_slogon_text = GUICtrlCreateLabel('"By kickass gamers, for kickass gamers"', $AboutGUI_W-280, 75, 250, 24)
    GUICtrlSetColor(-1, 0xFFFFFF)
    GUICtrlSetFont(-1, 10, 200, $GUI_FONTITALIC, 'Segoe UI', 4)
    GUICtrlSetBkColor(-1, 0x1d73c0)
    GUICtrlSetStyle(-1, $GUI_WS_EX_PARENTDRAG)

    $AbtGUI_text = GUICtrlCreateLabel($About_text, 20, 110, 500, 150)
    GUICtrlSetColor(-1, 0x000000)
    GUICtrlSetFont(-1, 10, 200, 0, 'Segoe UI', 4)
    GUICtrlSetBkColor(-1, 0xFFFFFF)
    GUICtrlSetStyle(-1, $GUI_WS_EX_PARENTDRAG)

    GUISetState(@SW_SHOW, $AboutGUI)

    While WinExists("About Xex Launcher", "")=1
        Switch GUIGetMsg()
            Case $AbtBtn_close
                GUIDelete($AboutGUI)

        EndSwitch
    WEnd
EndFunc

 

What happens is if you left click on the servers label or "button" as it's being implemented, a child gui pops up. Now from here if you minimize the parent gui then click on it in the task bar to restore the parent, the parent gui  (I believe this is what is happening) stops returning messages that are captured in the main while statement. 

I need help understanding first WHY this is happening then if from there I cannot resolve the bug, I will return to this topic and gracefully ask for help in doing so.

 

P.S. as always if you don't have an answer to the main topic of this thread but see a place I can improve my code please point it out.

P.S.S some of the comments in the code are incorrect as some elements of the code has been revised... I should probably update the comments

Thank you, 
Wombat

Edited by Wombat

Just look at us.
Everything is backwards; everything is upside down. Doctors destroy health. Lawyers destroy justice. Universities destroy knowledge. Governments destroy freedom. The major media destroy information and religions destroy spirituality. ~ Michael Ellner


The internet is our one and only hope at a truly free world, do not let them take it from us...

Share this post


Link to post
Share on other sites
UEZ

Try this:
 

Func _Server_gui()
    $SrvGUI = GUICreate("Servers", 1261, 681, 6, 146, BitOR($WS_POPUP, $WS_BORDER), $WS_EX_MDICHILD, $MainGUI)
;~     _WinAPI_SetParent($SrvGUI, $MainGUI)
    GUISetBkColor(0x353535)
    GUISetState(@SW_SHOW, $SrvGUI)
;~  _Position_Child()
EndFunc

If I minimize and restore the GUI then "Yes" appears.

Br,

UEZ


Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites
Wombat

well.... that works... I swear I tried that. Thank you UEZ

any idea what was causing the bug in the old code? I'd prefer to know so that I can avoid this in the future.

Also, how can I capture events from both gui? I've noticed if my "About" gui is alive, my main gui will not function. Any clue as to how to remedy this?

Edited by Wombat

Just look at us.
Everything is backwards; everything is upside down. Doctors destroy health. Lawyers destroy justice. Universities destroy knowledge. Governments destroy freedom. The major media destroy information and religions destroy spirituality. ~ Michael Ellner


The internet is our one and only hope at a truly free world, do not let them take it from us...

Share this post


Link to post
Share on other sites
UEZ

While your About function is running the code is caught in the while / wend loop:

While WinExists("About Xex Launcher", "")=1
        Switch GUIGetMsg()
            Case $AbtBtn_close
                GUIDelete($AboutGUI)
        EndSwitch
    WEnd

How should your main gui work?

What you can try is to use GUISetOnEvent on main GUI but I'm not sure whether it will work when About function is called. Test it.

Regarding the "bug" - I wouldn't say it is a bug rather it is the behavior how the GUI reacts when you initialize the child GUI that way.

 

Br,

UEZ

Edited by UEZ
  • Like 1

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites
Wombat

I considered using GUIOnEventMode but there are bugs using it and the OnHover UDF I'm using. Thanks for the help, I'll dig back in and see what I can figure out...


Just look at us.
Everything is backwards; everything is upside down. Doctors destroy health. Lawyers destroy justice. Universities destroy knowledge. Governments destroy freedom. The major media destroy information and religions destroy spirituality. ~ Michael Ellner


The internet is our one and only hope at a truly free world, do not let them take it from us...

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  

×