GET which twice Function

GET which twice Function

Postby Jimmy » Wed Apr 12, 2023 2:26 pm

hi,

i have a GET to "show" RECNO()
Code: Select all  Expand view  RUN
  0, 672 GET oGet VAR nVar PICTURE "999999" SIZE 96, 48 PIXEL RIGHT OF oBar ;
            FONT oFontDefault ;
            COLOR BFcolor, BGcolor ;
            VALID (.T.)

   oBrwDBF:bChange := { || SayStatusDBF(oBrwDBF,oGet,@nVar) }

now i like to use "same" GET to "input" Number and press "ENTER" for "GOTO" ... how ... need Idea :idea:

---

when "navigate" in XBROWSE Codeblock bChange will call PROCEDURE to "assign" RECNO()
when "input" a Number i want to press "ENTER" for "GOTO"

how can i find out if "ENTER" was press :?:
Code: Select all  Expand view  RUN
           VALID ( IF(IsPressENTER(),Do_Goto(nVar),NIL), .T. )
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1732
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: GET which twice Function

Postby cmsoft » Wed Apr 12, 2023 4:35 pm

Code: Select all  Expand view  RUN
@ 0, 672 GET    oGet VAR nVar PICTURE "999999" SIZE 96, 48 PIXEL RIGHT OF oBar;
            FONT oFontDefault ;
            COLOR BFcolor, BGcolor ;
        ACTION oBrwDBF:Goto(oGet:Value) BITMAP "BUSC1"  

Algo asi?
User avatar
cmsoft
 
Posts: 1291
Joined: Wed Nov 16, 2005 9:14 pm
Location: Mercedes - Bs As. Argentina

Re: GET which twice Function

Postby Jimmy » Wed Apr 12, 2023 5:24 pm

hi,

you are right, just call Function in VALID

Code: Select all  Expand view  RUN
   VALID ( CheckRecno( oBrwDBF, oGet, nVar ), .t. )

STATIC PROCEDURE CheckRecno( oBrwDBF, oGet, nVar )
   IF nVar <> RECNO()
      GOTO( nVar )
      oBrwDBF:refresh()
      oBrwDBF:SetFocus()
   ENDIF
RETURN

i was confuse by

Code: Select all  Expand view  RUN
    oBrwDBF:bChange := { || SayStatusDBF( oBrwDBF, oGet, @nVar ) }

STATIC PROCEDURE SayStatusDBF( oBrwDBF, oGet, nVar )
   // per Refernce
   nVar := RECNO()

   IF DELETED()
      oGet:SetColor( CLR_WHITE, CLR_RED )
   ELSE
      oGet:SetColor( BFcolor, BGcolor )
   ENDIF

   oGet:refresh()
RETURN
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1732
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 61 guests