PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: David Martin on February 27, 2005, 12:01:58 PM

Title: Toolbar Icons
Post by: David Martin on February 27, 2005, 12:01:58 PM
I am trying to build a MDI application with a 7 button toolbar using 48 x 48 XP icons.

Here is an example of what one icon looks like:

(https://www.planetsquires.com/protect/forum/proxy.php?request=http%3A%2F%2Fwww.ivyleague.net%2Fsamples%2Freportico.jpg&hash=0ef138fcd909c54e9631c6bc09e2a3a8aa1f165c)

Here is what it looks like in FF:

(https://www.planetsquires.com/protect/forum/proxy.php?request=http%3A%2F%2Fwww.ivyleague.net%2Fsamples%2FFF_Toolbar_Design.jpg&hash=b5b4ec83e608110658b31136ab20b5ba1a1ff0e9)

What's up with that?
Title: Toolbar Icons
Post by: TechSupport on February 27, 2005, 12:18:24 PM
What is te color depth of the icons? I am not near my source code right now but if I remember correctly, FireFly uses LoadImage which may not handle icons with a great number of colors.

BTW, are you developing your program in FireFly and Phoenix? ;)  I saw a similar post on Dominic's site. If you are, then what can I do to help win the race?  :D
Title: Toolbar Icons
Post by: David Martin on February 27, 2005, 12:44:21 PM
Quote from: TechSupportWhat is te color depth of the icons? I am not near my source code right now but if I remember correctly, FireFly uses LoadImage which may not handle icons with a great number of colors.
Yeah, they are 32 bit.

Quote from: TechSupportBTW, are you developing your program in FireFly and Phoenix? ;)  I saw a similar post on Dominic's site.
Tried both those so far, without the results I want, so now I am on PwrDev.  Look for my posts in Edwin's Forum next  :shock:

Quote from: TechSupportIf you are, then what can I do to help win the race?  :D
A kick a$$ tab implementation ( I am going to have a lot of 2 or 3 page tab forms ), form templates, control templates, imagelists all come to mind.

Phoenix has a lot of real neat features but I seem to bump into problems every time I have tried to use it for a complete program.  I have managed to finish deliverable programs with both FF and PwrDev, although nothing that complicated.

That is what I am starting to work on now ... my main "bread and butter" application.  It has been out since 1986 and in FoxPro since 1990.  I am trying to start with a nice Main Menu that can have modules added to it easily.

Owning all three PwrDev, FF and Phoenix gives me a lot, probaly to many, choices.  But it also gives me source code in three different formats that I can look through using Lynx ... this has helped me tremendously in getting a better grasp on how things work in the "Wonderfull World of Windows".
Title: Toolbar Icons
Post by: TechSupport on February 27, 2005, 03:33:57 PM
Hi David,

If you look at the code that is generated for the Toolbar you will see that the Image Lists that are created use the %ILC_COLOR flag. Maybe you can run a quick test for me? Manually change those equates from %ILC_COLOR to %ILC_COLOR32 and re-compile your project's main .BAS file (from JellyFish or the PB Editor, etc...).


from:
   FF_ImageListNormal = ImageList_Create(24, 24, %ILC_COLOR Or %ILC_MASK, 5, 1)

to:
   FF_ImageListNormal = ImageList_Create(24, 24, %ILC_COLOR32 Or %ILC_MASK, 5, 1)



