Results 1 to 6 of 6

Thread: What's the purpose of this line in the Tutorial App?

  1. #1
    Member marcuslee's Avatar
    Join Date
    Sep 2008
    Location
    Kansas, USA
    Age
    42
    Posts
    222
    Rep Power
    38

    What's the purpose of this line in the Tutorial App?

    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:

    [code=thinbasic]
    global Icon_Welcome_d as long = ImageList_Add masked, iList, app_sourcepath & "Icons\Welcome16_d.bmp", cPink
    [/code]

    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

  2. #2
    thinBasic MVPs
    Join Date
    May 2007
    Location
    UK
    Posts
    1,427
    Rep Power
    159

    Re: What's the purpose of this line in the Tutorial App?

    Mark which tutorial?

    So are you saying that the entry that is created in iList is not used?
    Home Desktop : Windows 7 - Intel Pentium (D) - 3.0 Ghz - 2GB - Geforce 6800GS
    Home Laptop : WinXP Pro SP3 - Intel Centrino Duo - 1.73 Ghz - 2 GB - Intel GMA 950
    Home Laptop : Windows 10 - Intel(R) Core(TM) i5-4210U CPU @ 1.70GHz, 2401 Mhz, 2 Core(s), 4 Logical Processor(s) - 4 GB - Intel HD 4400
    Work Desktop : Windows 10 - Intel I7 - 4 Ghz - 8GB - Quadro Fx 370

  3. #3
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10

    Re: What's the purpose of this line in the Tutorial App?

    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/prod...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
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  4. #4
    Member marcuslee's Avatar
    Join Date
    Sep 2008
    Location
    Kansas, USA
    Age
    42
    Posts
    222
    Rep Power
    38

    Re: What's the purpose of this line in the Tutorial App?

    Quote Originally Posted by Michael Clease
    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 ... ... 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

  5. #5
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10

    Re: What's the purpose of this line in the Tutorial App?

    Quote Originally Posted by marcuslee
    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 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
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  6. #6
    Member marcuslee's Avatar
    Join Date
    Sep 2008
    Location
    Kansas, USA
    Age
    42
    Posts
    222
    Rep Power
    38

    Re: What's the purpose of this line in the Tutorial App?

    Quote Originally Posted by Eros Olmi
    You have great spirit of observation.
    Ah, I have regained my super human powers of observation! At least until I miss something again ...


    Mark

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •