Changing color from say

Post Reply
Frank Demont
Posts: 142
Joined: Sun Oct 09, 2005 10:59 am

Changing color from say

Post 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
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post 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" ) }
regards, saludos

Antonio Linares
www.fivetechsoft.com
Frank Demont
Posts: 142
Joined: Sun Oct 09, 2005 10:59 am

Post 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
Post Reply