Sign in to follow this  
Followers 0
Belini

Colored lines in listview.

8 posts in this topic

#1 ·  Posted (edited)

putting different colors in listview:

#include <GuiConstants.au3>
#include <GuiListView.au3>
; ======================================
; AutoIt3 V 3.3.9.2
; Author: Belini
; Date: 03.30.2012
; Objective: Highlight rows in listview
; ======================================
$GUI = GUICreate("Listview_Colors", 200, 116, -1, -1)
$hListView = GUICtrlCreateListView("", 1, 1, 398, 298, bitor($LVS_NOCOLUMNHEADER, $LVS_NOSCROLL), $LVS_EX_GRIDLINES)
_GUICtrlListView_AddColumn($hListView, "Músicas do cd", 100)
_GUICtrlListView_AddColumn($hListView, "endereço", 200)
GUICtrlSetFont($hListView, 9, 400, 2, "arial")
GUICtrlSetBkColor($hListView, 0x233BF7)
GUICtrlSetColor($hListView, 0xFFFFFF)

GUICtrlCreateListViewItem("test 1", $hListView)
_GUICtrlListView_AddSubItem($hListView, 0, "test 1", 1)
GUICtrlSetBkColor(-1, 0xF25AF0)
GUICtrlCreateListViewItem("test 2", $hListView)
_GUICtrlListView_AddSubItem($hListView, 1, "test 2", 1)
GUICtrlSetBkColor(-1, 0x0FA327)
GUICtrlCreateListViewItem("test 3", $hListView)
_GUICtrlListView_AddSubItem($hListView, 2, "test 3", 1)
GUICtrlSetBkColor(-1, 0xF57E07)
GUICtrlCreateListViewItem("test 4", $hListView)
_GUICtrlListView_AddSubItem($hListView, 3, "test 4", 1)
GUICtrlSetBkColor(-1, 0xD1152E)
GUICtrlCreateListViewItem("test 5", $hListView)
_GUICtrlListView_AddSubItem($hListView, 4, "test 5", 1)
GUICtrlSetBkColor(-1, 0xF25AF0)
GUICtrlCreateListViewItem("test 6", $hListView)
_GUICtrlListView_AddSubItem($hListView, 5, "test 6", 1)
GUICtrlCreateListViewItem("test 7", $hListView)
GUICtrlSetBkColor(-1, 0x1C0CF7)
_GUICtrlListView_AddSubItem($hListView, 6, "test 7", 1)
GUICtrlSetBkColor(-1, 0x1F5C05)
GUISetState(@SW_SHOW, $GUI)

Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
GUIDelete()
Edited by Belini

Share this post


Link to post
Share on other sites



Anyway to get a list view like this?

Posted Image


Things that I've done..

Icon Resource Editor: icon resource editor 

AutoIt Piano: a piano

AutoIt Unlocker: unlocks files when you want to delete them

Colorful tooltips: a wrapper for the tool tips UDF

Rouge GoogleBot: a full screen animation

ASciTE text editor: a text editor written in autoit

Warning: Posts by this user are subject to change or may disappear without notice.

Share this post


Link to post
Share on other sites

ApudAngelorum,

That is a TreeView. :oops:

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

ApudAngelorum,

That is a TreeView. :oops:

M23

Hmm, I've always assumed that it was a list view since it has the ability to display list view style extras info like this.

Posted Image

How do I get a tree view control to display things like the above?

Maybe I'll take this to help section..


Things that I've done..

Icon Resource Editor: icon resource editor 

AutoIt Piano: a piano

AutoIt Unlocker: unlocks files when you want to delete them

Colorful tooltips: a wrapper for the tool tips UDF

Rouge GoogleBot: a full screen animation

ASciTE text editor: a text editor written in autoit

Warning: Posts by this user are subject to change or may disappear without notice.

Share this post


Link to post
Share on other sites

It's not a tree view or a list view, it's a combo of both.

Check out more information on process explorer's TreeListView here.

Thanks, but now that I dove into this I realize why there are no examples in autoit for this, it's a little complicated (or a lot).

If you want colors in ListViews (or TreeViews) then take a look at this one:

http://www.autoitscript.com/forum/index.php?showtopic=138250

Adding colors, fonts, icons, images and what not is easy because there are native autoit functions intended for doing this and APIs like OPs example, it's just that I was curious because at first sight I thought OP was doing something along the lines of like what I asked, but then I realized it was just colorizing entries using native autoit functions, I don't know why I was so compulsive when I posted this :oops:, It's just that I've been getting desperate that's all..


Things that I've done..

Icon Resource Editor: icon resource editor 

AutoIt Piano: a piano

AutoIt Unlocker: unlocks files when you want to delete them

Colorful tooltips: a wrapper for the tool tips UDF

Rouge GoogleBot: a full screen animation

ASciTE text editor: a text editor written in autoit

Warning: Posts by this user are subject to change or may disappear without notice.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0