home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 16 / CD_ASCQ_16_0994.iso / news / 4611 / fw16d.ins / SOURCE / FUNCTION / MDIREC.PRG < prev    next >
Text File  |  1994-05-14  |  1KB  |  40 lines

  1. // Generic MDI Record Editing Window - like 'good old days' dBase EDIT !!!
  2.  
  3. #include "FiveWin.ch"
  4.  
  5. //----------------------------------------------------------------------------//
  6.  
  7. function MDIRecEdit( cTitle, oIcon, nTop, nLeft, nBottom, nRight )
  8.  
  9.    local oWnd, oBrw
  10.    local cAlias := Alias()
  11.    local nField := 1
  12.  
  13.    DEFAULT nTop := 1, nLeft := 43, nBottom := 22, nRight := 79,;
  14.            cTitle := "Record Edit"
  15.  
  16.    DEFINE WINDOW oWnd FROM nTop, nLeft TO nBottom, nRight ;
  17.       TITLE cTitle MDICHILD ;
  18.       ICON oIcon
  19.  
  20.    @ 2, 0 LISTBOX oBrw ;
  21.       FIELDS ( cAlias )->( Field( nField ) ),;
  22.              ( cAlias )->( cValToChar( FieldGet( nField ) ) ) ;
  23.       HEADERS "Field", "Value" ;
  24.       SIZES 95, 400
  25.  
  26.    oBrw:bLogicLen = { || ( cAlias )->( FCount() ) }
  27.    oBrw:bGoTop    = { || nField := 1 }
  28.    oBrw:bGoBottom = { || nField := ( cAlias )->( FCount() ) }
  29.    oBrw:bSkip     = { | nSkip, nOld | nOld := nField, nField += nSkip,;
  30.                   nField := Min( Max( nField, 1 ), ( cAlias )->( FCount() ) ),;
  31.                   nField - nOld }
  32.  
  33.    oWnd:SetControl( oBrw )
  34.  
  35.    ACTIVATE WINDOW oWnd
  36.  
  37. return oWnd
  38.  
  39. //----------------------------------------------------------------------------//
  40.