Sign in to follow this  
Followers 0
enaiman

Messed coordinates

4 posts in this topic

This is how my GUI is looking normally:

post-18882-1172201164_thumb.jpg

Today I've been adding another GUI (created using Koda form) and run it at the begining

The purpose of it: to set 1 flag variable, to delete itself and give control back to main

After the control is given back to main, the main GUI looks like this:

post-18882-1172201178_thumb.jpg

Somehow the coordinates are messed and I don't have any idea how to fix this.

The whole code is veeery big (1500+ lines) so it is useless to put it here. I will put which segments will be needed.

Thank you for any suggestion.


SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Share this post


Link to post
Share on other sites



That is the weirdest thing I have ever seen. I would guess it has something to do with AutoIt's internal workings. That is unless you make any changes while it is inactive.

Share this post


Link to post
Share on other sites

thank you for your reply Mr Icekirby

I will try to offer some details:

here is the original code:

Opt("GUIOnEventMode", 1)
Opt("WinTitleMatchMode", 2)

$decision = MsgBox(52,"Warning","This program needs TeraTerm started in ""log"" mode." & @CRLF & "If you want to continue it will close any ""COM1"" instance of TeraTerm." & @CRLF & "Be sure to save your work before clicking ""Yes""." & @CRLF & @CRLF & "Do you want to continue?")
    Select
       Case $decision = 6;Yes
            If WinExists("COM1 - Tera Term", "") Then WinClose("COM1 - Tera Term", "")
            If WinExists("Tera Term: Log", "Filename") Then WinClose("Tera Term: Log", "Filename")
       Case $decision = 7;No
            Exit
    EndSelect
$Form1 = GUICreate("Extreme Network Switch Configuration v. 1.0", 519, 497, 193, 115)
GUISetOnEvent($GUI_EVENT_CLOSE, "AForm1Close")
$bootrom = GUICtrlCreateButton("BootRom Check", 36, 374, 109, 33, 0)
and the rest of the code follows ....

what I've added is:

between EndSelect and $Form 1:

Dim $interface_flag = 0, $mode="", $safe, $expert, $sure, $interface_ch
interface_choice()
Do 
Sleep(500)
Until $interface_flag = 1

this is added at the end (before GUISetState(@SW_SHOW))

Select
    Case $mode ="safe"
        choice_mode($GUI_DISABLE)
    Case $mode ="expert"
        choice_mode($GUI_ENABLE)
    Case Else
        MsgBox(16,"Error","Mode choice error.")
        Exit
EndSelect

and the "interface_choice()" function is:

Func interface_choice()
    $interface_ch = GUICreate("Choose Level", 219, 130, 196, 113)
    GUICtrlCreateGroup("", 8, 25, 201, 65)
    $safe = GUICtrlCreateRadio("Safe Interface", 18, 40, 161, 17)
    $expert = GUICtrlCreateRadio("@$#%$# I know what I'm doing", 18, 63, 177, 17)
;GUICtrlCreateGroup("", -99, -99, 1, 1)
    $sure = GUICtrlCreateButton("&OK", 73, 99, 75, 25, 0)
    GUICtrlSetOnEvent(-1, "sureClick")
    GUICtrlCreateLabel("Choose the interface type", 40, 8, 125, 17)
    GUISetState(@SW_SHOW)
EndFunc

Func sureClick()
    Select
        Case GUICtrlRead($safe) = $GUI_CHECKED
            $mode = "safe"
            $interface_flag = 1
            GUIDelete($interface_ch)
        Case GUICtrlRead($expert) = $GUI_CHECKED    
            $mode = "expert"
            $interface_flag = 1
            GUIDelete($interface_ch)
    EndSelect
EndFunc

Func choice_mode($state1)
    GUICtrlSetState($bootrom, $state1)
    GUICtrlSetState($firmware, $state1)
    GUICtrlSetState($configure, $state1)
    GUICtrlSetState($diagnostics, $state1)
;GUICtrlSetState($mike_config, $GUI_DISABLE)
    GUICtrlSetState($tt_com1, $state1)
    GUICtrlSetState($tt_ip, $state1)
    GUICtrlSetState($temp_ip, $state1)
    GUICtrlSetState($set_tftp, $state1)
    GUICtrlSetState($ping_sw, $state1)
    GUICtrlSetState($login_sw, $state1)
    GUICtrlSetState($logout_sw, $state1)
    GUICtrlSetState($final_cfg, $state1)
EndFunc

This is everything I did - the original script works OK but with these additions, the GUI is messed up.

I tried to make the main GUI resizeable and once I've dragged a little bit from the lowest corner the GUI went back to normal ...

I don't know what this can be - the fact tis that this isn't the first GUI to put inside the main script - actually I've put there more than 10 and all went OK.

Anyway - a big Thanks for anyone willing to help.


SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Share this post


Link to post
Share on other sites

I guess this is something very difficult to solve or it doesn't worth trying.

Anyway I found a workaround (holy workarounds :whistle: ) and I've replaced the whole function with a menu; it doesn't have the graphic appearance but ... it works.

Thanks for anyone thinking about this issue.


SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

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