Radimus
(KiX Supporter)
2003-04-22 04:20 PM
changing Icon in listview

I am populating a listview with a 'default icon (32) and then later on the script does some testing and then changes (32) into (9 or 34)

problem is, the icon doesn't change...

code:
Function PCStatus()
DIM $mac,$name

for each $item in $list.items
$name=$item.SubItems(1).Text
if wshping($name)[1] >0
$Item.subitems(0).icon=34
else
$return = EnumMAC('164.51.34.5',$name)
if not @error
$mac = $return[2,0]
shell 'cmd /c \\a06\logon\tools\wol.exe ' + $mac +' > nul'
sleep 10
if wshping($name)[1] >0
$Item.subitems(0).icon=34
else
$Item.subitems(0).icon=9
endif
else
$Item.subitems(0).icon=9
endif
endif
$list.refresh
next
EndFunction

help...


ShawnAdministrator
(KiX Supporter)
2003-04-22 05:31 PM
Re: changing Icon in listview

Try

$Item.subitems(0).ImageIndex = n

where n = the index into the SmallImageList or LargeImageList plugin.

-Shawn


Radimus
(KiX Supporter)
2003-04-22 05:36 PM
Re: changing Icon in listview

thanks. I got it to work with:
$Item.imageindex = 9

[ 22. April 2003, 17:37: Message edited by: Radimus ]


Radimus
(KiX Supporter)
2003-07-17 07:47 PM
Re: changing Icon in listview

how do I get the icon/index of the icon in the listview?

JochenAdministrator
(KiX Supporter)
2003-07-17 08:00 PM
Re: changing Icon in listview

by not specifying the Index with the equal sign and a value but evaluating it !?

Does that make sense ?

ehh:


$Index = $Item.SubItems(0).ImageIndex


or is that write-only ?


Radimus
(KiX Supporter)
2003-07-17 08:15 PM
Re: changing Icon in listview

nope

for each $item in $ListViewEx1.items
$index = $item.subitems(0).imageindex
? $index
next

returns nothing


Chris S.
(MM club member)
2003-07-17 08:27 PM
Re: changing Icon in listview

Ja, according to the docs ImageIndex sets the image index, but does not get.

Perhaps you could make a zero-width column to store the info you want? Or... use the tag property to store an array of the image index.


ShawnAdministrator
(KiX Supporter)
2003-07-17 10:55 PM
Re: changing Icon in listview

Your right, ImageIndex is write-only at the moment. Will definitely make it read/write in the next release though.

ShawnAdministrator
(KiX Supporter)
2003-07-18 01:07 AM
Re: changing Icon in listview

Ok, Item.ImageIndex is now read/writeable. btw, TabPage.ImageIndex was already read/writeable.

-Shawn


JochenAdministrator
(KiX Supporter)
2003-07-18 08:38 AM
Re: changing Icon in listview

That implies the possibility to display an Icon on the Tabs, right ?

Hey, have you ever noticed my finding posted over at kforg that the text on the Tabs moved a bit upwards between one private build and the first beta ?

Nothing too spectacular but should be corrected imo [Smile]


ShawnAdministrator
(KiX Supporter)
2003-07-18 01:55 PM
Re: changing Icon in listview

Captain, yes I remember your comment. And then just lately, Kelly brought up the same issue. Your right, of course ... between the private build and the subsequent beta release, I switched from system drawn tabs to owner drawn tabs. In the process, the tab text and the image got thrown out of alignment. Plus, the behavior of the tabs when they are clicked changed. Instead of popping-up in 3D, they kinda look to be dropping down.

Anyways, I fixed the text part of the tab last night. I am currently working on the image part now. So this will be fixed in the next release. Because the tabs are owner-drawn, have lots of flexibility in terms of their appearance, so might have to re-cycle on it a couple of times before its perfect.

-Shawn


JochenAdministrator
(KiX Supporter)
2003-07-18 01:58 PM
Re: changing Icon in listview

Jeez,

No hurries please [Eek!]

It's really minor stuff, but thanx anyway for fixing it [Smile]

hehe : how about this request ? [Roll Eyes]


