//-------------------------------------------------------------- // // RepView.Mnu // // Menu for RepView.Wfm // // Dependencies: RepView.H // VdBase.H // // // dBASE Samples Group // // Copyright (c) 2000, dBASE, Inc. // All rights reserved. // //--------------------------------------------------------------- #include RepView.H #include VdBase.H ** END HEADER -- do not remove this line // // Generated on 02/08/1998 // parameter formObj new RepViewMENU(formObj, "root") class RepViewMENU(formObj, name) of MENUBAR(formObj, name) set proc to program(1) additive this.File = new MENU(this) with (this.File) text = "&File" endwith this.File.Close = new MENU(this.File) with (this.File.Close) text = "&Close" shortCut = "Ctrl+F4" onClick = {;form.close()} endwith this.File.Sep1 = new MENU(this.File) with (this.File.Sep1) text = "" separator = true endwith this.File.Print = new MENU(this.File) with (this.File.Print) text = "&Print..." shortCut = "Ctrl+P" onClick = class::Print_OnClick endwith this.View = new MENU(this) with (this.View) text = "&View" endwith this.View.TopPage = new MENU(this.View) with (this.View.TopPage) text = "T&op Page" shortCut = "Ctrl+Home" onClick = class::TopPage_OnClick endwith this.View.PrevPage = new MENU(this.View) with (this.View.PrevPage) text = "&Previous Page" shortCut = "PgUp" onClick = class::PrevPage_OnClick endwith this.View.NextPage = new MENU(this.View) with (this.View.NextPage) text = "&Next Page" shortCut = "PgDn" onClick = class::NextPage_OnClick endwith this.View.LastPage = new MENU(this.View) with (this.View.LastPage) text = "&Last Page" shortCut = "Ctrl+End" onClick = class::LastPage_OnClick endwith if type("formObj") == "O" and formObj.mdi this.Window = new MENU(this) with (this.Window) text = "&Window" endwith endif this.Help = new MENU(this) with (this.Help) text = "&Help" endwith this.HELP.ABOUT = new MENU(this.HELP) this.Help.About.onClick = {;do About.Wfm with APPNAME_STRING,; VERSION_STRING,; COPYRIGHT_STRING} this.Help.About.text = "&About " + APPNAME_STRING if type("formObj") == "O" and formObj.mdi this.windowMenu = this.Window endif function Print_onClick local bPrint bPrint = form.repView.ref.printer.CHOOSEPRINTER() if ( bPrint ) form.repView.ref.output := 1 // printer form.repView.ref.render() form.repView.ref.output := 3 // default endif return ( bPrint ) function TopPage_onClick form.repView.filename := form.repView.filename store 1 to form.repView.ref.startPage,; form.repView.ref.endPage return ( form.repView.ref.render() ) function PrevPage_onClick local nPage nPage = form.repView.ref.startPage nPage-- form.repView.filename := form.repView.filename form.repView.ref.startPage := nPage form.repView.ref.endPage := nPage return ( form.repView.ref.render() ) function NextPage_onClick form.repView.ref.startPage++ form.repView.ref.endPage := form.repView.ref.startPage form.repView.ref.render() if form.repView.ref.isLastPage() form.LastPage = form.repView.ref.endPage endif function LastPage_onClick if type("form.LastPage") # "N" if ConfirmationMessage("Are you sure? This may take a while with a long report, and you cannot cancel.","Please Confirm") # BUTTON_YES return endif endif local rRep, nPages, fpOnPage rRep = form.repView.ref if type("form.LastPage") # "N" rRep.startPage := 1 rRep.endPage := -1 rRep.outPutFileName := "findlast.prn" rRep.outPut := 2 nPages = 0 fpOnPage = rRep.onPage rRep.onPage := {|| nPages++ } rRep.render() form.LastPage = nPages erase "findlast.prn" rRep.onPage := fpOnPage rRep.outPut := 3 rRep.outPutFileName := "" endif rRep.startPage := form.LastPage rRep.endPage := form.LastPage return rRep.render() endclass