home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1993 #2 / Image.iso / clipper / cuaclip.zip / CUACLIP.CH < prev    next >
Text File  |  1993-06-01  |  12KB  |  289 lines

  1. /*
  2. Copyright(C) Delcom-Deltranik International Software Engineering 1990-1993.
  3.  
  4. $owner: BILLW$
  5.  
  6. $version: 1.14$ $date: February 24, 1993$ $time: 03:20:09 PM$
  7.  
  8. $lgb$
  9. 1.0 October 22, 1992 BILLW
  10. 1.1 October 22, 1992 BILLW
  11. 1.2 October 23, 1992 BILLW
  12. 1.3 October 23, 1992 BILLW
  13. 1.4 October 30, 1992 BILLW
  14. 1.5 November 13, 1992 BILLW
  15. 1.6 December 3, 1992 BILLW
  16. 1.7 December 3, 1992 BILLW
  17. 1.8 December 3, 1992 BILLW
  18. 1.9 December 3, 1992 BILLW
  19. 1.10 December 23, 1992 BILLW
  20. 1.11 December 23, 1992 BILLW
  21. 1.12 February 12, 1993 BILLW
  22. 1.13 February 19, 1993 BILLW
  23. 1.14 February 24, 1993 BILLW
  24. $lge$
  25. */
  26.  
  27. #DEFINE VERSION "Version: $release: relsub1$"
  28.  
  29. /* $nokeywords$ */
  30.  
  31. #DEFINE R_RELEASE    "Release: 1.0"
  32.  
  33. #DEFINE GE_VALID         9     // flush and exit with validation
  34. #DEFINE GE_RIGHT         10
  35. #DEFINE GE_LEFT          11
  36.  
  37. #DEFINE B_NCURRENT    1
  38. #DEFINE B_NLISTSIZE   2
  39. #DEFINE B_LHORIZONTAL 3
  40. #DEFINE B_LHOTKEYS    4
  41. #DEFINE B_LINDEXED    5
  42. #DEFINE B_NNEWROWPOS  6
  43. #DEFINE B_NOLDROW     7
  44. #DEFINE B_NOLDCOL     8
  45. #DEFINE B_NOLDCURRENT 9
  46. #DEFINE B_NTOP        10
  47. #DEFINE B_NLEFT       11
  48. #DEFINE B_NBOTTOM     12
  49. #DEFINE B_NRIGHT      13
  50. #DEFINE B_XSEEKVAL    14
  51. #DEFINE B_BEMPTY      15
  52. #DEFINE B_LMORE       16
  53. #DEFINE B_BCONDITION  17
  54. #DEFINE B_LALLLINE    18
  55. #DEFINE B_AKEYS       19
  56. #DEFINE B_LMENU       20
  57. #DEFINE B_PROMPTLIST  21
  58. #DEFINE B_PROMPTPOS   22
  59. #DEFINE B_ACBLOCKS    23
  60. #DEFINE B_BCUSTOMHIGH 24
  61. #DEFINE B_XBOTTOMVAL  25
  62. #DEFINE B_BTHEBROWSE  26
  63. #DEFINE B_LINDATA     27
  64. #DEFINE B_AARRAY      28
  65. #DEFINE B_NBTYPE      29
  66. #DEFINE B_BEVENT      30
  67. #DEFINE B_LVERTMOVE   31
  68.  
  69. #DEFINE GR_NAME             1
  70. #DEFINE GR_MESSAGE        2
  71. #DEFINE GR_ORIGINAL        3
  72. #DEFINE GR_COLORS            4
  73. #DEFINE GR_WITH            5
  74. #DEFINE GR_HIDDEN            6
  75. #DEFINE GR_ORIGIN            7
  76. #DEFINE GR_AREA         8
  77. #DEFINE GR_LIST            9
  78. #DEFINE GR_EXPAND            10
  79.  
  80. #DEFINE LB_HASFOCUS    10
  81. #DEFINE LB_MAXROW      11
  82. #DEFINE LB_MAXCOL      12
  83. #DEFINE LB_BROWSE      13
  84. #DEFINE LB_COLORS      14
  85. #DEFINE LB_ELEMENT     15
  86. #DEFINE LB_POSITION    16
  87.  
  88. #DEFINE FALSE                .F.
  89. #DEFINE TRUE                .T.
  90.  
  91. #DEFINE C_AVAILABLE        1
  92. #DEFINE C_INFOCUS            2
  93. #DEFINE C_UNAVAILABLE    3
  94.  
  95. #DEFINE L_FILENAME        1
  96. #DEFINE L_INDEX            2
  97. #DEFINE L_SEEK_EXP        3
  98. #DEFINE L_RETURN_EXP        4
  99. #DEFINE L_DISPLAY_EXP    5
  100. #DEFINE L_DATA_EXP       6
  101.  
  102. #DEFINE R_BUTTON             CHR(9)
  103. #DEFINE R_CHECK             CHR(251)
  104.  
  105. #DEFINE R_VALUE            1
  106. #DEFINE R_PROMPT            2
  107. #DEFINE R_ROW                3
  108. #DEFINE R_COL                4
  109.  
  110.  
  111. #DEFINE K_UNDO          K_CTRL_U
  112.  
  113. #DEFINE M_LEFT_BUTTON    -48
  114. #DEFINE M_RIGHT_BUTTON    -49
  115. #DEFINE M_MIDDLE_BUTTON    -50
  116. #DEFINE M_DOUBLE_CLICK    -51
  117.  
  118. #COMMAND QUIT => SetMouse(0) ; ClearMouse() ; 
  119.                  ; SETMODE( MAXROW() + 1, MAXCOL() + 1 ) ; __Quit()
  120.  
  121. #COMMAND DEFAULT <var> TO <value> => <var> := IIF(<var> == NIL, <value>, <var>)
  122. #COMMAND DEFAULT <var> TO <value> FROM <default> ;
  123.          => <var> := IIF(<default> == NIL, <value>, <default> )
  124.  
  125. ***
  126. *  READ
  127. *
  128.  
  129. #COMMAND READ <nExp>                                                    ;
  130.       => ReadModal(GetList,<nExp>)                                      ;
  131.        ; GetList := {}
  132.  
  133. #COMMAND READ SAVE                                                      ;
  134.       => ReadModal(GetList)
  135.  
  136. #COMMAND READ SAVE [<nExp>]                                                     ;
  137.       => ReadModal(GetList,[<nExp>])
  138.  
  139. #COMMAND @ <row>, <col> GET <var>                                       ;
  140.                         [USING <reader>]                                ;
  141.                         [VALID <valid>]                                 ;
  142.                         [WHEN <when>]                                   ;
  143.                         [<hide: HIDDEN>]                                ;
  144.                         [COLOR <color>]                                 ;
  145.                         [MASTERVAR <origin>]                            ;
  146.                         [MASTERAREA <dbf>]                              ;
  147.                         [LIST <list>]                                   ;
  148.                         [DBLIST <dblist>]                               ;
  149.                         [USERLIST <userlist>]                           ;
  150.                         [PICTURE <picture>]                             ;
  151.                         [MESSAGE <saymsg>]                              ;
  152.                         [WITH <with>]                                   ;
  153.                         [SEND <msg>]                                    ;
  154.                                                                         ;
  155.       => AAdd(                                                          ;
  156.                GetList,                                                 ;
  157.                __GET_( <row>, <col>,                                    ;
  158.                       { |x| iif( x == NIL, <var>, <var> := x ) },       ;
  159.                       <(var)>, <"reader">, <{valid}>, <{when}>,         ;
  160.                       <.hide.>, <color>, <{origin}>, <"dbf">, <list>,   ;
  161.                       <dblist>, <userlist>, <picture>, <saymsg>, <with> ;
  162.                             )                                                  ;
  163.              )                                                          ;
  164.       [; ATail(GetList):<msg>]                                          ;
  165.       [; ATail(GetList):Reader := { |get,x,y| <reader>(get,x,y) }]      ;
  166.       [; <reader>(ATail(GetList),.T.)]
  167.  
  168.  
  169. #COMMAND @ <row>, <col> BUTTON <button>                                 ;
  170.                         [MESSAGE <saymsg>]                              ;
  171.                         [COLOR <color>]                                 ;
  172.                         [ACTION <act>]                                  ;
  173.                         [WHEN <when>]                                   ;
  174.                         [<hide: HIDDEN>]                                ;
  175.                                                                         ;
  176.       => AADD( GetList,                                                 ;
  177.                __GET_( <row>, <col>, <{button}>, <button>, "BUTTON",    ;
  178.                      <{act}>, <{when}>, <.hide.>, <color>,,,,,,,<saymsg>);
  179.              )                                                          ;
  180.            ; ATail(GetList):Reader := { |get,x| Button(get,x) }           ;
  181.            ; Button(ATail(GetList),.T.)
  182.  
  183.  
  184. #COMMAND @ <row>, <col> LISTBOX <var>                                   ;
  185.                                 TO <maxrow>,<maxcol>                            ;
  186.                                 WITH <list>                                     ;
  187.                                 [MESSAGE <saymsg>]                              ;
  188.                                 [MASTERVAR <origin>]                            ;
  189.                                 [MASTERAREA <dbf>]                              ;
  190.                                 [COLOR <color>]                                 ;
  191.                                 [ACTION <act>]                                  ;
  192.                                 [WHEN <when>]                                   ;
  193.                                                                                                 ;
  194.         => AADD( GetList,                                                 ;
  195.                     __GET_( <row>, <col>,                                    ;
  196.                             { |x| iif( x == NIL, <var>, <var> := x ) },        ;
  197.                             <(var)>, "LISTBOX", <{act}>, <{when}>, .F.,        ;
  198.                             ,,<{origin}>, <"dbf">,,,,<saymsg>, <list> )        ;
  199.                  )                                                          ;
  200.             ; ATail(GetList):reader := { |get,x| ListBox( get, x ) }       ;
  201.             ; AADD( ATAIL( GetList ):cargo, .F. )                          ;
  202.             ; AADD( ATAIL( GetList ):cargo, <maxrow> )                     ;
  203.             ; AADD( ATAIL( GetList ):cargo, <maxcol> )                     ;
  204.             ; AADD( ATAIL( GetList ):cargo, NIL )                          ;
  205.             ; AADD( ATAIL( GetList ):cargo, <color> )                      ;
  206.             ; AADD( ATAIL( GetList ):cargo, 1 )                            ;
  207.             ; AADD( ATAIL( GetList ):cargo, 1 )                            ;
  208.             ; ListBox( ATail(GetList), .T. )
  209.  
  210.  
  211. ***
  212. *  MENU TO / PROMPT
  213. *
  214.  
  215. #COMMAND MENU TO <v> USING <x> [WITH <w>] [<force: FORCE>]              ;
  216.       => <v> := PromptModal( PromptList, <x>, <w>, <.force.> )          ;
  217.            ; PromptList := {}
  218.  
  219. #COMMAND MENU TO <v> SAVE USING <x> [WITH <w>] [<force: FORCE>]         ;
  220.       => <v> := PromptModal( PromptList, <x>, <w>, <.force.> )
  221.  
  222. #COMMAND MENU TO <v> [WITH <w>] [<force: FORCE>]                        ;
  223.       => <v> := PromptModal( PromptList, <v>, <w>, <.force.> )          ;
  224.            ; PromptList := {}
  225.  
  226. #COMMAND MENU TO <v> SAVE [WITH <w>] [<force: FORCE>]                   ;
  227.       => <v> := PromptModal( PromptList, <v>, <w>, <.force.> )
  228.  
  229.  
  230. #COMMAND @ <row>, <col> PROMPT <prompt>                                 ;
  231.                         [MESSAGE <msg>]                                 ;
  232.                         [ACTION <act>]                                  ;
  233.                         [PULLDOWN <pd>]                                 ;
  234.                         [WHEN <wen>]                                    ;
  235.                                                                         ;
  236.       => AADD( PromptList, GetNew( <row>, <col>, , , ,))                ;
  237.              ;Atail(PromptList):cargo := {"",0,0,""}                    ;
  238.              [;Atail(PromptList):cargo := {<msg>,0,0,""}]               ;
  239.              ;_SetPrompt( Atail(PromptList), <prompt> )                 ;
  240.              ;Atail(PromptList):colorSpec := SetMenuColor(TRUE)         ;
  241.              [;Atail(PromptList):postBlock := <{act}>]                  ;
  242.              [;Atail(PromptList):postBlock := <pd>]                     ;
  243.              [;Atail(PromptList):preBlock := <{wen}>                    ;
  244.              ;Atail(PromptList):colorSpec:=SetMenuColor(<wen>)]         ;
  245.              ;PromptDisp( Atail(PromptList) )
  246.  
  247. ***
  248. *  Clear screen
  249. *
  250.  
  251. #command CLS                                                            ;
  252.       => MScroll()                                                       ;
  253.        ; SetPos(0,0)
  254.  
  255. #command @ <row>, <col>                                                 ;
  256.       => MScroll( <row>, <col>, <row> )                                  ;
  257.        ; SetPos( <row>, <col> )
  258.  
  259. #command @ <top>, <left> CLEAR                                          ;
  260.       => MScroll( <top>, <left> )                                        ;
  261.        ; SetPos( <top>, <left> )
  262.  
  263.  
  264. #command @ <top>, <left> CLEAR TO <bottom>, <right>                     ;
  265.       => MScroll( <top>, <left>, <bottom>, <right> )                     ;
  266.        ; SetPos( <top>, <left> )
  267.  
  268.  
  269. #command NETUSE <(db)>                                                     ;
  270.              [VIA <rdd>]                                                ;
  271.              [ALIAS <a>]                                                ;
  272.              [<new: NEW>]                                               ;
  273.              [<ex: EXCLUSIVE>]                                          ;
  274.              [<sh: SHARED>]                                             ;
  275.              [<ro: READONLY>]                                           ;
  276.              [INDEX <(index1)> [, <(indexn)>]]                          ;
  277.                                                                         ;
  278.       => IF dbNetUse(                                                   ;
  279.                     <.new.>, <rdd>, <(db)>, <(a)>,                      ;
  280.                     if(<.sh.> .or. <.ex.>, !<.ex.>, NIL), <.ro.>        ;
  281.                   )                                                     ;
  282.       [; dbSetIndex( <(index1)> ) ]                                     ;
  283.       [; dbSetIndex( <(indexn)> ) ]                                     ;
  284.          ; ELSE ; BREAK( <(db)> ) ; ENDIF
  285.  
  286.  
  287.  
  288.  
  289.