Page 1 of 1

Changing color from say

Posted: Tue Oct 03, 2006 7:55 am
by Frank Demont
Hello,

I try to change the text color from a say object with :

oSay:Setcolor(CLR_HRED) ; oSay:refresh()

But , it doesn't work.

I Tryed it also in testsay2.prg , no succes

Code: Select all

// A sample showing to to let a SAY accept Clicks events

#include "FiveWin.ch"

function Main()

   local oDlg, oSay, oCursor

   DEFINE CURSOR oCursor HAND

   DEFINE DIALOG oDlg

   @ 2, 2 SAY oSay PROMPT "Test"

   oSay:lWantClick = .t.
   oSay:bLClicked  = { || oSay:SetColor(CLR_HRED) , oSay:refresh() }
   //oSay:bLClicked  = { || MsgInfo( "Hello" ) }
   oSay:oCursor    = oCursor

   ACTIVATE DIALOG oDlg CENTERED

return nil

Frank

Posted: Tue Oct 03, 2006 8:10 am
by Antonio Linares
Frank,

This code works fine:

Code: Select all

#define COLOR_BTNFACE       15
...
   oSay:bLClicked  = { || oSay:SetColor( CLR_WHITE, GetSysColor( COLOR_BTNFACE ) ), oSay:Refresh(), MsgInfo( "Hello" ) }

Posted: Tue Oct 03, 2006 8:43 am
by Frank Demont
Antonio,

Ok , it seems that the background color can't be omitted. I supposed that when it is nil , it has not to change. Now i have to know what this color is or ,

oSay:SetColor( CLR_HRED , osay:nClrPane )

Frank