Jump to content

Infinite scroll


mutleey
 Share

Recommended Posts

Hello everyone, I've been trying to make a scroll with images for a few days but I haven't achieved anything, the maximum result I got was the script I left below, would it be possible to do it like in the Touch.Gif? I intend to use it with a touchscreen monitor so when I click with the mouse and drag and need the list of pics to scroll.

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

#include <Scrollbars\GUIScrollBars_Ex.au3>

Global $aButton[51]
Global $bButton[51]
Global $cButton[51]

; Create GUI
$hGUI_Main = GUICreate("", 792, 1080, -1, 0, $WS_POPUP, $WS_EX_TOPMOST)
GUISetBkColor(0xFFAAAA)

For $ii = 0 To 50
    $aButton[$ii] = GUICtrlCreatePic("mp3.jpg", 6, 10 + (262 * $ii), 250, 250)
    $bButton[$ii] = GUICtrlCreatePic("mp3.jpg", 262, 10 + (262 * $ii), 250, 250)
    $cButton[$ii] = GUICtrlCreatePic("mp3.jpg", 518, 10 + (262 * $ii), 250, 250)
Next

_GUIScrollBars_Generate($hGUI_Main, 0, 10 + (262 * $ii))

GUISetState(@SW_SHOW, $hGUI_Main)

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

 

mp3.jpg

Touch.gif

Link to comment
Share on other sites

I would use HTML. There are a bunch of HTTP daemons here to choose from.
In a browser, press F11 to go full screen, and again to go back to window mode. ( you can try it right now on this browser )

The code to do that via browser, is all over the net.

The AutoIt way.., you'll have to pre-load 3 full screen pages to fake an eternal scroll, loading the next canvas/ChildGui, to fake it ?. Too much.
I'd truly look at JS/CSS in HTML.

If a user clicks, you can have your own protocol ( search here in the forums on how to register a protocol ), say "mutleey://" and it'll do whatever you code it to do.

 

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

Link to comment
Share on other sites

@mutleey I just scripted what follows to use an imagelist control and it worked.
I placed 6 images (jpg) in the script directory, resized them 100x100 (didn't care about the ratio because I just wanted to get a quick result, would it work or not ?)

#include <GDIPlus.au3>
#include <GuiImageList.au3>
#include <GuiListView.au3>

GUICreate("ImageList Create", 400, 300)
$idListview = GUICtrlCreateListView("", 2, 2, 394, 296, -1, $LVS_EX_SUBITEMIMAGES)
For $i = 0 To 1 ; 2 columns
    _GUICtrlListView_AddColumn($idListview, "Col " & $i, 105)
Next
$hImageList = _GUIImageList_Create(100, 100) ; all images are 100x100

_GDIPlus_Startup()
For $i = 0 To 5 ; 6 images
    $hBitmap = _GDIPlus_BitmapCreateFromFile(@ScriptDir & "\image " & $i & ".jpg")
    $hGDIBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap)
    _GUIImageList_Add($hImageList, $hGDIBitmap)
    _WinAPI_DeleteObject($hGDIBitmap)
    _GDIPlus_BitmapDispose($hBitmap)
Next
_GDIPlus_Shutdown()

