Hello
I'm trying to change the colour of a highlighted item in a XbpListbox() but for the life of me I've no idea where the colours are coming from
Currently the highlight bar is blue with white text, and when the box is disabled it's blue with a grey text ( very hard to see )
None of these attributes, below, seem to change anything
Alternatively, has anyone got an example of a CSS sheet for a Listbox, with various defined colours for highlighted items whilst the box is active or disabled ?
Thanks for any help
Chris
PUBLIC app10lbox := {{ XBP_PP_COMPOUNDNAME , "9.Courier" },;
{ XBP_PP_ACTIVE_CLR , GRA_CLR_RED },;
{ XBP_PP_INACTIVE_CLR , GRA_CLR_RED },;
{ XBP_PP_ACTIVETEXT_FGCLR , GRA_CLR_RED },;
{ XBP_PP_ACTIVETEXT_BGCLR , GRA_CLR_RED },;
{ XBP_PP_INACTIVETEXT_FGCLR , GRA_CLR_RED },;
{ XBP_PP_INACTIVETEXT_BGCLR , GRA_CLR_RED },;
{ XBP_PP_FGCLR , GRA_CLR_BLACK },;
{ XBP_PP_BGCLR , GRA_CLR_WHITE },;
{ XBP_PP_DISABLED_FGCLR , GRA_CLR_RED },;
{ XBP_PP_DISABLED_BGCLR , GRA_CLR_PALEGRAY }}
Listbox colours
Re: Listbox colours
Anyone ?
Just to confirm, I can't seem to change the colour blue/white on the left box ( enabled - left box) and blue/Grey ( disabled - right box )
Thanks
Chris
Just to confirm, I can't seem to change the colour blue/white on the left box ( enabled - left box) and blue/Grey ( disabled - right box )
Thanks
Chris
Re: Listbox colours
Hi,
This is not the way to change font and colors in a XbpListBox, with the XBP_PP_* parameters. You can do that with the XbpListBox owner-draw option, setting :drawMode = XBP_DRAW_OWNER, and using :drawItem() and :measureItem() methods.
To create a CSS sheet for a XbpListBox, use XbpListBox:visualStyle propery and XbpHTMLStyle() class. You have an example for that in the description of XbpComboBox:visualStyle property.
Slavko
This is not the way to change font and colors in a XbpListBox, with the XBP_PP_* parameters. You can do that with the XbpListBox owner-draw option, setting :drawMode = XBP_DRAW_OWNER, and using :drawItem() and :measureItem() methods.
To create a CSS sheet for a XbpListBox, use XbpListBox:visualStyle propery and XbpHTMLStyle() class. You have an example for that in the description of XbpComboBox:visualStyle property.
Slavko
Best regards,
Slavoljub Damnjanovic
SD-SoftDesign, Alaska Software Technology Partner
https://www.sd-softdesign.com
https://www.sd-softdesign.rs
Slavoljub Damnjanovic
SD-SoftDesign, Alaska Software Technology Partner
https://www.sd-softdesign.com
https://www.sd-softdesign.rs
Re: Listbox colours
Slavko,
it would probably be easier to replace xbplistbox with xpbbrowse or xbpquickbrowse object on array than going through all the hassle of ownedraw
it would probably be easier to replace xbplistbox with xpbbrowse or xbpquickbrowse object on array than going through all the hassle of ownedraw
SlavkoDam wrote: ↑Mon Mar 11, 2024 12:57 am Hi,
This is not the way to change font and colors in a XbpListBox, with the XBP_PP_* parameters. You can do that with the XbpListBox owner-draw option, setting :drawMode = XBP_DRAW_OWNER, and using :drawItem() and :measureItem() methods.
To create a CSS sheet for a XbpListBox, use XbpListBox:visualStyle propery and XbpHTMLStyle() class. You have an example for that in the description of XbpComboBox:visualStyle property.
Slavko
Re: Listbox colours
I don't agree with you. You cannot compare XbpListBox with XbpBrowse and XbpQuickBrowse. You cannot use XbpBrowse and XbpQuickBrowse as GET elements. XbpBrowse don't have :dataLink property, and in XbpQuickBrowse :dataLink property and :getData() method have different purposes. They also don't have :markMode and :multiColumn properties of XbpListBox, and you cannot define colors for disabled items. Besides, XbpBrowse and XbpQuickBrowse is much more complex to create than XbpListBox.
Owner-draw is not very hard to implement. You have examples in Xbase++ samples. Its not the point what is easier to achieve but what do you want to achieve. For advanced options you have to do advanced programming.
Owner-draw is not very hard to implement. You have examples in Xbase++ samples. Its not the point what is easier to achieve but what do you want to achieve. For advanced options you have to do advanced programming.
Best regards,
Slavoljub Damnjanovic
SD-SoftDesign, Alaska Software Technology Partner
https://www.sd-softdesign.com
https://www.sd-softdesign.rs
Slavoljub Damnjanovic
SD-SoftDesign, Alaska Software Technology Partner
https://www.sd-softdesign.com
https://www.sd-softdesign.rs
Re: Listbox colours
Roger implemented the "COMBO" clause for DCSAY ... GET, which uses a popup button beside a get field to show a browse for value selections. Maybe this will do the job.
But I also agree with Slavko. Ownerdrawing is no magic, and there are samples for that, even in your eXpress++-installation.
But I also agree with Slavko. Ownerdrawing is no magic, and there are samples for that, even in your eXpress++-installation.
Best regards,
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Re: Listbox colours
Tom,
Yes, its a fine option in eXpress++ and I implemented a similar one in my PowerWin. But, its only a help to select a value into a get field when you press a popup button, and not a direct get select as XbpListBox. To return to the beginning, the initial request was to change font and colors of active, selected and disabled items of XbpListBox, and that can be only done with owner-draw or HTML CSS style.
Slavko
Yes, its a fine option in eXpress++ and I implemented a similar one in my PowerWin. But, its only a help to select a value into a get field when you press a popup button, and not a direct get select as XbpListBox. To return to the beginning, the initial request was to change font and colors of active, selected and disabled items of XbpListBox, and that can be only done with owner-draw or HTML CSS style.
Slavko
Best regards,
Slavoljub Damnjanovic
SD-SoftDesign, Alaska Software Technology Partner
https://www.sd-softdesign.com
https://www.sd-softdesign.rs
Slavoljub Damnjanovic
SD-SoftDesign, Alaska Software Technology Partner
https://www.sd-softdesign.com
https://www.sd-softdesign.rs
Re: Listbox colours
Slavko, I know it's not the same. But maybe it helps Chris to do what he wants to do.
Best regards,
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Re: Listbox colours
Thanks for the replies, I've worked out what was needed and used the DrawMode option
The Owner draw example worked well, once I'd stripped out all the code I wanted
Thanks once again
Chris
The Owner draw example worked well, once I'd stripped out all the code I wanted
Thanks once again
Chris