A problem with function ChooseColor() ?

A problem with function ChooseColor() ?

Postby ukoenig » Sat Feb 06, 2016 1: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 ?

Image

added a alert to the color-selection

Image

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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: A problem with function ChooseColor() ?

Postby Antonio Linares » Sat Feb 06, 2016 8: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42076
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: A problem with function ChooseColor() ?

Postby ukoenig » 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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 75 guests