John117 Posted January 12, 2012 Share Posted January 12, 2012 I have a gui set up. It has several tabs. On one of the tabs I need about 100 rows. Each row includes 7 input fields. As you can guess. I cant fit 100 rows on the gui without exceeding the gui size. The gui is currently set at 800,600. I can see around 20 rows. I need to somehow be able to scroll down on the tab to see the additional 80 tabs... A scroll bar like in IE would be great! Any suggestions? test included. Thanks! #include <GUIConstants.au3> #include <TabConstants.au3> Opt("GUIOnEventMode", 1) HotKeySet("{ESC}", "_ParentWin_Special_Close") $Form1 = GUICreate("Form1", 800, 600, Default, Default) $tab = GUICtrlCreateTab(10, 10, 780, 560, $TCS_BUTTONS) $tab1 = GUICtrlCreateTabItem("tab1") GUICtrlSetState(-1, $GUI_SHOW); will be display first Dim $F[1000] $aLeft = 20 $aTop = 150 $aHeigth = 20 $Rows = (1+(50*6)) ;rows = 50 For $x = 1 To $Rows Step 7 $F[$x] = GUICtrlCreateInput($x, 20, $aTop, 30, $aHeigth) $F[$x+1] = GUICtrlCreateInput($x+1, 20+30+2, $aTop, 30, $aHeigth) $F[$x+2] = GUICtrlCreateCombo($x+2, 20+30+30+4, $aTop, 120, $aHeigth) $F[$x+3] = GUICtrlCreateInput($x+3, 20+30+30+120+6, $aTop, 300, $aHeigth) $F[$x+4] = GUICtrlCreateCombo($x+4, 20+30+30+120+300+8, $aTop, 120, $aHeigth) $F[$x+5] = GUICtrlCreateCombo($x+5, 20+30+30+120+300+120+10, $aTop, 40, $aHeigth) $F[$x+6] = GUICtrlCreateCombo($x+6, 20+30+30+120+300+120+40+12, $aTop, 80, $aHeigth) $aTop = $aTop + 22 Next $tab2 = GUICtrlCreateTabItem("Tab2") GUISetState(@SW_SHOW) While 1 Sleep(20) WEnd Func _ParentWin_Special_Close() Exit EndFunc ;==>_ParentWin_Special_Close Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 12, 2012 Moderators Share Posted January 12, 2012 John117,Try a child GUI with a scrollbar. The Tabs tutorial in the Wiki shows how to deal with child GUIs on tabs - the GUIScrollBars_Ex UDF in my sig will get you scrollbars in the child GUI very easily. Give it a try and come back if you run into difficulties. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
John117 Posted January 16, 2012 Author Share Posted January 16, 2012 Melba23: Thank you for your suggestion! Looks like it will be a good option. I am stuck on how to automatically display the child gui and hide it when selecting another tab. Looks like it doesnt like 'onevent' for the individual tab selection. Any thoughts on how to hide it, short of placing a button on the tab is should be on and having all tab selections hide it? (not really a bad option I guess) expandcollapse popup#include <GUIConstants.au3> #include <TabConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include "GUIScrollbars_Ex.au3" Opt("GUIOnEventMode", 1) HotKeySet("{ESC}", "_ParentWin_Special_Close") $Form1 = GUICreate("Form1", 800, 600, Default, Default) $tab = GUICtrlCreateTab(10, 10, 780, 560, $TCS_BUTTONS) GUICtrlSetOnEvent(-1, "_Hide") $tab1 = GUICtrlCreateTabItem("tab1") ;~ GUICtrlSetOnEvent(-1, "_Show") GUICtrlSetState(-1, $GUI_SHOW); will be display first $Left = 600 $Top = 40 $Heigth = 20 $Width = 120 Global $Report_Builder_Button = GUICtrlCreateButton("Click to Display", $Left, $Top, $Width, $Heigth, 0) GUICtrlSetOnEvent(-1, "_Show") $tab2 = GUICtrlCreateTabItem("Tab2") ;~ GUICtrlSetOnEvent(-1, "_Hide") Dim $F[1000] $aLeft = 20 $aTop = 150 $aHeigth = 20 $Rows = (1+(100*6)) ;rows = 50 ; Close Tab definiton GUICtrlCreateTabItem("") $hTab_Win0 = GUICreate("", 780, 400, 10, 150, $WS_POPUP, $WS_EX_MDICHILD, $Form1) $aTop = 20 For $x = 1 To $Rows Step 7 $F[$x] = GUICtrlCreateInput($x, 20, $aTop, 30, $aHeigth) $F[$x+1] = GUICtrlCreateInput($x+1, 20+30+2, $aTop, 30, $aHeigth) $F[$x+2] = GUICtrlCreateCombo($x+2, 20+30+30+4, $aTop, 120, $aHeigth) $F[$x+3] = GUICtrlCreateInput($x+3, 20+30+30+120+6, $aTop, 300, $aHeigth) $F[$x+4] = GUICtrlCreateCombo($x+4, 20+30+30+120+300+8, $aTop, 120, $aHeigth) $F[$x+5] = GUICtrlCreateCombo($x+5, 20+30+30+120+300+120+10, $aTop, 40, $aHeigth) $F[$x+6] = GUICtrlCreateCombo($x+6, 20+30+30+120+300+120+40+12, $aTop, 80, $aHeigth) $aTop = $aTop + 22 Next _GUIScrollbars_Generate($hTab_Win0, 0, 2000) GUISetState(@SW_SHOW, $Form1) ;~ GUISetState(@SW_SHOW, $hTab_Win0) While 1 Sleep(20) WEnd Func _Show() GUISetState(@SW_SHOW, $hTab_Win0) EndFunc Func _Hide() GUISetState(@SW_HIDE, $hTab_Win0) EndFunc Func _ParentWin_Special_Close() ;~ _GUIScrollbars_Generate($Form1, 0, 2000) Exit EndFunc ;==>_ParentWin_Special_Close Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 16, 2012 Moderators Share Posted January 16, 2012 John117,I would do it like this:expandcollapse popup#include <GUIConstants.au3> #include <TabConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include "GUIScrollbars_Ex.au3" Opt("GUIOnEventMode", 1) HotKeySet("{ESC}", "_Exit") $Form1 = GUICreate("Form1", 800, 600, Default, Default) GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit") $tab = GUICtrlCreateTab(10, 10, 780, 560, $TCS_BUTTONS) GUICtrlSetOnEvent(-1, "_Tab") $tab1 = GUICtrlCreateTabItem("tab1") GUICtrlSetState(-1, $GUI_SHOW); will be display first $Left = 600 $Top = 40 $Heigth = 20 $Width = 120 $tab2 = GUICtrlCreateTabItem("Tab2") Dim $F[1000] $aLeft = 20 $aTop = 150 $aHeigth = 20 $Rows = (1 + (100 * 6)) ;rows = 50 ; Close Tab definiton GUICtrlCreateTabItem("") $hTab_Win0 = GUICreate("", 780, 400, 10, 150, $WS_POPUP, $WS_EX_MDICHILD, $Form1) GUISetBkColor(0xFF0000) ; Just to show the GUI clearly $aTop = 20 For $x = 1 To $Rows Step 7 $F[$x] = GUICtrlCreateInput($x, 20, $aTop, 30, $aHeigth) $F[$x + 1] = GUICtrlCreateInput($x + 1, 20 + 30 + 2, $aTop, 30, $aHeigth) $F[$x + 2] = GUICtrlCreateCombo($x + 2, 20 + 30 + 30 + 4, $aTop, 120, $aHeigth) $F[$x + 3] = GUICtrlCreateInput($x + 3, 20 + 30 + 30 + 120 + 6, $aTop, 300, $aHeigth) $F[$x + 4] = GUICtrlCreateCombo($x + 4, 20 + 30 + 30 + 120 + 300 + 8, $aTop, 120, $aHeigth) $F[$x + 5] = GUICtrlCreateCombo($x + 5, 20 + 30 + 30 + 120 + 300 + 120 + 10, $aTop, 40, $aHeigth) $F[$x + 6] = GUICtrlCreateCombo($x + 6, 20 + 30 + 30 + 120 + 300 + 120 + 40 + 12, $aTop, 80, $aHeigth) $aTop = $aTop + 22 Next _GUIScrollbars_Generate($hTab_Win0, 0, 2000) GUISetState(@SW_SHOW, $Form1) GUISetState(@SW_SHOW, $hTab_Win0) While 1 Sleep(20) WEnd Func _Tab() Switch GUICtrlRead($tab) Case 0 GUISetState(@SW_SHOW, $hTab_Win0) Case 1 GUISetState(@SW_HIDE, $hTab_Win0) EndSwitch EndFunc ;==>_Tab Func _Exit() Exit EndFunc ;==>_ExitPlease ask if anything is unclear. Glad you like the Scrollbars UDF. M23 Xandy 1 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
GEOSoft Posted January 16, 2012 Share Posted January 16, 2012 $bShow = True Func _ToggleWin() $bShow = Not $bShow If $bShow Then GUISetState(@SW_Show, $hTab_Win0) Return EndIf GUISetState(@SW_Hide, $hTab_Win0) EndFuncAlso add event functions for the TAB not the TabItems using GUICtrlRead($Tab)And you shouldn't have GUICtrlCreateTabItem("") where it is. Put it after the last control on that tab. George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
John117 Posted January 16, 2012 Author Share Posted January 16, 2012 Thank you very much! I will start giving more attention and credit to switches. I haven't spent much time with them, but can see how much easier they make things. Also, thanks for chipping in GEOSoft! Appreciate it! Link to comment Share on other sites More sharing options...
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