_GUICtrlListView_SetImageList($idListview, $hImageList, 1) ; 1 = Image list with small icons (0 or 2 won't display anything)

For $i = 0 To 2 ; 3 rows (2 images per row)
    _GUICtrlListView_AddItem($idListview, "", $i*2) ; 0/2/4 = image 0/2/4 in Col 0
    _GUICtrlListView_AddSubItem($idListview, $i, "", 1, $i*2 +1) ; $i = row, 1 = Col 1 (1st subitem), $i*2 +1 = image 1/3/5
Next

GUISetState(@SW_SHOW)
Do
Until GUIGetMsg() = -3 ; $GUI_EVENT_CLOSE = -3

_GUIImageList_Destroy($hImageList)
GUIDelete()

Image-List-Create.jpg

The list is naturally scrollable, maybe it could be a good start for what you want to achieve.
Good luck and a great day to all of you :bye:
Link to comment
Share on other sites

Thanks for the personal response.

@argumentum What I need has to be in the same autoit gui, and my knowledge in JS/CSS in HTML is very bad.

@pixelsearch Maybe my purpose wasn't very clear, the script I posted at the beginning of the topic works reasonably, the only problem is that scrolling is only in the sidebar or in the mouse scroll, what I would need to do is scroll the images with a "touch" I click anywhere in the gui and with the click activated I move the mouse up and down to scroll the image.

The last gif image at the beginning of the topic shows what I need.

Link to comment
Share on other sites

Something along this :

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <SendMessage.au3>
#include <Misc.au3>

#include <GUIScrollBars_Ex.au3>

Global $aButton[51]
Global $bButton[51]
Global $cButton[51]

; Create GUI
$hGUI_Main = GUICreate("", 792, 1080, -1, 0, $WS_POPUP, $WS_EX_TOPMOST)
GUISetBkColor(0xFFAAAA)

For $i = 0 To 50
  $aButton[$i] = GUICtrlCreatePic("mp3.jpg", 6, 10 + (262 * $i), 250, 250)
  $bButton[$i] = GUICtrlCreatePic("mp3.jpg", 262, 10 + (262 * $i), 250, 250)
  $cButton[$i] = GUICtrlCreatePic("mp3.jpg", 518, 10 + (262 * $i), 250, 250)
Next

_GUIScrollBars_Generate($hGUI_Main, 0, 10 + (262 * $i))

GUISetState(@SW_SHOW, $hGUI_Main)

Local $iPos, $iY
While 1
  Switch GUIGetMsg()
    Case $GUI_EVENT_CLOSE
      Exit
    Case $GUI_EVENT_PRIMARYDOWN
      $iPos = MouseGetPos(1)
      $iY = $iPos
      While _IsPressed("01")
        If $iPos = MouseGetPos(1) Then ContinueLoop
        $iPos = MouseGetPos(1)
        If $iPos < $iY Then
          For $i = 1 To Int(($iY - $iPos) / 15)
            _SendMessage($hGUI_Main, $WM_VSCROLL, $SB_LINEDOWN)
          Next
        Else
          For $i = 1 To Int(($iPos - $iY) / 15)
            _SendMessage($hGUI_Main, $WM_VSCROLL, $SB_LINEUP)
          Next
        EndIf
        If $i > 1 Then $iY = $iPos
      WEnd
  EndSwitch
WEnd

 

Edited by Nine
change approach to reduce flickering
Link to comment
Share on other sites

This is more a proof of concept and probably can be done more nicely but it gives you the infinite scrolling effect.

Global $aCtrl[30], $hMain, $nMax

Global $hMain = GUICreate('Sample', 380, 600)
$nMax = CreateUI($aCtrl)
GUISetState()

While True
    Switch GUIGetMsg()
        Case -3 ; GUI_EVENT_CLOSE
            Exit
        Case -7 ; GUI_PRIMARY_DOWN
            ScrollControls($aCtrl)
    EndSwitch
WEnd

Func CreateUI(ByRef $aCtrl)
    Local $nIndex = 0, $nMaxH = 0
    For $j = 0 To 9
        For $i = 0 To 2
            $aCtrl[$nIndex] = GUICtrlCreateLabel('Picture' & $nIndex + 1, $i * 120 + 20, $j * 120 + 20, 100, 100, 0x1201)
            If $j * 120 + 20 + 100 + 20 > $nMaxH Then $nMaxH = $j * 120 + 20 + 100 + 20
            $nIndex += 1
        Next
    Next
    Return $nMaxH - 600
EndFunc

Func ScrollControls($aCtrl)
    Local $iMouseDelta, $iDeltaY, $nIndex
    Local Static $WinDelta = 0
    Local $yPos = MouseGetPos(1)
    Do
        $iMouseDelta = MouseGetPos(1) - $yPos
        $iDeltaY = $iMouseDelta - $WinDelta
        $nIndex = 0
        For $j = 0 To 9
            For $i = 0 To 2
                ; Remove or comment next two lines if you want infinite scrolling
                If $iDeltaY < 0 Then $iDeltaY = 0
                If $iDeltaY > $nMax Then $iDeltaY = $nMax
                GUICtrlSetPos($aCtrl[$nIndex], $i * 120 + 20, $j * 120 + 20 - $iDeltaY, 100, 100)
                $nIndex += 1
            Next
        Next
        Sleep(10)
    Until GUIGetMsg() = -8  ; GUI_PRIMARY_UP
    $WinDelta = -$iDeltaY
EndFunc

 

Edited by Andreik
Link to comment
Share on other sites

@mutleey got it now :)
I inserted in my reworked script Nine's way to scroll, with minor changes (scrolling messages sent to listview and not to GUI). I also added a dummy listview Col 0 (width 0) to never see any item selected while clicking and dragging the mouse etc... It's great to have different ways to do this, using GUICtrlCreatePic or _GUIImageList_Create
Here is version 2 :
#include <GUIConstantsEx.au3>
#include <GDIPlus.au3>
#include <GuiImageList.au3>
#include <GuiListView.au3>
#include <Misc.au3>
#include <ScrollBarsConstants.au3>
#include <WindowsConstants.au3>

