Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 4 of 4 total
Thread Icon Library
Mon, Oct 5 2015 10:59 AMPermanent Link

Christian Kaufmann

Finally I found the place where to add the icon image in the icon library interface
(Background.Image.Name). But I'm still not sure if I really got it:

IconLibrary is a global object. So I have only one for all my applications.

Coming from Delphi I always have a global ImageList on my main form which I use for all application
specific icons. Is there a common way to handle that? Or should I just go with TImage components
everywhere?

I added this line in one of my own component unit to include a changed Icon Library interface

{$INTERFACE tmyiconlibrary}  >> contains a version for TIconLibrary with additional states.

In the IDE this is shown correctly, but when I compile it I can see my new state names in the .HTML
file, but the new Icon is not displayed correctly on my form.

cu Christian
Mon, Oct 5 2015 11:10 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Christian,

<< Coming from Delphi I always have a global ImageList on my main form which I use for all application specific icons. Is there a common way to handle that? Or should I just go with TImage components everywhere? >>

No, don't use TImage for icons.  For starters, you won't see them at design-time, and they will slow down the loading of your applications (multiple image requests).

<< I added this line in one of my own component unit to include a changed Icon Library interface

{$INTERFACE tmyiconlibrary}  >> contains a version for TIconLibrary with additional states. >>

Don't do it that way.  Instead, just copy the iconlibrary.wbi interface file to a new directory, and then modify it there.  Then, in order to use the icons at design-time, modify the Environment/Options/Library Search Paths so that you include the location of the new icon library *before* the standard component library search path for the control interfaces.  The IDE will prompt you to rebuild the component library when you click on OK for the Environment Options dialog, and then you'll be all set.

A lot of this isn't ideal, so it will be easier to deal with in the future.

Tim Young
Elevate Software
www.elevatesoft.com
Mon, Oct 5 2015 2:19 PMPermanent Link

Christian Kaufmann

> No, don't use TImage for icons.  For starters, you won't see them at design-time, and they will
> slow down the loading of your applications (multiple image requests).

I know. I have such a website with about 50 icons on the startpage. Should refactor it since a long
time. Sprites would be an idea. http://www.w3schools.com/css/css_image_sprites.asp

I was already thinking about a TIImageListIcon component where I provide one PNG with all icons of
a TImageList from a server. TImageListIcon then would have an index property (like ImageIndex in
Delphi). Since my web app has a corresponding Delphi desktop app, I could use the same icons with
the same identifier. Once I'm familiar with the EWB component / interface model, I think this
wouldn't be that complicate.

> Don't do it that way.  Instead, just copy the iconlibrary.wbi interface file to a new directory,
> and then modify it there.  Then, in order to use the icons at design-time, modify the

Ok I don't have that many icons for now.

Not for EWB 2.02 but a solution could be a command line parameter for the IDE with a path to the
ewbide.ini file. Then I could have IDE settings "per application".

And thanks again for your great work!

cu Christian
Mon, Oct 5 2015 3:01 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Christian,

<< I know. I have such a website with about 50 icons on the startpage. Should refactor it since a long
time. Sprites would be an idea. http://www.w3schools.com/css/css_image_sprites.asp >>

You don't need sprites with EWB icons - they are already being loaded in one shot as part of the HTML loader file.

<< Ok I don't have that many icons for now.  >>

The number of icons won't matter in this respect.

<< And thanks again for your great work! >>

Smile

Tim Young
Elevate Software
www.elevatesoft.com
Image