InunoTaishou Posted June 24, 2014 Share Posted June 24, 2014 So there used to be a <illegal name on the autoit forum> that I used to use and i love how the GUI is setup for storing profiles and showing values in, what looks like, the gui list I've tried GuiCtrlCreateListView(& Item) but it doesn't really match up. It sounds really picky, I know, but I like the coumn/row line seperation so it creates boxes And then after that I need it so that while the GUI is active it keeps the first button (run) highlighted I'm wanting to store a whole bunch of documents in it. Type the first few letters of the file name from the gui, Enter and it opens. So it'd be something like File name | path | Date modified | File extension (.pdf, .txt, etc) #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <GUIListBox.au3> #include <WindowsConstants.au3> #include <GUIListView.au3> Global $var2,$var3,$var4,$var22,$var33,$var44,$var222,$var333,$var444 #Region ### START Koda GUI section ### Form= $frmMain = GUICreate("Bot", 600, 400, 500, 197) $grpFiles = GUICtrlCreateGroup("Scripts", 5, 50, 510, 155) $lstFiles = GUICtrlCreateListView("File name | path | Date modified | File extension", 10, 66, 500, 100) $file1 = GUICtrlCreateListViewItem("C:\Tests|" & $var2 & "|" & $var22 & $var222,$lstScripts) $file2 = GUICtrlCreateListVIewItem("D:\Test|" & $var3 & "|" & $var33 & $var333,$lstScripts) $file3 = GUICtrlCreateListViewItem("C:\Test|" & $var4 & "|" & $var44 & $var444,$lstScripts) $open = GUICtrlCreateButton("Open", 10, 168, 75, 33) $aFile = GUICtrlCreateButton("Add File", 95, 168, 75, 33) $tabLog = GUICtrlCreateTab(10, 207, 510, 155) GUICtrlCreateTabItem("Common Log") GUISetState(@SW_SHOW,$frmMain) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_Event_Close Exit Case $open _open() Case $aFile _aFile() EndSwitch WEnd Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 24, 2014 Moderators Share Posted June 24, 2014 InunoTaishou,Is there actually a question in there or are we supposed to read your mind as to exactly what you want? Some possible solutions to the implicit questions in your post: - 1. A ListView does give you "the column/row line separation so it creates boxes" look that you desire - particularly if you use the $LVS_EX_GRIDLINES style.- 2. Using the $BS_DEFPUSHBUTTON style on the "Run" button should help with the "while the GUI is active it keeps the first button (run) highlighted" problem - and the "[press] Enter and it opens" one too.- 3. As for "Type the first few letters of the file name from the gui" - I imagine you will have to search the ListView using _GUICtrlListView_GetItemText and then highlight the first/best match as you add characters to the search input.I hope this is of some help. If you want to be more specific about exactly what you want to do, we can probably offer better focused help. 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...
Zedna Posted June 24, 2014 Share Posted June 24, 2014 Here is correction of your GUI part GUICtrlCreateListViewItem() #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <GUIListBox.au3> #include <WindowsConstants.au3> #include <GUIListView.au3> Global $var2,$var3,$var4,$var22,$var33,$var44,$var222,$var333,$var444 $var3 = 'D:\Test\' $var33 = '2013-12-31' $var333 = 'DOC' #Region ### START Koda GUI section ### Form= $frmMain = GUICreate("Bot", 600, 400, 500, 197) $grpFiles = GUICtrlCreateGroup("Scripts", 5, 50, 510, 155) $lstFiles = GUICtrlCreateListView("File name|path|Date modified|File extension", 10, 66, 500, 100) $file1 = GUICtrlCreateListViewItem("file1.txt|C:\Tests\|2014-06-24|TXT",$lstFiles) $file2 = GUICtrlCreateListVIewItem("file2.DOC|" & $var3 & "|" & $var33 & "|" & $var333,$lstFiles) $open = GUICtrlCreateButton("Open", 10, 168, 75, 33) $aFile = GUICtrlCreateButton("Add File", 95, 168, 75, 33) $tabLog = GUICtrlCreateTab(10, 207, 510, 155) GUICtrlCreateTabItem("Common Log") GUISetState(@SW_SHOW,$frmMain) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_Event_Close Exit ;~ Case $open ;~ _open() ;~ Case $aFile ;~ _aFile() EndSwitch WEnd Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
InunoTaishou Posted June 24, 2014 Author Share Posted June 24, 2014 Sorry if I wasn't specific enough, it was really late, but you completely nailed it Melba And thanks Zedna, I was just using the random path to see what the List looks like, if I want to add 500 files I don't want 500 $var's lol I'll be using _GUICtrlListView_AddArray and then probably something with iniwrite to save the select file information One more question while I'm here, which is better/faster/more efficient for buttons: OnEventMode or Select...Case? #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GUIListBox.au3> #include <GUIListView.au3> #include <GuiButton.au3> #Region ### START Koda GUI section ### Form= $frmMain = GUICreate("Bot", 600, 400, 500, 197) $grpFiles = GUICtrlCreateGroup("", 5, 50, 510, 155) $lstFiles = GUICtrlCreateListView("", 10, 66, 500, 100,$LVS_EX_Gridlines) _GUICtrlListView_SetExtendedListViewStyle($lstFiles, BitOR($LVS_EX_FULLROWSELECT,$LVS_EX_Gridlines)) $open = _GUICtrlButton_Create($frmMain,"Open", 10, 168, 75, 33,$BS_DEFPUSHBUTTON) _GUICtrlListView_AddColumn($lstFiles,"File name",100) _GUICtrlListView_AddColumn($lstFiles,"Path",150) _GUICtrlListView_AddColumn($lstFiles,"Date Modified",100) _GUICtrlListView_AddColumn($lstFiles,"Extension",75) $aFile = _GUICtrlButton_Create($frmMain,"Add File", 95, 168, 75, 33) $tabLog = GUICtrlCreateTab(10, 207, 510, 155) GUICtrlCreateTabItem("Common Log") GUISetState(@SW_SHOW,$frmMain) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_Event_Close Exit Case $open Case $aFile EndSwitch WEnd Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 24, 2014 Moderators Share Posted June 24, 2014 InunoTaishou,Nice to see the crystal ball is in good working order! As to which AutoIt mode is "better" - this is completely subjective and depends on the particular script. If you search you will find a number of threads where this has been discussed at length, but personally I tend to use MessageLoop mode unless there is a very good reason not to do so. And before you ask, the Interrupting a running function tutorial in the Wiki shows a very good one! 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...
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