Board index » cppbuilder » how to get my own icon into my new component?

how to get my own icon into my new component?


2004-01-15 11:57:38 PM
cppbuilder40
Hallo!
I just developed my first component.
Because i used the standard TPanel for it,
in the component palette my component
has the same icon as the TPanel-Component.
How can i include my own icon for it?
greetings
stephan
 
 

Re:how to get my own icon into my new component?

"Stephan Treder" < XXXX@XXXXX.COM >ha scritto nel messaggio
Quote
Hallo!
I just developed my first component.
Because i used the standard TPanel for it,
in the component palette my component
has the same icon as the TPanel-Component.
How can i include my own icon for it?

greetings
stephan

You've to create a TComponentName.dcr resource.
You can do it using Image Editor and add it to your package (or project)
together .cpp and .h files.
DCR is a sort of resource file, You've open Image Editor, new Component
Resource file (.dcr) and paint a bitmap in Contents->Bitmap->TCOMPONENTNAME
all in uppercase.
Save it and add it
Mario Sernicola
 

Re:how to get my own icon into my new component?

"Mario Sernicola" < XXXX@XXXXX.COM >wrote in message
Quote
You've to create a TComponentName.dcr resource.
I prefer to use a .RES file myself. .DCR has never worked for me. Also, a
.RES file can be compiled directly into the component, whereas a .DCR file
is typically used as an external file instead.
Gambit
 

{smallsort}

Re:how to get my own icon into my new component?

Quote
in the component palette my component
has the same icon as the TPanel-Component.
How can i include my own icon for it?
I ask the same question in this newsgroup before.
make a "MyComponentIcon.res" file include a bitmap size of 24x24.
the bitmap name "MyComponent", same name for the component.
add this line
#pragma resource "MyComponentIcon.res"
to your "MyComponent.cpp".
rebuild the MyComponetn.cpp
regards.
 

Re:how to get my own icon into my new component?

"Cactus" < XXXX@XXXXX.COM >wrote in message
Quote
make a "MyComponentIcon.res" file include a bitmap size
of 24x24. the bitmap name "MyComponent", same name
for the component.
Note that the name of the bitmap must be the *exact* same name as the
component class, and it *must* be in all caps, not mixed case like you have
shown above.
Quote
add this line
#pragma resource "MyComponentIcon.res"
to your "MyComponent.cpp".
Generally speaking, it is better to add the .res file to the component's
design-time package instead.
Gambit
 

Re:how to get my own icon into my new component?

Quote

>make a "MyComponentIcon.res" file include a bitmap size
>of 24x24. the bitmap name "MyComponent", same name
>for the component.

Note that the name of the bitmap must be the *exact* same name as the
component class, and it *must* be in all caps, not mixed case like you
have
shown above.

Item names in a *.res file. it could not match case.
in Image Editor, all name is up case. even key-in low case.
Quote
>add this line
>#pragma resource "MyComponentIcon.res"
>to your "MyComponent.cpp".

Generally speaking, it is better to add the .res file to the component's
design-time package instead.

Are you meaning add MyComponentIcon.res to the package project?
regard.
 

Re:how to get my own icon into my new component?

Quote
Are you meaning add MyComponentIcon.res to the package project?

regard.


Yes...
And it worked fine - thanks to all :-)
Stephan
 

Re:how to get my own icon into my new component?

"Cactus" < XXXX@XXXXX.COM >wrote in message news: XXXX@XXXXX.COM ...
Quote
Item names in a *.res file. it could not match case.
The bitmaps that you place inside the .res must be in all upper case,
otherwise the bitmaps will not be found correctly.
Quote
Are you meaning add MyComponentIcon.res to the package project?
Yes.
Gambit