Jtssi Posted December 17, 2021 Share Posted December 17, 2021 Hello, is it possible to do like the picture? A section that opens and closes, with a scrollbar on the right? Thanks Link to comment Share on other sites More sharing options...
ad777 Posted December 18, 2021 Share Posted December 18, 2021 it's possible:see below for ex: this example when you scroll button is clicked: expandcollapse popup#include <GUIConstantsEx.au3> #include <GuiScrollBars.au3> #include <StructureConstants.au3> #include <WindowsConstants.au3> Example() Func Example() Local $idFileMenu, $idExititem, $hGUIMsg, $hGUI, $h_GUIC, $h_GUIC2 Local $idListview, $idButton $hGUI = GUICreate("ScrollBar Example", 400, 400, -1, -1, BitOR($WS_MINIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU, $WS_SIZEBOX)) GUISetBkColor(0x88AABB) $idFileMenu = GUICtrlCreateMenu("File") $idExititem = GUICtrlCreateMenuItem("Exit", $idFileMenu) $idListview = GUICtrlCreateListView("col1 |col2|col3 ", 10, 10, 200, 150) ; ,$LVS_SORTDESCENDING) $idButton = GUICtrlCreateButton("Value?", 75, 170, 70, 20) GUICtrlSetResizing($idButton, $GUI_DOCKALL) For $x = 1 To 30 GUICtrlCreateListViewItem("item" & $x & "|col2|col3", $idListview) Next GUICtrlSetResizing($idListview, $GUI_DOCKALL) $h_GUIC = GUICreate("Child GUI", 200, 200, 10, 200, $WS_CHILD, $WS_EX_CLIENTEDGE, $hGUI) Global $button = GUICtrlCreateButton("a button", 10, 10, 90, 20) GUISetBkColor(0X006400) GUISetState(@SW_SHOW) GUICtrlSetResizing($h_GUIC, $GUI_DOCKALL) GUISwitch($hGUI) GUIRegisterMsg($WM_VSCROLL, "WM_VSCROLL") GUISetState(@SW_SHOW) _GUIScrollBars_Init($hGUI) _GUIScrollBars_Init($h_GUIC) While 1 $hGUIMsg = GUIGetMsg() Switch $hGUIMsg Case $GUI_EVENT_CLOSE, $idExititem ExitLoop Case $button MsgBox(0,"a button","Clicked from HSCROLL") EndSwitch WEnd Exit EndFunc ;==>Example Func WM_VSCROLL($hWnd, $iMsg, $wParam, $lParam) #forceref $iMsg, $wParam, $lParam Local $iScrollCode = BitAND($wParam, 0x0000FFFF) Local $iIndex = -1, $iCharY, $iPosY Local $iMin, $iMax, $iPage, $iPos, $iTrackPos For $x = 0 To UBound($__g_aSB_WindowInfo) - 1 If $__g_aSB_WindowInfo[$x][0] = $hWnd Then $iIndex = $x $iCharY = $__g_aSB_WindowInfo[$iIndex][3] ExitLoop EndIf Next If $iIndex = -1 Then Return 0 ; Get all the vertial scroll bar information Local $tSCROLLINFO = _GUIScrollBars_GetScrollInfoEx($hWnd, $SB_VERT) $iMin = DllStructGetData($tSCROLLINFO, "nMin") $iMax = DllStructGetData($tSCROLLINFO, "nMax") $iPage = DllStructGetData($tSCROLLINFO, "nPage") ; Save the position for comparison later on $iPosY = DllStructGetData($tSCROLLINFO, "nPos") $iPos = $iPosY $iTrackPos = DllStructGetData($tSCROLLINFO, "nTrackPos") Switch $iScrollCode Case $SB_TOP ; user clicked the HOME keyboard key DllStructSetData($tSCROLLINFO, "nPos", $iMin) Case $SB_BOTTOM ; user clicked the END keyboard key DllStructSetData($tSCROLLINFO, "nPos", $iMax) Case $SB_LINEUP ; user clicked the top arrow DllStructSetData($tSCROLLINFO, "nPos", $iPos - 1) Case $SB_LINEDOWN ; user clicked the bottom arrow DllStructSetData($tSCROLLINFO, "nPos", $iPos + 1) Case $SB_PAGEUP ; user clicked the scroll bar shaft above the scroll box DllStructSetData($tSCROLLINFO, "nPos", $iPos - $iPage) Case $SB_PAGEDOWN ; user clicked the scroll bar shaft below the scroll box DllStructSetData($tSCROLLINFO, "nPos", $iPos + $iPage) Case $SB_THUMBTRACK ; user dragged the scroll box DllStructSetData($tSCROLLINFO, "nPos", $iTrackPos) EndSwitch ; // Set the position and then retrieve it. Due to adjustments ; // by Windows it may not be the same as the value set. DllStructSetData($tSCROLLINFO, "fMask", $SIF_POS) _GUIScrollBars_SetScrollInfo($hWnd, $SB_VERT, $tSCROLLINFO) _GUIScrollBars_GetScrollInfo($hWnd, $SB_VERT, $tSCROLLINFO) ;// If the position has changed, scroll the window and update it $iPos = DllStructGetData($tSCROLLINFO, "nPos") If ($iPos <> $iPosY) Then ControlClick("ScrollBar Example","",$button);ScrollBar Example title of window _GUIScrollBars_ScrollWindow($hWnd, 0, $iCharY * ($iPosY - $iPos)) $iPosY = $iPos EndIf Return $GUI_RUNDEFMSG EndFunc ;==>WM_VSCROLL iam ِAutoit programmer. best thing in life is to use your Brain to Achieve everything you want. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 18, 2021 Moderators Share Posted December 18, 2021 Jtssi, You can use my GUIExtender UDF to get the extendable sections - and my GUIScrollbars UDF to get the scrollable area (look in my sig for the links). I have never tried to combine the two, but I will take a look and see what I can come up with this PM. 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 December 21, 2021 Moderators Share Posted December 21, 2021 Jtssi, Combining the 2 UDFs is proving very complicated - GUIExtender keeps wanting to change the size of the GUI, while GUIScrollbars_Ex tries to keep it the same size and only change the scrollable area within! I will keep plugging away at the problem over the Xmas holidays, but do not hold your breath for a working solution. 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 24, 2022 Moderators Share Posted January 24, 2022 Jtssi, That was a lot more trouble than I thought it might be - but my perseverance has paid off and i have a working example to show you. You will need all of the attached files to get it to run - please let me know if it does what you require. Comments from anyone else also welcome of course. M23 GUIExtender_Ex_Test.au3 GUIExtender_Ex_Test_Example.au3 GUIExtender_Test.au3 GUIScrollbars_Size.au3 DinFuv 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...
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