Toolbaritems and there Bitmap´s

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Toolbaritems and there Bitmap´s

marco-2
Hi,

first of all, i want to say thanks, for all the helpful answers i got
in the past days.
Now i´ve got another question... i want to disply the bitmaps i
created on the toolbar items. I set them, but they won´t be displayed.
What have i got to do, what i´m doing wrong?
thanks a lot!
Marco


Reply | Threaded
Open this post in threaded view
|

Re: Toolbaritems and there Bitmap´s

Ian Bartholomew-9
Marco,

> Now i´ve got another question... i want to disply the bitmaps i
> created on the toolbar items. I set them, but they won´t be displayed.
> What have i got to do, what i´m doing wrong?

Without knowing exactly what you are doing, and what exactly is happening,
it is a bit difficult to say what is wrong.  What you should be doing is
something like -

- Create a file containing the bitmaps which are to be used for the toolbar.
For example, a toolbar containing 4 buttons with each displaying a default
(16x16) pixel bitmap will need a bitmap file containing one 64x16 bitmap ***
(see below). The first button will use the pixels in the main bitmap  from
0@0 to 15@15 (bitmap #0), the second (bitmap #1) will use 16@0 to: 31@15 and
so on until bitmap #3 which will be 48@0 to 63@15

- In the Dolphin view composer add an empty toolbar (the "Toolbar.Tool bar"
resource) to your Shell.

- Set the Shell's #layoutManager aspect to "Border layout"

- Set the #arrangement aspect of the Toolbar to "north"

- Go to the Toolbar's #items aspect and add 4 new buttons

- Edit each of the new buttons so that the #bitmap aspect points at the
bitmap file you created *** (see below), the #bitmapIndex is the offset of
the required bitmap within that file (nb 0 to 3 in the above example) ***
(see below), #command contains the selector (symbol) for the method to be
evaluated when the button is pressed and #text for the hover help text.

- Add methods to the Shell that respond to the commands sent by the buttons.

That should be about it. There are a few more things that might need be done
but this is the basics.

*** You could create individual files, each containing a single 16x16
bitmap. If you do this remember that the #bitmapIndex aspect for all the
buttons must then be set to 0.

--
Ian
reply-to address is only valid until the spamming starts


Reply | Threaded
Open this post in threaded view
|

Re: Toolbaritems and there Bitmap´s

rush
"Ian Bartholomew" <[hidden email]> wrote in message
news:aam6rs$bsobg$[hidden email]...
> Marco,
> Ian

Ian,

Since you have a goodie that manages bitmaps, I hope you might understand
bitmaps whole better than me.

Do you understand all the woodo of setting a transparent back colour for the
toolbar? How does the toolbar control choose which color is the transparent
one? Is it some fixed rgb combination, or it is the firs color defined for
the bitmap or what?  As a somewhat entertaining example, I have one toolbar
which is perfectly transparent in win XP but it is has distinctive pink
background in win2k :).

On the side note, are the 8 bit bitmaps still the ones to use, or win XP
need a new style alfa blend 32 bit ones? If yes how does this look on the
old windows, and how does one support both?

If you have any advice on this I will be very gratefull.

Davorin Rusevljan


Reply | Threaded
Open this post in threaded view
|

Re: Toolbaritems and there Bitmap´s

Ian Bartholomew-9
Davorin,

> Since you have a goodie that manages bitmaps, I hope you might understand
> bitmaps whole better than me.

The behaviour on XP seems to have changed somewhat so I'm probably no wiser
than anyone else on the subject. I've found a way of setting the toolbar
colours under XP that works for me but I haven't tried it on other OSs.

FWIW, the way it used to work was that if you set the toolbar background to
RGB 192/192/192 and set an aspect of the bitmap (the Map3DColorsMask) then
Windows would automatically convert the colour to the correct value for the
users current settings.  What seems to happen now is that you can't (in a
way that I could find anyway) set the background colour of the toolbar - it
is always transparent and always uses the same background colour as the main
shell.  Whether this is intentional, a XP bug or something in D5's XP look
and feel I don't really know.

> Do you understand all the woodo of setting a transparent back colour for
the
> toolbar? How does the toolbar control choose which color is the
transparent
> one? Is it some fixed rgb combination, or it is the firs color defined for
> the bitmap or what?  As a somewhat entertaining example, I have one
toolbar
> which is perfectly transparent in win XP but it is has distinctive pink
> background in win2k :).

Sounds nice :-)  All I can suggest is the way (workaround) I've been using.
Set the background colour for the shell to "Color buttonFace" and either
leave the toolbar backcolor alone (the default is the same colour) or set it
to nil.  You will normally cover all of the shell anyway (because if you
have a toolbar you will probably use a BorderLayout for the Shell which
means adding a container for all the other subviews) so it doesn't really
matter what colour you use.  The shell backcolor will then show through the
transparent toolbar and give the correct effect.

However, I've only tried this on XP so, as I said, I don't know what will
happen on other OS's.

> On the side note, are the 8 bit bitmaps still the ones to use, or win XP
> need a new style alfa blend 32 bit ones? If yes how does this look on the
> old windows, and how does one support both?

I'm still using 8 bit colours. It might well be that XP works better with
some other format of bitmap but it's not something I've looked at.

> If you have any advice on this I will be very gratefull.

I'm afraid the above is the best I can do - if you find out anything more
then please let me know as well :-)

--
Ian
reply-to address is only valid until the spamming starts


Reply | Threaded
Open this post in threaded view
|

Re: Toolbaritems and there Bitmap´s

Ian Bartholomew-9
I knew I'd forgotten to add something ...

If you set the toolbars #hasFlatAppearance aspect to false then the
#background cololur aspect of the toolbar _is_ used. If you don't mind the
slightly old fashioned look then this might be a better way to go,

--
Ian
reply-to address is only valid until the spamming starts