fett8802 Posted August 9, 2010 Share Posted August 9, 2010 At the risk of getting yelled at, I'm going to go ahead and ask my question. Let it be known that I've spent the last two work hours searching for an answer here and at google. (I really hate that most forum posts these days begin with "I'm sorry, don't yell at me but...") I haven't been able to find anything that could directly explain this. I found some UDF (supposedly) files here that were simply GUI's that I couldn't include. Here's the question: I'm working on a program that will program certain aspects of my jobs electronic panels. This is done over a TCP connection to the panel. Everything works fine and dandy. At the bottom of the GUI, I have a ListView that I use as a diagnostics screen; it reports all connection information, packets, and all that stuff; and is constantly updating. It also reports any errors that come across. Now, what I'd like to have happen is that any time the program errors, the text come across in the ListView red; so that I can easily scroll through the diagnostics and recognize any errors. Now, I've tried all the different functions and they ALL change the entire ListView. I'm really shocked that AutoIt is missing something as intuitive and simple as a function to simply color one added ListView item. Is there any relatively simple way to achieve this? (And if not, why the heck not?) Thanks for you help, Fett [sub]My UDF[/sub][sub] - Basics and Time extensions. Great for those new at AutoIt, also contains some powerful time extensions for pros.[/sub][sub]ScrabbleIt[/sub][sub] - Scrabble done in pure AutoIt. (In Progress)[/sub][sub]Nerd Party Extreme | My Portfolio | [email="fett8802@gmail.com"]Contact Me[/email][/sub] Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted August 9, 2010 Share Posted August 9, 2010 That wasn't very hard, got it on my first try: GUICreate("test", 640, 480) $listview = GUICtrlCreateListView("something", 5, 5, 200, 200) GUICtrlCreateListViewItem("test1", $listview) GUICtrlCreateListViewItem("test2", $listview) GUICtrlSetColor(-3, 0xFF0000) GUICtrlSetBkColor(-3, 0x0000FF) GUICtrlCreateListViewItem("test3", $listview) GUISetState() Do Until GUIGetMsg() = -3 .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
fett8802 Posted August 9, 2010 Author Share Posted August 9, 2010 (edited) Here's an example of some of the code I have. I can't post much, as it's considered proprietary. _GUICtrlListView_AddItem($Diagnostics,$Diag_Item_Number) _GUICtrlListView_AddSubItem($Diagnostics, $Diag_Item_Number - 1, @HOUR & ":" & @MIN & ":" & @SEC, 0) _GUICtrlListView_AddSubItem($Diagnostics, $Diag_Item_Number - 1, "In", 1) _GUICtrlListView_AddSubItem($Diagnostics, $Diag_Item_Number - 1, "Version", 2) _GUICtrlListView_AddSubItem($Diagnostics, $Diag_Item_Number - 1, $Panel_Version, 3) If $PVRL = 500 Then ;If $Color_Diagnostics = 1 Then ;GUICtrlSetColor($Diagnostics, 0xFF0000) ;EndIf _GUICtrlListView_AddSubItem($Diagnostics, $Diag_Item_Number - 1, "Version Response Failed -- Connection Ended", 4) _GUICtrlStatusBar_SetText($StatusBar1, "Communication Status: Connection Ended", 0) ;GUICtrlSetColor($Diagnostics, 0x000000) Else _GUICtrlListView_AddSubItem($Diagnostics, $Diag_Item_Number - 1, $Panel_Version_Response, 4) EndIf _GUICtrlListView_Scroll($Diagnostics, 0, 16) Where the $PVRL = 500 is the TCP timeout. So, it writes the same first half every time and write the last half if the timeout occurs. Also, the $Diag_Item_Number increases every post. And here's a screen shot of the Diagnostics portion. Sorry about having to black out some of the information. Edited August 9, 2010 by fett8802 [sub]My UDF[/sub][sub] - Basics and Time extensions. Great for those new at AutoIt, also contains some powerful time extensions for pros.[/sub][sub]ScrabbleIt[/sub][sub] - Scrabble done in pure AutoIt. (In Progress)[/sub][sub]Nerd Party Extreme | My Portfolio | [email="fett8802@gmail.com"]Contact Me[/email][/sub] Link to comment Share on other sites More sharing options...
KaFu Posted August 9, 2010 Share Posted August 9, 2010 Take a look at this recent discussion on the topic.Here's the MSDN link to the NMLVCUSTOMDRAW Structure. In the example above exchange clrTextBk with clrText to colorize the text itself. OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) 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