This is my REDEFINE command. I try many time with :Refresh() at ON DBLCLICK, after edit the record and save the record will scroll up 1 line. If I remove :Refresh() and save. The record is refreshing and still the current line.
Code: Select all
REDEFINE XBROWSE oTbw FIELDS TBL->TBL_RMNO, ;
TBL->TBL_RMTY, ;
strim(TBL->TBL_NUMRM,3), ;
strim(TBL->TBL_COVER,3),;
iif(!empty(MSS->MSG_INTNO),hMsgBmp,''), ;
TBL->(RsGstName(TBL->TBL_NAT,25)), ;
GST->GST_GSTYPE,;
dtoc(TBL->TBL_ARR),;
dtoc(TBL->TBL_DEP),;
left(TBL->TBL_GROUP,10),;
left(TBL->TBL_COM,14), ;
iif(val(TBL->TBL_SHRNO)>0,hShrBmp,''), ;
iif(TBL->TBL_WAIT='W',hWaiBmp,''), ;
TBL->TBL_RMK, ;
TBL->TBL_ARFLT, ;
TBL->TBL_ARTIME, ;
TBL->TBL_DPFLT, ;
TBL->TBL_DPTIME ;
ALIAS 'TBL' ;
FIELDSIZES 50, 40, 33, 33, 30, 150, 35, 65, 65, 85, 85, 35, 35, 250, 70, 55, 70, 55 ;
JUSTIFY 0,2,2,2,2,0,2,0,0,0,0,2,2,0,2,2,2,2 ;
HEADERS TE('àÅ¢Ëéͧ','Room#'), TE('»À.Ëéͧ','RmTy'), TE('Ëéͧ','Rms'), ;
TE('ᢡ','Gst'), TE('¨´ËÁÒÂ','Msg'), TE('ª×èÍᢡ','Guest name'), TE('ᢡ','Type'), ;
TE('Çѹà¢éÒ','Arrival'), TE('ÇѹÍÍ¡','Departure'), ;
TE('¡ÃØê»','Group'), TE('ºÃÔÉÑ·','Company'), TE('¾Ñ¡ÃèÇÁ#','Share#'), TE('ÃÍ','Wait'), TE('ËÁÒÂà˵Ø','Remarks'), ;
TE('à·ÕèÂÇà¢éÒ','Arr.Flight'), TE('àÇÅÒà¢éÒ','Arr.Time'), ;
TE('à·ÕèÂÇÍÍ¡','Dep.Flight'), TE('àÇÅÒÍÍ¡','Dep.Time') ;
ID 130 ;
OF rDlg ;
ON DBLCLICK (RsvnScr(.F.,,oDbf),oTbw:Refresh(), oTbw:SetFocus())
oTbw:nMarqueeStyle := MARQSTYLE_HIGHLROW
oTbw:nRowDividerStyle:= LINESTYLE_LIGHTGRAY
oTbw:nColDividerStyle:= LINESTYLE_LIGHTGRAY
oTbw:nHeaderHeight := 24
oTbw:nRowHeight := 20
// oTbw:lRecordSelector := .F.
// oTbw:l2007 := .T.
oTbw:bClrStd := {|| { iif( GST->GST_GSTYPE='V' , CLR_HRED , CLR_BLACK ), GetSysColor( 5 ) } }
oTbw:lFooter := .T.
oTbw:aCols[3]:bFooter := { || nTlRms }
oTbw:aCols[3]:lTotal := .t.
oTbw:aCols[4]:bFooter := { || nTlGst }
oTbw:aCols[4]:lTotal := .t.
oTbw:bChange := { || rDlg:aEvalWhen(), rDlg:Update(), ReBtn1(lMainMenu,oBtn) }
oTbw:bKeyChar := { | nKey | ( IIF(nKey = VK_RETURN, RsvnScr(.F.,,oDbf) , )) }
oTbw:bKeyDown := { | nKey | ( IIF(nKey = VK_INSERT, RsvnScr(.T.,,oDbf) , ;
IIF(nKey = VK_DELETE, (CancelRs( oTbw, oDbf ), oTbw:GoTop()) , ) ) , ;
oTbw:SetFocus() ) } // oTbw:Refresh(),
oTbw:bLClicked := { | nRow, nCol, nFlags | if(oTbw:nAt()=12 .and. !empty( TBL->TBL_SHRNO ), ShowShare(), ;
if(oTbw:nAt()=13 .and. TBL->TBL_STATUS='R' .and. UserRights(37,.F.), ( WaitList() ) , ; // , oTbw:Refresh()
) ) }
oTbw:bRClicked := { | nRow, nCol, nFlags | ( oTbw:SetFocus(), oTbw:lButtonDown(nRow,nCol), RsvnMenu( nRow, nCol, rDlg, oTbw, oBtn, oDbf, oComDbf, lGrpOpt ) ) }
oTbw:aCols[5]:AddResource("MSG")
oTbw:aCols[5]:bBmpData := { || iif(!empty(MSS->MSG_INTNO) , 1, 0) }
oTbw:aCols[5]:nDataBmpAlign := AL_CENTER
oTbw:aCols[12]:AddResource("SHARE")
oTbw:aCols[12]:bBmpData := { || iif(val(TBL->TBL_SHRNO)>0 , 1, 0) }
oTbw:aCols[12]:nDataBmpAlign := AL_CENTER
oTbw:aCols[13]:AddResource("WAIT")
oTbw:aCols[13]:bBmpData := { || iif( TBL->TBL_WAIT='W' , 1, 0) }
oTbw:aCols[13]:nDataBmpAlign := AL_CENTER