Sign in to follow this  
Followers 0
dinodod

controls on tabs don't hide

6 posts in this topic

I'm having an odd issue where I have several tabs in my GUI and when i click to change tabs, the controls don't hide. I end up having a merging of the 2 tabs and I was wondering if anyone knew how to correct this?

I know it sounds odd. Is there any way to 'trace' the issue to find the cause or is this a known issue?

Thanks!


Digital Chaos - Life as we know it today.I'm a Think Tank. Problem is, my tank is empty.The Quieter you are, the more you can HearWhich would you choose - Peace without Freedom or Freedom without Peace?Digital Chaos Macgyver ToolkitCompletely Dynamic MenuSQLIte controlsAD FunctionsEXCEL UDFPC / Software Inventory UDFPC / Software Inventory 2GaFrost's Admin Toolkit - My main competitor :)Virtual SystemsVMWAREMicrosoft Virtual PC 2007

Share this post


Link to post
Share on other sites



I'm having an odd issue where I have several tabs in my GUI and when i click to change tabs, the controls don't hide. I end up having a merging of the 2 tabs and I was wondering if anyone knew how to correct this?

I know it sounds odd. Is there any way to 'trace' the issue to find the cause or is this a known issue?

Thanks!

You using the built-in GuiCtrlCreateTab/GuiCtrlCreateTabItem or the UDF create?

If using the UDF create suggest using the built-in.


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

I'm having an odd issue where I have several tabs in my GUI and when i click to change tabs, the controls don't hide. I end up having a merging of the 2 tabs and I was wondering if anyone knew how to correct this?

I know it sounds odd. Is there any way to 'trace' the issue to find the cause or is this a known issue?

Thanks!

Have you remembered to end the tab definition with GuiCtrlCreateTabItem("")?

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

To solve the problem we need to see some code, if you don't want to post your script (or it's to big), make an example that can reproduce your problem :P.


 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Share this post


Link to post
Share on other sites

ok, I believe I found the issue. I have my GUI partially buit when using the GUICreate function. The rest of the gui for the tabs is created on the fly in my While / Wend section (See below). As I move from one tab to another, the items stay on the screen and don't hide. This puts a wench in my logic atm as my tabs are dependant on the actions of the other tabs.

Guess I'm gonna need to re-think the logic here and find a way to do some background checks.

While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
    
    Case $msg=$tab
        If GUICtrlRead($tab) = 1 then
            $GUI_Button_Back3 = GUICtrlCreateButton("Back", $ButtonX + 20, $Y1 + 20, 100, 30)
        EndIf
    EndSelect
WEnd

Digital Chaos - Life as we know it today.I'm a Think Tank. Problem is, my tank is empty.The Quieter you are, the more you can HearWhich would you choose - Peace without Freedom or Freedom without Peace?Digital Chaos Macgyver ToolkitCompletely Dynamic MenuSQLIte controlsAD FunctionsEXCEL UDFPC / Software Inventory UDFPC / Software Inventory 2GaFrost's Admin Toolkit - My main competitor :)Virtual SystemsVMWAREMicrosoft Virtual PC 2007

Share this post


Link to post
Share on other sites

It's a bad idea to create the controls like that, better create them before the loop. And if you need them dynamically, then you can use GUISwitch($hGUI, GUICtrlRead($hTab, 1)) and end the tab definition every time...

#include <GuiConstants.au3>

$hGUI = GUICreate("Test Script", 300, 200)

$hTab = GUICtrlCreateTab(10, 20, 280, 130)

GUICtrlCreateTabItem("Tab1")
GUICtrlCreateTabItem("Tab2")

GUICtrlCreateTabItem("")

GUISetState(@SW_SHOW, $hGUI)

$iButton1 = -1
$iButton2 = -1

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $hTab
            GUISwitch($hGUI, GUICtrlRead($hTab, 1))
            
            Switch GUICtrlRead($hTab)
                Case 0
                    If $iButton1 = -1 Then $iButton1 = GUICtrlCreateButton("Button (in tab 1)", 20, 60, 80, 20)
                Case 1
                    If $iButton2 = -1 Then $iButton2 = GUICtrlCreateButton("Button (in tab 2)", 20, 60, 80, 20)
            EndSwitch
            
            GUICtrlCreateTabItem("")
    EndSwitch
WEnd

But as i said, the best way is to create them previously:

#include <GuiConstants.au3>

$hGUI = GUICreate("Test Script", 300, 200)

$hTab = GUICtrlCreateTab(10, 20, 280, 130)

GUICtrlCreateTabItem("Tab1")
$iButton1 = GUICtrlCreateButton("Button (in tab 1)", 20, 60, 80, 20)

GUICtrlCreateTabItem("Tab2")
$iButton2 = GUICtrlCreateButton("Button (in tab 2)", 20, 60, 80, 20)

GUICtrlCreateTabItem("")

GUISetState(@SW_SHOW, $hGUI)

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

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