Gets Color

Post Reply
Arindam
Posts: 44
Joined: Sat Jul 29, 2006 5:03 pm
Location: Kolkata, India

Gets Color

Post by Arindam »

Hi!,

In Get function while putting pre-condition ( i.e. WHEN ), I am not able to set new color in getbox. I am trying to do the same as follows:

Function AddCust( )

SET _3DLOOK ON
cStat := "ADD"
oDbf:Blank()

DEFINE DIALOG oDlg RESOURCE "Customer" OF oWnd TITLE "ADD CUSTOMER" Color "W/W"

REDEFINE SAY oSay ID 110 OF oDlg Color "W/W+" Font oFont1
REDEFINE SAY oSay ID 120 OF oDlg Color "W/W+" Font oFont1
REDEFINE SAY oSay ID 130 OF oDlg Color "W/W+" Font oFont1

REDEFINE GET oGet Var oDbf:CustNo ID 140 OF oDlg ;
Valid nodupl(oDbf:CustNo, Customer->CustNo, "ADD", , 1 , ;
"Invalid Customer Code:" + CRLF + CRLF + ;
"A Customer with the current Customer No " + ;
"found.") ;
Picture "@!" Color "N/W"

REDEFINE GET oGet Var oDbf:CustName ID 150 OF oDlg ;
Valid ReqData( oDbf:CustName ) ;
Picture "@!" Color "N/W"

REDEFINE GET oGet Var oDbf:CustAdd1 ID 160 OF oDlg ;
When !Empty( oDbf:CustName ) ;
Valid ReqData( oDbf:CustAdd1 ) ;
Picture "@!" Color "N/W"

REDEFINE BUTTON oBtnoK ID 170 OF oDlg ;
ACTION SaveData()

REDEFINE BUTTON oBtnCncl ID 180 OF oDlg ;
ACTION oDLg:End()

ACTIVATE DIALOG oDlg NOMODAL ;
Valid CloseAdd( oRecStat )

Return Nil

NOTE : I am faceing problem to set color in ID 160. Until & unless I entered some data in ID 150, The getbox color of ID 160 remain white.
How can I set the color as I want?

With regard,

Arindam
Carlos G.
Posts: 8
Joined: Mon Oct 10, 2005 2:37 pm
Location: Vallirana

Re: Gets Color

Post by Carlos G. »

Try

REDEFINE GET oGet Var oDbf:CustAdd1 ID 160 OF oDlg ;
When (if(!Empty( oDbf:CustName ), oGet:lReadOnly:= .F.,oGet:lReadOnly:= .T.), .T.) ;
Valid ReqData( oDbf:CustAdd1 ) ;
Picture "@!" Color "N/W"

Saludos
Carlos G.
Arindam
Posts: 44
Joined: Sat Jul 29, 2006 5:03 pm
Location: Kolkata, India

Post by Arindam »

Mr. Carlos,

Thanks for your suggestion. It is ok. But if Pre-condition do not permit, in such cases the getbox color remain same [i.e. White]. In my example if I re-write the ID 150 as follows :

REDEFINE GET oGet Var oDbf:CustName ID 150 OF oDlg ;
When userID = "Prop" ;
Valid ReqData( oDbf:CustName ) ;
Picture "@!" Color "N/W"

If the userID other then the proprietor, may be manager or operator, in that case how can I change the getbox color? It is required as because it is very odd looking. If it is not possible then can I repaint the getbox with any other color like, light gray.

Waiting for your reply.

With regard
Arindam
FiveWiDi
Posts: 910
Joined: Mon Oct 10, 2005 2:38 pm

Gets Color

Post by FiveWiDi »

Try

REDEFINE GET oGet Var oDbf:CustName ID 150 OF oDlg ;
When (If(userID = "Prop", ;
(oGet:lReadOnly := .F., oGet:SetColor( yournClrFore, yournClrBack ) ), ;
(oGet:lReadOnly := .T., oGet:SetColor( yournClrFore, yournClrBack ) ) ;
), ;
.T. ;
) ;
Valid ReqData( oDbf:CustName ) ;
Picture "@!"

Saludos
Carlos G.
Post Reply