Alaska Software Inc. - XbpCombobox background color
Username: Password:
AuthorTopic: XbpCombobox background color
Itai Ben-ArtziXbpCombobox background color
on Sat, 06 Feb 2021 16:36:52 -0800
Afaik, the XbpCombobox object background color always shown as
GRA_CLR_PALGREY. Can I change it to GRA_CLR_WHITE? How?

Thanks,
-Itai
Jonathan LeemingRe: XbpCombobox background color
on Sun, 07 Feb 2021 13:47:16 -0700
On 2/6/2021 5:36 PM, Itai Ben-Artzi wrote:
> Afaik, the XbpCombobox object background color always shown as
> GRA_CLR_PALGREY. Can I change it to GRA_CLR_WHITE? How?
> 
> Thanks,
> -Itai
> 
Hi Itai,

xbpComboBox:SetColorBG(30275296)  pale green back ground

Regards... Jonathan
Jonathan LeemingRe: XbpCombobox background color
on Sun, 07 Feb 2021 14:02:51 -0700
On 2/7/2021 1:47 PM, Jonathan Leeming wrote:
> On 2/6/2021 5:36 PM, Itai Ben-Artzi wrote:
>> Afaik, the XbpCombobox object background color always shown as
>> GRA_CLR_PALGREY. Can I change it to GRA_CLR_WHITE? How?
>>
>> Thanks,
>> -Itai
>>
> Hi Itai,
> 
> xbpComboBox:SetColorBG(30275296)  pale green back ground
> 
> Regards... Jonathan

Hi Again,

the xbpComboBox is a subclass of the xbpListBox which is a subclass of 
the xbpWindow which has the SetColorBG() method.

I'm guessing you are using the Xbase++ 2.0 documentation.  Although I 
use 2.0 I still refer to the 1.9 documentation when looking for the 
class iVars & methods as I find it's easier to see what is available.

With the 2.0 documentation one has to migrate through the parent class 
tree to find these details.

Stay Safe... Jonathan
Itai Ben-ArtziRe: XbpCombobox background color
on Sun, 07 Feb 2021 13:53:53 -0800
Jonathan,
The problem (maybe a bug) is that SetColorBG() only affects the
dropdown, selectable area, but not the top, visible [selected] object.
I've tried xbpComboBox:SetColorBG(GRA_CLR_WHITE) and
xbpComboBox:XbpSLE:SetColorBG(GRA_CLR_WHITE), but the selected item BG
is always grey.

I am using the latest 2.0.
-Itai
Andreas Gehrs-Pahl
Re: XbpCombobox background color
on Sun, 07 Feb 2021 20:51:37 -0500
Itai,

>The problem (maybe a bug) is that SetColorBG() only affects the
>dropdown, selectable area, but not the top, visible [selected] object.

That isn't true. You must be doing something weird. Please provide an 
example program that shows this!

>I've tried xbpComboBox:SetColorBG(GRA_CLR_WHITE) and
>xbpComboBox:XbpSLE:SetColorBG(GRA_CLR_WHITE), but the selected item BG
>is always grey.

By default, the XbpCombobox background color is always white. That includes 
the SLE and the Listbox. I don't know if you can set the background color 
for the SLE and Listbox parts separately, at least not without using owner 
drawing.

If the XbpCombobox is disabled, the SLE would be pale gray, but then you 
couldn't drop down the Listbox, anyway. The actual colors also depend on 
your Windows Theme's colors and if Visual Styles are enabled or not and if 
a manifest file is used or not.

So, show us what you are actually doing!

Andreas

Andreas Gehrs-Pahl
Absolute Software, LLC

phone: (989) 723-9927
email: Andreas@AbsoluteSoftwareLLC.com
web:   http://www.AbsoluteSoftwareLLC.com
[L]:   https://www.LinkedIn.com/in/AndreasGehrsPahl
[F]:   https://www.FaceBook.com/AbsoluteSoftwareLLC
Itai Ben-ArtziRe: XbpCombobox background color
on Mon, 08 Feb 2021 01:46:00 -0800
Thanks!!
OK, I've figured it out.
It is the Type := XBPCOMBO_DROPDOWNLIST that paint the SLE grey.
I should use Owner-Drawing to fix it.

