home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Visual Database / Visual dBase Pro v7.0 / DATA1.CAB / Sample_dBASE / Fleet / Repview.pop < prev    next >
Encoding:
Text File  |  1997-11-20  |  3.0 KB  |  114 lines

  1. ** END HEADER -- do not remove this line
  2. //
  3. // Generated on 09/25/97
  4. //
  5. parameter formObj, popupName
  6. new repviewPOPUP(formObj, popupName)
  7.  
  8. class repviewPOPUP(formObj, popupName) of POPUP(formObj, popupName)
  9.    with (this)
  10.       onInitMenu = class::popOnInitMenu
  11.       left = 0
  12.       top = 0
  13.       trackRight = true
  14.    endwith
  15.  
  16.  
  17.    this.MENUTOP = new MENU(this)
  18.    with (this.MENUTOP)
  19.       onClick = class::MENUTOP_ONCLICK
  20.       text = "Top Page"
  21.    endwith
  22.  
  23.  
  24.    this.MENUPREV = new MENU(this)
  25.    with (this.MENUPREV)
  26.       onClick = class::MENUPREV_ONCLICK
  27.       text = "Previous Page"
  28.    endwith
  29.  
  30.  
  31.    this.MENUNEXT = new MENU(this)
  32.    with (this.MENUNEXT)
  33.       onClick = class::MENUNEXT_ONCLICK
  34.       text = "Next Page"
  35.    endwith
  36.  
  37.  
  38.    this.MENUSEP1 = new MENU(this)
  39.    with (this.MENUSEP1)
  40.       text = ""
  41.       separator = true
  42.    endwith
  43.  
  44.  
  45.    this.MENUPRINT = new MENU(this)
  46.    with (this.MENUPRINT)
  47.       onClick = class::MENUPRINT_ONCLICK
  48.       text = "Print..."
  49.    endwith
  50.  
  51.    function MENUTOP_onClick
  52.       this.parent.parent.repView.filename := ;
  53.         this.parent.parent.repView.filename
  54.       with ( this.parent.parent.repView.ref )
  55.          startPage := 1
  56.          endPage   := 1
  57.       endwith      
  58.    return ( this.parent.parent.repView.ref.render() )
  59.  
  60.    function MENUPREV_onClick
  61.       local nPage, rView
  62.       rView = this.parent.parent.repView
  63.       nPage = rView.ref.startPage
  64.       nPage--
  65.       rView.filename := rView.filename
  66.       rView.ref.startPage := nPage
  67.       rView.ref.endPage   := nPage
  68.    return ( rView.ref.render() )
  69.  
  70.  
  71.       with ( this.parent.parent.repView.ref )
  72.          startPage--
  73.          endPage := this.parent.parent.repView.ref.startPage
  74.       endwith      
  75.    return ( this.parent.parent.repView.ref.render() )
  76.  
  77.    function MENUNEXT_onClick
  78.       with ( this.parent.parent.repView.ref )
  79.          startPage++
  80.          endPage := this.parent.parent.repView.ref.startPage
  81.       endwith      
  82.    return ( this.parent.parent.repView.ref.render() )
  83.  
  84.    function MENUPRINT_onClick
  85.       local bPrint
  86.       bPrint = CHOOSEPRINTER()
  87.       if ( bPrint )
  88.          this.parent.parent.repView.ref.output := 1 // printer
  89.          this.parent.report.repView.ref.render()
  90.          this.parent.report.repView.ref.output := 3 // default
  91.       endif
  92.    return ( bPrint )
  93.  
  94.    function popOnInitMenu
  95.       local bRepFound
  96.       bRepFound = ( TYPE("this.parent.repView.ref.startPage") == "N" )
  97.       if ( bRepFound )
  98.          with ( this )
  99.             menuPrint.enabled := true
  100.             menuNext.enabled  := ( not this.parent.repView.ref.isLastPage() )
  101.             menuTop.enabled   := ( this.parent.repView.ref.startPage > 1 )
  102.             menuPrev.enabled  := ( this.parent.repView.ref.startPage > 1 )
  103.          endwith
  104.       else
  105.          with ( this )
  106.             menuPrint.enabled := false
  107.             menuNext.enabled  := false
  108.             menuTop.enabled   := false
  109.             menuPrev.enabled  := false
  110.          endwith
  111.       endif
  112.    return ( bRepFound )
  113. endclass
  114.