home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Database / CLIPR503.W96 / MEMOSYS.PR_ / MEMOSYS.PR
Text File  |  1995-06-20  |  3KB  |  101 lines

  1. /*****************************************************************************
  2. *
  3. *  Memosys.prg
  4. *
  5. *  Standard Clipper 5.3 memo Subsystem
  6. *
  7. *  Copyright (c) 1991-1993, Computer Associates International, Inc.
  8. *  All rights reserved.
  9. *
  10. *  NOTE: compile with /m /n /w
  11. *
  12. */
  13.  
  14. #include "memosys.ch"
  15. #include "box.ch"
  16.  
  17.  
  18. /*  OpenMemo(aInfo, indexEntry, indexSavescr)
  19. * Opens a memo, calls MemoEdit and restores the screen
  20. *
  21. */
  22. FUNCTION OpenMemo(aInfo, indexEntry, indexSavescr, lModify)
  23.  
  24.       DrawMemoArea(aInfo, indexSavescr)
  25.       EditMemo(aInfo, indexEntry, indexSavescr, lModify)
  26.       RestoreMemoArea(aInfo, indexSavescr)
  27.  
  28.    RETURN .T.
  29.  
  30.  
  31. /*  EditMemo(aInfo, indexEntry, indexSavescr, lModify)
  32. * Edits a memo
  33. *
  34. */
  35. FUNCTION EditMemo(aInfo, indexEntry, indexSavescr, lModify)
  36.  
  37.       IF (aInfo[indexSavescr][MEMO__FRAME] == .T.)
  38.          aInfo[indexEntry] := MemoEdit(aInfo[indexEntry],                   ;
  39.                                        aInfo[indexSavescr][MEMO__TOP]+1,    ;
  40.                                        aInfo[indexSavescr][MEMO__LEFT]+1,   ;
  41.                                        aInfo[indexSavescr][MEMO__BOTTOM]-1, ;
  42.                                        aInfo[indexSavescr][MEMO__RIGHT]-1,  ;
  43.                                        lModify)
  44.       ELSE
  45.          aInfo[indexEntry] := MemoEdit(aInfo[indexEntry],                 ;
  46.                                        aInfo[indexSavescr][MEMO__TOP],    ;
  47.                                        aInfo[indexSavescr][MEMO__LEFT],   ;
  48.                                        aInfo[indexSavescr][MEMO__BOTTOM], ;
  49.                                        aInfo[indexSavescr][MEMO__RIGHT],  ;
  50.                                        lModify)
  51.       ENDIF
  52.  
  53.    RETURN .T.
  54.  
  55.  
  56. /*  DrawMemoArea(aInfo, indexSavescr)
  57. * Save, clear and frame entry window for future MemoEdit call
  58. *
  59. */
  60. FUNCTION DrawMemoArea(aInfo, indexSavescr)
  61.    local top, left, bottom, right
  62.  
  63.       top    := aInfo[indexSavescr][MEMO__TOP]
  64.       left   := aInfo[indexSavescr][MEMO__LEFT]
  65.       bottom := aInfo[indexSavescr][MEMO__BOTTOM]
  66.       right  := aInfo[indexSavescr][MEMO__RIGHT]
  67.  
  68.       aInfo[indexSavescr][MEMO__SAVESCR] := SaveScreen(top, left, bottom, right)
  69.       Scroll(top, left, bottom, right, 0)
  70.       IF (aInfo[indexSavescr][MEMO__FRAME] == .T.)
  71.          @ top, left, bottom, right BOX B_SINGLE
  72.       ENDIF
  73.  
  74.    RETURN .T.
  75.  
  76.  
  77. /*  RestoreMemoArea(aInfo,indexSavescr)
  78. * Restores the screen area covered by a memo
  79. *
  80. */
  81. FUNCTION RestoreMemoArea(aInfo, indexSavescr)
  82.  
  83.       RestScreen(aInfo[indexSavescr][MEMO__TOP],    ;
  84.                  aInfo[indexSavescr][MEMO__LEFT],   ;
  85.                  aInfo[indexSavescr][MEMO__BOTTOM], ;
  86.                  aInfo[indexSavescr][MEMO__RIGHT],  ;
  87.                  aInfo[indexSavescr][MEMO__SAVESCR] )
  88.  
  89.    RETURN .T.
  90.  
  91.  
  92. /*  CloseMemo()
  93. * manages the VALID clause for the memo entry fields
  94. *
  95. */
  96. FUNCTION CloseMemo()
  97.  
  98.    RETURN .T.
  99.  
  100.  
  101.