Page 1 of 2
Combobox: How to color items
Posted: Fri Feb 23, 2018 3:01 pm
by MarcoBoschi
Is it possibile to color each item of a Combobox with a different color?
King Regards
Marco
Re: Combobox: How to color items
Posted: Fri Feb 23, 2018 4:40 pm
by Antonio Linares
Marco,
Please review FWH\samples\ownerdra.prg
Re: Combobox: How to color items
Posted: Fri Feb 23, 2018 4:44 pm
by MarcoBoschi
VeryGood
Re: Combobox: How to color items
Posted: Mon Feb 26, 2018 10:04 am
by MarcoBoschi
Antonio,
not all bitmaps are correctly displayed
I open yellow.bmp using Paint I draw another color using brush and save
But I cannot see correctly the bitmap
Re: Combobox: How to color items
Posted: Mon Feb 26, 2018 11:17 am
by MarcoBoschi
This is bmp file modified
This is one of correct bitmaps
Re: Combobox: How to color items
Posted: Mon Feb 26, 2018 1:40 pm
by cnavarro
Run ok for me
Re: Combobox: How to color items
Posted: Mon Feb 26, 2018 2:02 pm
by Marc Venken
Hello Christobal,
Could you share the code for the combo with the colors insite ?
Re: Combobox: How to color items
Posted: Mon Feb 26, 2018 2:09 pm
by cnavarro
Marc Venken wrote:Hello Christobal,
Could you share the code for the combo with the colors insite ?
Look post of Antonio
Antonio Linares wrote:Marco,
Please review FWH\samples\ownerdra.prg
Re: Combobox: How to color items
Posted: Mon Feb 26, 2018 3:31 pm
by MarcoBoschi
Cristobal,
if you download this bmp file
http://www.marcoboschi.it/public/rosso.bmp
and subsititute one of bmp files you can see that there is a problem
You cannot see the bitmap rosso.bmp
The question is: these bmp files are particular bmp files?
screenshot
Re: Combobox: How to color items
Posted: Mon Feb 26, 2018 3:33 pm
by cnavarro
Ah!, ok, I will try
Send me your image original
Re: Combobox: How to color items
Posted: Mon Feb 26, 2018 6:16 pm
by ukoenig
A test
Code: Select all
REDEFINE COMBOBOX oCbx2 VAR cItem4 ;
ID 140 OF oDlg ;
ITEMS { " White", " Blue", " Rosso", " Yellow", " Green", " Red" } ;
BITMAPS { c_path + "sWhite.bmp",;
c_path + "sBlue.bmp",;
c_path + "sRosso.bmp",;
c_path + "sYellow.bmp",;
c_path + "sGreen.bmp",;
c_path + "sRed.bmp" }
oCbx2:nItemHeight( 22 )
regards
Uwe
Re: Combobox: How to color items
Posted: Mon Feb 26, 2018 6:20 pm
by nageswaragunupudi
The bitmaps are drawn, treating the color at pixel 0,0 as transparent. In the case of rosso.bmp, color at (0,0) is same as the entire body of the bitmap, so the entire bitmap is treated as transparent.
Please choose a bitmap where the color at (0,0) is different from the rest of the bitmap
Re: Combobox: How to color items
Posted: Mon Feb 26, 2018 6:28 pm
by ukoenig
Rao,
the left upper corner is different in color
to show a black frame
regards
Uwe
Re: Combobox: How to color items
Posted: Mon Feb 26, 2018 7:02 pm
by nageswaragunupudi
Uwe
I am referring to the bitmap downloaded from
http://www.marcoboschi.it/public/rosso.bmp, not the bmps you are using.
Yes. Because in your bitmaps 0,0 color is different from the rest of the colors, the painting is ok.
Re: Combobox: How to color items
Posted: Mon Feb 26, 2018 7:50 pm
by MarcoBoschi
Dear coders, thank you so much