home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1993 #2 / Image.iso / text / ncclib.zip / NCCDEMO.ZIP / G_SUMM.PRG < prev    next >
Text File  |  1992-10-21  |  3KB  |  94 lines

  1. //═══════════════════════════════════════════════════════╕
  2. //  Program .....: G_Summ                                │
  3. //  CopyRight ...: 1992 National Computer Consultants    │
  4. //                 All rights are reserved.              │
  5. //  Author ......: Greg Rice                             │
  6. //═══════════════════════════════════════════════════════╛
  7.  
  8. #include "inkey.ch"
  9.  
  10. static func skipper( o, n )
  11.  
  12.    local nActualSkipped := 0, nDirection := if(n>0,1,-1)
  13.  
  14.    if n == 0
  15.      Return 0
  16.    endif
  17.  
  18.    while nActualSkipped # n
  19.      if nDirection == 1
  20.        o:userslot++
  21.        if ! o:While()
  22.          o:userslot--
  23.          exit
  24.        endif
  25.        nActualSkipped++
  26.      else
  27.        o:userSlot--
  28.        if ! o:While()
  29.          o:userslot++
  30.          exit
  31.        endif
  32.        nActualSkipped--
  33.      endif
  34.    enddo
  35.  
  36. Return( nActualSkipped )
  37.  
  38.  
  39.  
  40. Function g_summary()
  41.  
  42.     local xh := setcolor(), nSel := 0, scrn := savescreen(), lscrn, ;
  43.           p, o, i, n := {}, xTop, xBottom
  44.  
  45.  
  46.     setColor( popup_color() )
  47.  
  48.     for i = 1 to len( Windows() )
  49.       aadd( n, str(i,1) + ". " + padr(winFilename(i),30,' ') )
  50.     next
  51.  
  52.  
  53.     xTop := int(((maxrow()/2) - 6 ))
  54.     xBottom := xTop + 14
  55.  
  56.     p := NccViewit():New(xTop,38,xBottom,69)
  57.     p:InverseColor  := p:StandardColor
  58.     p:Statusblock   := { || "" }
  59.     p:userslot      := 1
  60.     p:Datablock     := { || if( Empty( WinIndexfiles(o:CurrentItem)[1] ), "", ;
  61.                             padr( str(p:userslot,1) + ". " + ;
  62.                                   winindexfiles( o:CurrentItem )[p:userslot], ;
  63.                                   p:rightcolumn - p:leftcolumn + 1, " " ;
  64.                                 ) ;
  65.                                ) ;
  66.                        }
  67.     p:GoTopBlock    := { || p:userslot := 1 }
  68.     p:GoBottomBlock := { || p:userslot := len( winindexfiles( o:CurrentItem ) ) }
  69.     p:WhileBlock    := { || p:userslot > 0 .and. p:userslot <= len( winindexfiles( o:CurrentItem ) ) }
  70.     p:SkipBlock     := { |n| Skipper( p, n ) }
  71.  
  72.     nSel := arraydsp( n, ;
  73.                      'Environment Summary', ;
  74.                      'DATABASE FILES          │            INDEX FILES    ' ;
  75.                      ,xTop,04,xBottom,71, ;
  76.                      0, ;
  77.                      0, ;
  78.                      .t., ;
  79.                      , ;
  80.                      { |a| o := a, ;
  81.                            MouseSys():Hide(), ;
  82.                            p:RefreshAll(), ;
  83.                            MouseSys():Show(), ;
  84.                            dView_MouseReader(a,xTop,04,xBottom,71) ;
  85.                      } ;
  86.                     )
  87.  
  88.     restscreen(,,,,scrn)
  89.     setcolor( xh )
  90.  
  91.  
  92. Return( NIL )
  93.  
  94.