Get\Action .. disable the field only

Get\Action .. disable the field only

Postby Rick Lipkin » Tue Apr 14, 2020 3:08 pm

To All

I have a Get\action statement that I add a bitmap to that allows me to click on the bitmap ( button magnifying glass ) within the field to fire off the code below. Everything works great but is there a way to disable the field so no one can enter in any data .. I just want the field to be read only .. be able to click the ( active ) button to run my Action routine and fill in the value back into the disabled field ..

Image

In the image above, I want to disable that field but still be able to click the button than send a value back to the disabled field and refresh the results.

Code: Select all  Expand view

REDEFINE GET oBreakC   VAR nBreakC         ID 133 of oGRPS PICTURE "999.99" BITMAP "find";
      ACTION ( _RateSlct( cMode,oFontB,"BUTTON",cInstate,cOutState,1,;
                          @nBreakC,oBreakC,@nLunchC,oLunchC,@nDinnerC,oDinnerC,@nMRate,oMRate),;
                         _Exp(  @nBreak,  @nBreakC,  @nBreakT,oBreakT, ;
                         @nLunch,  @nLunchC,  @nLunchT,  oLunchT, ;
                         @nDinner, @nDinnerC, @nDinnerT, oDinnerT, ;
                         @nTmeals, oTmeals,   @nTotalExp,oTotalExp,;
                         @nTHotel, @nTMileage,@nTRegist, @nTAirFare,;
                         @nTMisc,  @nNights,  @nHcost,   oTHotel,;
                         @nMiles,  @nMrate, oTmileage,;
                         oLunch:SetFocus(),oLunch:oJump := oLunch ) ) UPDATE
       oBreakC:lAdjustBtn := .t.
 


Thanks
Rick Lipkin
User avatar
Rick Lipkin
 
Posts: 2663
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Get\Action .. disable the field only

Postby MOISES » Tue Apr 14, 2020 4:13 pm

Maybe you can set its lenght to 0?
Saludos / Regards,

FWH 20.04, Harbour 3.2.0 dev (r1909261630) y BCC 7.40
MOISES
 
Posts: 838
Joined: Wed Aug 22, 2007 10:09 am

Re: Get\Action .. disable the field only

Postby Natter » Tue Apr 14, 2020 4:29 pm

oGet:bGotFocus:={||oGet:aControls[1]:SetFocus()}
Natter
 
Posts: 1203
Joined: Mon May 14, 2007 9:49 am

Re: Get\Action .. disable the field only

Postby nageswaragunupudi » Tue Apr 14, 2020 5:09 pm

Make the Get READONLY.
In that case, the user can not enter any text in the Get, but can click the button.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Get\Action .. disable the field only

Postby Rick Lipkin » Tue Apr 14, 2020 5:10 pm

Gentleman

I found the answer ... and yes Rao .. you were correct !!!!!

Code: Select all  Expand view

REDEFINE GET oBreakC   VAR nBreakC         ID 133 of oGRPS PICTURE "999.99" BITMAP "find";
      ACTION ( _RateSlct( cMode,oFontB,"BUTTON",cInstate,cOutState,1,;
                          @nBreakC,oBreakC,@nLunchC,oLunchC,@nDinnerC,oDinnerC,@nMRate,oMRate),;
                         _Exp(  @nBreak,  @nBreakC,  @nBreakT,oBreakT, ;
                         @nLunch,  @nLunchC,  @nLunchT,  oLunchT, ;
                         @nDinner, @nDinnerC, @nDinnerT, oDinnerT, ;
                         @nTmeals, oTmeals,   @nTotalExp,oTotalExp,;
                         @nTHotel, @nTMileage,@nTRegist, @nTAirFare,;
                         @nTMisc,  @nNights,  @nHcost,   oTHotel,;
                         @nMiles,  @nMrate, oTmileage,;
                         oLunch:SetFocus(),oLunch:oJump := oLunch ) ) COLOR CLR_BLACK, 16053492 READONLY
 


Adding the Readonly clause will disable the field and the button still works and returns the correct value to the readonly field

Image

Thanks
Rick Lipkin
User avatar
Rick Lipkin
 
Posts: 2663
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 39 guests