-Itai
James LoughnerRe: XbpCombobox background color
on Mon, 08 Feb 2021 09:31:13 -0500
On 2/8/21 4:46 AM, Itai Ben-Artzi wrote:
> Thanks!!
> OK, I've figured it out.
> It is the Type := XBPCOMBO_DROPDOWNLIST that paint the SLE grey.
> I should use Owner-Drawing to fix it.
> 
> -Itai
> 
Set color on SLE component. remember it is made up of several sub 
components and each is addressable
Andreas Gehrs-Pahl
Re: XbpCombobox background color
on Mon, 08 Feb 2021 15:32:00 -0500
Itai,

>OK, I've figured it out.
>It is the Type := XBPCOMBO_DROPDOWNLIST that paint the SLE grey.
>I should use Owner-Drawing to fix it.

Nope. The XbpCombobox:Type has no effect on the color. The only difference 
between XBPCOMBO_DROPDOWN and XBPCOMBO_DROPDOWNLIST is that you can't type 
values in the XbpSLE part that are not in the XbpListbox. The color can be 
changed just as with the other two types. And (unless possibly with owner 
drawing) you can't set different colors for the SLE and the Listbox parts. 
The following coloring options behave identical:

aPP := {{XBP_PP_BGCLR, XBPSYSCLR_ENTRYFIELD}} (with :New() or :Create())
XbpCombobox:SetColorBG(XBPSYSCLR_ENTRYFIELD)
XbpCombobox:XbpSLE:SetColorBG(XBPSYSCLR_ENTRYFIELD)
XbpCombobox:XbpListbox:SetColorBG(XBPSYSCLR_ENTRYFIELD)

And you can't change the Disabled color for the XbpCombobox() class, for 
which several PDRs exist.

So, show us some code that reproduces your statements.

Andreas

Andreas Gehrs-Pahl
Absolute Software, LLC

phone: (989) 723-9927
email: Andreas@AbsoluteSoftwareLLC.com
web:   http://www.AbsoluteSoftwareLLC.com
[L]:   https://www.LinkedIn.com/in/AndreasGehrsPahl
[F]:   https://www.FaceBook.com/AbsoluteSoftwareLLC
Itai Ben-ArtziRe: XbpCombobox background color
on Wed, 10 Feb 2021 09:58:43 -0800
Andreas,
Here is a snippet:

oXbp := xbpComboBox():new( oParent, , {10,100}, {120,150} )
oXbp:clipSiblings := .T.
oXbp:type := XBPCOMBO_DROPDOWNLIST   Try to comment this line
oXbp:Create()
for i := 1 to 4
  oXbp:addItem('Test ' + AllTrim(Str(i)))
next i
Andreas Gehrs-Pahl
Re: XbpCombobox background color
on Thu, 11 Feb 2021 20:06:40 -0500
Itai,

>oXbp := xbpComboBox():new( oParent, , {10,100}, {120,150} )
>oXbp:clipSiblings := .T.
>oXbp:type := XBPCOMBO_DROPDOWNLIST   Try to comment this line
>oXbp:Create()
>for i := 1 to 4
>   oXbp:addItem('Test ' + AllTrim(Str(i)))
>next i

I don't see anything about (background) colors here. Can you give us a 
working, compilable, program that shows that the SLE background color of 
a ComboBox is gray while the ListBox has a different background color, and 
that shows that you can't change the SLE background color, but can change 
the ListBox background color.

That is what you originally said. Please show us. Also, a small image that 
shows the XbpComboBox misbehaving the way you described, might be helpful.

Andreas

Andreas Gehrs-Pahl
Absolute Software, LLC

phone: (989) 723-9927
email: Andreas@AbsoluteSoftwareLLC.com
web:   http://www.AbsoluteSoftwareLLC.com
[L]:   https://www.LinkedIn.com/in/AndreasGehrsPahl
[F]:   https://www.FaceBook.com/AbsoluteSoftwareLLC
Jim LeeRe: XbpCombobox background color
on Mon, 08 Feb 2021 04:55:00 +0100
hi,

have you dusable "visual Sstyle" ?
those Color will not shown when "over-paimt" by "visual Style"
Jan EscholtRe: XbpCombobox background color
on Fri, 12 Feb 2021 05:26:12 +0100
I use a class XbpComboBoxEx from Günter Beyes who posted it in February 
2010. With this I can change the colors.

Jan

Am 07.02.2021 um 01:36 schrieb Itai Ben-Artzi:
> Afaik, the XbpCombobox object background color always shown as
> GRA_CLR_PALGREY. Can I change it to GRA_CLR_WHITE? How?
> 
> Thanks,
> -Itai
>
Itai Ben-ArtziRe: XbpCombobox background color
on Wed, 10 Mar 2021 15:37:55 -0800
Jan,
In which folder?