Does the color look any better?
Title: Toolbar Icons
Post by: David Martin on February 27, 2005, 04:03:35 PM
I tried this before.  But, whenever I choose Ctrl + F5 Compile Exe .. ( Hey, shouldn't there be three periods there instead of two?) FF replaces the Project1_IVYMAINMENU_FORM.inc file with a newly built one ... wiping out the changes.
Title: Toolbar Icons
Post by: David Martin on February 27, 2005, 04:05:21 PM
Here is something else for yah.  Whenever I reload that project only the first four icons show on the toolbar.

If I bring up the Toolbar Editor and click on Ok it shows all seven.

The compiled exe always correctly has all seven.
Title: Toolbar Icons
Post by: Roger Garstang on February 27, 2005, 06:48:54 PM
You have to compile it outside of FireFly and compile the Main .bas file.  It may still give you errors though as you'd be using new equates that inclean may not have in the generated include file, so you'd have to look them up.  Your image also looks like a size problem...like it is loading your 48x48 and showing them as 32x32.
Title: Toolbar Icons
Post by: TechSupport on February 27, 2005, 07:03:57 PM
Quote from: Roger GarstangYou have to compile it outside of FireFly and compile the Main .bas file.  It may still give you errors though as you'd be using new equates that inclean may not have in the generated include file, so you'd have to look them up.  Your image also looks like a size problem...like it is loading your 48x48 and showing them as 32x32.

Roger - right you are.

David:

- make sure that you select the 32x32 size in the "Toolbar Styles" dialog.

- Ensure that you have the "Use IncLean" Environment Option unchecked.

- Compile from within FireFly.

- Exit FireFly

- Find the generated source code for the Form. There should be a section in the code where the toolbar is created. That code contains the creation of 3 image lists. For each image list, change the %ILC_COLOR to %ILC_COLOR32. Save the file.

- Remain outside of FireFly and load the main generated source file (.bas) into a code editor (JellyFish, PBEditor, etc).

- Compile and run from.

How are your results now???? If that corrects the problem then I may have to add additional options in the toolbar settings for %ILC_COLOR, %ILC_COLOR32, etc.
Title: Toolbar Icons
Post by: Roger Garstang on February 27, 2005, 07:30:36 PM
Actually he said he has 48x48, so he'd need that selection in styles.  Unless they are really 32x32 then he'd need that setting.  Best bet would be to open them up in an icon editor and confirm the sizes.  Also, that there aren't any other types/sizes of icons in there that may be loading.

Paul,

While we are on sizes, the imagelist I assume sets up whatever size the style is, but when images are added you need a handle and I assume this is got from LoadImage.  I haven't looked at generated code for toolbars yet, but does the size in LoadImage match the size in the imagelist and the style of the toolbar?
Title: Toolbar Icons
Post by: TechSupport on February 27, 2005, 09:19:48 PM
Quote from: Roger GarstangI haven't looked at generated code for toolbars yet, but does the size in LoadImage match the size in the imagelist and the style of the toolbar?

Yes it does - they both match.
Title: Toolbar Icons
Post by: David Martin on February 28, 2005, 01:31:36 PM
Quote from: TechSupportchange the %ILC_COLOR to %ILC_COLOR32
Paul,

This took care of the problem.  I checked it with 256 color and 32 bit XP icons and they all looked great in the compiled exe.
Title: Toolbar Icons
Post by: Roger Garstang on February 28, 2005, 03:13:45 PM
Hmm, sounds like a new option is needed for specifying 4,8,16,24,32 bit imagelists...or maybe just specify 32 if memory isn't an issue and it doesn't effect other bit icons loaded.

ILC_COLOR alone either is 4bit or DDB.
Title: Toolbar Icons
Post by: TechSupport on March 01, 2005, 06:48:55 PM
Quote from: Roger GarstangHmm, sounds like a new option is needed for specifying 4,8,16,24,32 bit imagelists...

These options have now been added to the "Toolbar Styles" popup window. This new feature will be in the next FireFly update.
Title: Toolbar Icons
Post by: David Martin on March 01, 2005, 06:57:10 PM
Great, does that mean that they will display correctly in the designer also?
Title: Toolbar Icons
Post by: TechSupport on March 01, 2005, 10:30:28 PM
Quote from: David MartinGreat, does that mean that they will display correctly in the designer also?

Yes, definately.
Title: Toolbar Icons
Post by: Roger Garstang on March 02, 2005, 01:24:19 AM
I think I'm going to be using more toolbars now.  Next thing we need is progressbars in the statusbar...hehehe

Use:
SetParent, then-
FF_StatusBar_GetRect(HWND_STATUSBAR, 2, panel)
MoveWindow(HWND_FILEPROGRESS, panel.nLeft, panel.nTop, panel.nRight-panel.nLeft, panel.nBottom-panel.nTop, %FALSE)

Although internally you probably wouldn't need the wrapper other than to help in code generation.  Might need a small adjustment for XP Themes too, maybe shrinking it on top and bottom and having a 1 pixel space on top and bottom then to leave a little room for Billy to slap his 3D colors all over it.  I think it also draws the right or left bounding line for the panel funny too...I just like keeping themes off when I have one down there because it looks better.