FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour A problem with function ChooseColor() ?
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
A problem with function ChooseColor() ?
Posted: Sat Feb 06, 2016 01:24 PM
Hello,

I noticed a problem with < ChooseColor() >
restoring the old color, doesn't seems to work
a BREAK returns always 0 ( black )
Also tested changing the color BEFORE the break but still black
Return NIL would be ok, because 0 is a color as well can be selected.

tested as well with sample < LINES.prg >

STATIC PROCEDURE NewColor()
LOCAL OldColor := nColor
if ( nColor := ChooseColor() ) == -1 // NO result
// MsgAlert( nColor ) = returns always 0 !!!
nColor := OldColor
endif


any idea how to keep the old color ?



added a alert to the color-selection



best regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: A problem with function ChooseColor() ?
Posted: Sat Feb 06, 2016 08:30 PM
Uwe,

FWH function ChooseColor() supports two optional parameters:

http://wiki.fivetechsoft.com/doku.php?id=fivewin_function_choosecolor

As the first parameter you may provide it the "oldColor" and that value will be returned
when the user press cancel
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: A problem with function ChooseColor() ?
Posted: Mon Feb 08, 2016 11:11 AM

Antonio,

thank You very much for the info.
With included parameters in < ChooseColor() > it works fine now.
flag = 1 opens a small and flag = 2 opens a full color-selection.

best regards
Uwe :D

Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.

Continue the discussion