DCBROWSECOL COLOR lost on highlighted line with Xbase++ v2
DCBROWSECOL COLOR lost on highlighted line with Xbase++ v2
We have a customer who extensively uses a dialog containing a browse displaying Invoice and Credit Notes.
The DCBROWSECOL...COLOR clause is used to set the foreground color of the items.
Invoices are set to GRA_CLR_BLACK.
Credit Notes are set to GRA_CLR_RED.
This coloring also shows correctly on the currently highlighted row.
And this worked fine when they were using an application built with Xbase++ 1.9.
They have now switched to an application built with Xbase++ 2.0 and the coloring is Ok on the non-highlighted lines but the highlighted line is only ever shown with a black foreground text color.
Can you tell me if this is this an Xbase++ issue or an Express++ one?
The DCBROWSECOL...COLOR clause is used to set the foreground color of the items.
Invoices are set to GRA_CLR_BLACK.
Credit Notes are set to GRA_CLR_RED.
This coloring also shows correctly on the currently highlighted row.
And this worked fine when they were using an application built with Xbase++ 1.9.
They have now switched to an application built with Xbase++ 2.0 and the coloring is Ok on the non-highlighted lines but the highlighted line is only ever shown with a black foreground text color.
Can you tell me if this is this an Xbase++ issue or an Express++ one?
Regan Cawkwell
Real Business Applications Ltd
http://www.rbauk.com
Real Business Applications Ltd
http://www.rbauk.com
Re: DCBROWSECOL COLOR lost on highlighted line with Xbase++
Have you a small snippet of code that I can compile and run?
The eXpress train is coming - and it has more cars.
Re: DCBROWSECOL COLOR lost on highlighted line with Xbase++
I'll get one together on Monday as I'm off until then (going to a Hot Air Balloon Festival for the weekend).rdonnay wrote:Have you a small snippet of code that I can compile and run?
Thanks.
Regan Cawkwell
Real Business Applications Ltd
http://www.rbauk.com
Real Business Applications Ltd
http://www.rbauk.com
-
- Posts: 484
- Joined: Wed Jan 27, 2010 10:25 pm
- Location: Berlin Germany
Re: DCBROWSECOL COLOR lost on highlighted line with Xbase++
Change all color arrays from a 2 value array to a 4 color array.
_______________________
Best Regards
Wolfgang
Best Regards
Wolfgang
Re: DCBROWSECOL COLOR lost on highlighted line with Xbase++
Thanks, Wolfgang. That worked perfectly.Wolfgang Ciriack wrote:Change all color arrays from a 2 value array to a 4 color array.
Roger, does this mean that the code that handles a color array returned from a codeblack has a bug in it?
Regan Cawkwell
Real Business Applications Ltd
http://www.rbauk.com
Real Business Applications Ltd
http://www.rbauk.com
Re: DCBROWSECOL COLOR lost on highlighted line with Xbase++
I'm not sure what you did.Roger, does this mean that the code that handles a color array returned from a codeblack has a bug in it?
Show me the before and after code.
The eXpress train is coming - and it has more cars.
Re: DCBROWSECOL COLOR lost on highlighted line with Xbase++
OK. Old code:rdonnay wrote:I'm not sure what you did.Roger, does this mean that the code that handles a color array returned from a codeblack has a bug in it?
Show me the before and after code.
Code: Select all
STATIC FUNCTION LP_OrdColor(aLedger,aItem)
LOCAL aColor, cAUTH
aColor := {NIL,NIL}
if ValType(aItem) = "A"
if aItem[LP_ITEM_EL_TYPE] == "C" // credit note
aColor:={GRA_CLR_RED,NIL}
if aLedger[LP_EL_LEDGER] == "P" .and. !empty(aItem[LP_ITEM_EL_AUTH])
if Get_Auth_From_Word(aItem[LP_ITEM_EL_AUTH])$"QN"
aColor:={GraMakeRGBColor( { 225 , 140 , 140 } ),NIL}
endif
endif
else
if aLedger[LP_EL_LEDGER] == "P" .and. !empty(aItem[LP_ITEM_EL_AUTH])
cAUTH:=Get_Auth_From_Word(aItem[LP_ITEM_EL_AUTH])
if cAUTH == "Q" // query
aColor:={GRA_CLR_DARKPINK,NIL}
elseif cAUTH == "N" // held / not authorised
aColor:={GRA_CLR_DARKGREEN,NIL}
endif
endif
endif
endif
RETURN aColor
Code: Select all
STATIC FUNCTION LP_OrdColor(aLedger,aItem)
LOCAL aColor, cAUTH
aColor := {NIL,NIL,NIL,NIL}
if ValType(aItem) = "A"
if aItem[LP_ITEM_EL_TYPE] == "C" // credit note
aColor:={GRA_CLR_RED,NIL,GRA_CLR_RED,NIL}
if aLedger[LP_EL_LEDGER] == "P" .and. !empty(aItem[LP_ITEM_EL_AUTH])
if Get_Auth_From_Word(aItem[LP_ITEM_EL_AUTH])$"QN"
aColor:={GraMakeRGBColor( { 225 , 140 , 140 } ),NIL,GraMakeRGBColor( { 225 , 140 , 140 } ),NIL}
endif
endif
else
if aLedger[LP_EL_LEDGER] == "P" .and. !empty(aItem[LP_ITEM_EL_AUTH])
cAUTH:=Get_Auth_From_Word(aItem[LP_ITEM_EL_AUTH])
if cAUTH == "Q" // query
aColor:={GRA_CLR_DARKPINK,NIL,GRA_CLR_DARKPINK,NIL}
elseif cAUTH == "N" // held / not authorised
aColor:={GRA_CLR_DARKGREEN,NIL,GRA_CLR_DARKGREEN,NIL}
endif
endif
endif
endif
RETURN aColor
Regan Cawkwell
Real Business Applications Ltd
http://www.rbauk.com
Real Business Applications Ltd
http://www.rbauk.com
-
- Posts: 484
- Joined: Wed Jan 27, 2010 10:25 pm
- Location: Berlin Germany
Re: DCBROWSECOL COLOR lost on highlighted line with Xbase++
I use this for changing some colors when the cursor is on this line, for exampleI didn't really have a clue what values to put into the 4 element array so I had to assume the 1st two elements were a FG and BG pair and the last two were too.
{GRA_CLR_WHITE,GRA_CLR_DARKGREEN,GRA_CLR_DARKGREEN,nil}
- Attachments
-
- Image.png (9.68 KiB) Viewed 18264 times
_______________________
Best Regards
Wolfgang
Best Regards
Wolfgang
Re: DCBROWSECOL COLOR lost on highlighted line with Xbase++
Out of interest, how did you find out about the 4 elements needed? I cannot find any mention of it in the documentation.Wolfgang Ciriack wrote:I use this for changing some colors when the cursor is on this line, for exampleI didn't really have a clue what values to put into the 4 element array so I had to assume the 1st two elements were a FG and BG pair and the last two were too.
{GRA_CLR_WHITE,GRA_CLR_DARKGREEN,GRA_CLR_DARKGREEN,nil}
Regan Cawkwell
Real Business Applications Ltd
http://www.rbauk.com
Real Business Applications Ltd
http://www.rbauk.com
-
- Posts: 605
- Joined: Thu Jan 28, 2010 9:11 pm
- Location: Steven Point, Wisconsin USA
- Contact:
Re: DCBROWSECOL COLOR lost on highlighted line with Xbase++
I found out about the NIL process from Roger. That appears to cause the normal color to occur.