Vadersapien Posted January 16, 2010 Posted January 16, 2010 Hi, I while back I asked about the "Tab in Tab" situation, and was given the method of creating a child GUI to house the "tab in a tab". It works, except there is one problem: When you click another tab in the "parent" tab, the child GUI hides, yet no controls show where the child GUI was...here is my complete code: expandcollapse popup#AutoIt3Wrapper_icon=dev-icon.ico #NoAutoIt3Execute #include <COM.au3> #include <GUIConstantsEx.au3> #Include <GUIStatusBar.au3> #include <Icons.au3> #include <ListViewConstants.au3> #include <WindowsConstants.au3> ;Set AutoIt Specific Options AutoItSetOption('GUICloseOnESC', False) AutoItSetOption('MustDeclareVars', True) AutoItSetOption('TrayIconHide', True) ;Declare Variables Local $ParentTab, $hParentTab Local $PersonalitiesTab, $FileListPC, $FileListRobot, $PerPic, $hChildGUI Local $LiveControlTab Local $EditorTab Local $MediaTab Local $ApplicationsTab, $ApplicationsCatList Local $JavaTab Local $TimeTab Local $StatusBar, $ProgressBar, $StatusBarParts[2] = [650, 150] ;Create GUI Global $hGUI = GUICreate('RS Media Manager', 800, 600) ;Create GUI Content $ParentTab = GUICtrlCreateTab(5, 5, 792, 568) $hParentTab = GUICtrlGetHandle($ParentTab) ;Create 'Personalities' Tab Content $PersonalitiesTab = GUICtrlCreateTabItem('Personalities') GUICtrlCreateLabel('Computer', 10, 43) $FileListPC = GUICtrlCreateList('', 10, 60, 320, 263, $LVS_SINGLESEL) $PerPic = GUICtrlCreatePic('perpic.jpg', 334, 32, 132, 176) GUICtrlCreateLabel('Robot', 470, 43) $FileListRobot = GUICtrlCreateList('', 470, 60, 320, 263, $LVS_SINGLESEL) $hChildGUI = GUICreate('', 780, 253, 5, 310, $WS_CHILD, -1, $hParentTab) GUICtrlCreateTab(0, 0, 782, 253) GUICtrlCreateTabItem('All') GUICtrlCreateListView('Name|Description|Path', 5, 27, 770, 220) GUICtrlCreateTabItem('Common') GUICtrlCreateTabItem('Control Mode') GUICtrlCreateTabItem('Arm Mode') GUICtrlCreateTabItem('Bodycon') GUICtrlCreateTabItem('') GUISetState() ;Switch back to main GUI GUISwitch($hGUI) ;Create 'Macro Editor' Tab Content $LiveControlTab = GUICtrlCreateTabItem('Live Control') ;Create 'Macro Editor' Tab Content $EditorTab = GUICtrlCreateTabItem('Editor') ;Create 'Media' Tab Content $MediaTab = GUICtrlCreateTabItem('Media') ;Create 'Personalities' Tab Content $ApplicationsTab = GUICtrlCreateTabItem('Applications') $ApplicationsCatList = GUICtrlCreateListView(-1, 10, 31, 200, 536, $LVS_NOCOLUMNHEADER) ;Create 'Personalities' Tab Content $JavaTab = GUICtrlCreateTabItem('Java') ;Create 'Time' Tab Content $TimeTab = GUICtrlCreateTabItem('Time') ;End Tab GUICtrlCreateTabItem('') ;Create Statusbar $StatusBar = _GUICtrlStatusBar_Create($hGUI) _GUICtrlStatusBar_SetParts($StatusBar, $StatusBarParts) _GUICtrlStatusBar_SetText($StatusBar, ' ' & 'Robot not connected', 0) $ProgressBar = GUICtrlCreateProgress(0, 0) GuiCtrlSetData($ProgressBar, 50) _GUICtrlStatusBar_EmbedControl($StatusBar, 1, GUICtrlGetHandle($ProgressBar)) ;Show main GUI GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE GUIDelete() Exit Case $GUI_EVENT_RESTORE _GUICtrlStatusBar_EmbedControl($StatusBar, 1, GUICtrlGetHandle($ProgressBar)) Case $ParentTab Switch GUICtrlRead($ParentTab, 1) Case $PersonalitiesTab GUISetState(@SW_SHOW, $hChildGUI) Case Else GUISetState(@SW_HIDE, $hChildGUI) EndSwitch EndSwitch WEnd Try clicking on the "Applications" tab. You'll see what I mean... Try Pacfox, my Firefox theme.Try Power Eject, my windows gadget that allows you to eject most drives.Using AutoIt 3.3.4.0, Windows 7 Premium, Intel Core 2 Quad CPU @ 2.66ghz, 4gb RAM, Nvidia GeForce 9500GT Graphics Card & Samsung 22" Monitor.
KaFu Posted January 16, 2010 Posted January 16, 2010 This works fine for me. Maybe and extra _WinAPI_RedrawWindow() does the trick? expandcollapse popup#AutoIt3Wrapper_icon=dev-icon.ico #NoAutoIt3Execute ;#include <COM.au3> #include <GUIConstantsEx.au3> #Include <GUIStatusBar.au3> ;#include <Icons.au3> #include <ListViewConstants.au3> #include <WindowsConstants.au3> #include <WinApi.au3> ;Set AutoIt Specific Options AutoItSetOption('GUICloseOnESC', False) AutoItSetOption('MustDeclareVars', True) AutoItSetOption('TrayIconHide', True) ;Declare Variables Local $ParentTab, $hParentTab Local $PersonalitiesTab, $FileListPC, $FileListRobot, $PerPic, $hChildGUI, $hChildGUI2 Local $LiveControlTab Local $EditorTab Local $MediaTab Local $ApplicationsTab, $ApplicationsCatList Local $JavaTab Local $TimeTab Local $StatusBar, $ProgressBar, $StatusBarParts[2] = [650, 150] ;Create GUI Global $hGUI = GUICreate('RS Media Manager', 800, 600) ;Create GUI Content $ParentTab = GUICtrlCreateTab(5, 5, 792, 568) $hParentTab = GUICtrlGetHandle($ParentTab) ;Create 'Personalities' Tab Content $PersonalitiesTab = GUICtrlCreateTabItem('Personalities') GUICtrlCreateLabel('Computer', 10, 43) $FileListPC = GUICtrlCreateList('', 10, 60, 320, 263, $LVS_SINGLESEL) $PerPic = GUICtrlCreatePic('perpic.jpg', 334, 32, 132, 176) GUICtrlCreateLabel('Robot', 470, 43) $FileListRobot = GUICtrlCreateList('', 470, 60, 320, 263, $LVS_SINGLESEL) $hChildGUI = GUICreate('', 780, 253, 5, 310, $WS_CHILD, -1, $hParentTab) GUICtrlCreateTab(0, 0, 782, 253) GUICtrlCreateTabItem('All') GUICtrlCreateListView('Name|Description|Path', 5, 27, 770, 220) GUICtrlCreateTabItem('Common') GUICtrlCreateTabItem('Control Mode') GUICtrlCreateTabItem('Arm Mode') GUICtrlCreateTabItem('Bodycon') GUICtrlCreateTabItem('') GUISetState() ;Switch back to main GUI GUISwitch($hGUI) ;Create 'Macro Editor' Tab Content $LiveControlTab = GUICtrlCreateTabItem('Live Control') $hChildGUI2 = GUICreate('', 780, 253, 5, 310, $WS_CHILD, -1, $hParentTab) GUICtrlCreateTab(0, 0, 782, 253) GUICtrlCreateTabItem('All2') GUICtrlCreateListView('Name|Description|Path', 5, 27, 770, 220) GUICtrlCreateTabItem('Common') GUICtrlCreateTabItem('Control Mode') GUICtrlCreateTabItem('Arm Mode') GUICtrlCreateTabItem('Bodycon') GUICtrlCreateTabItem('') ;Switch back to main GUI GUISwitch($hGUI) ;Create 'Macro Editor' Tab Content $EditorTab = GUICtrlCreateTabItem('Editor') ;Create 'Media' Tab Content $MediaTab = GUICtrlCreateTabItem('Media') ;Create 'Personalities' Tab Content $ApplicationsTab = GUICtrlCreateTabItem('Applications') $ApplicationsCatList = GUICtrlCreateListView(-1, 10, 31, 200, 536, $LVS_NOCOLUMNHEADER) ;Create 'Personalities' Tab Content $JavaTab = GUICtrlCreateTabItem('Java') ;Create 'Time' Tab Content $TimeTab = GUICtrlCreateTabItem('Time') ;End Tab GUICtrlCreateTabItem('') ;Create Statusbar $StatusBar = _GUICtrlStatusBar_Create($hGUI) _GUICtrlStatusBar_SetParts($StatusBar, $StatusBarParts) _GUICtrlStatusBar_SetText($StatusBar, ' ' & 'Robot not connected', 0) $ProgressBar = GUICtrlCreateProgress(0, 0) GuiCtrlSetData($ProgressBar, 50) _GUICtrlStatusBar_EmbedControl($StatusBar, 1, GUICtrlGetHandle($ProgressBar)) ;Show main GUI GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE GUIDelete() Exit Case $GUI_EVENT_RESTORE _GUICtrlStatusBar_EmbedControl($StatusBar, 1, GUICtrlGetHandle($ProgressBar)) Case $ParentTab Switch GUICtrlRead($ParentTab, 1) Case $PersonalitiesTab GUISetState(@SW_SHOW, $hChildGUI) GUISetState(@SW_HIDE, $hChildGUI2) Case $LiveControlTab GUISetState(@SW_HIDE, $hChildGUI) GUISetState(@SW_SHOW, $hChildGUI2) Case Else GUISetState(@SW_HIDE, $hChildGUI) GUISetState(@SW_HIDE, $hChildGUI2) _WinAPI_RedrawWindow($hGUI) EndSwitch EndSwitch WEnd OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2025-May-18) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16)
martin Posted January 16, 2010 Posted January 16, 2010 On 1/16/2010 at 1:11 AM, 'Vadersapien said: Hi, I while back I asked about the "Tab in Tab" situation, and was given the method of creating a child GUI to house the "tab in a tab". It works, except there is one problem: When you click another tab in the "parent" tab, the child GUI hides, yet no controls show where the child GUI was...here is my complete code: .. Try clicking on the "Applications" tab. You'll see what I mean... Make the parent of the child window $hGUI not $hParenttab. 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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now