BrettF Posted January 8, 2007 Posted January 8, 2007 expandcollapse popup#include <GUIConstants.au3> #include <GuiList.au3> Global $input Global $Form1 = GUICreate("PDB- Installer Creator", 632, 521, 193, 115) Global $Pic1 = GUICtrlCreatePic("", 16, 24, 120, 250, BitOR($SS_NOTIFY,$WS_GROUP)) Global $Input1 = GUICtrlCreateInput("1", 168, 81, 113, 21) Global $Input2 = GUICtrlCreateInput("2", 168, 41, 113, 21) Global $Input3 = GUICtrlCreateInput('3', 168, 121, 113, 21) Global $Input4 = GUICtrlCreateInput("4", 384, 305, 233, 21) Global $Input5 = GUICtrlCreateInput("5", 168, 161, 113, 21) Global $Input6 = GUICtrlCreateInput("6", 168, 201, 113, 21) Global $Label1 = GUICtrlCreateLabel("Side Picture (Acutual Size)", 168, 24, 163, 17) Global $Label2 = GUICtrlCreateLabel("Installer Title", 168, 64, 163, 17) Global $Label3 = GUICtrlCreateLabel("Installer Icon (32x32)", 168, 104, 163, 17) Global $Label4 = GUICtrlCreateLabel("Title:", 352, 304, 27, 17) Global $Label5 = GUICtrlCreateLabel("Text:", 352, 328, 28, 17) Global $Label6 = GUICtrlCreateLabel("Defult Installation Path", 168, 144, 163, 17) Global $Label7 = GUICtrlCreateLabel("Start Menu Deafult Name", 168, 184, 163, 17) Global $Label8 = GUICtrlCreateLabel("ALabel8", 160, 440, 43, 17) Global $Label9 = GUICtrlCreateLabel("ALabel9", 160, 456, 43, 17) Global $list1 = GUICtrlCreateList("ll", 16, 304, 129, 201) Global $DriveCombobox = GUICtrlCreateList("", 240, 304, 89, 84) Global $Edit1 = GUICtrlCreateEdit("", 352, 24, 265, 241) GUICtrlSetData(-1, "AEdit1") Global $Edit2 = GUICtrlCreateEdit("", 352, 344, 265, 161) GUICtrlSetData(-1, "AEdit2") Global $Group1 = GUICtrlCreateGroup("Installer Settings:", 8, 8, 329, 273) Global $Group2 = GUICtrlCreateGroup("Files To Install:", 8, 288, 217, 225) Global $Group3 = GUICtrlCreateGroup("Drives to Burn to:", 232, 288, 105, 113) Global $Group4 = GUICtrlCreateGroup("License of Software:", 344, 8, 281, 273) Global $Group5 = GUICtrlCreateGroup("Welcome Screen Text:", 344, 288, 281, 225) Global $Button1 = GUICtrlCreateButton("Remove", 152, 336, 57, 25, 0) Global $Button2 = GUICtrlCreateButton("Browse", 288, 40, 41, 25, 0) Global $Button3 = GUICtrlCreateButton("Browse", 288, 120, 41, 25, 0) Global $Button4 = GUICtrlCreateButton("Add", 152, 304, 57, 25, 0) Global $Button5 = GUICtrlCreateButton("Browse", 288, 160, 41, 25, 0) Global $Button7 = GUICtrlCreateButton("Preview", 232, 408, 105, 25, 0) Global $Button8 = GUICtrlCreateButton("Burn Protected Disc", 232, 440, 105, 41, 0) Global $Button9 = GUICtrlCreateButton("About", 232, 488, 105, 25, 0) Global $as_drive = DriveGetDrive ("CDROM") If Not @error = 1 Then Local $s_ComboData For $intcount = 1 to $as_drive[0] $s_ComboData &= "|"& StringUpper($as_drive[$intcount]) Next GUICtrlSetData($DriveCombobox,StringTrimLeft($s_ComboData,1),$as_drive[1]) Else Msgbox(0,"ERROR","Could not get system CD and DVD drives.") Return 0 EndIf GUISetState(@SW_SHOW) While 1 $Msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit Case $msg = $Button1 $ret = _GUICtrlListDeleteItem ($list1, 1) If ($ret == $LB_ERR) Then MsgBox(16, "Error", "You must have at least 1 file to install") EndIf Case $msg = $Button2 $pic = FileOpenDialog ( "Select Side Splash, 120x250:", "", "Images (*.jpg;*.bmp;*.gif)") GUICtrlSetImage ($pic1, $pic) GUICtrlSetData ( $Input2 ,$pic) Case $msg = $Button3 FileOpenDialog ( "Select Icon, 32x32:", "", "Icons (*.ico)") GUICtrlSetData ( $Input2 ,$pic) Case $msg = $Button4 $var = FileOpenDialog("Title", "", "All (*.*)") $var = StringReplace($var, "|", @CRLF) If (StringLen($var) > 0) Then $ret = _GUICtrlListAddItem ($list1, GUICtrlRead($var)) If ($ret < 0) Then If ($ret == $LB_ERRSPACE) Then MsgBox(16, "Error", "insufficient space to store the new strings from calling _GUICtrlListAddItem") ElseIf ($ret == $LB_ERR) Then MsgBox(16, "Error", "Unknown error from _GUICtrlListAddItem") EndIf EndIf EndIf Case $msg = $Button5 $DefultInstalpth = FileSelectFolder ( "Please Select a Defult Installation Path.", "", "") GUICtrlSetData ( $Input5 ,$DefultInstalpth) Case $msg = $Button7 GLOBAL $title = GUICtrlRead ($Input1,0) GLOBAL $SidePic = GUICtrlRead ($Input2,0) GLOBAL $icon = GUICtrlRead ($Input3,0) GLOBAL $wlcmTitle = GUICtrlRead ($Input4,0) GLOBAL $DefultInstalpth = GUICtrlRead ($Input5,0) GLOBAL $StartMenu = GUICtrlRead ($Input6,0) GLOBAL $Filelist = GUICtrlRead ($List1,0) GLOBAL $license = GUICtrlRead ($Edit1,0) GLOBAL $wlctxt = GUICtrlRead ($Edit2,0) Welcomescn () Case $msg = $Button8 CreateDisc () Case $msg = $Button9 EndSelect WEnd Thats the code. For some reason, when i try to add files it comes up with an error? What have i done wrong?? Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version!
BrettF Posted January 9, 2007 Author Posted January 9, 2007 How can i get all the listbox data to be read?? Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version!
Helge Posted January 9, 2007 Posted January 9, 2007 (edited) The problem is with the way you've done your _GUICtrlListAddItem. $var = FileOpenDialog("Title", "", "All (*.*)") $var = StringReplace($var, "|", @CRLF) ;... $ret = _GUICtrlListAddItem ($list1, GUICtrlRead($var))oÝ÷ ÛMú½ªÛÉ÷öÖ¢{k¢_Ûæ§xP®T^iÚÞ¶êç²Ø^éz½ØÁëZ楢¶Ø^v,~ÀuÒ-zh±¬¬¶¶¬yÊ'v«jgz»!¢é]mëaz«¨¶+-®)àþ+hi×jºHmébz÷jÉv®-iº.¶Øb²Þ²¶)j ºØ^{"²×¶!jxÁ«'yç^vȧqëayÚ²Ê^r'âq©eÊëvØ^ÂݲÚâj}ý¶Çuا«b'âÅú+¶¬Â¥u·¦ºé²©eÊȧqèºÇº'+jë° m¡ÊÚ²'˲¶âÇ*.®ènW¦ë-±ëmí7êö«jËazÇ¢wij¶¦z׫jwr¢ë!¢é]mè(¡Ûhèjú"vȦV«¦ºé¥j׫µ©jZ(«mëjëh×6_GUICtrlListAddItem ($list1, 0) ; crashes _GUICtrlListAddItem ($list1, String(0)) ; works _GUICtrlListAddItem (GUICtrlGetHandle($list1), 0) ; works Edited January 9, 2007 by Helge
BrettF Posted January 9, 2007 Author Posted January 9, 2007 Thankyou, i changed the layout anyway, but thankyou, i'll keep it for future scripts. Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version!
PaulIA Posted April 5, 2007 Posted April 5, 2007 To avoid similar problem later take a look at these... _GUICtrlListAddItem ($list1, 0) ; crashes _GUICtrlListAddItem ($list1, String(0)) ; works _GUICtrlListAddItem (GUICtrlGetHandle($list1), 0) ; worksoÝ÷ Ûú®¢×®;¬¶ëëhܸjëh×6#include <A3LListbox.au3> $hGUI = GUICreate("List Box", 400, 296) $hList = _Listbox_Create($hGUI, 2, 2, 396, 294) GUISetState() _Listbox_AddString ($hList, 0) _Listbox_InsertString($hList, 1, 1) do until GUIGetMsg() = $GUI_EVENT_CLOSE Auto3Lib: A library of over 1200 functions for AutoIt
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