satanttin Posted November 14, 2013 Posted November 14, 2013 Hello, I have a question i would like to know is it possible to mass hide controls and mass show controls? because i have a few controls i want to hide in certain menu's. as example with menu 1 i want to show label 1/10 and if i press on menu 2 i want to show button 1/10 can someone give me pointers where to go with this? cause my script would be way too long if i do this one by one. If it's not possible i just add em one by one tho.
water Posted November 14, 2013 Posted November 14, 2013 (edited) Either set the controls to enabled/disabled (using $GUI_ENABLE / $GUI_DISABLE) or use Melba's >GUIExtender UDF to show/hide a part of the GUI. Edited November 14, 2013 by water My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
satanttin Posted November 14, 2013 Author Posted November 14, 2013 Either set the controls to enabled/disabled (using $GUI_ENABLE / $GUI_DISABLE) or use Melba's >GUIExtender UDF to show/hide a part of the GUI. yes but $gui_enable/disable is the same as $gui_show/hide right? since when they are hided i can't use em and can't click on it?
water Posted November 14, 2013 Posted November 14, 2013 (edited) No. $GUI_SHOW Control will be visible. On Tabitem control will select the first tab to be displayed. $GUI_HIDE Control will not be visible. $GUI_ENABLE Control will be enabled. $GUI_DISABLE Control will be greyed out. Edited November 14, 2013 by water My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
satanttin Posted November 14, 2013 Author Posted November 14, 2013 greyed out but still visable? cause if that's the case it would be anoying since the different menu's will overlap some of the controls that will be ontop of each other. and the tab display will be ok because the program is just for clicking buttons and seeing text so no need that the tabitem control will be in the correct order?
michaelslamet Posted November 14, 2013 Posted November 14, 2013 I started most of my "main" scripts in 2010. That was the first time I hear about AutoIT. I wrote most of the GUI Controls manually, that is write them one by one, line by line. When I need to mass control them (eg: disable/enable them, move them to new position, checked/unchecked them), it's pain in the as* Later on, I learned I should put them on array, so I can use For...Next loop to control them, something like: For $a = 0 to Ubound($aList_of_Websites)-1 $hCheckBox[$a] = GUICtrlCreateCheckbox($aList_of_Websites[$a], 20, 100 + (20 * $a)) GUICtrlSetState($hCheckBox[$a], $GUI_CHECKED) Next Maybe you should put those controls into array?
water Posted November 14, 2013 Posted November 14, 2013 It becomes a bit hard to follow what you have and what you try to achieve. Have you already coded something you can post? My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
satanttin Posted November 14, 2013 Author Posted November 14, 2013 I started most of my "main" scripts in 2010. That was the first time I hear about AutoIT. I wrote most of the GUI Controls manually, that is write them one by one, line by line. When I need to mass control them (eg: disable/enable them, move them to new position, checked/unchecked them), it's pain in the as* Later on, I learned I should put them on array, so I can use For...Next loop to control them, something like: For $a = 0 to Ubound($aList_of_Websites)-1 $hCheckBox[$a] = GUICtrlCreateCheckbox($aList_of_Websites[$a], 20, 100 + (20 * $a)) GUICtrlSetState($hCheckBox[$a], $GUI_CHECKED) Next Maybe you should put those controls into array? ermm well i'm not that smart hehe xD and seems way too difficult to me so might stick with doing it manual. not that bad once i set it up good it can stay as it is for a long time anyways, it's just a small program. but thanks for your reply
satanttin Posted November 14, 2013 Author Posted November 14, 2013 It becomes a bit hard to follow what you have and what you try to achieve. Have you already coded something you can post? Func Gui_Main() GUISetState(@SW_SHOW, $Main) GUIDelete($Gui_Startup) GUICtrlSetState($LName, $GUI_SHOW) GUICtrlSetState($LDepartment, $GUI_SHOW) EndFunc something like that when i open a new gui i want such things automaticly be shown and other labels and what not be hidden till i goto home where other controls need to be visable and those not.
Solution water Posted November 14, 2013 Solution Posted November 14, 2013 Here is an example how the array thing works. You can either create the controls in a loop or manually. It's important to store the returned ControlIds in a array. #include <GUIConstantsEx.au3> Global $msg, $ahCheckBoxes[10] GUICreate("My GUI") ; Create some (5) checkboxes in a loop For $iIndex = 0 To 4 $ahCheckBoxes[$iIndex] = GUICtrlCreateCheckbox($ahCheckBoxes[$iIndex], 20, 50 + (20 * $iIndex), 15, 15) Next ; Create some (5) checkboxes manually $ahCheckBoxes[5] = GUICtrlCreateCheckbox($ahCheckBoxes[$iIndex], 20, 50 + (20 * 5), 15, 15) $ahCheckBoxes[6] = GUICtrlCreateCheckbox($ahCheckBoxes[$iIndex], 20, 50 + (20 * 6), 15, 15) $ahCheckBoxes[7] = GUICtrlCreateCheckbox($ahCheckBoxes[$iIndex], 20, 50 + (20 * 7), 15, 15) $ahCheckBoxes[8] = GUICtrlCreateCheckbox($ahCheckBoxes[$iIndex], 20, 50 + (20 * 8), 15, 15) $ahCheckBoxes[9] = GUICtrlCreateCheckbox($ahCheckBoxes[$iIndex], 20, 50 + (20 * 9), 15, 15) $hCheck = GUICtrlCreateButton("Check all", 20, 260, 80) $hUncheck = GUICtrlCreateButton("Uncheck all", 110, 260, 80) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE ExitLoop Case $hCheck For $iIndex = 0 To UBound($ahCheckBoxes) - 1 GUICtrlSetState($ahCheckBoxes[$iIndex], $GUI_CHECKED) Next Case $hUncheck For $iIndex = 0 To UBound($ahCheckBoxes) - 1 GUICtrlSetState($ahCheckBoxes[$iIndex], $GUI_UnCHECKED) Next EndSwitch WEnd GUIDelete() My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
michaelslamet Posted November 14, 2013 Posted November 14, 2013 ermm well i'm not that smart hehe xD and seems way too difficult to me so might stick with doing it manual. not that bad once i set it up good it can stay as it is for a long time anyways, it's just a small program. but thanks for your reply If I'm that smart, I already have a capability to create some powerful UDFs and share it here
satanttin Posted November 14, 2013 Author Posted November 14, 2013 Here is an example how the array thing works. You can either create the controls in a loop or manually. It's important to store the returned ControlIds in a array. #include <GUIConstantsEx.au3> Global $msg, $ahCheckBoxes[10] GUICreate("My GUI") ; Create some (5) checkboxes in a loop For $iIndex = 0 To 4 $ahCheckBoxes[$iIndex] = GUICtrlCreateCheckbox($ahCheckBoxes[$iIndex], 20, 50 + (20 * $iIndex), 15, 15) Next ; Create some (5) checkboxes manually $ahCheckBoxes[5] = GUICtrlCreateCheckbox($ahCheckBoxes[$iIndex], 20, 50 + (20 * 5), 15, 15) $ahCheckBoxes[6] = GUICtrlCreateCheckbox($ahCheckBoxes[$iIndex], 20, 50 + (20 * 6), 15, 15) $ahCheckBoxes[7] = GUICtrlCreateCheckbox($ahCheckBoxes[$iIndex], 20, 50 + (20 * 7), 15, 15) $ahCheckBoxes[8] = GUICtrlCreateCheckbox($ahCheckBoxes[$iIndex], 20, 50 + (20 * 8), 15, 15) $ahCheckBoxes[9] = GUICtrlCreateCheckbox($ahCheckBoxes[$iIndex], 20, 50 + (20 * 9), 15, 15) $hCheck = GUICtrlCreateButton("Check all", 20, 260, 80) $hUncheck = GUICtrlCreateButton("Uncheck all", 110, 260, 80) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE ExitLoop Case $hCheck For $iIndex = 0 To UBound($ahCheckBoxes) - 1 GUICtrlSetState($ahCheckBoxes[$iIndex], $GUI_CHECKED) Next Case $hUncheck For $iIndex = 0 To UBound($ahCheckBoxes) - 1 GUICtrlSetState($ahCheckBoxes[$iIndex], $GUI_UnCHECKED) Next EndSwitch WEnd GUIDelete() Thanks for the demo but this is way to hard for me to implent this option. So guys thanks for the advice but i got to go with the manual feature all the scripting and testing is not worth for a few controls if it where 100+ ok but it's not. So i mak this one as solved.
Moderators Melba23 Posted November 14, 2013 Moderators Posted November 14, 2013 satanttin,Have you looked at my GUIExtender UDF as suggested earlier? It might be just what you are looking for. 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
satanttin Posted November 14, 2013 Author Posted November 14, 2013 satanttin, Have you looked at my GUIExtender UDF as suggested earlier? It might be just what you are looking for. M23 @Melba23 yes i did just didn't figured it out xD never worked with a udf anyways since i love to write my own scripts. (and because i just didn't get what it did exactly)
Moderators Melba23 Posted November 14, 2013 Moderators Posted November 14, 2013 satanttin, never worked with a udf anywaysThen you are missing out on what is probably the greatest advantage of the language and the forum - being able to harness the power of code from others into your own scripts without too much difficulty. But if that is your choice..... 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
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