Jump to content

Strange tab behaviour


enaiman
 Share

Recommended Posts

Sorry if this issue have been discussed but after more than 1 hour of searching the topics I couldn't find anything relevant.

Here is my problem;

According to a user choice from a combo list I've created a new tab:

if $msg = $site_mnemonic Then
        if GUICtrlRead($site_mnemonic) = "RHHL" Then
            GUICtrlCreateTabitem ("RHHL Vlan")
        GUICtrlCreateLabel("VLAN Name", 30, 50)
        GUICtrlCreateLabel("Tag", 140, 50)
..........

The creation is succesful but ...

If I click the new created tab I will see the tab I've created having all its content AND all the elements from the first tab (it is like the image isn't refreshed).

The result looks like the image attached.

IF I click on another tab and I come back to the weird one it will look NORMAL (like on the lower part of the image)

IF (after I create the tab) I don't click it directly but clicking first on another tab then the weird one - it will look NORMAL.

How could I avoid this "intermediar click" and get my tab to look normal?

Thank you,

post-18882-1165793958_thumb.jpg

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 :)

Link to comment
Share on other sites

Thank you for your reply Zedna,

Here is all the code I've got until now (I'm still at the begining of the script)

#include <GUIConstants.au3>

GUICreate("Config File Generator", 850, 660)  

GUICtrlCreateButton ("Save Config File",  50, 620, 100)
GUICtrlCreateButton ("Exit",  270, 620, 100)


GUICtrlCreateTab (5,5, 843,600)
GUICtrlCreateTabitem ("Site Info")

GUICtrlCreateLabel("Site", 20, 40)
$site_mnemonic = GUICtrlCreateCombo ("Choose Site Mnemonic", 20,60,150) 
GUICtrlSetData(-1,"56CO|ABCH|ANAE|ANZG|ARST|AYDC|UCHC|VIEWPOINT|ZHCH")


GUICtrlCreateLabel("Function", 185, 40)
$sw_function = GUICtrlCreateCombo ("Switch Function", 185,60,100)
GUICtrlSetData(-1,"CO|ED")


GUICtrlCreateLabel("Switch Number", 300, 40)
$sw_number = GUICtrlCreateCombo ("Switch Number", 300,60,100)
GUICtrlSetData(-1,"01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|
33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50")


GUICtrlCreateLabel("Switch Location", 20, 90)
$sw_location = GUICtrlCreateInput ( "", 20,  110, 200, 20)


GUICtrlCreateLabel("Rack Number", 240, 90)
$rack_number = GUICtrlCreateCombo ("Rack Number", 240,110,100) 
GUICtrlSetData(-1,"01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|
33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50")


GUICtrlCreateGroup ("IP Info", 15, 150, 180, 170)


GUICtrlCreateLabel("Switch's IP address", 20, 170)
GUICtrlCreateInput ( "", 20,  190, 30, 20)
GUICtrlCreateInput ( "", 60,  190, 30, 20)
GUICtrlCreateInput ( "", 100,  190, 30, 20)
GUICtrlCreateInput ( "", 140,  190, 30, 20)

GUICtrlCreateLabel("Gateway IP", 20, 215)
GUICtrlCreateInput ( "", 20,  235, 30, 20)
GUICtrlCreateInput ( "", 60,  235, 30, 20)
GUICtrlCreateInput ( "", 100,  235, 30, 20)
GUICtrlCreateInput ( "", 140,  235, 30, 20)

GUICtrlCreateLabel("Net Mask", 20, 260)
GUICtrlCreateInput ( "255", 20,  280, 30, 20)
GUICtrlCreateInput ( "255", 60,  280, 30, 20)
GUICtrlCreateInput ( "255", 100,  280, 30, 20)
GUICtrlCreateInput ( "0", 140,  280, 30, 20)


GUICtrlCreateGroup ("Switch Type", 220, 150, 180, 170)
$20024 = GUICtrlCreateRadio ("Summit 200-24", 240, 170)
$20048 = GUICtrlCreateRadio ("Summit 200-48", 240, 200)
$48si = GUICtrlCreateRadio ("Summit 48si", 240, 230)
$40024 = GUICtrlCreateRadio ("Summit 400-24", 240, 260)
$40048 = GUICtrlCreateRadio ("Summit 400-48t", 240, 290)


GUICtrlCreateTabitem ("Uplink / DNS / SNTP")

GUICtrlCreateGroup ("200-24", 15, 45, 100, 100)
GUICtrlCreateLabel("Port 25 String", 25, 60)
$20024up25 = GUICtrlCreateInput ( "", 25,  75, 75, 20)
GUICtrlCreateLabel("Port 26 String", 25, 100)
$20024up26 = GUICtrlCreateInput ( "", 25,  115, 75, 20)



GUISetState ()    


While 1
    $msg = GUIGetMsg()
    
    if $msg = $site_mnemonic Then
        if GUICtrlRead($site_mnemonic) = "RHHL" Then
            GUICtrlCreateTabitem ("RHHL Vlan")
            GUICtrlCreateLabel("VLAN Name", 30, 50)
            GUICtrlCreateLabel("Tag", 140, 50)
            GUICtrlCreateLabel("Ports assigned", 190, 50)
            GUICtrlCreateLabel("Tag Uplink", 340, 50)
            $rhhl_vlan = FileOpen("rhhl_vlan.txt", 0)
            $j = 70
        While 1
            $vlan_name = FileReadLine($rhhl_vlan)
            If @error = -1 Then ExitLoop
            GUICtrlCreateCheckbox ($vlan_name, 20, $j, 120, 20)
            GUICtrlCreateInput ( "", 140,  $j, 40, 20)
            GUICtrlCreateInput ( "", 190,  $j, 140, 20)
            GUICtrlCreateCheckbox ("", 360, $j, 20, 20)
            $vlan_name = FileReadLine($rhhl_vlan)
            If @error = -1 Then ExitLoop
            GUICtrlCreateCheckbox ($vlan_name, 450, $j, 120, 20)
            GUICtrlCreateInput ( "", 590,  $J, 40, 20)
            GUICtrlCreateInput ( "", 650,  $j, 140, 20)
            GUICtrlCreateCheckbox ("", 810, $j, 20, 20)
            $j = $j+25
            
Wend
FileClose($rhhl_vlan)
        
        GUISetState(@SW_hide)           
        GUISetState(@SW_SHOW)
        
        EndIf
    EndIf
    
    if $msg = $20024 Then
        if GUICtrlRead($20024) = $GUI_CHECKED Then
    
    GUICtrlSetState($20024up25, $GUI_HIDE)

    EndIf
    EndIf
    
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend

I've used that @SW_hide and @SW_show because without them the result was even uglier.

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 :)

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...