Jump to content

Recommended Posts

Posted

 

For some reason I can't get this GuiCtrlCreateList to behave data is being added to it successfully (I think), the array is value (though large), and yet it still doesn't work.

Anyone have any clues on what is going on? What am I doing wrong?

 

So the code of concern is below but the GUI itself is larger and posted below in full.

Global $FileList = GUICtrlCreateList("first", 8, 8, 297, 201, BitOR($LBS_EXTENDEDSEL, $WS_VSCROLL))
    GUICtrlSetLimit(-1, 200) ; to limit horizontal scrolling
    Local $c = GUICtrlSetData($FileList, "|" & _ArrayToString($OnlySamples))
    MsgBox(0,0,$c)

Full Gui

#Region StartGUI
    Global $Form1 = GUICreate("Queue Selection - F5 to Refresh - F8 to open folders - F10 Load Special QC", 865, 297 - 1, -1, -1, -1)
    $RefreshDepartment = GUICtrlCreateButton("Refresh", 672, 56, 161, 25)
    $AB = GUICtrlCreateButton("Add b", 305, 170, 45, 20)
    $ACCV = GUICtrlCreateButton("Add ccv", 305, 190, 45, 20)
    $KeyInpSave = GUICtrlCreateButton("Save", 805, 180, 60, 25)
    $CheatSheet = GUICtrlCreateButton("KeysSheet", 805, 155, 60, 25)
    Global $KeyInp = GUICtrlCreateInput($Keystohit, 672, 180, 129, 21)
    $Label4 = GUICtrlCreateLabel("2) Enter Keys to be typed between Sample ID's seperated by commas - SEE ASH FOR FIRST TIME SETUP!", 650, 80, 220, 40)

    Global $ComboDepartmentList = GUICtrlCreateCombo("", 672, 32, 161, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL))
    GUICtrlSetData($ComboDepartmentList, "|" & _ArrayToString($DepartmentList))
    GUICtrlSetData($ComboDepartmentList, $departmentchosen)

    $Label7 = GUICtrlCreateLabel("1) Choose Your Department", 656, 8, 204, 17)

    $Label2 = GUICtrlCreateLabel("DF", 600, 0, 18, 17)
    Global $FileList = GUICtrlCreateList("first", 8, 8, 297, 201, BitOR($LBS_EXTENDEDSEL, $WS_VSCROLL))
    GUICtrlSetLimit(-1, 200) ; to limit horizontal scrolling
    Local $c = GUICtrlSetData($FileList, "|" & _ArrayToString($OnlySamples))
    MsgBox(0,0,$c)

;~  GUICtrlSetData(-1, _ArrayToString($OnlySamples))
;~  GUICtrlSetData($FileList, "|" & _ArrayToString($OnlySamples))
;~  GUICtrlSetData($FileList, "123")


    $MoveLeft = GUICtrlCreateButton(">", 316, 7, 30, 25)
    $MoveLeftAll = GUICtrlCreateButton(">>", 316, 40, 31, 25)
    $MoveRight = GUICtrlCreateButton("<", 317, 73, 31, 25)
    $MoveRightAll = GUICtrlCreateButton("<<", 317, 106, 32, 25)
    $Refresh = GUICtrlCreateButton("Refresh", 305, 140, 45, 25)

