PDA

View Full Version : What's the purpose of this line in the Tutorial App?



marcuslee
24-11-2009, 07:36
I've been going over the source code for the tutorial application, making sure I understand everything. Well, when I got to line 111, I stopped and wondered. (Well, actually, I had a question about constants but I answered my own question before I posted.)

Here's the line in question:



global Icon_Welcome_d as long = ImageList_Add masked, iList, app_sourcepath & "Icons\Welcome16_d.bmp", cPink


I understand what the line does. The Help file was quite helpful. What I don't understand is its purpose in the application. This variable is not referenced anywhere else. And, this is the only image in the list that has a transparent value assigned to it. Was it something that was never implemented?



Mark :suicide:

Michael Clease
24-11-2009, 08:24
Mark which tutorial?

So are you saying that the entry that is created in iList is not used?

ErosOlmi
24-11-2009, 09:11
Well,

all icons in Treeview can have an normal or selected state. It can be showed using 2 different icons.
See help for Treeview_Insertitem at http://www.thinbasic.com/public/products/thinBasic/help/html/index.html?treeview_insertitem.htm

At first I wanted to show this situation but later I removed but left the icons.

You can see what I mean in TreeView.tBasic example you can find in \thinBasic\SampleScripts\UI\TreeView\ where only the current TreeView items is colored while all other items are grayed out (because I've used 2 different icons)

Eros

marcuslee
24-11-2009, 15:34
Mark which tutorial?


It's the tutorial application found in the samplescripts of the latest beta release. In this folder: \thinBasic\SampleScripts\Tutorial



So are you saying that the entry that is created in iList is not used?


Yeah, so much for my super human powers of observation ... :oops: ... I first thought it was just one entry, one line that wasn't used, but as Eros explained it was one among many others that weren't used.

I've been playing with the idea of putting the grayed out ones back in, but when I made them all gray, it looked funny. I think I understand how Eros felt when he was programming it. However, then I reversed the process. I don't think it was meant to make grayed out ones appear when you click on the item, but it did have a certain asthetic appeal that the other way didn't. It was almost like, "I'm grayed out. You can't select me again. You have already selected me!"

I do have another question, though. Does the transparent value only need to be set with the first item and not subsequent items?


Mark

ErosOlmi
24-11-2009, 15:45
I do have another question, though. Does the transparent value only need to be set with the first item and not subsequent items?


You have great spirit of observation.
I introduced an improve in ImageList_Add (http://www.thinbasic.com/public/products/thinBasic/help/html/index.html?imagelist_add.htm) but forgot to mention it in help file.
ImageList_Add with MASKED option has last parameter (nRGB) optional. thinBasic will remember the last color used in such a way that subsequent calls to ImageList_Add will use last used color if that parameter is missing.

I will amend help.

Thanks a lot
Eros

marcuslee
24-11-2009, 16:50
You have great spirit of observation.


Ah, I have regained my super human powers of observation! :yahoo: At least until I miss something again ... :cray:


Mark :D