Jump to content

GUI_Extender - New Version 16 Apr 2022


Melba23
 Share

Recommended Posts

  • Moderators

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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Moderators

dmob,

You asked for it, so you get to test it: GUIExtender_Mod.au3

; #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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Moderators

dmob,

Excellent news - thanks for testing.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Moderators

[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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • 6 months later...
  • Moderators

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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Melba23 changed the title to GUI_Extender - New Version 30 Mar 21

Tested on Windows11 - works well

(not related to @MWIProd question)

Edited 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 Codefor 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 APIErrorLog.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 TaskSchedulerIE 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 stuffOnHungApp handlerAvoid "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"
:naughty:  :ranting:, 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

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 by MWIProd
Link to comment
Share on other sites

  • Moderators

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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Moderators

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:

#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 by Melba23
Beta code removed

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • 2 months later...
  • Moderators

MWIProd,

Delighted to hear it - I will release a new version this weekend.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • 2 weeks later...
  • Moderators

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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Melba23 changed the title to GUI_Extender - New Version 16 Apr 2022
  • Moderators

[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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

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

  • 10 months later...

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

 

#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

  • Moderators

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:

#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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...