Sign in to follow this  
Followers 0
buzz44

GUICtrlSetImage () for ListViewItem

12 posts in this topic

#1 ·  Posted (edited)

When I use GUICtrlSetImage ($listview, "blah.bmp") or GUICtrlSetImage ($listviewitem, "blah.bmp") without using GUICtrlSetImage() on a list view again, it sets all the items with the same image. Is this correct behavour?

Different/Same problem below.

Using this example...

#include <GUIConstants.au3>

GUICreate("listview items",220,250, 100,200)

$listview = GuiCtrlCreateListView ("col1  |col2|col3  ",10,10,200,150);,$LVS_SORTDESCENDING)

$item1=GuiCtrlCreateListViewItem("item1|col2|col3",$listview)
$item2=GuiCtrlCreateListViewItem("item2|col2|col3",$listview)
$item3=GuiCtrlCreateListViewItem("item3|col2|col3",$listview)
$item4=GuiCtrlCreateListViewItem("item4|col2|col3",$listview)
$item5=GuiCtrlCreateListViewItem("item5|col2|col3",$listview)
$item6=GuiCtrlCreateListViewItem("item6|col2|col3",$listview)

GuiSetState()

GUICtrlSetImage ($item2, "Blah.bmp")
GUICtrlSetImage ($item3, "Blah22.bmp"); Comment line to show first problem
Do
  $msg = GuiGetMsg ()
Until $msg = $GUI_EVENT_CLOSE

Item 2's image is set first. Meaning all the items have the same image. Then Item 3's image is set and all the images remain the same except item 3, where it is set to the correct image.

Is this normal?

Btw great work on this, I have been waiting for AutoIt to support images in ListView's :(. Any chance of being able to change the image size? or thumbnails etc, such as in 'Explorer'.

Edit:

Due to the new updated GUICtrlSetColor() and GUICtrlSetBkColor() will

_GUICtrlListViewSetBkColor() and _GUICtrlListViewSetTextColor() be

removed?

Edited by Burrup

[u]Old Projects:[/u]A3MORGB2Hex[u]Old Functions:[/u]_TimeAdd/_TimeSub_AddComma_BubbleSort _RippleSort "He who does not understand your silence will probably not understand your words." - Elbert Hubbard.

Share this post


Link to post
Share on other sites



hmm, when running your script, after creating the opbove pictures, mine ain't seem to put on any icons at all :(

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Are using the latest beta, 3.1.1.47?

Edit: And the images have to be located in the script dir, unless you give the full path.

Edited by Burrup

[u]Old Projects:[/u]A3MORGB2Hex[u]Old Functions:[/u]_TimeAdd/_TimeSub_AddComma_BubbleSort _RippleSort "He who does not understand your silence will probably not understand your words." - Elbert Hubbard.

Share this post


Link to post
Share on other sites

Are using the latest beta, 3.1.1.47?

Edit: And the images have to be located in the script dir, unless you give the full path.

<{POST_SNAPBACK}>

yes im running .47 and tried both script dir and full path, non worked:S

Share this post


Link to post
Share on other sites

When I use GUICtrlSetImage ($listview, "blah.bmp") or GUICtrlSetImage ($listviewitem, "blah.bmp") without using GUICtrlSetImage() on a list view again, it sets all the items with the same image. Is this correct behavour?

Different/Same problem below.

Using this example...

#include <GUIConstants.au3>

GUICreate("listview items",220,250, 100,200)

$listview = GuiCtrlCreateListView ("col1  |col2|col3  ",10,10,200,150);,$LVS_SORTDESCENDING)

$item1=GuiCtrlCreateListViewItem("item1|col2|col3",$listview)
$item2=GuiCtrlCreateListViewItem("item2|col2|col3",$listview)
$item3=GuiCtrlCreateListViewItem("item3|col2|col3",$listview)
$item4=GuiCtrlCreateListViewItem("item4|col2|col3",$listview)
$item5=GuiCtrlCreateListViewItem("item5|col2|col3",$listview)
$item6=GuiCtrlCreateListViewItem("item6|col2|col3",$listview)

