Page 1 of 1

Hi-Lite get fields like the old Dos days

Posted: Thu Mar 12, 2020 9:39 pm
by Rick Lipkin
To All

Let me ask this question another way ... remember in the old dos days .. when you tabbed or hit enter to go to the next get .. the field get would turn another color ( yellow perhaps ) .. is there a global setting ( or code ) that will turn the get field a different color when the field is in focus ... I have a complex form with lots of gets .. it is very difficult to see the cursor when it moves from field to field .. I just need a way to turn the field get to a hi-lited color .. that would help the users to know where they are in the form.

Thanks
Rick Lipkin

Re: Hi-Lite get fields like the old Dos days

Posted: Fri Mar 13, 2020 2:57 am
by hua
Maybe

Code: Select all

TGet():nClrFocus := 16577214
TGet():lClrFocus := .t.
 

Re: Hi-Lite get fields like the old Dos days

Posted: Fri Mar 13, 2020 8:27 am
by nageswaragunupudi
Simpler

Code: Select all

SetGetColorFocus()
 

Re: Hi-Lite get fields like the old Dos days

Posted: Sun Mar 15, 2020 5:13 pm
by Rick Lipkin
Rao

SetGetColorFocus() .. 2 questions

1) do you have a short example ??
2) I would prefer to use this function when and where I need it .. and not be a global setting ..

Thanks
Rick Lipkin

Re: Hi-Lite get fields like the old Dos days

Posted: Sun Mar 15, 2020 6:46 pm
by MOISES
Rick,

It is a global setting to be called at the beginining of main()

Re: Hi-Lite get fields like the old Dos days

Posted: Mon Mar 16, 2020 1:00 am
by horacio
Hello, if you want to customize

Code: Select all

oGet : bGotFocus := { || oGet : SetColor( 0, CLR_GRAY ) }
oGet : bLostFocus := { || oGet : SetColor( 0, CLR_WHITE ) }
 
Saludos

Re: Hi-Lite get fields like the old Dos days

Posted: Mon Mar 16, 2020 4:54 am
by nageswaragunupudi
Rick Lipkin wrote:Rao

SetGetColorFocus() .. 2 questions

1) do you have a short example ??
2) I would prefer to use this function when and where I need it .. and not be a global setting ..

Thanks
Rick Lipkin
1) Just put it in one of your applications and see the difference.

2)
Syntax:

Code: Select all

SetGetColorFocus( [nClr] )
 
You can also use it as a Global setting or keep changing / toggling it wherever you want in your program.
All Gets created after this setting and before you change the setting use this color for focused gets.

Code: Select all

SetGetColorFocus( CLR_WHITE )
 
Restores normal behavior.