JavaScript_Freek Posted August 8, 2006 Share Posted August 8, 2006 expandcollapse popup;*********************** ; Sample GUI Menu ; Coded by: Dan ; August 2, 2006 ;Special Thanks to: gafrost, SmOke_N, Skruge, Paulie, and codemyster! ;*********************** #include <GuiConstants.au3> #include <Misc.au3> #include <File.au3> #include <GuiListView.au3> FileWrite("c:/blank.txt", "") Global $oRP $name = InputBox("Log In", "Please enter your name:") ; GUI GUICreate("Sample GUI Menu", 400, 400) GUISetIcon(@SystemDir & " notepad.exe", 0) $TagsPageC = GUICtrlCreateLabel('Visit AutoIt Homepage', 5, 399, 100, 15, $SS_CENTER) GUICtrlSetFont($TagsPageC, 9, 400, 4) GUICtrlSetColor($TagsPageC, 0x0000ff) ; BANNER $s_TempFile = _TempFile() InetGet("http://i37.photobucket.com/albums/e91/Zombie1992/logo4.gif", $s_TempFile) GUICtrlCreatePic($s_TempFile, 0, 0, 400, 67) ; SLIDER GUICtrlCreateLabel("Slider:", 235, 325) GUICtrlCreateSlider(270, 325, 120, 30) GUICtrlSetData(-1, 30) ; TEXT GUICtrlCreateLabel("Sample GUI Menu (SGUIM). AutoItV3. Sample Label ", 10, 275, 389,20) $label = GUICtrlCreateLabel("Logged in as: " & $name, 150, 75, 400, 14) ;GUICtrlSetStyle (-1, $SS_RIGHT ) ; MENU $filemenu = GUICtrlCreateMenu("File") $fileitem = GUICtrlCreateMenuitem("Open...", $filemenu) $recentfilesmenu = GUICtrlCreateMenu("Recent Files", $filemenu) $separator1 = GUICtrlCreateMenuitem("", $filemenu) $exititem = GUICtrlCreateMenuitem("Exit", $filemenu) $filemenu = GUICtrlCreateMenu("Scripts") $prog1 = GUICtrlCreateMenuitem("Progress") $helpmenu = GUICtrlCreateMenu("About") $aboutitem = GUICtrlCreateMenuitem("About", $helpmenu) ; TAB GUICtrlCreateTab(1, 70, 400, 190) $tab1 = GUICtrlCreateTabItem("Intro") GUICtrlCreateLabel("Welcome to Sample GUI Menu V2." & @CRLF & " " & @CRLF & "Sample Gui Program Is In Launch. This is a sample gui with features such as login, tabs, clickable links, and NotePad Feature! ", 20, 120, 385, 100) GUICtrlCreateTabItem("Info") $Edit_1 = GuiCtrlCreateEdit("Welcome to SimpleEdit 1.1 Created by: codemyster", 15, 100, 373, 120) $Button_2 = GuiCtrlCreateButton("New", 20, 220, 100, 30) $Button_3 = GuiCtrlCreateButton("Save", 220, 220, 100, 30) $Button_7 = GuiCtrlCreateButton("Open", 120, 220, 100, 30) GUICtrlCreateTabItem("AutoIt") $treeview = GUICtrlCreateTreeView(15, 100, 100, 150, BitOr($TVS_HASBUTTONS, $TVS_HASLINES, $TVS_LINESATROOT, $TVS_DISABLEDRAGDROP, $TVS_SHOWSELALWAYS), $WS_EX_CLIENTEDGE) $generalitem = GUICtrlCreateTreeViewitem("General", $treeview) GUICtrlSetColor(-1, 0x0000C0) $displayitem = GUICtrlCreateTreeViewitem("Users", $treeview) GUICtrlSetColor(-1, 0x0000C0) $compitem = GUICtrlCreateTreeViewitem("Computer", $generalitem) $useritem = GUICtrlCreateTreeViewitem("User", $generalitem) $resitem = GUICtrlCreateTreeViewitem("Resolution", $displayitem) $otheritem = GUICtrlCreateTreeViewitem("Other", $displayitem) GuiCtrlCreateLabel("Latest Version of AutoIt: " &@AutoItVersion &"", 120,230) Dim $listview, $button, $msg, $i, $ret, $s_item $listview = GUICtrlCreateListView("Col1|Col2|Col3 ", 120, 100, 210, 100, BitOR($LVS_SINGLESEL, $LVS_SHOWSELALWAYS, $LVS_NOSORTHEADER)) $button = GUICtrlCreateButton ("Value?",120,205,70,20) $item1=GUICtrlCreateListViewItem("Apple|Pear|Fruit",$listview) $item2=GUICtrlCreateListViewItem("ABC|123|321",$listview) $item3=GUICtrlCreateListViewItem("Item1|Item2|Item3",$listview) $input1=GUICtrlCreateInput("Input Testing!",199,205,100,20) GUICtrlSetState(-1,$GUI_DROPACCEPTED) ; to allow drag and dropping GUISetState() GUICtrlSetData($item2,"ITEM1") GUICtrlSetData($item3,"||COL33") GUICtrlDelete($item1) _GUICtrlListViewSetItemCount($listview, 20) ; GUI MESSAGE LOOP GUICtrlCreateTabItem("") ; end tabitem definition GUICtrlSetState($tab1, $GUI_SHOW) ; will be display first GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $fileitem $file = FileOpenDialog("Choose file...", @TempDir, "All (*.*)") If @error <> 1 Then GUICtrlCreateMenuitem($file, $recentfilesmenu) Case $msg = $exititem ExitLoop Case $msg = $GUI_EVENT_CLOSE ;~ $oRP.SaveFile (@ScriptDir & "RichText.rtf", 0) ExitLoop Case $msg = $TagsPageC Run(@ComSpec & ' /c start http://www.autoitscript.com/autoit3%27"]http://www.autoitscript.com/autoit3', '', @SW_HIDE) Case $msg = $aboutitem MsgBox(0, "About Sample GUI Menu", "Sample GUI Menu V2" & @CRLF & @CRLF & "Created by: Javascript_Freek" & @CRLF & "" & @CRLF & "©AutoIt") Case $msg = $prog1 Run('C:\Program Files\AutoIt3\beta\Examples', '', @SW_HIDE) Case $msg = $GUI_EVENT_CLOSE $msg = GuiGetMsg() Case $msg = $Button_7 GUICtrlSetData($Edit_1,Fileread(FileOpenDialog("Select a file to open",@ScriptDir, "All Files (*.*)"))) Case $msg = $button MsgBox(0,"listview item",GUICtrlRead(GUICtrlRead($listview)),2) Case $msg = $listview MsgBox(0,"listview", "clicked="& GUICtrlGetState($listview),2) Case $msg = $GUI_EVENT_CLOSE ExitLoop EndSelect WEndoÝ÷ Ø e®(!´kçfjH§+l¢Ø^íý²Ø^Ävº)v'éîjÛh¤p¢é]mébábä®*m°èºÐn¶Ø^±Êâ¦Û0¢{p¢¹yÆ®±è¦¶¼¢h)ä¶ax Rr¸©¶Å¨ºWm+z¸ ×è¯^*.rXíãë¢ Þ²ÈÂ¥v -¢Ø^ëhÑ1jjezÆ®¶s`66Rb33c¶×6rÒb33c·&ös¢'Vâb33´3¢b3#µ&öw&ÒfÆW2b3#´WFôC2b3#¶&WFb3#´W×ÆW2b33²Âb33²b33²Â5uôDRoÝ÷ Ù8^zºè«¢+ØÀÌØíÁɽÄôU% Ñɱ ÉÑ5¹Õ¥Ñ´ ÅÕ½ÐíAɽÉÍÌÅÕ½Ðì Help, I don't know how to fix it! [center]Cookyx.com :: Simple LAN Chat[/center] Link to comment Share on other sites More sharing options...
i542 Posted August 8, 2006 Share Posted August 8, 2006 I'm not sure this work because it is not tested but: Run('explorer.exe C:\Program Files\AutoIt3\beta\Examples', '', @SW_HIDE) i542 I can do signature me. Link to comment Share on other sites More sharing options...
JavaScript_Freek Posted August 8, 2006 Author Share Posted August 8, 2006 No the problem is $prog1 = GUICtrlCreateMenuitem("Progress") [center]Cookyx.com :: Simple LAN Chat[/center] Link to comment Share on other sites More sharing options...
NELyon Posted August 8, 2006 Share Posted August 8, 2006 YOu didn't give a menu ID GUICTrlCeateMenuItem("progress", $menuvariable) Link to comment Share on other sites More sharing options...
JavaScript_Freek Posted August 8, 2006 Author Share Posted August 8, 2006 Thanks! Now the error is: Case $msg = $prog1 Run('C:\Program Files\AutoIt3\beta\Examples', '', @SW_HIDE) [center]Cookyx.com :: Simple LAN Chat[/center] Link to comment Share on other sites More sharing options...
rambo3889 Posted August 8, 2006 Share Posted August 8, 2006 You cant run a map run only works on executables RunWait(@ComSpec & " /C " &"C:\Program Files\AutoIt3\beta\Examples", "", @SW_HIDE) Should work not sure My Scripts:Radioblog Club Music DownloaderOther stuff:Fun movieIm serious read the help file it helps :PFight 'Till you drop. Never stop, You Cant give up. Til you reach the top Fight! youre the best in town Fight! Link to comment Share on other sites More sharing options...
JavaScript_Freek Posted August 8, 2006 Author Share Posted August 8, 2006 (edited) Nope it didn't work. Anyone else want to give it a shot? Case $msg = $prog1 RunWait(@AutoItExe & &"C:\Program Files\AutoIt3\beta\Examples", "","") Didn't work. Edited August 8, 2006 by JavaScript_Freek [center]Cookyx.com :: Simple LAN Chat[/center] Link to comment Share on other sites More sharing options...
rambo3889 Posted August 8, 2006 Share Posted August 8, 2006 (edited) Might work expandcollapse popup#include <Process.au3> ;*********************** ; Sample GUI Menu ; Coded by: Dan ; August 2, 2006 ;Special Thanks to: gafrost, SmOke_N, Skruge, Paulie, and codemyster! ;*********************** #include <GuiConstants.au3> #include <Misc.au3> #include <File.au3> #include <GuiListView.au3> FileWrite("c:/blank.txt", "") Global $oRP $name = InputBox("Log In", "Please enter your name:") ; GUI GUICreate("Sample GUI Menu", 400, 400) GUISetIcon(@SystemDir & " notepad.exe", 0) $TagsPageC = GUICtrlCreateLabel('Visit AutoIt Homepage', 5, 399, 100, 15, $SS_CENTER) GUICtrlSetFont($TagsPageC, 9, 400, 4) GUICtrlSetColor($TagsPageC, 0x0000ff) ; BANNER $s_TempFile = _TempFile() InetGet("http://i37.photobucket.com/albums/e91/Zombie1992/logo4.gif", $s_TempFile) GUICtrlCreatePic($s_TempFile, 0, 0, 400, 67) ; SLIDER GUICtrlCreateLabel("Slider:", 235, 325) GUICtrlCreateSlider(270, 325, 120, 30) GUICtrlSetData(-1, 30) ; TEXT GUICtrlCreateLabel("Sample GUI Menu (SGUIM). AutoItV3. Sample Label ", 10, 275, 389,20) $label = GUICtrlCreateLabel("Logged in as: " & $name, 150, 75, 400, 14) ;GUICtrlSetStyle (-1, $SS_RIGHT ) ; MENU $filemenu = GUICtrlCreateMenu("File") $fileitem = GUICtrlCreateMenuitem("Open...", $filemenu) $recentfilesmenu = GUICtrlCreateMenu("Recent Files", $filemenu) $separator1 = GUICtrlCreateMenuitem("", $filemenu) $exititem = GUICtrlCreateMenuitem("Exit", $filemenu) $filemenu = GUICtrlCreateMenu("Scripts") $prog1 = GUICtrlCreateMenuitem("Progress",$filemenu) $helpmenu = GUICtrlCreateMenu("About") $aboutitem = GUICtrlCreateMenuitem("About", $helpmenu) ; TAB GUICtrlCreateTab(1, 70, 400, 190) $tab1 = GUICtrlCreateTabItem("Intro") GUICtrlCreateLabel("Welcome to Sample GUI Menu V2." & @CRLF & " " & @CRLF & "Sample Gui Program Is In Launch. This is a sample gui with features such as login, tabs, clickable links, and NotePad Feature! ", 20, 120, 385, 100) GUICtrlCreateTabItem("Info") $Edit_1 = GuiCtrlCreateEdit("Welcome to SimpleEdit 1.1 Created by: codemyster", 15, 100, 373, 120) $Button_2 = GuiCtrlCreateButton("New", 20, 220, 100, 30) $Button_3 = GuiCtrlCreateButton("Save", 220, 220, 100, 30) $Button_7 = GuiCtrlCreateButton("Open", 120, 220, 100, 30) GUICtrlCreateTabItem("AutoIt") $treeview = GUICtrlCreateTreeView(15, 100, 100, 150, BitOr($TVS_HASBUTTONS, $TVS_HASLINES, $TVS_LINESATROOT, $TVS_DISABLEDRAGDROP, $TVS_SHOWSELALWAYS), $WS_EX_CLIENTEDGE) $generalitem = GUICtrlCreateTreeViewitem("General", $treeview) GUICtrlSetColor(-1, 0x0000C0) $displayitem = GUICtrlCreateTreeViewitem("Users", $treeview) GUICtrlSetColor(-1, 0x0000C0) $compitem = GUICtrlCreateTreeViewitem("Computer", $generalitem) $useritem = GUICtrlCreateTreeViewitem("User", $generalitem) $resitem = GUICtrlCreateTreeViewitem("Resolution", $displayitem) $otheritem = GUICtrlCreateTreeViewitem("Other", $displayitem) GuiCtrlCreateLabel("Latest Version of AutoIt: " &@AutoItVersion &"", 120,230) Dim $listview, $button, $msg, $i, $ret, $s_item $listview = GUICtrlCreateListView("Col1|Col2|Col3 ", 120, 100, 210, 100, BitOR($LVS_SINGLESEL, $LVS_SHOWSELALWAYS, $LVS_NOSORTHEADER)) $button = GUICtrlCreateButton ("Value?",120,205,70,20) $item1=GUICtrlCreateListViewItem("Apple|Pear|Fruit",$listview) $item2=GUICtrlCreateListViewItem("ABC|123|321",$listview) $item3=GUICtrlCreateListViewItem("Item1|Item2|Item3",$listview) $input1=GUICtrlCreateInput("Input Testing!",199,205,100,20) GUICtrlSetState(-1,$GUI_DROPACCEPTED) ; to allow drag and dropping GUISetState() GUICtrlSetData($item2,"ITEM1") GUICtrlSetData($item3,"||COL33") GUICtrlDelete($item1) _GUICtrlListViewSetItemCount($listview, 20) ; GUI MESSAGE LOOP GUICtrlCreateTabItem("") ; end tabitem definition GUICtrlSetState($tab1, $GUI_SHOW) ; will be display first GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $fileitem $file = FileOpenDialog("Choose file...", @TempDir, "All (*.*)") If @error <> 1 Then GUICtrlCreateMenuitem($file, $recentfilesmenu) Case $msg = $exititem ExitLoop Case $msg = $GUI_EVENT_CLOSE ;~ $oRP.SaveFile (@ScriptDir & "RichText.rtf", 0) Exit Case $msg = $TagsPageC Run(@ComSpec & ' /c start http://www.autoitscript.com/autoit3%27"]http://www.autoitscript.com/autoit3', '', @SW_HIDE) Case $msg = $aboutitem MsgBox(0, "About Sample GUI Menu", "Sample GUI Menu V2" & @CRLF & @CRLF & "Created by: Javascript_Freek" & @CRLF & "" & @CRLF & "©AutoIt") Case $msg = $prog1 $installdir=RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt","InstallDir") ;~ MsgBox(262144,'Debug line ~112','Selection:' & @lf & '$installdir' & @lf & @lf & 'Return:' & @lf & $installdir & @lf & @lf & '@Error:' & @lf & @Error);### Debug MSGBOX $rc = _RunDos("start "&$installdir &"\beta\Examples") Case $msg = $GUI_EVENT_CLOSE $msg = GuiGetMsg() Case $msg = $Button_7 GUICtrlSetData($Edit_1,Fileread(FileOpenDialog("Select a file to open",@ScriptDir, "All Files (*.*)"))) Case $msg = $button MsgBox(0,"listview item",GUICtrlRead(GUICtrlRead($listview)),2) Case $msg = $listview MsgBox(0,"listview", "clicked="& GUICtrlGetState($listview),2) Case $msg = $GUI_EVENT_CLOSE ExitLoop EndSelect WEnd Edited August 8, 2006 by rambo3889 My Scripts:Radioblog Club Music DownloaderOther stuff:Fun movieIm serious read the help file it helps :PFight 'Till you drop. Never stop, You Cant give up. Til you reach the top Fight! youre the best in town Fight! Link to comment Share on other sites More sharing options...
JavaScript_Freek Posted August 8, 2006 Author Share Posted August 8, 2006 (edited) Thanks but now i get:Windows cannot find C:\ProgramI think it's because it has a space between Program and Files.expandcollapse popup;*********************** ; Sample GUI Menu ; Coded by: Dan ; August 2, 2006 ;Special Thanks to: gafrost, SmOke_N, Skruge, Paulie, and codemyster! ;*********************** #include <GuiConstants.au3> #include <Misc.au3> #include <File.au3> #include <GuiListView.au3> #include <Process.au3> FileWrite("c:/blank.txt", "") Global $oRP $name = InputBox("Log In", "Please enter your name:") ; GUI GUICreate("Sample GUI Menu", 400, 400) GUISetIcon(@SystemDir & " notepad.exe", 0) $TagsPageC = GUICtrlCreateLabel('Visit AutoIt Homepage', 5, 399, 100, 15, $SS_CENTER) GUICtrlSetFont($TagsPageC, 9, 400, 4) GUICtrlSetColor($TagsPageC, 0x0000ff) ; BANNER $s_TempFile = _TempFile() InetGet("http://i37.photobucket.com/albums/e91/Zombie1992/logo4.gif", $s_TempFile) GUICtrlCreatePic($s_TempFile, 0, 0, 400, 67) ; SLIDER GUICtrlCreateLabel("Slider:", 235, 325) GUICtrlCreateSlider(270, 325, 120, 30) GUICtrlSetData(-1, 30) ; TEXT GUICtrlCreateLabel("Sample GUI Menu (SGUIM). AutoItV3. Sample Label ", 10, 275, 389,20) $label = GUICtrlCreateLabel("Logged in as: " & $name, 150, 75, 400, 14) ;GUICtrlSetStyle (-1, $SS_RIGHT ) ; MENU $filemenu = GUICtrlCreateMenu("File") $fileitem = GUICtrlCreateMenuitem("Open...", $filemenu) $recentfilesmenu = GUICtrlCreateMenu("Recent Files", $filemenu) $separator1 = GUICtrlCreateMenuitem("", $filemenu) $exititem = GUICtrlCreateMenuitem("Exit", $filemenu) $filemenu = GUICtrlCreateMenu("Scripts") $prog1 = GUICtrlCreateMenuitem("Progress",$filemenu) $helpmenu = GUICtrlCreateMenu("About") $aboutitem = GUICtrlCreateMenuitem("About", $helpmenu) ; TAB GUICtrlCreateTab(1, 70, 400, 190) $tab1 = GUICtrlCreateTabItem("Intro") GUICtrlCreateLabel("Welcome to Sample GUI Menu V2." & @CRLF & " " & @CRLF & "Sample Gui Program Is In Launch. This is a sample gui with features such as login, tabs, clickable links, and NotePad Feature! ", 20, 120, 385, 100) GUICtrlCreateTabItem("Info") $Edit_1 = GuiCtrlCreateEdit("Welcome to SimpleEdit 1.1 Created by: codemyster", 15, 100, 373, 120) $Button_2 = GuiCtrlCreateButton("New", 20, 220, 100, 30) $Button_3 = GuiCtrlCreateButton("Save", 220, 220, 100, 30) $Button_7 = GuiCtrlCreateButton("Open", 120, 220, 100, 30) GUICtrlCreateTabItem("AutoIt") $treeview = GUICtrlCreateTreeView(15, 100, 100, 150, BitOr($TVS_HASBUTTONS, $TVS_HASLINES, $TVS_LINESATROOT, $TVS_DISABLEDRAGDROP, $TVS_SHOWSELALWAYS), $WS_EX_CLIENTEDGE) $generalitem = GUICtrlCreateTreeViewitem("General", $treeview) GUICtrlSetColor(-1, 0x0000C0) $displayitem = GUICtrlCreateTreeViewitem("Users", $treeview) GUICtrlSetColor(-1, 0x0000C0) $compitem = GUICtrlCreateTreeViewitem("Computer", $generalitem) $useritem = GUICtrlCreateTreeViewitem("User", $generalitem) $resitem = GUICtrlCreateTreeViewitem("Resolution", $displayitem) $otheritem = GUICtrlCreateTreeViewitem("Other", $displayitem) GuiCtrlCreateLabel("Latest Version of AutoIt: " &@AutoItVersion &"", 120,230) Dim $listview, $button, $msg, $i, $ret, $s_item $listview = GUICtrlCreateListView("Col1|Col2|Col3 ", 120, 100, 210, 100, BitOR($LVS_SINGLESEL, $LVS_SHOWSELALWAYS, $LVS_NOSORTHEADER)) $button = GUICtrlCreateButton ("Value?",120,205,70,20) $item1=GUICtrlCreateListViewItem("Apple|Pear|Fruit",$listview) $item2=GUICtrlCreateListViewItem("ABC|123|321",$listview) $item3=GUICtrlCreateListViewItem("Item1|Item2|Item3",$listview) $input1=GUICtrlCreateInput("Input Testing!",199,205,100,20) GUICtrlSetState(-1,$GUI_DROPACCEPTED) ; to allow drag and dropping GUISetState() GUICtrlSetData($item2,"ITEM1") GUICtrlSetData($item3,"||COL33") GUICtrlDelete($item1) _GUICtrlListViewSetItemCount($listview, 20) ; GUI MESSAGE LOOP GUICtrlCreateTabItem("") ; end tabitem definition GUICtrlSetState($tab1, $GUI_SHOW) ; will be display first GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $fileitem $file = FileOpenDialog("Choose file...", @TempDir, "All (*.*)") If @error <> 1 Then GUICtrlCreateMenuitem($file, $recentfilesmenu) Case $msg = $exititem ExitLoop Case $msg = $GUI_EVENT_CLOSE ;~ $oRP.SaveFile (@ScriptDir & "RichText.rtf", 0) Exit Case $msg = $TagsPageC Run(@ComSpec & ' /c start [url=http://www.autoitscript.com/autoit3%27"]http://www.autoitscript.com/autoit3%27"[/url]]http://www.autoitscript.com/autoit3', '', @SW_HIDE) Case $msg = $aboutitem MsgBox(0, "About Sample GUI Menu", "Sample GUI Menu V2" & @CRLF & @CRLF & "Created by: Javascript_Freek" & @CRLF & "" & @CRLF & "©AutoIt") Case $msg = $prog1 $installdir=RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt","InstallDir") ;~ MsgBox(262144,'Debug line ~112','Selection:' & @lf & '$installdir' & @lf & @lf & 'Return:' & @lf & $installdir & @lf & @lf & '@Error:' & @lf & @Error);### Debug MSGBOX $rc = _RunDos("start "&$installdir &"\beta\Examples") Case $msg = $GUI_EVENT_CLOSE $msg = GuiGetMsg() Case $msg = $Button_7 GUICtrlSetData($Edit_1,Fileread(FileOpenDialog("Select a file to open",@ScriptDir, "All Files (*.*)"))) Case $msg = $button MsgBox(0,"listview item",GUICtrlRead(GUICtrlRead($listview)),2) Case $msg = $listview MsgBox(0,"listview", "clicked="& GUICtrlGetState($listview),2) Case $msg = $GUI_EVENT_CLOSE ExitLoop EndSelect WEnd Edited August 8, 2006 by JavaScript_Freek [center]Cookyx.com :: Simple LAN Chat[/center] Link to comment Share on other sites More sharing options...
BPBNA Posted August 8, 2006 Share Posted August 8, 2006 (edited) Run(@ComSpec & ' /c start http://www.autoitscript.com/autoit3', '', @SW_HIDE) Edit: In the post below, you still need to get rid of the %27] as my code shows above. Edited August 8, 2006 by BPBNA Link to comment Share on other sites More sharing options...
Daniel W. Posted August 8, 2006 Share Posted August 8, 2006 Try this expandcollapse popup;*********************** ; Sample GUI Menu ; Coded by: Dan ; August 2, 2006 ;Special Thanks to: gafrost, SmOke_N, Skruge, Paulie, and codemyster! ;*********************** #include <GuiConstants.au3> #include <Misc.au3> #include <File.au3> #include <GuiListView.au3> #include <Process.au3> FileWrite("c:/blank.txt", "") Global $oRP $name = InputBox("Log In", "Please enter your name:") ; GUI GUICreate("Sample GUI Menu", 400, 400) GUISetIcon(@SystemDir & " notepad.exe", 0) $TagsPageC = GUICtrlCreateLabel('Visit AutoIt Homepage', 5, 399, 100, 15, $SS_CENTER) GUICtrlSetFont($TagsPageC, 9, 400, 4) GUICtrlSetColor($TagsPageC, 0x0000ff) ; BANNER $s_TempFile = _TempFile() InetGet("http://i37.photobucket.com/albums/e91/Zombie1992/logo4.gif", $s_TempFile) GUICtrlCreatePic($s_TempFile, 0, 0, 400, 67) ; SLIDER GUICtrlCreateLabel("Slider:", 235, 325) GUICtrlCreateSlider(270, 325, 120, 30) GUICtrlSetData(-1, 30) ; TEXT GUICtrlCreateLabel("Sample GUI Menu (SGUIM). AutoItV3. Sample Label ", 10, 275, 389,20) $label = GUICtrlCreateLabel("Logged in as: " & $name, 150, 75, 400, 14) ;GUICtrlSetStyle (-1, $SS_RIGHT ) ; MENU $filemenu = GUICtrlCreateMenu("File") $fileitem = GUICtrlCreateMenuitem("Open...", $filemenu) $recentfilesmenu = GUICtrlCreateMenu("Recent Files", $filemenu) $separator1 = GUICtrlCreateMenuitem("", $filemenu) $exititem = GUICtrlCreateMenuitem("Exit", $filemenu) $filemenu = GUICtrlCreateMenu("Scripts") $prog1 = GUICtrlCreateMenuitem("Progress",$filemenu) $helpmenu = GUICtrlCreateMenu("About") $aboutitem = GUICtrlCreateMenuitem("About", $helpmenu) ; TAB GUICtrlCreateTab(1, 70, 400, 190) $tab1 = GUICtrlCreateTabItem("Intro") GUICtrlCreateLabel("Welcome to Sample GUI Menu V2." & @CRLF & " " & @CRLF & "Sample Gui Program Is In Launch. This is a sample gui with features such as login, tabs, clickable links, and NotePad Feature! ", 20, 120, 385, 100) GUICtrlCreateTabItem("Info") $Edit_1 = GuiCtrlCreateEdit("Welcome to SimpleEdit 1.1 Created by: codemyster", 15, 100, 373, 120) $Button_2 = GuiCtrlCreateButton("New", 20, 220, 100, 30) $Button_3 = GuiCtrlCreateButton("Save", 220, 220, 100, 30) $Button_7 = GuiCtrlCreateButton("Open", 120, 220, 100, 30) GUICtrlCreateTabItem("AutoIt") $treeview = GUICtrlCreateTreeView(15, 100, 100, 150, BitOr($TVS_HASBUTTONS, $TVS_HASLINES, $TVS_LINESATROOT, $TVS_DISABLEDRAGDROP, $TVS_SHOWSELALWAYS), $WS_EX_CLIENTEDGE) $generalitem = GUICtrlCreateTreeViewitem("General", $treeview) GUICtrlSetColor(-1, 0x0000C0) $displayitem = GUICtrlCreateTreeViewitem("Users", $treeview) GUICtrlSetColor(-1, 0x0000C0) $compitem = GUICtrlCreateTreeViewitem("Computer", $generalitem) $useritem = GUICtrlCreateTreeViewitem("User", $generalitem) $resitem = GUICtrlCreateTreeViewitem("Resolution", $displayitem) $otheritem = GUICtrlCreateTreeViewitem("Other", $displayitem) GuiCtrlCreateLabel("Latest Version of AutoIt: " &@AutoItVersion &"", 120,230) Dim $listview, $button, $msg, $i, $ret, $s_item $listview = GUICtrlCreateListView("Col1|Col2|Col3 ", 120, 100, 210, 100, BitOR($LVS_SINGLESEL, $LVS_SHOWSELALWAYS, $LVS_NOSORTHEADER)) $button = GUICtrlCreateButton ("Value?",120,205,70,20) $item1=GUICtrlCreateListViewItem("Apple|Pear|Fruit",$listview) $item2=GUICtrlCreateListViewItem("ABC|123|321",$listview) $item3=GUICtrlCreateListViewItem("Item1|Item2|Item3",$listview) $input1=GUICtrlCreateInput("Input Testing!",199,205,100,20) GUICtrlSetState(-1,$GUI_DROPACCEPTED) ; to allow drag and dropping GUISetState() GUICtrlSetData($item2,"ITEM1") GUICtrlSetData($item3,"||COL33") GUICtrlDelete($item1) _GUICtrlListViewSetItemCount($listview, 20) ; GUI MESSAGE LOOP GUICtrlCreateTabItem("") ; end tabitem definition GUICtrlSetState($tab1, $GUI_SHOW) ; will be display first GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $fileitem $file = FileOpenDialog("Choose file...", @TempDir, "All (*.*)") If @error <> 1 Then GUICtrlCreateMenuitem($file, $recentfilesmenu) Case $msg = $exititem ExitLoop Case $msg = $GUI_EVENT_CLOSE ;~ $oRP.SaveFile (@ScriptDir & "RichText.rtf", 0) Exit Case $msg = $TagsPageC Run(@ComSpec & ' /c start http://www.autoitscript.com/autoit3%27"]http://www.autoitscript.com/autoit3', '', @SW_HIDE) Case $msg = $aboutitem MsgBox(0, "About Sample GUI Menu", "Sample GUI Menu V2" & @CRLF & @CRLF & "Created by: Javascript_Freek" & @CRLF & "" & @CRLF & "©AutoIt") Case $msg = $prog1 $installdir=RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt","InstallDir") ;~ MsgBox(262144,'Debug line ~112','Selection:' & @lf & '$installdir' & @lf & @lf & 'Return:' & @lf & $installdir & @lf & @lf & '@Error:' & @lf & @Error);### Debug MSGBOX $installdir = StringReplace( $installdir , " " , Chr( 32 ) ) $rc = _RunDos("start "&$installdir &"\beta\Examples") Case $msg = $GUI_EVENT_CLOSE $msg = GuiGetMsg() Case $msg = $Button_7 GUICtrlSetData($Edit_1,Fileread(FileOpenDialog("Select a file to open",@ScriptDir, "All Files (*.*)"))) Case $msg = $button MsgBox(0,"listview item",GUICtrlRead(GUICtrlRead($listview)),2) Case $msg = $listview MsgBox(0,"listview", "clicked="& GUICtrlGetState($listview),2) Case $msg = $GUI_EVENT_CLOSE ExitLoop EndSelect WEnd --------------------------------------------------------------------------------------------------------------------------------Scripts : _Encrypt UDF_UniquePCCode UDF MS like calculatorInstall programm *UPDATED* --------------------------------------------------------------------------------------------------------------------------------[quote name='Helge' post='213117' date='Jul 26 2006, 10:22 AM']Have you ever tried surfing the internet with a milk-carton ?This is similar to what you're trying to do.[/quote] Link to comment Share on other sites More sharing options...
JavaScript_Freek Posted August 8, 2006 Author Share Posted August 8, 2006 I get the same Windows can not open error [center]Cookyx.com :: Simple LAN Chat[/center] Link to comment Share on other sites More sharing options...
Daniel W. Posted August 8, 2006 Share Posted August 8, 2006 its a dos error the dos command "start ..." does not work with spaces ... --------------------------------------------------------------------------------------------------------------------------------Scripts : _Encrypt UDF_UniquePCCode UDF MS like calculatorInstall programm *UPDATED* --------------------------------------------------------------------------------------------------------------------------------[quote name='Helge' post='213117' date='Jul 26 2006, 10:22 AM']Have you ever tried surfing the internet with a milk-carton ?This is similar to what you're trying to do.[/quote] Link to comment Share on other sites More sharing options...
CWorks Posted August 8, 2006 Share Posted August 8, 2006 (edited) $rc = _RunDos("start explorer.exe " & $installdir & "\beta\Examples") better way to do it $rc = Run("explorer.exe " & $installdir & "\beta\Examples") Edited August 8, 2006 by CWorks Link to comment Share on other sites More sharing options...
JavaScript_Freek Posted August 8, 2006 Author Share Posted August 8, 2006 (edited) Omg yes it works! When I try to compile it it says: Error reading the file: <GuiListView.au3> Edited August 8, 2006 by JavaScript_Freek [center]Cookyx.com :: Simple LAN Chat[/center] Link to comment Share on other sites More sharing options...
CWorks Posted August 8, 2006 Share Posted August 8, 2006 (edited) works fine for me using Daniel W.'s example with my fix Edited August 8, 2006 by CWorks Link to comment Share on other sites More sharing options...
JavaScript_Freek Posted August 8, 2006 Author Share Posted August 8, 2006 So when you compile on SciTe it doesnt give you the <GuiListView.au3> error? [center]Cookyx.com :: Simple LAN Chat[/center] Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted August 8, 2006 Moderators Share Posted August 8, 2006 So when you compile on SciTe it doesnt give you the <GuiListView.au3> error?Make sure your compiling in Beta. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
CWorks Posted August 8, 2006 Share Posted August 8, 2006 (edited) compiling in SciTe with beta .132 and 0 errors or warnings Edited August 8, 2006 by CWorks Link to comment Share on other sites More sharing options...
JavaScript_Freek Posted August 8, 2006 Author Share Posted August 8, 2006 (edited) Compile in Beta? I have the latest release out. You mean compile in SciTe? Weird. I right clicked the .au3 file and click "Compile" and it worked. But the icon was bit messed up. I clicked "Compile With Options" hit compile and it said Error reading file: <GuiListView.au3> Edited August 8, 2006 by JavaScript_Freek [center]Cookyx.com :: Simple LAN Chat[/center] 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