GUICreate("ImageList Create v2", 840, 600)
$idListview = GUICtrlCreateListView("", 0, 0, 840, 600, BitOr($LVS_SINGLESEL, $LVS_NOCOLUMNHEADER), $LVS_EX_SUBITEMIMAGES)
$hListview = GUICtrlGetHandle($idListview)

_GUICtrlListView_AddColumn($idListview, "", 0) ; dummy Col 0 (item column) : purpose is to never show any LV item selected.
For $i = 1 To 4 ; 4 subitems columns
    _GUICtrlListView_AddColumn($idListview, "", 205)
Next

$hImageList = _GUIImageList_Create(200, 200) ; all images are 200 x 200

_GDIPlus_Startup()
For $i = 0 To 299 ; 300 images
    $hBitmap = _GDIPlus_BitmapCreateFromFile(@ScriptDir & "\image " & Mod($i, 12) & ".jpg")
    $hGDIBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap)
    _GUIImageList_Add($hImageList, $hGDIBitmap)
    _WinAPI_DeleteObject($hGDIBitmap)
    _GDIPlus_BitmapDispose($hBitmap)
Next
_GDIPlus_Shutdown()

_GUICtrlListView_SetImageList($idListview, $hImageList, 1) ; 1 = Image list with small icons (0 or 2 won't display anything)

For $i = 0 To 74 ; 75 rows (4 images per row => 300 images)
    _GUICtrlListView_AddItem($idListview, "") ; dummy Col 0 (item column)
    For $j = 1 To 4 ; 4 subitems columns
        _GUICtrlListView_AddSubItem($idListview, $i, "", $j, $i*4 + ($j-1))
    Next
Next

GUISetState(@SW_SHOW)
Local $iPos, $iY

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            ExitLoop

        Case $GUI_EVENT_PRIMARYDOWN
            $iPos = MouseGetPos(1)
            $iY = $iPos
            While _IsPressed("01")
                If $iPos = MouseGetPos(1) Then ContinueLoop
                $iPos = MouseGetPos(1)
                If $iPos < $iY Then
                    For $i = 1 To Int(($iY - $iPos) / 15)
                        _SendMessage($hListview, $WM_VSCROLL, $SB_LINEDOWN)
                    Next
                Else
                    For $i = 1 To Int(($iPos - $iY) / 15)
                        _SendMessage($hListview, $WM_VSCROLL, $SB_LINEUP)
                    Next
                EndIf
                If $i > 1 Then $iY = $iPos
            WEnd
    EndSwitch
WEnd

_GUIImageList_Destroy($hImageList)
GUIDelete()

Image-List-Create-v2.jpg

I wonder if you guys have an answer to this : do we always need GDI+ to load jpg images from disk and get their $hBitmap ? Can't it be done with a GDI function instead ?
Link to comment
Share on other sites

I thank colleagues @argumentum @pixelsearch @Nine and @Andreik  for their help, I already have a base to work with, thank you very much;

 

4 hours ago, pixelsearch said:

I wonder if you guys have an answer to this : do we always need GDI+ to load jpg images from disk and get their $hBitmap ? Can't it be done with a GDI function instead ?

@pixelsearch At first I won't use GDI+, but as the script evolves I can implement it.

Link to comment
Share on other sites

Hello everyone, I'm having some problems with the script, my idea would be to scroll the screen as in the gif at the beginning of the topic (this was solved with the help of colleagues) and when clicking on an image open another gui with the information according to the selected image , however as it would be many images I decided to use "GUIOnEventMode" to create the "buttons", however the scroll stops working and if I scroll the screen and already touch on top of any image the second gui already opens, any tip would help a lot.

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <SendMessage.au3>
#include <Misc.au3>
#include <File.au3>

#include <Scrollbars\GUIScrollBars_Ex.au3>

Opt("GUIOnEventMode", 1)

; Create GUI
$hGUI_Main = GUICreate("", 1080, 1080, -1, 0, $WS_POPUP, $WS_EX_TOOLWINDOW)
GUISetBkColor(0xFFAAAA)

GUISetOnEvent($GUI_EVENT_CLOSE, ___Exit)

Local $aPic = _FileListToArrayRec(@ScriptDir & "\pics", "*.jpg", $FLTAR_FILES, $FLTAR_NORECUR, $FLTAR_NOSORT, $FLTAR_NOPATH)
If @error Then
    MsgBox($MB_SYSTEMMODAL, "Ooops!", "No pics files found")
    Exit
EndIf
;~ _ArrayDisplay($aPic, $aPic[0])

Local $spic[$aPic[0]]
Local $picN = 0
Local $posH = 30
Local $posV = 350

For $ii = 1 To $aPic[0] - 1
    $spic[$ii] = GUICtrlCreatePic(@ScriptDir & "\pics\" & $aPic[$ii], $posH, $posV, 320, 450)
    GUICtrlSetOnEvent(-1, "selPIC")

    Switch $picN
        Case 0, 1
            $picN += 1
            $posH += 350
        Case Else
            $picN = 0
            $posH = 30
            $posV += 490
    EndSwitch
Next

_GUIScrollBars_Generate($hGUI_Main, 0, 10 + (164 * $ii))

GUISetState(@SW_SHOW)

Local $iPos, $iY
While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_PRIMARYDOWN
            $iPos = MouseGetPos(1)
            $iY = $iPos
            While _IsPressed("01")
                If $iPos = MouseGetPos(1) Then ContinueLoop
                $iPos = MouseGetPos(1)
                If $iPos < $iY Then
                    For $ii = 1 To Int(($iY - $iPos) / 15)
                        _SendMessage($hGUI_Main, $WM_VSCROLL, $SB_LINEDOWN)
                    Next
                Else
                    For $ii = 1 To Int(($iPos - $iY) / 15)
                        _SendMessage($hGUI_Main, $WM_VSCROLL, $SB_LINEUP)
                    Next
                EndIf
                If $ii > 1 Then $iY = $iPos
            WEnd
    EndSwitch
WEnd


Func selPIC()
;~  ConsoleWrite(@GUI_CtrlId & @CRLF)

;~  GUISetState(@SW_DISABLE, $hGUI_Main)

    $hGUI_SEL = GUICreate("", 600, 600, -1, -1, $WS_POPUP, $WS_EX_TOOLWINDOW)

    GUISetState(@SW_SHOW)

    While 1
        Sleep(175)
    WEnd
EndFunc


Func ___Exit()
    Exit
EndFunc

 

pics.zip

Edited by mutleey
Link to comment
Share on other sites

@mutleey If it was me, I would use the left click only for the infinite scroll. Because if you use the left click for both scrolling and selecting a pic, then things could mix up and harder to script.

If you want infos on a pic, you could right click on the pic, get its id (via a registered WM_COMMAND) then display its infos, without the need of GUIOnEventMode. Based on Nine's script, here is how I would get the right-clicked pic id via WM_COMMAND . The pic id is displayed in Scite Console, from 3 to 155 in this example, e.g. 153 pics, with 3 being the smallest control id in a GUI. Here, as the 1st control created is GUICtrlCreatePic, then 3 is corresponds to the 1st pic, but it won't always be like that, in case you created other controls before the 1st GUICtrlCreatePic.
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <SendMessage.au3>
#include <Misc.au3>
#include <GUIScrollBars_Ex.au3> ; Melba23's

Global $aButton[51], $bButton[51], $cButton[51], $g_idPicSelected = 0

; Create GUI
$hGUI_Main = GUICreate("", 792, 1080, -1, 0, $WS_POPUP, $WS_EX_TOPMOST)
GUISetBkColor(0xFFAAAA)

For $i = 0 To 50
    $aButton[$i] = GUICtrlCreatePic("mp3.jpg", 6, 10 + (262 * $i), 250, 250)
    $bButton[$i] = GUICtrlCreatePic("mp3.jpg", 262, 10 + (262 * $i), 250, 250)
    $cButton[$i] = GUICtrlCreatePic("mp3.jpg", 518, 10 + (262 * $i), 250, 250)
Next

_GUIScrollBars_Generate($hGUI_Main, 0, 10 + (262 * $i))

GUIRegisterMsg($WM_COMMAND, "WM_COMMAND")
GUISetState(@SW_SHOW, $hGUI_Main)

Local $iPos, $iY
While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit

        Case $GUI_EVENT_PRIMARYDOWN ; left click
            $iPos = MouseGetPos(1)
            $iY = $iPos
            While _IsPressed("01")
                If $iPos = MouseGetPos(1) Then ContinueLoop
                $iPos = MouseGetPos(1)
                If $iPos < $iY Then
                    For $i = 1 To Int(($iY - $iPos) / 15)
                        _SendMessage($hGUI_Main, $WM_VSCROLL, $SB_LINEDOWN)
                    Next
                Else
                    For $i = 1 To Int(($iPos - $iY) / 15)
                        _SendMessage($hGUI_Main, $WM_VSCROLL, $SB_LINEUP)
                    Next
                EndIf
                If $i > 1 Then $iY = $iPos
            WEnd

        Case $GUI_EVENT_SECONDARYDOWN ; right click
            MouseClick("") ; computer performs a left click to trigger WM_COMMAND and get the id of the right-clicked pic.
            ConsoleWrite($g_idPicSelected & @crlf)
    EndSwitch
WEnd

Func WM_COMMAND($hWnd, $iMsg, $wParam, $lParam)
    $g_idPicSelected = BitAND($wParam, 0xFFFF) ; Low Word (control id)
    Return $GUI_RUNDEFMSG
EndFunc   ;==>WM_COMMAND

Now as you intend to display the infos in a new GUI, then you probably need to use the advanced GUIGetMsg() with a parameter = 1 , to know exactly which GUI is concerned when you click inside it, close it etc... or you could disable the main GUI while the infos appear in the secondary GUI, there are plenty of options.
Good luck :)
Link to comment
Share on other sites

@pixelsearch After your answer, a light came to me, I'm going to use the script from @Nine and when clicking on the monitor guide, you can hear a change in the mouse position (scrolling) if there is only scrolling the page, if the mouse position remains the same as at the beginning of the click releasing the left mouse button triggers the click. I'll work on it...thanks for now.

Link to comment
Share on other sites

Hello friends, I have a doubt here in the script which is as follows... when clicking on any image the $hGUI_Info gui is created but sometimes when clicking on the close.jpg image to close this gui and return to the scrolling gui the gui $hGUI_Info is called again, any tips from friends so this doesn't happen?
Many times when closing the $hGUI_Info gui in the scrolling gui the first click does not work, only the second does it open again.

#include <GUIConstantsEx.au3>
;~ #include <WindowsConstants.au3>
#include <SendMessage.au3>
#include <Misc.au3>
#include <File.au3>
#include "includes\GUIScrollBars_Ex.au3" ; Melba23's
;~ #include <GuiScrollBars.au3>

Global Const $mouseYcoord = 1
Global $g_idPicSelected = 0

; =============================================================================
; GUI Principal ===============================================================
$hGUI_Main = GUICreate("", 1080, 1080, -1, 0, $WS_POPUP, $WS_EX_TOPMOST)
GUISetBkColor(0xFFAAFF)

$hGUI_Pics = GUICreate("", 1080, 1040, -1, 20, $WS_POPUP, $WS_EX_TOOLWINDOW, $hGUI_Main)
GUISetBkColor(0xFFAAAA)

Local $aPic = _FileListToArrayRec(@ScriptDir & "\pics", "*.jpg", $FLTAR_FILES, $FLTAR_NORECUR, $FLTAR_NOSORT, $FLTAR_NOPATH)
If @error Then
    MsgBox($MB_SYSTEMMODAL, "Error!", "No pics files found")
    Exit
EndIf
;~ _ArrayDisplay($aPic, $aPic[0])

Local $picCover[$aPic[0]]
Local $picN = 0
Local $posH = 30
Local $posV = 10

For $ii = 1 To $aPic[0] - 1
    $picCover[$ii] = GUICtrlCreatePic(@ScriptDir & "\pics\" & $aPic[$ii], $posH, $posV, 320, 450)
    GUICtrlSetCursor(-1, 0)
;~  ConsoleWrite(($aPic[0] - 1) & "/" & $ii  & @CRLF)

    Switch $picN
        Case 0, 1
            $picN += 1
            $posH += 350
        Case Else
            $picN = 0
            $posH = 30
            $posV += 490
    EndSwitch
Next

_GUIScrollBars_Generate($hGUI_Pics, 0, 10 + (164 * $ii))

GUIRegisterMsg($WM_COMMAND, "WM_COMMAND")

GUISetState(@SW_SHOW, $hGUI_Main)
GUISetState(@SW_SHOW, $hGUI_Pics)

Local $iPos, $iY
While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit

        Case $GUI_EVENT_PRIMARYDOWN ; left click
            $iPos = MouseGetPos($mouseYcoord)

            $coordClick = $iPos
            ConsoleWrite("coordClick:" & $coordClick & " / ")

            $iY = $iPos
            While _IsPressed("01")
                If $iPos = MouseGetPos(1) Then ContinueLoop
                $iPos = MouseGetPos(1)
                If $iPos < $iY Then
                    For $ii = 1 To Int(($iY - $iPos) / 15)
                        _SendMessage($hGUI_Pics, $WM_VSCROLL, $SB_LINEDOWN)
                    Next
                Else
                    For $ii = 1 To Int(($iPos - $iY) / 15)
                        _SendMessage($hGUI_Pics, $WM_VSCROLL, $SB_LINEUP)
                    Next
                EndIf
                If $ii > 1 Then $iY = $iPos
            WEnd

            ConsoleWrite("MouseGetPos:" & MouseGetPos($mouseYcoord) & @CRLF)

            If $GUI_EVENT_PRIMARYUP And MouseGetPos($mouseYcoord) == $coordClick Then
                ConsoleWrite("@GUI_CtrlId(" & $g_idPicSelected & ")" & @CRLF)
                Switch $g_idPicSelected
                    Case 3 To ($aPic[0] - 1)
                        selPic()
                EndSwitch
            EndIf
    EndSwitch
WEnd

Func selPic()
    $hGUI_Info = GUICreate("", 900, 900, -1, 80, $WS_POPUP, BitOR($WS_EX_TOOLWINDOW, $WS_EX_TOPMOST))

    Local $btnClose = GUICtrlCreatePic(@ScriptDir & "\close.jpg", 40, 22, 108, 108)
    GUICtrlSetCursor(-1, 0)

    GUISetState(@SW_SHOW)

    While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE
                Exit
            Case $btnClose
                GUIDelete($hGUI_Info)
                ExitLoop
        EndSwitch

        Sleep(25)
    WEnd
EndFunc


Func WM_COMMAND($hWnd, $iMsg, $wParam, $lParam)
    $g_idPicSelected = BitAND($wParam, 0xFFFF) ; Low Word (control id)
    Return $GUI_RUNDEFMSG
EndFunc   ;==>WM_COMMAND

 

close.jpg

Link to comment
Share on other sites

I have a doubt when creating more than 50 buttons in the looping, which would be the most efficient way to monitor these buttons.

Switch GUIGetMsg()
    Case $button1
        func1()
    Case $button2
        func2()
    Case $button3
        func3()
    Case $button4
        func4()
    Case $button5
        func5()
    Case ...
        ...
    Case ...
        ...
    Case ...
        ...
WEnd

 

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...