Moderators Melba23 Posted March 24, 2021 Author Moderators Share Posted March 24, 2021 dmob, Thanks for that. I will take a look when I can - we are having a lot of electrical work done in the house at the moment and I lose power for quite a lot of the day. 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...
Moderators Melba23 Posted March 27, 2021 Author Moderators Share Posted March 27, 2021 dmob, You asked for it, so you get to test it: GUIExtender_Mod.au3 expandcollapse popup; #FUNCTION# ========================================================================================================= ; Name...........: _GUIExtender_Section_Activate ; Description ...: Creates buttons for extension/retraction of GUI sections ; Syntax.........: _GUIExtender_Section_Activate($hWnd, $iSection[, $sExtended = ""[, $sRetracted = ""[, $iX = 0[, $iY = 0[, $iW = 0[, $iH = 0[, $iType = 0[, $iEventMode = 0]]]]]]]]]) ; Parameters ....: $hWnd - Handle of GUI containing the section ; $iSection - Section to action ; 0 = all extendable sections ; $sExtended - Action control content when extended ; Mode 0/1 = Text of button - default: small up/left arrow ; Mode 2 = Path to icon, DLL or executable - main icon displayed ; If another icon from the file is required, add a trailing "|" followed by the icon index ; Mode 3 = Path to image file ; $sRetracted - Action control content when retracted ; Mode 0/1 = Text of button - default: small down/right arrow ; Mode 2 = Path to icon, DLL or executable - main icon displayed ; If another icon from the file is required, add a trailing "|" followed by the icon index ; Mode 3 = Path to image file ; $iX - Left side of the control ; $iY - Top of the control ; $iW - Width of the control ; $iH - Height of the control ; $iType - Type of control: ; 0 = normal button (default) ; 1 = pushbutton ; 2 = icon ; 3 = image - set to 4 programatically if image is png ; $iEventMode - 0 = (default) MessageLoop mode ; 1 = OnEvent mode - control automatically linked to __GUIExtender_Section_Event function ; Requirement(s).: v3.3 + ; Return values .: Success: Returns 1 ; Failure: Returns 0 and sets @error as follows: ; 1 = GUI not initialised ; 2 = Control not created ; Author ........: Melba23 ; Remarks .......: Sections are static unless an action control has been set ; Omitting all optional parameters creates a section which can only be actioned programmatically ; Example........: Yes Images can be bmp, jpg, gif, or png as requested. Plus you can select any of the available icons in exe/DLL files. Let me know what you think. 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...
dmob Posted March 30, 2021 Share Posted March 30, 2021 @Melba Works perfectly, thank you. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 30, 2021 Author Moderators Share Posted March 30, 2021 dmob, Excellent news - thanks for testing. 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...
Moderators Melba23 Posted March 30, 2021 Author Moderators Share Posted March 30, 2021 [New Version] - 30 Mar 21 Added: - _GUIExtender_EventMonitor now returns 0 if nothing has occurred and 1 if a section has been actioned. @extended is set to the index number of the actioned section or 0 for all sections. This could be useful if you want to have only one section extended at one time - as soon as one is opened you can programmatically retract all the others. - The action control for a section can now be a normal button, a push button, an icon, or an image. Icons and images are passed as full paths. Normally the main icon of an exe/DLL file is shown, but this can be changed by adding the icon index number separated from the path by "|". See the _GUIExtender_Section_Activate header for more details. New UDF plus examples in the zip in the first post. M23 dmob 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...
MWIProd Posted October 27, 2021 Share Posted October 27, 2021 Hi Melba23, GUISetOnEvent($GUI_EVENT_RESTORE) doesn't work with your UDF. Nothing happen when I restore the window. Which syntax must I use to have this functionnality back ? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted October 27, 2021 Author Moderators Share Posted October 27, 2021 MWIProd, If you are using OnEvent mode, the Restore event function should be called automatically by the UDF. Could you please post a short reproducer script so I can debug. -see here how to do it 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...
mLipok Posted October 27, 2021 Share Posted October 27, 2021 (edited) Tested on Windows11 - works well (not related to @MWIProd question) Edited October 27, 2021 by mLipok Signature beginning:* Please remember: "AutoIt"..... * Wondering who uses AutoIt and what it can be used for ? * Forum Rules ** ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Code * for other useful stuff click the following button: Spoiler Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API * ErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 * My contribution to others projects or UDF based on others projects: * _sql.au3 UDF * POP3.au3 UDF * RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF * SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane * Useful links: * Forum Rules * Forum etiquette * Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * Wiki: * Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX IE Related: * How to use IE.au3 UDF with AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskScheduler * IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related: * How to get reference to PDF object embeded in IE * IE on Windows 11 * I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions * EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *I also encourage you to check awesome @trancexx code: * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuff * OnHungApp handler * Avoid "AutoIt Error" message box in unknown errors * HTML editor * winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/ "Homo sum; humani nil a me alienum puto" - Publius Terentius Afer"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming" , be and \\//_. Anticipating Errors : "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty." Signature last update: 2023-04-24 Link to comment Share on other sites More sharing options...
MWIProd Posted October 28, 2021 Share Posted October 28, 2021 (edited) Here it is : #include <GUIConstantsEx.au3> #include <GUIExtender.au3> Opt("GUIOnEventMode", 1) $hGUI = GUICreate("", 500, 300) GUISetOnEvent($GUI_EVENT_CLOSE, "Exit1") GUISetOnEvent($GUI_EVENT_RESTORE, "Restore") _GUIExtender_Init($hGUI, 1) _GUIExtender_Section_Create($hGUI, Default, 300) _GUIExtender_Section_Activate($hGUI, 2) GUICtrlCreateButton("Toggle", 20, 20) GUICtrlSetOnEvent(-1, "Toggle") Global $idButton = GUICtrlCreateButton("Hello", 20, 200) _GUIExtender_Section_Create($hGUI, Default, Default) _GUIExtender_Section_Create($hGUI, -99) _GUIExtender_Section_Action($hGUI, 2, False) ; hide section 2 GUISetState(@SW_SHOW) GUICtrlSetState($idButton, $GUI_HIDE) While 1 Sleep(10) WEnd Func Toggle() _GUIExtender_Section_Action($hGUI, 2, 9) EndFunc ;==>Toggle Func Restore() GUICtrlSetState($idButton, $GUI_SHOW) EndFunc ;==>Restore Func Exit1() Exit EndFunc ;==>Exit1 Every time I show/hide section 2, the button $idButton is no longer hidden. Edited October 28, 2021 by MWIProd Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted October 28, 2021 Author Moderators Share Posted October 28, 2021 MWIProd, The UDF was not designed to handle hidden controls, so every time the UDF needs to redraw the GUI it assumes that all controls in an expanded section are visible. Hence your hidden button reappears after a restore event and whenever you toggle section 2. No-one has ever found this a problem before, but I will take a look to see how easy it would be to determine the visible state of each control - and if it could be done without too many changes to the UDF code, how much it would cost in execution time. 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...
MWIProd Posted October 29, 2021 Share Posted October 29, 2021 Melba23, Thank you for your fast answers. I understand why you didn't add this functionnality. If you do, I'll be very happy. 🙂 Have a good day. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted October 29, 2021 Author Moderators Share Posted October 29, 2021 (edited) MWIProd, A fun way to pass a dull day! I think I have a solution for you - I have added a new function to the UDF allowing you to specify which controls should not be automatically reshown when it redraws the GUI. You no longer need to hide/show the control within the script - this function does that as well as telling the UDF whether or not to show it on redraw. Here is the modified UDF: And here is a script based on yours to show it working: expandcollapse popup#include <GUIConstantsEx.au3> #include "GUIExtender_Mod.au3" Opt("GUIOnEventMode", 1) HotKeySet("^h", "_Hide") HotKeySet("^s", "_Show") $hGUI = GUICreate("", 500, 300) GUISetOnEvent($GUI_EVENT_CLOSE, "Exit1") ; No need for the RESTORE Event - handled internally by the UDF _GUIExtender_Init($hGUI, 1) _GUIExtender_Section_Create($hGUI, Default, 300) _GUIExtender_Section_Activate($hGUI, 2) GUICtrlCreateButton("Toggle", 20, 20) GUICtrlSetOnEvent(-1, "Toggle") Global $idButton = GUICtrlCreateButton("Hello", 20, 200) _GUIExtender_Section_Create($hGUI, Default, Default) _GUIExtender_Section_Create($hGUI, -99) _GUIExtender_Section_Action($hGUI, 2, False) ; hide section 2 GUISetState(@SW_SHOW) ; Hide control _GUIExtender_Hidden_Control($hGUI, $idButton) While 1 Sleep(10) WEnd Func Toggle() _GUIExtender_Section_Action($hGUI, 2, 9) EndFunc ;==>Toggle Func _Show() ; Show control _GUIExtender_Hidden_Control($hGUI, $idButton, False) EndFunc Func _Hide() ; Hide control _GUIExtender_Hidden_Control($hGUI, $idButton) EndFunc Func Exit1() Exit EndFunc ;==>Exit1 Please play with it and see if you can break it. M23 Edited April 16, 2022 by Melba23 Beta code removed 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...
MWIProd Posted January 21, 2022 Share Posted January 21, 2022 (edited) Hello Melba23, Sorry for my late response. I didn't notice your so fast answer. 😯 This is a good day for me. The new version works like a charm. I am very grateful to you. 🙏 Edited January 21, 2022 by MWIProd Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 21, 2022 Author Moderators Share Posted January 21, 2022 MWIProd, Delighted to hear it - I will release a new version this weekend. 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...
Moderators Melba23 Posted January 30, 2022 Author Moderators Share Posted January 30, 2022 Hi, I would be grateful for some Beta testing on this new version of the UDF as the requester of the latest changes is not responding in his thread: There are 2 example scripts for you to play with: - GUIExtender_Test_Example: This demonstrates the new "keep controls hidden" functionality developed over the posts above. - GUIExtender_Ex_Test_Example: This demonstrates the fusion of extendable sections and scrollbars using my GUIExtender and GUIScrollbars_Size UDFs. I would be grateful for comments and any eventual bug reports before releasing a new version - here is a zip with all necessary files: GUIExtender_Ex_Beta.zip 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...
Moderators Melba23 Posted April 16, 2022 Author Moderators Share Posted April 16, 2022 [New Version] - 16 Apr 2022 Added: A new function _GUIExtender_Hidden_Control which allows you to specify which controls should not be automatically reshown when it redraws the GUI. You no longer need to hide/show the control within the script - this function does that as well as telling the UDF whether or not to show it on redraw. New UDF and an additional example in the first post. M23 Draygoes, mLipok and MWIProd 3 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...
Draygoes Posted April 16, 2022 Share Posted April 16, 2022 Nice! Thanks for the update @Melba23:) Spoiler "If a vegetarian eats vegetables,What the heck does a humanitarian eat?" "I hear voices in my head, but I ignore them and continue on killing." "You have forced me to raise the indifference warning to beige, it's a beige alert people. As with all beige alerts please prepare to think about the possibility of caring." An optimist says that giving someone power DOESN'T immediately turn them into a sadist. A pessimist says that giving someone power doesn't IMMEDIATELY turn them into a sadist. Link to comment Share on other sites More sharing options...
lesmly Posted March 5, 2023 Share Posted March 5, 2023 I encountered such a problem, I do not know if it is a bug or lack of my skills. When I try to add a context menu and use the window shrink button I get an error Subscript used on non-accessible variable.: ControlMove($aActive_Section_Data[0][3], "", $iCID, $aPos1[0] - $iAdjust_X, $aPos1[1] - $iAdjust_Y) ControlMove($aActive_Section_Data[0][3], "", $iCID, $aPos1^ ERROR Can you check what is causing this? I am basing this on your example 5 expandcollapse popup#include <GUIConstantsEx.au3> #include <GUIConstants.au3> #include "GUIExtender.au3" $hGUI = GUICreate("Test", 400, 300) _GUIExtender_Init($hGUI, 1) _GUIExtender_Section_Create($hGUI, 0, 100) _GUIExtender_Section_Activate($hGUI, 1) GUICtrlCreateLabel("", 0, 0, 100, 300) GUICtrlSetBkColor(-1, 0xFFCCCC) _GUIExtender_Section_Create($hGUI, 100, 200) $cButton_1 = GUICtrlCreateButton(">>", 110, 10, 20, 30) $cButton_2 = GUICtrlCreateButton("<<", 260, 10, 20, 30) ; $listlistylst = GUICtrlCreateListView("My List", 150, 20, 70, 162) $hCMenuLST = GUICtrlCreateContextMenu($listlistylst) $hCMenuzaznacz = GUICtrlCreateMenu("Check", $hCMenuLST) $hCmenu2p = GUICtrlCreateMenuItem("2 floor", $hCMenuzaznacz) $hCmenu3p = GUICtrlCreateMenuItem("3 floor", $hCMenuzaznacz) ; _GUIExtender_Section_Create($hGUI, 300, 100) _GUIExtender_Section_Activate($hGUI, 3) GUICtrlCreateLabel("", 300, 0, 100, 300) GUICtrlSetBkColor(-1, 0xCCCCFF) _GUIExtender_Section_Create($hGUI, -99) GUISetState() While 1 $aMsg = GUIGetMsg(1) Switch $aMsg[0] Case $GUI_EVENT_CLOSE Exit Case $cButton_1 Switch _GUIExtender_Section_State($hGUI, 1) Case 0 ; Extend to the left - override default _GUIExtender_Section_Action($hGUI, 1, 1, 2) GUICtrlSetData($cButton_1, ">>") Case 1 ; Retract from the left - override default _GUIExtender_Section_Action($hGUI, 1, 0, 2) GUICtrlSetData($cButton_1, "<<") EndSwitch Case $cButton_2 Switch _GUIExtender_Section_State($hGUI, 3) Case 0 ; Extend to the right (default) _GUIExtender_Section_Action($hGUI, 3) GUICtrlSetData($cButton_2, "<<") Case 1 ; Retract from the right (default _GUIExtender_Section_Action($hGUI, 3, 0) GUICtrlSetData($cButton_2, ">>") EndSwitch EndSwitch _GUIExtender_EventMonitor($aMsg[1], $aMsg[0]) WEnd Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 6, 2023 Author Moderators Share Posted March 6, 2023 lesmly, Nice catch! The Context menu is being created within the GUIExtender structure, but of course cannot be hidden/restored like a normal control. The solution is to create the menu outside of the GUIExtender structure like this: expandcollapse popup#include <GUIConstantsEx.au3> #include <GUIConstants.au3> #include "GUIExtender.au3" $hGUI = GUICreate("Test", 400, 300) _GUIExtender_Init($hGUI, 1) _GUIExtender_Section_Create($hGUI, 0, 100) _GUIExtender_Section_Activate($hGUI, 1) GUICtrlCreateLabel("", 0, 0, 100, 300) GUICtrlSetBkColor(-1, 0xFFCCCC) _GUIExtender_Section_Create($hGUI, 100, 200) $cButton_1 = GUICtrlCreateButton(">>", 110, 10, 20, 30) $cButton_2 = GUICtrlCreateButton("<<", 260, 10, 20, 30) ; $listlistylst = GUICtrlCreateListView("My List", 150, 20, 70, 162) ; _GUIExtender_Section_Create($hGUI, 300, 100) _GUIExtender_Section_Activate($hGUI, 3) GUICtrlCreateLabel("", 300, 0, 100, 300) GUICtrlSetBkColor(-1, 0xCCCCFF) _GUIExtender_Section_Create($hGUI, -99) $hCMenuLST = GUICtrlCreateContextMenu($listlistylst) $hCMenuzaznacz = GUICtrlCreateMenu("Check", $hCMenuLST) $hCmenu2p = GUICtrlCreateMenuItem("2 floor", $hCMenuzaznacz) $hCmenu3p = GUICtrlCreateMenuItem("3 floor", $hCMenuzaznacz) GUISetState() While 1 $aMsg = GUIGetMsg(1) Switch $aMsg[0] Case $GUI_EVENT_CLOSE Exit Case $cButton_1 Switch _GUIExtender_Section_State($hGUI, 1) Case 0 ; Extend to the left - override default _GUIExtender_Section_Action($hGUI, 1, 1, 2) GUICtrlSetData($cButton_1, ">>") Case 1 ; Retract from the left - override default _GUIExtender_Section_Action($hGUI, 1, 0, 2) GUICtrlSetData($cButton_1, "<<") EndSwitch Case $cButton_2 Switch _GUIExtender_Section_State($hGUI, 3) Case 0 ; Extend to the right (default) _GUIExtender_Section_Action($hGUI, 3) GUICtrlSetData($cButton_2, "<<") Case 1 ; Retract from the right (default _GUIExtender_Section_Action($hGUI, 3, 0) GUICtrlSetData($cButton_2, ">>") EndSwitch EndSwitch _GUIExtender_EventMonitor($aMsg[1], $aMsg[0]) WEnd Let me know if that does not work for you - it certainly does for me! M23 lesmly 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...
lesmly Posted March 6, 2023 Share Posted March 6, 2023 works great now! Thanks! 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