home *** CD-ROM | disk | FTP | other *** search
- //--------------------------------------------------------------
- //
- // Mugs.mnu - Mugs Sample Application
- //
- // Menu for all data enty forms and the application frame
- // window. See MUGS.PRG to all instances of attaching this
- // menu to forms and the frame window.
- //
- // Dependencies: MUGS.PRG
- //
- // Visual dBASE Samples Group
- //
- // $Revision: 1.12 $
- //
- // Copyright (c) 1997, Borland International, Inc.
- // All rights reserved.
- //
- //---------------------------------------------------------------
- ** END HEADER -- do not remove this line
- //
- // Generated on 10/18/97
- //
- parameter formObj
- new MugsMENU(formObj, "root")
-
- class MugsMENU(formObj, name) of MENUBAR(formObj, name)
- with (this)
- onInitMenu = class::ROOT_ONINITMENU
- endwith
-
-
- this.MENUFILE = new MENU(this)
- with (this.MENUFILE)
- text = "&File"
- endwith
-
-
- this.MENUFILE.MENUOPEN = new MENU(this.MENUFILE)
- with (this.MENUFILE.MENUOPEN)
- onClick = class::MENUOPEN_ONCLICK
- text = "&Open..."
- shortCut = "Ctrl+O"
- statusMessage = "Open a data entry form"
- endwith
-
-
- this.MENUFILE.MENUCLOSE = new MENU(this.MENUFILE)
- with (this.MENUFILE.MENUCLOSE)
- onClick = class::MENUCLOSE_ONCLICK
- text = "&Close"
- statusMessage = "Close the active window"
- endwith
-
-
- this.MENUFILE.SEPARATOR1 = new MENU(this.MENUFILE)
- with (this.MENUFILE.SEPARATOR1)
- text = ""
- separator = true
- endwith
-
-
- this.MENUFILE.MENUEXIT = new MENU(this.MENUFILE)
- with (this.MENUFILE.MENUEXIT)
- onClick = class::MENUEXIT_ONCLICK
- text = "E&xit"
- statusMessage = "Exit Mugs"
- endwith
-
-
- this.MENUEDIT = new MENU(this)
- with (this.MENUEDIT)
- text = "&Edit"
- endwith
-
-
- this.MENUEDIT.MENUUNDO = new MENU(this.MENUEDIT)
- with (this.MENUEDIT.MENUUNDO)
- text = "&Undo"
- shortCut = "Ctrl+Z"
- endwith
-
-
- this.MENUEDIT.SEPARATOR1 = new MENU(this.MENUEDIT)
- with (this.MENUEDIT.SEPARATOR1)
- text = ""
- separator = true
- endwith
-
-
- this.MENUEDIT.MENUCUT = new MENU(this.MENUEDIT)
- with (this.MENUEDIT.MENUCUT)
- text = "Cu&t"
- shortCut = "Ctrl+X"
- endwith
-
-
- this.MENUEDIT.MENUCOPY = new MENU(this.MENUEDIT)
- with (this.MENUEDIT.MENUCOPY)
- text = "&Copy"
- shortCut = "Ctrl+C"
- endwith
-
-
- this.MENUEDIT.MENUPASTE = new MENU(this.MENUEDIT)
- with (this.MENUEDIT.MENUPASTE)
- text = "&Paste"
- shortCut = "Ctrl+V"
- endwith
-
-
- this.MENUVIEW = new MENU(this)
- with (this.MENUVIEW)
- text = "&View"
- endwith
-
-
- this.MENUVIEW.MENUTOOLBAR = new MENU(this.MENUVIEW)
- with (this.MENUVIEW.MENUTOOLBAR)
- onClick = class::MENUTOOLBAR_ONCLICK
- text = "&Customize Toolbars..."
- statusMessage = "Set the size, hint and flat properties of the toolbar"
- endwith
-
-
- this.MENUVIEW.MENUAPPBAR = new MENU(this.MENUVIEW)
- with (this.MENUVIEW.MENUAPPBAR)
- onClick = class::MENUAPPBAR_ONCLICK
- text = "Application Toolbar"
- checked = true
- endwith
-
-
- this.MENUVIEW.MENUDATABAR = new MENU(this.MENUVIEW)
- with (this.MENUVIEW.MENUDATABAR)
- onClick = class::MENUDATABAR_ONCLICK
- text = "Data Toolbar"
- endwith
-
-
- this.MENUTABLE = new MENU(this)
- with (this.MENUTABLE)
- text = "&Table"
- endwith
-
-
- this.MENUTABLE.MENUAPPEND = new MENU(this.MENUTABLE)
- with (this.MENUTABLE.MENUAPPEND)
- onClick = class::MENUAPPEND_ONCLICK
- text = "&Add Row"
- shortCut = "Ctrl+A"
- endwith
-
-
- this.MENUTABLE.MENUDELETE = new MENU(this.MENUTABLE)
- with (this.MENUTABLE.MENUDELETE)
- onClick = class::MENUDELETE_ONCLICK
- text = "&Delete Current Row..."
- endwith
-
-
- this.MENUTABLE.MENUSAVE = new MENU(this.MENUTABLE)
- with (this.MENUTABLE.MENUSAVE)
- onClick = class::MENUSAVE_ONCLICK
- text = "&Save Row"
- shortCut = "Ctrl+S"
- endwith
-
-
- this.MENUTABLE.MENUABANDON = new MENU(this.MENUTABLE)
- with (this.MENUTABLE.MENUABANDON)
- onClick = class::MENUABANDON_ONCLICK
- text = "A&bandon Row"
- endwith
-
-
- this.MENUTABLE.SEPARATOR1 = new MENU(this.MENUTABLE)
- with (this.MENUTABLE.SEPARATOR1)
- text = ""
- separator = true
- endwith
-
-
- this.MENUTABLE.MENULOCATE = new MENU(this.MENUTABLE)
- with (this.MENUTABLE.MENULOCATE)
- onClick = class::MENULOCATE_ONCLICK
- text = "Locate Row..."
- endwith
-
- this.MENUTABLE.MENUREFRESH = new MENU(this.MENUTABLE)
- with (this.MENUTABLE.MENUREFRESH)
- onClick = class::MENUREFRESH_ONCLICK
- text = "Refresh"
- endwith
-
-
- this.MENUTABLE.SEPARATOR2 = new MENU(this.MENUTABLE)
- with (this.MENUTABLE.SEPARATOR2)
- text = ""
- separator = true
- endwith
-
-
- this.MENUTABLE.MENUPREV = new MENU(this.MENUTABLE)
- with (this.MENUTABLE.MENUPREV)
- onClick = class::MENUPREV_ONCLICK
- text = "&Previous Row"
- endwith
-
-
- this.MENUTABLE.MENUNEXT = new MENU(this.MENUTABLE)
- with (this.MENUTABLE.MENUNEXT)
- onClick = class::MENUNEXT_ONCLICK
- text = "&Next Row"
- endwith
-
-
- this.MENUTABLE.MENUFIRST = new MENU(this.MENUTABLE)
- with (this.MENUTABLE.MENUFIRST)
- onClick = class::MENUFIRST_ONCLICK
- text = "&First Row"
- endwith
-
-
- this.MENUTABLE.MENULAST = new MENU(this.MENUTABLE)
- with (this.MENUTABLE.MENULAST)
- onClick = class::MENULAST_ONCLICK
- text = "&Last Row"
- endwith
-
-
- this.MENUREPORTS = new MENU(this)
- with (this.MENUREPORTS)
- text = "&Reports"
- endwith
-
-
- this.MENUREPORTS.MENUINVOICE = new MENU(this.MENUREPORTS)
- with (this.MENUREPORTS.MENUINVOICE)
- onClick = class::MENUINVOICE_ONCLICK
- text = "Customer Invoice..."
- endwith
-
-
- this.MENUREPORTS.MENUCADDRESS = new MENU(this.MENUREPORTS)
- with (this.MENUREPORTS.MENUCADDRESS)
- onClick = class::MENUCADDRESS_ONCLICK
- text = "Customer Address Labels"
- endwith
-
-
- this.MENUREPORTS.SEPARATOR1 = new MENU(this.MENUREPORTS)
- with (this.MENUREPORTS.SEPARATOR1)
- text = ""
- separator = true
- endwith
-
-
- this.MENUREPORTS.MENUSUPPLIER = new MENU(this.MENUREPORTS)
- with (this.MENUREPORTS.MENUSUPPLIER)
- onClick = class::MENUSUPPLIER_ONCLICK
- text = "Supplier Information"
- endwith
-
-
- this.MENUREPORTS.MENUINVENTORY = new MENU(this.MENUREPORTS)
- with (this.MENUREPORTS.MENUINVENTORY)
- onClick = class::MENUINVENTORY_ONCLICK
- text = "Inventory Summary"
- endwith
-
-
- this.MENUREPORTS.SEPARATOR3 = new MENU(this.MENUREPORTS)
- with (this.MENUREPORTS.SEPARATOR3)
- text = ""
- separator = true
- endwith
-
-
- this.MENUREPORTS.MENUICHART = new MENU(this.MENUREPORTS)
- with (this.MENUREPORTS.MENUICHART)
- onClick = class::MENUICHART_ONCLICK
- text = "Inventory Chart..."
- endwith
-
-
- this.MENUWINDOW = new MENU(this)
- with (this.MENUWINDOW)
- text = "&Window"
- endwith
-
-
- this.MENUHELP = new MENU(this)
- with (this.MENUHELP)
- text = "&Help"
- endwith
-
-
- this.MENUHELP.MENUABOUT = new MENU(this.MENUHELP)
- with (this.MENUHELP.MENUABOUT)
- onClick = class::MENUABOUT_ONCLICK
- text = "&About Mugs"
- endwith
-
-
- this.editCutMenu = this.menuedit.menucut
- this.editCopyMenu = this.menuedit.menucopy
- this.editPasteMenu = this.menuedit.menupaste
- this.editUndoMenu = this.menuedit.menuundo
- this.windowMenu = this.menuWindow
-
- // {Linked Method} form.root.menutable.menuabandon.onClick
- function MENUABANDON_OnClick
- local thisForm
- thisForm = this.parent.parent.parent
- return ( thisForm.app.dataAction.abandonRow( thisForm ) )
-
- // {Linked Method} form.root.menuhelp.menuabout.onClick
- function MENUABOUT_OnClick
- local thisForm
- thisForm = this.parent.parent.parent
- return ( thisForm.app.openAboutDialog() )
-
- // {Linked Method} form.root.menutable.menuappend.onClick
- function MENUAPPEND_OnClick
- local thisForm
- thisForm = this.parent.parent.parent
- return ( thisForm.app.dataAction.appendRow( thisForm ) )
-
- // {Linked Method} form.root.menutable.menurefresh.onClick
- function MENUREFRESH_OnClick
- local thisForm
- thisForm = this.parent.parent.parent
- return ( thisForm.app.dataAction.refreshRow( thisForm ) )
-
- // {Linked Method} form.root.menureports.menucaddress.onClick
- function MENUCADDRESS_OnClick
- DO "customer.lab"
- return true
-
- // {Linked Method} form.root.menufile.menuclose.onClick
- function MENUCLOSE_OnClick
- // close current window
- local bClose
- if ( this.parent.parent.parent.className == "FRAMEWINDOW" )
- MSGBOX("No child window to close. " + ;
- "You can select File | Exit to close the Mugs application", ;
- "Alert", 64)
- bClose = false
- else
- bClose = this.parent.parent.parent.close()
- endif
- return ( bClose )
-
-
- // {Linked Method} form.root.menufile.menuexit.onClick
- function MENUEXIT_OnClick
- local thisForm
- thisForm = this.parent.parent.parent
- return ( thisForm.app.close() )
-
- // {Linked Method} form.root.menutable.menudelete.onClick
- function MENUDELETE_OnClick
- local thisForm
- thisForm = this.parent.parent.parent
- return ( thisForm.app.dataAction.deleteRow( thisForm ) )
-
- // {Linked Method} form.root.menutable.menulocate.onClick
- function MENULOCATE_OnClick
- local thisForm
- thisForm = this.parent.parent.parent
- return ( thisForm.app.dataAction.locateRow( thisForm ) )
-
- // {Linked Method} form.root.menutable.menufirst.onClick
- function MENUFIRST_OnClick
- local thisForm
- thisForm = this.parent.parent.parent
- return ( thisForm.app.dataAction.goFirst( thisForm ) )
-
- // {Linked Method} form.root.menureports.menuichart.onClick
- function MENUICHART_OnClick
- local thisForm
- thisForm = this.parent.parent.parent
- return ( thisForm.app.readIChart() )
-
- // {Linked Method} form.root.menureports.menuinventory.onClick
- function MENUINVENTORY_onClick
- do "inventory.rep"
- return
-
- // {Linked Method} form.root.menureports.menuinvoice.onClick
- function MENUINVOICE_onClick
- local thisForm
- thisForm = this.parent.parent.parent
- return ( thisForm.app.renderInvoice() )
-
- // {Linked Method} form.root.menutable.menulast.onClick
- function MENULAST_OnClick
- local thisForm
- thisForm = this.parent.parent.parent
- return ( thisForm.app.dataAction.goLast( thisForm ) )
-
- // {Linked Method} form.root.menutable.menunext.onClick
- function MENUNEXT_OnClick
- local thisForm
- thisForm = this.parent.parent.parent
- return ( thisForm.app.dataAction.goNext( thisForm ) )
-
- // {Linked Method} form.root.menufile.menuopen.onClick
- function MENUOPEN_OnClick
- local thisForm
- thisForm = this.parent.parent.parent
- return ( thisForm.app.openFileOpenDialog() )
-
- // {Linked Method} form.root.menutable.menuprev.onClick
- function MENUPREV_OnClick
- local thisForm
- thisForm = this.parent.parent.parent
- return ( thisForm.app.dataAction.goPrev( thisForm ) )
-
- // {Linked Method} form.root.menutable.menusave.onClick
- function MENUSAVE_OnClick
- local thisForm
- thisForm = this.parent.parent.parent
- return ( thisForm.app.dataAction.saveRow( thisForm ) )
-
- // {Linked Method} form.root.menuview.menuappbar.onClick
- function MENUAPPBAR_onClick
- local thisForm
- thisForm = this.parent.parent.parent
- this.checked := ( not this.checked )
- thisForm.app.toolbars.appBar.visible := this.checked
- return ( this.checked )
-
- // {Linked Method} form.root.menuview.menudatabar.onClick
- function MENUDATABAR_onClick
- local thisForm
- thisForm = this.parent.parent.parent
- this.checked := ( not this.checked )
- thisForm.app.toolbars.dataBar.visible := this.checked
- return ( this.checked )
-
-
- // {Linked Method} form.root.menureports.menusupplier.onClick
- function MENUSUPPLIER_OnClick
- DO "supplier.rep"
- return true
-
- // {Linked Method} form.root.menuview.menutoolbar.onClick
- function MENUTOOLBAR_OnClick
- local thisForm
- thisForm = this.parent.parent.parent
- return ( thisForm.app.openToolbarDialog() )
-
- // {Linked Method} form.root.onInitMenu
- function ROOT_onInitMenu
- local bRowset, bAtFirst, bAtLast
- bRowset = ( TYPE("this.parent.rowset.handle") == "N" )
- bAtFirst = true
- bAtLast = true
- if ( bRowset )
- bAtFirst := this.parent.rowset.atFirst()
- bAtLast := this.parent.rowset.atLast()
- endif
- with ( this.menuView )
- menuAppBar.checked := this.parent.app.toolbars.appBar.visible
- menuDataBar.checked := this.parent.app.toolbars.dataBar.visible
- endwith
- with ( this.menuTable )
- menuAppend.enabled := ( bRowset )
- menuDelete.enabled := ( bRowset )
- menuAbandon.enabled := ( bRowset )
- menuSave.enabled := ( bRowset )
- menuLocate.enabled := ( bRowset )
- menuRefresh.enabled := ( bRowset )
- menuFirst.enabled := ( not bAtFirst )
- menuPrev.enabled := ( not bAtFirst )
- menuNext.enabled := ( not bAtLast )
- menuLast.enabled := ( not bAtLast )
- endwith
- return ( bRowset )
- endclass
-