ShawnAdministrator
(KiX Supporter)
2003-07-18 02:07 PM
Re: changing Icon in listview

This had to be fixed anyways ... I am currently in a maintenance mode right now. Not really working on anything major, just going back over KF and fixing-up little things here and there.

A Kixtart.Network snappin ? Hey - if someone wants to take a stab at developing this namespace go for it ... I remember Jooel and I having this discussion some time ago ... we were looking at some third-party snappin (cant remember the name) to do with inter-process communication. Jooel expressed some interest in it anyways.

[ 18. July 2003, 14:08: Message edited by: Shawn ]


ShawnAdministrator
(KiX Supporter)
2003-07-18 02:42 PM
Re: changing Icon in listview

Giving much thought to what should be the next biggie in KF ... this will be started after this maintenance mode is done ... ideas ...

TreeView
GridView
StatusBar
NotifyIcon (TaskBarIcon)
ToolBar

These are the biggies, still looking at:

ProgressBar Upgrade (support text)
RichTextBox (finish it with HTML support)

and a whole whack of small stuff ...

-Shawn


JochenAdministrator
(KiX Supporter)
2003-07-18 03:02 PM
Re: changing Icon in listview

You know for what this would be useful for me [Wink]

If only I had the knowledge to do so I'd have started this long time ago [Frown]

Great things on your list:

Actually working around the editable toolbar for PP 1.1, no great thing but better intrinsic anyways [Roll Eyes]


Chris S.
(MM club member)
2003-07-18 03:03 PM
Re: changing Icon in listview

I'd be hip on adding a SysTray object towards the top of the list.

krabourn
(Hey THIS is FUN)
2003-07-18 09:18 PM
Re: changing Icon in listview

Is the Shell going to go by the wayside in favor of Diagnostic.Process or somthing like that? I was really hoping for some sort of run method that could return all the streams without making a console. All of this because of Ping. If this is going to be a while, I guess I will look at another 3rd party dll.

Other than that, I say go through the Kixforms tracking system and see what you can mark off as done and fix the easy ones that don't require a new object to be created. That way you stay more in "Maintenance Mode". [Smile]

[ 18. July 2003, 21:20: Message edited by: krabourn ]


ShawnAdministrator
(KiX Supporter)
2003-07-18 10:33 PM
Re: changing Icon in listview

Yes, Shell is going away in favour of Diagnostics.Process() and Diagnostics.ProcessStartInfo classes. Here's a link to how these classes work. The re-direction of stdout will NOT be there on day one guaranteed, but the framework will be and and will set the stage for day two. I'm just waiting to iron-out the new Namespace names before I proceed. I dont count this item as a "biggie" because its new and stand-alone.

Run a second console app and read its output.

Let me know what you think of that link. It looks like lots-o-fun.


krabourn
(Hey THIS is FUN)
2003-07-18 11:04 PM
Re: changing Icon in listview

Looks cool! [Cool]

I personally can't wait, but I guess I should look at a third party dll for ping while I wait.

Thanks


Radimus
(KiX Supporter)
2003-07-19 12:55 AM
Re: changing Icon in listview

http://www.blundstrom.ca/portfolio.asp?pid=14

http://tangentsoft.net/wskfaq/examples/dllping.html

http://users.chello.be/ws36637/ping.html

http://www.sockets.com/ms_icmp.htm

http://www.aspobjects.com/ASP_Components/Network/Ping/

http://www.howtodothings.com/showarticle.asp?article=560

http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/Q_20409335.html

http://cwashington.netreach.net/main/tools/default.asp?topic=a-m DSPing


krabourn
(Hey THIS is FUN)
2003-07-19 09:05 PM
Re: changing Icon in listview

Thanks.

I will probably use C2GPing at componentstogo. This one is pretty fast. That is assuming I am able to get all the error codes figured out. My backup looks like will be DynuPing from dynucom.

I don't see how I can use the ICMP.dll. I don't think it is scriptable.


krabourn
(Hey THIS is FUN)
2003-07-21 05:37 PM
Re: changing Icon in listview

I have found two problems/annoyances with C2GPing.

Just some food for thought on a hajacked thread. [Smile]