LurchMan Posted November 18, 2010 Share Posted November 18, 2010 Hey Everyone - I've got a simple GUI with a list view in it, and I was wondering if it was possible to make a single row in the list view a different color than all the rest instead of the entire list view. Any help will be appreciated. Thanks! Dating a girl is just like writing software. Everything's going to work just fine in the testing lab (dating), but as soon as you have contract with a customer (marriage), then your program (life) is going to be facing new situations you never expected. You'll be forced to patch the code (admit you're wrong) and then the code (wife) will just end up all bloated and unmaintainable in the end. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 18, 2010 Moderators Share Posted November 18, 2010 LurchMan, Does this 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...
LurchMan Posted November 18, 2010 Author Share Posted November 18, 2010 LurchMan, Does this help? M23 Melba - Thanks for the reply but I can't seem to get that to work. There are a lot of errors with it and it looks like it was written with an older version of AutoIt. Dating a girl is just like writing software. Everything's going to work just fine in the testing lab (dating), but as soon as you have contract with a customer (marriage), then your program (life) is going to be facing new situations you never expected. You'll be forced to patch the code (admit you're wrong) and then the code (wife) will just end up all bloated and unmaintainable in the end. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 18, 2010 Moderators Share Posted November 18, 2010 LurchMan,Works fine for me if I comment out line #302 in the UDF:If $Debug_LV Then _GUICtrlListView_ValidateClassName($hWnd)The author seems to have forgotton to include that function. 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...
LurchMan Posted November 18, 2010 Author Share Posted November 18, 2010 (edited) Yea, I found that too, but I'm getting this error when I try and run the: _GUICtrlListView_Formatting_Startup($GUI, $hLV) Error: C:\Documents and Settings\xxxxx\Desktop\LV_Format_include.au3 (189) : ==> Variable must be of type "Object".: Local $index = $oParamSearch.Item($iParam) Local $index = $oParamSearch^ ERROR Before this point all I've done is build the GUI and display it. Edit: Even when I comment out the startup function I still get the error. Edited November 18, 2010 by LurchMan Dating a girl is just like writing software. Everything's going to work just fine in the testing lab (dating), but as soon as you have contract with a customer (marriage), then your program (life) is going to be facing new situations you never expected. You'll be forced to patch the code (admit you're wrong) and then the code (wife) will just end up all bloated and unmaintainable in the end. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 18, 2010 Moderators Share Posted November 18, 2010 LurchMan, Does this simple script work for you with the UDF in the same folder? #include <GUIConstantsEx.au3> #include 'LV_Format_include.au3' $hGUI = GUICreate("Test", 500, 500) $hListView = GUICtrlCreateListView("Col 1", 10, 10, 480, 200) GUISetState() _GUICtrlListView_Formatting_Startup($hGUI, $hListView) _GUICtrlListView_AddOrIns_Item($hListView, "Fred") _GUICtrlListView_AddOrIns_Item($hListView, "Fred") _GUICtrlListView_AddOrIns_Item($hListView, "Fred") _GUICtrlListView_AddOrIns_Item($hListView, "Fred") _GUICtrlListView_FormattingCell($hListView, 0, 0, 0xFF0000, -1, -1, 600, 'Times New Roman') _GUICtrlListView_FormattingCell($hListView, 1, 0, 0xFFFF00, -1, -1, 600, 'Comic Sans MS') _GUICtrlListView_FormattingCell($hListView, 3, 0, 0xE0E0FF, -1, -1, 600, 'Courier New') While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE _GUICtrlListView_Formatting_Shutdown() Exit EndSwitch WEnd I get nicely coloured items with the correct fonts. 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...
LurchMan Posted November 18, 2010 Author Share Posted November 18, 2010 (edited) Yes that does work. Do I have to create the ListView with the standard function instead of the UDF, and add items with the one included in this udf? Edit: Tried changing how the ListView is created and I still get the same error. Gui: expandcollapse popup$jobstatus = GUICreate("Job Status", 602, 476, 223, 131) GUISetOnEvent($GUI_EVENT_CLOSE, "jobstatusClose") $menu = GUICtrlCreateMenu("File") $open = GUICtrlCreateMenuItem("Open File (CTRL+O)", $menu) GUICtrlSetOnEvent(-1, "_OpenINI") $ClearError = GUICtrlCreateMenuItem("Clear Error (F2)", $menu) GUICtrlSetOnEvent(-1, "_ClearError") $refresh = GUICtrlCreateMenuItem("Refresh (F5)", $menu) GUICtrlSetOnEvent(-1, "_Refresh") $exit = GUICtrlCreateMenuItem("Exit", $menu) GUICtrlSetOnEvent(-1, "jobstatusClose") $apps = GUICtrlCreateMenu("Cycle Apps") $depends = GUICtrlCreateMenuItem("Cycle Dependencies (CTRL+D)", $apps) GUICtrlSetOnEvent(-1, "_StartDepend") $scheduler = GUICtrlCreateMenuItem("Cycle Scheduler (CTRL+S)", $apps) GUICtrlSetOnEvent(-1, "_StartSch") $ListView = _GUICtrlListView_Create($jobstatus, "Job Name|Computer|Status|Current Step|Errors|Total Run Time", 8, 0, 586, 302, _ BitOR($LVS_REPORT, $LVS_SORTASCENDING, $LVS_AUTOARRANGE, $LVS_SHOWSELALWAYS)) _GUICtrlListView_SetExtendedListViewStyle($ListView, BitOR($LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT, $LVS_EX_DOUBLEBUFFER)) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 100) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 150) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 2, 100) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 3, 75) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 4, 75) $log = GUICtrlCreateEdit("", 8, 312, 585, 137, BitOR($ES_AUTOVSCROLL, $ES_AUTOHSCROLL, $ES_READONLY, $ES_WANTRETURN, $WS_VSCROLL)) GUICtrlSetData(-1, "") _Refresh() GUISetState() Dim $jobstatus_AccelTable[5][2] = [["{F5}", $refresh],["{F2}", $ClearError],["^o", $open],["^s", $scheduler],["^d", $depends]] GUISetAccelerators($jobstatus_AccelTable) _GUICtrlListView_Formatting_Startup($jobstatus, $ListView) While 1 Sleep (100) WEnd Thank you for helping me sort this out. Edited November 18, 2010 by LurchMan Dating a girl is just like writing software. Everything's going to work just fine in the testing lab (dating), but as soon as you have contract with a customer (marriage), then your program (life) is going to be facing new situations you never expected. You'll be forced to patch the code (admit you're wrong) and then the code (wife) will just end up all bloated and unmaintainable in the end. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 18, 2010 Moderators Share Posted November 18, 2010 LurchMan, Looks like it! Studying the example for a new UDF is usually the way to go - and that is exactly what I did here. 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