Page 1 of 2 12>
Topic Options
#91943 - 2003-04-22 04:20 PM changing Icon in listview
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
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...
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#91944 - 2003-04-22 05:31 PM Re: changing Icon in listview
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Try

$Item.subitems(0).ImageIndex = n

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

-Shawn

Top
#91945 - 2003-04-22 05:36 PM Re: changing Icon in listview
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
thanks. I got it to work with:
$Item.imageindex = 9

[ 22. April 2003, 17:37: Message edited by: Radimus ]
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#91946 - 2003-07-17 07:47 PM Re: changing Icon in listview
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
how do I get the icon/index of the icon in the listview?
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#91947 - 2003-07-17 08:00 PM Re: changing Icon in listview
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
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 ?
_________________________



Top
#91948 - 2003-07-17 08:15 PM Re: changing Icon in listview
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
nope

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

returns nothing
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#91949 - 2003-07-17 08:27 PM Re: changing Icon in listview
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
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.

Top
#91950 - 2003-07-17 10:55 PM Re: changing Icon in listview
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Your right, ImageIndex is write-only at the moment. Will definitely make it read/write in the next release though.
Top
#91951 - 2003-07-18 01:07 AM Re: changing Icon in listview
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Ok, Item.ImageIndex is now read/writeable. btw, TabPage.ImageIndex was already read/writeable.

-Shawn

Top
#91952 - 2003-07-18 08:38 AM Re: changing Icon in listview
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
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]
_________________________



Top
#91953 - 2003-07-18 01:55 PM Re: changing Icon in listview
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
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

Top
#91954 - 2003-07-18 01:58 PM Re: changing Icon in listview
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Jeez,

No hurries please [Eek!]

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

hehe : how about this request ? [Roll Eyes]
_________________________



Top
#91955 - 2003-07-18 02:07 PM Re: changing Icon in listview
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
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 ]

Top
#91956 - 2003-07-18 02:42 PM Re: changing Icon in listview
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
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

Top
#91957 - 2003-07-18 03:02 PM Re: changing Icon in listview
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
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]
_________________________



Top
#91958 - 2003-07-18 03:03 PM Re: changing Icon in listview
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
I'd be hip on adding a SysTray object towards the top of the list.
Top
#91959 - 2003-07-18 09:18 PM Re: changing Icon in listview
krabourn Offline
Hey THIS is FUN
*****

Registered: 2000-12-11
Posts: 244
Loc: San Antonio, Texas, USA
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 ]
_________________________
Kelly

Top
#91960 - 2003-07-18 10:33 PM Re: changing Icon in listview
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
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.

Top
#91961 - 2003-07-18 11:04 PM Re: changing Icon in listview
krabourn Offline
Hey THIS is FUN
*****

Registered: 2000-12-11
Posts: 244
Loc: San Antonio, Texas, USA
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
_________________________
Kelly

Top
#91962 - 2003-07-19 12:55 AM Re: changing Icon in listview
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
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
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
Page 1 of 2 12>


Moderator:  Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 657 anonymous users online.
Newest Members
M_Moore, BeeEm, min_seow, Audio, Hoschi
17883 Registered Users

Generated in 0.079 seconds in which 0.032 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org