GuiSetState()

GUICtrlSetImage ($item2, "Blah.bmp")
GUICtrlSetImage ($item3, "Blah22.bmp"); Comment line to show first problem
Do
  $msg = GuiGetMsg ()
Until $msg = $GUI_EVENT_CLOSE

Item 2's image is set first. Meaning all the items have the same image. Then Item 3's image is set and all the images remain the same except item 3, where it is set to the correct image.

Is this normal?

Btw great work on this, I have been waiting for AutoIt to support images in ListView's :(. Any chance of being able to change the image size? or thumbnails etc, such as in 'Explorer'.

Edit:

Due to the new updated GUICtrlSetColor() and GUICtrlSetBkColor() will 

_GUICtrlListViewSetBkColor() and _GUICtrlListViewSetTextColor() be

removed?

<{POST_SNAPBACK}>

There are 3 different parts for setting color

Does GUICtrlSetBkColor also set the text back color for listview?


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

Hi :(

ok, try to answer some things and maybe I will extend the command-descriptions in the helpfile...if I find the time...

@Burrup: it's the same behaviour like on the TreeView:

If you first set an icon for listview or listviewitem then this icon will be used for all icons automatically.

At the moment the ListView supports only the "report"-view.

@Wb-FreeKill: tested again here (XPSP1): OK , also tested yesterday again with 95/98/NT4/2000 and XPSP2.

@gafrost: at the moment are only supported setting color on a _ListView_ not the items itself explicitely.

So maybe we can implement this but the problem is when you set the textbkcolor for an item it must also be called by "GUICtrlSetBkColor".

We have 2 commands but 3 possibilities :(

So back to your question: yes, the text background color is also be set.

So long...

Holger

Share this post


Link to post
Share on other sites

Hi :(

ok, try to answer some things and maybe I will extend the command-descriptions in the helpfile...if I find the time...

@Burrup: it's the same behaviour like on the TreeView:

If you first set an icon for listview or listviewitem then this icon will be used for all icons automatically.

At the moment the ListView supports only the "report"-view.

@Wb-FreeKill: tested again here (XPSP1): OK , also tested yesterday again with 95/98/NT4/2000 and XPSP2.

@gafrost: at the moment are only supported setting color on a _ListView_ not the items itself explicitely.

So maybe we can implement this but the problem is when you set the textbkcolor for an item it must also be called by "GUICtrlSetBkColor".

We have 2 commands but 3 possibilities  :(

So back to your question: yes, the text background color is also be set.

So long...

Holger

<{POST_SNAPBACK}>

Thanks, figured that's the way you handle the back color, almost did that myself with the UDF's.

@Burrup, more than likely the 3 UDF's for Listview color will be removed seeing as how this hasn't made it to release.


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

Thanks all. I was unsure as I haven't had much experience with TreeViews.


[u]Old Projects:[/u]A3MORGB2Hex[u]Old Functions:[/u]_TimeAdd/_TimeSub_AddComma_BubbleSort _RippleSort "He who does not understand your silence will probably not understand your words." - Elbert Hubbard.

Share this post


Link to post
Share on other sites

Thanks all. I was unsure as I haven't had much experience with TreeViews.

<{POST_SNAPBACK}>

So don't use the "v3 bug reports"" forum when you are not for sure it is a bug

The "V3 support" is the correct forum and after when you are for sure gwrite in the bug one

Thanks

Share this post


Link to post
Share on other sites

It still doesn't work for me.

<{POST_SNAPBACK}>

Can you post a script that reproduce what you experience?

I am confuse of what is the real problem. :">

Thanks

Share this post


Link to post
Share on other sites

Sorry JP, I hadn't updated the AutoIt3.exe yet. It had been running when I extracted the .zip archive and I didn't realize, so it hadn't been able to overwrite with the new version. All my documenation was up to date, but not the .exe itself. I was actually running .46 (as I was creating the example script, I put @AutoItVersion in the window title.. then I tested it and started to smack myself).

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