If the WHEN clause is False, DCCOMBOBOX will gray the text and the PRESENTATION clause will not override this. i.e.
aPres:={ { XBP_PP_FGCLR, GRA_CLR_BLACK }, ;
{ XBP_PP_BGCLR, GRA_CLR_WHITE }, ;
{ XBP_PP_DISABLED_FGCLR, GRA_CLR_BLACK }, ;
{ XBP_PP_DISABLED_BGCLR, GRA_CLR_BACKGROUND } }
@ 0,0 DCCOMBOBOX cPick LIST aChoices SIZE 10,10 WHEN {|| .F.} PRESENTATION aPres
I would expect the text to be Black, but it is Gray. How do I make the text color Black if WHEN is False?
Thx,
Bob
DCCOMBOBOX PRESENTATION will not set disabled color
Re: DCCOMBOBOX PRESENTATION will not set disabled color
Some Xbase parts don't always work as advertised.
You could try a workaround by using EditProtect instead of When..
EDITPROTECT {|o,x| x:= .t., o:setColorFG(IIF(x,GRA_CLR_BLACK,GRA_CLR_BACKGROUND)), o:setColorBG(IIF(x,GRA_CLR_BLACK,GRA_CLR_WHITE))}
You could try a workaround by using EditProtect instead of When..
EDITPROTECT {|o,x| x:= .t., o:setColorFG(IIF(x,GRA_CLR_BLACK,GRA_CLR_BACKGROUND)), o:setColorBG(IIF(x,GRA_CLR_BLACK,GRA_CLR_WHITE))}
The eXpress train is coming - and it has more cars.
Re: DCCOMBOBOX PRESENTATION will not set disabled color
Using this, I get a runtime error:
Description: Receiver of message is not an object.
Operation: setColorFG
Description: Receiver of message is not an object.
Operation: setColorFG
Re: DCCOMBOBOX PRESENTATION will not set disabled color
hi Bob,
did you talk about "List" Part or SLE Part of Combobox ?
if you want to change Color of SLE you have to useif you talk about "List" Part : use Ownerdraw
did you talk about "List" Part or SLE Part of Combobox ?
if you want to change Color of SLE you have to use
Code: Select all
oCombobox:XbpSLE:SetColorFG()
oCombobox:XbpSLE:SetColorGG()
greetings by OHR
Jimmy
Jimmy
Re: DCCOMBOBOX PRESENTATION will not set disabled color
It was the SLE part I was concerned with. On further testing, I found that the first time EDITPROTECT is processed, the object is undefined. I had to insert a test to make sure the object was actually being passed. Then, I inserted your modification. It kind of worked as expected, but the colors were not set initially, only after the object was clicked on.
Thx
Thx
Re: DCCOMBOBOX PRESENTATION will not set disabled color
You can set the colors initially with the COLOR clause of the DCCOMBOBOX.but the colors were not set initially, only after the object was clicked on.
The eXpress train is coming - and it has more cars.
Re: DCCOMBOBOX PRESENTATION will not set disabled color
The COLOR clause just seems to act on the List, not the SLE, which is where I need it to work.
For consistency, I like the active Gets and ComboBox SLE's to have black lettering on white background.
I like the disabled Gets and ComboBox SLE's to use the default background color to show that they are not active, but I find the default grey lettering on this background hard to see in our environment when you are not right in front of the screen. However, black lettering works great. That being said, it looks like the best solution may be to use EDITPROTECT and not visually differentiate active and disabled ComboBoxes.
Thanks for all your help.
For consistency, I like the active Gets and ComboBox SLE's to have black lettering on white background.
I like the disabled Gets and ComboBox SLE's to use the default background color to show that they are not active, but I find the default grey lettering on this background hard to see in our environment when you are not right in front of the screen. However, black lettering works great. That being said, it looks like the best solution may be to use EDITPROTECT and not visually differentiate active and disabled ComboBoxes.
Thanks for all your help.