;~  Global $ProcessList = GUICtrlCreateList("", 352, 8, 241, 201, BitOR($LBS_EXTENDEDSEL, $WS_VSCROLL))
    Global $ProcessList = GUICtrlCreateList("", 352, 8, 241, 201, BitOR($WS_BORDER, $WS_VSCROLL))


    $Clear = GUICtrlCreateButton("Clear List", 8, 217, 75, 25)
    $Cancel = GUICtrlCreateButton("Cancel", 8, 249, 75, 25)
    GUICtrlCreateLabel("3) WinLock Settings - Hit CONTROL-ALT-W", 650, 210)
    Global $WinLock = GUICtrlCreateButton("WinLock", 650, 240, 75, 25)
    Global $WinLockPartial = GUICtrlCreateButton("WinLockPartial", 740, 240, 75, 25)
    Global $NOTC = GUICtrlCreateCheckbox("Don't Enter Test Code", 1, 278, 150, 17)

    $Load = GUICtrlCreateButton("Load - Or Press F3!", 96, 217, 499, 33)
    GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
    GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
    Global $Checkbox13 = GUICtrlCreateCheckbox("x1", 600, 16, 33, 17)
    Global $GCVersion1 = GUICtrlCreateCheckbox("GC23", 640, 120)
    Global $GCVersion2 = GUICtrlCreateCheckbox("GCV2", 690, 120)
    Global $GCVersion3 = GUICtrlCreateCheckbox("GCV3", 740, 120)
    Global $GCVersion4 = GUICtrlCreateCheckbox("GCV4", 790, 120)
    Global $GCVersion5 = GUICtrlCreateCheckbox("GCV5", 640, 140)
    Global $GCVersion6 = GUICtrlCreateCheckbox("GCV6", 690, 140)
    Global $GCVersion7 = GUICtrlCreateCheckbox("GCV7", 740, 140)

    Global $Other = GUICtrlCreateInput("Other", 240, 256, 273, 21)
    Global $Window = GUICtrlCreateInput($WindowName, 650, 270, 210, 21)
    Global $Checkbox1 = GUICtrlCreateCheckbox("J-FLAG", 528, 256, 57, 17)
    Global $Checkbox2 = GUICtrlCreateCheckbox("x2", 600, 40, 33, 17)
    Global $Checkbox3 = GUICtrlCreateCheckbox("x3", 600, 64, 33, 17)
    Global $Checkbox4 = GUICtrlCreateCheckbox("x4", 600, 88, 33, 17)
    Global $Checkbox5 = GUICtrlCreateCheckbox("x5", 600, 112, 33, 17)
    Global $Checkbox6 = GUICtrlCreateCheckbox("x10", 600, 136, 33, 17)
    Global $Checkbox7 = GUICtrlCreateCheckbox("x20", 600, 160, 33, 17)
    Global $Checkbox8 = GUICtrlCreateCheckbox("x40", 600, 184, 33, 17)
    Global $Checkbox9 = GUICtrlCreateCheckbox("x50", 600, 208, 41, 17)
    Global $Checkbox10 = GUICtrlCreateCheckbox("x100", 600, 232, 41, 17)
    Global $Checkbox11 = GUICtrlCreateCheckbox("x200", 600, 256, 41, 17)
    Global $GCMode = GUICtrlCreateCheckbox("GC", 605, 278, 41, 17)
    Global $Checkbox12 = GUICtrlCreateCheckbox("Custom DF", 160, 256, 73, 17)
    GUICtrlCreateLabel("For Custom DF's multiple entries may be entered by seperating with a semi-colon", 220, 280)

    ;Create hotkeys which are only active when the GUI has focus.
;~  $OpenFile = GUICtrlCreateDummy()
;~  $LoadFile = GUICtrlCreateDummy()
;~  Dim $aHotKeys[2][2] = [["{F4}", $OpenFile], ["{F5}", $LoadFile]]
;~  HotKeySet("^!w", "GetWinInfo")
;~  HotKeySet("{F3}", "LoadHotKey")
;~  HotKeySet("{F8}", "Update")
;~  HotKeySet("{F10}", "LoadQC")

;~  GUISetAccelerators($aHotKeys, $Form1)

    ;Determine location of GUI and system tray and move GUI to bottom right corner, above tray.
    $aWin = WinGetPos($Form1)
;~  _ArrayDisplay($aWin)
    $aTaskbar = WinGetPos("[CLASS:Shell_TrayWnd]", "")
    Global $X = @DesktopWidth - $aWin[2] - 4
    Global $Y = @DesktopHeight - $aWin[3] - $aTaskbar[3] - 4
    WinMove($Form1, "", $X, $Y)
    GUISetState(@SW_SHOW)

 

Posted

It would make things easier if you posted runnable code for example, does the following work for you?

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

Example()

Func Example()
    ;~ Example Data
    Local $aExample[400]
    For $i = 0 To 399
        $aExample[$i] = "Example " & $i
    Next
    ;~ List Gui Example
    GUICreate("List Example", 320, 220)
    Local $idList = GUICtrlCreateList("", 10, 10, 300, 200, BitOR($LBS_EXTENDEDSEL, $WS_VSCROLL))
    GUICtrlSetLimit($idList, 200)
    GUICtrlSetData($idList, "First|" & _ArrayToString($aExample))
    GUISetState()
    While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE
                ExitLoop
        EndSwitch
    WEnd
EndFunc

 

Posted

HI @Subz, yup, please excuse my braindamage.. I am re-writing this program from scratch to use SQL instead of text files.. and I forgot to disable a function that updates the control to blank, because the file no longer exists. 

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
  • Recently Browsing   0 members

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