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

  1. //--------------------------------------------------------------
  2. //
  3. //  Mugs.mnu - Mugs Sample Application
  4. //
  5. //  Menu for all data enty forms and the application frame 
  6. //  window. See MUGS.PRG to all instances of attaching this
  7. //  menu to forms and the frame window. 
  8. //
  9. //  Dependencies: MUGS.PRG
  10. //
  11. //  Visual dBASE Samples Group
  12. //
  13. //  $Revision:   1.12  $
  14. //
  15. //  Copyright (c) 1997, Borland International, Inc. 
  16. //  All rights reserved.
  17. //
  18. //---------------------------------------------------------------
  19. ** END HEADER -- do not remove this line
  20. //
  21. // Generated on 10/18/97
  22. //
  23. parameter formObj
  24. new MugsMENU(formObj, "root")
  25.  
  26. class MugsMENU(formObj, name) of MENUBAR(formObj, name)
  27.    with (this)
  28.       onInitMenu = class::ROOT_ONINITMENU
  29.    endwith
  30.  
  31.  
  32.    this.MENUFILE = new MENU(this)
  33.    with (this.MENUFILE)
  34.       text = "&File"
  35.    endwith
  36.  
  37.  
  38.    this.MENUFILE.MENUOPEN = new MENU(this.MENUFILE)
  39.    with (this.MENUFILE.MENUOPEN)
  40.       onClick = class::MENUOPEN_ONCLICK
  41.       text = "&Open..."
  42.       shortCut = "Ctrl+O"
  43.       statusMessage = "Open a data entry form"
  44.    endwith
  45.  
  46.  
  47.    this.MENUFILE.MENUCLOSE = new MENU(this.MENUFILE)
  48.    with (this.MENUFILE.MENUCLOSE)
  49.       onClick = class::MENUCLOSE_ONCLICK
  50.       text = "&Close"
  51.       statusMessage = "Close the active window"
  52.    endwith
  53.  
  54.  
  55.    this.MENUFILE.SEPARATOR1 = new MENU(this.MENUFILE)
  56.    with (this.MENUFILE.SEPARATOR1)
  57.       text = ""
  58.       separator = true
  59.    endwith
  60.  
  61.  
  62.    this.MENUFILE.MENUEXIT = new MENU(this.MENUFILE)
  63.    with (this.MENUFILE.MENUEXIT)
  64.       onClick = class::MENUEXIT_ONCLICK
  65.       text = "E&xit"
  66.       statusMessage = "Exit Mugs"
  67.    endwith
  68.  
  69.  
  70.    this.MENUEDIT = new MENU(this)
  71.    with (this.MENUEDIT)
  72.       text = "&Edit"
  73.    endwith
  74.  
  75.  
  76.    this.MENUEDIT.MENUUNDO = new MENU(this.MENUEDIT)
  77.    with (this.MENUEDIT.MENUUNDO)
  78.       text = "&Undo"
  79.       shortCut = "Ctrl+Z"
  80.    endwith
  81.  
  82.  
  83.    this.MENUEDIT.SEPARATOR1 = new MENU(this.MENUEDIT)
  84.    with (this.MENUEDIT.SEPARATOR1)
  85.       text = ""
  86.       separator = true
  87.    endwith
  88.  
  89.  
  90.    this.MENUEDIT.MENUCUT = new MENU(this.MENUEDIT)
  91.    with (this.MENUEDIT.MENUCUT)
  92.       text = "Cu&t"
  93.       shortCut = "Ctrl+X"
  94.    endwith
  95.  
  96.  
  97.    this.MENUEDIT.MENUCOPY = new MENU(this.MENUEDIT)
  98.    with (this.MENUEDIT.MENUCOPY)
  99.       text = "&Copy"
  100.       shortCut = "Ctrl+C"
  101.    endwith
  102.  
  103.  
  104.    this.MENUEDIT.MENUPASTE = new MENU(this.MENUEDIT)
  105.    with (this.MENUEDIT.MENUPASTE)
  106.       text = "&Paste"
  107.       shortCut = "Ctrl+V"
  108.    endwith
  109.  
  110.  
  111.    this.MENUVIEW = new MENU(this)
  112.    with (this.MENUVIEW)
  113.       text = "&View"
  114.    endwith
  115.  
  116.  
  117.    this.MENUVIEW.MENUTOOLBAR = new MENU(this.MENUVIEW)
  118.    with (this.MENUVIEW.MENUTOOLBAR)
  119.       onClick = class::MENUTOOLBAR_ONCLICK
  120.       text = "&Customize Toolbars..."
  121.       statusMessage = "Set the size, hint and flat properties of the toolbar"
  122.    endwith
  123.  
  124.  
  125.    this.MENUVIEW.MENUAPPBAR = new MENU(this.MENUVIEW)
  126.    with (this.MENUVIEW.MENUAPPBAR)
  127.       onClick = class::MENUAPPBAR_ONCLICK
  128.       text = "Application Toolbar"
  129.       checked = true
  130.    endwith
  131.  
  132.  
  133.    this.MENUVIEW.MENUDATABAR = new MENU(this.MENUVIEW)
  134.    with (this.MENUVIEW.MENUDATABAR)
  135.       onClick = class::MENUDATABAR_ONCLICK
  136.       text = "Data Toolbar"
  137.    endwith
  138.  
  139.  
  140.    this.MENUTABLE = new MENU(this)
  141.    with (this.MENUTABLE)
  142.       text = "&Table"
  143.    endwith
  144.  
  145.  
  146.    this.MENUTABLE.MENUAPPEND = new MENU(this.MENUTABLE)
  147.    with (this.MENUTABLE.MENUAPPEND)
  148.       onClick = class::MENUAPPEND_ONCLICK
  149.       text = "&Add Row"
  150.       shortCut = "Ctrl+A"
  151.    endwith
  152.  
  153.  
  154.    this.MENUTABLE.MENUDELETE = new MENU(this.MENUTABLE)
  155.    with (this.MENUTABLE.MENUDELETE)
  156.       onClick = class::MENUDELETE_ONCLICK
  157.       text = "&Delete Current Row..."
  158.    endwith
  159.  
  160.  
  161.    this.MENUTABLE.MENUSAVE = new MENU(this.MENUTABLE)
  162.    with (this.MENUTABLE.MENUSAVE)
  163.       onClick = class::MENUSAVE_ONCLICK
  164.       text = "&Save Row"
  165.       shortCut = "Ctrl+S"
  166.    endwith
  167.  
  168.  
  169.    this.MENUTABLE.MENUABANDON = new MENU(this.MENUTABLE)
  170.    with (this.MENUTABLE.MENUABANDON)
  171.       onClick = class::MENUABANDON_ONCLICK
  172.       text = "A&bandon Row"
  173.    endwith
  174.  
  175.  
  176.    this.MENUTABLE.SEPARATOR1 = new MENU(this.MENUTABLE)
  177.    with (this.MENUTABLE.SEPARATOR1)
  178.       text = ""
  179.       separator = true
  180.    endwith
  181.  
  182.  
  183.    this.MENUTABLE.MENULOCATE = new MENU(this.MENUTABLE)
  184.    with (this.MENUTABLE.MENULOCATE)
  185.       onClick = class::MENULOCATE_ONCLICK
  186.       text = "Locate Row..."
  187.    endwith
  188.  
  189.    this.MENUTABLE.MENUREFRESH = new MENU(this.MENUTABLE)
  190.    with (this.MENUTABLE.MENUREFRESH)
  191.       onClick = class::MENUREFRESH_ONCLICK
  192.       text = "Refresh"
  193.    endwith
  194.  
  195.  
  196.    this.MENUTABLE.SEPARATOR2 = new MENU(this.MENUTABLE)
  197.    with (this.MENUTABLE.SEPARATOR2)
  198.       text = ""
  199.       separator = true
  200.    endwith
  201.  
  202.  
  203.    this.MENUTABLE.MENUPREV = new MENU(this.MENUTABLE)
  204.    with (this.MENUTABLE.MENUPREV)
  205.       onClick = class::MENUPREV_ONCLICK
  206.       text = "&Previous Row"
  207.    endwith
  208.  
  209.  
  210.    this.MENUTABLE.MENUNEXT = new MENU(this.MENUTABLE)
  211.    with (this.MENUTABLE.MENUNEXT)
  212.       onClick = class::MENUNEXT_ONCLICK
  213.       text = "&Next Row"
  214.     endwith
  215.  
  216.  
  217.    this.MENUTABLE.MENUFIRST = new MENU(this.MENUTABLE)
  218.    with (this.MENUTABLE.MENUFIRST)
  219.       onClick = class::MENUFIRST_ONCLICK
  220.       text = "&First Row"
  221.    endwith
  222.  
  223.  
  224.    this.MENUTABLE.MENULAST = new MENU(this.MENUTABLE)
  225.    with (this.MENUTABLE.MENULAST)
  226.       onClick = class::MENULAST_ONCLICK
  227.       text = "&Last Row"
  228.    endwith
  229.  
  230.  
  231.    this.MENUREPORTS = new MENU(this)
  232.    with (this.MENUREPORTS)
  233.       text = "&Reports"
  234.    endwith
  235.  
  236.  
  237.    this.MENUREPORTS.MENUINVOICE = new MENU(this.MENUREPORTS)
  238.    with (this.MENUREPORTS.MENUINVOICE)
  239.       onClick = class::MENUINVOICE_ONCLICK
  240.       text = "Customer Invoice..."
  241.    endwith
  242.  
  243.  
  244.    this.MENUREPORTS.MENUCADDRESS = new MENU(this.MENUREPORTS)
  245.    with (this.MENUREPORTS.MENUCADDRESS)
  246.       onClick = class::MENUCADDRESS_ONCLICK
  247.       text = "Customer Address Labels"
  248.    endwith
  249.  
  250.  
  251.    this.MENUREPORTS.SEPARATOR1 = new MENU(this.MENUREPORTS)
  252.    with (this.MENUREPORTS.SEPARATOR1)
  253.       text = ""
  254.       separator = true
  255.    endwith
  256.  
  257.  
  258.    this.MENUREPORTS.MENUSUPPLIER = new MENU(this.MENUREPORTS)
  259.    with (this.MENUREPORTS.MENUSUPPLIER)
  260.       onClick = class::MENUSUPPLIER_ONCLICK
  261.       text = "Supplier Information"
  262.    endwith
  263.  
  264.  
  265.    this.MENUREPORTS.MENUINVENTORY = new MENU(this.MENUREPORTS)
  266.    with (this.MENUREPORTS.MENUINVENTORY)
  267.       onClick = class::MENUINVENTORY_ONCLICK
  268.       text = "Inventory Summary"
  269.    endwith
  270.  
  271.  
  272.    this.MENUREPORTS.SEPARATOR3 = new MENU(this.MENUREPORTS)
  273.    with (this.MENUREPORTS.SEPARATOR3)
  274.       text = ""
  275.       separator = true
  276.    endwith
  277.  
  278.  
  279.    this.MENUREPORTS.MENUICHART = new MENU(this.MENUREPORTS)
  280.    with (this.MENUREPORTS.MENUICHART)
  281.       onClick = class::MENUICHART_ONCLICK
  282.       text = "Inventory Chart..."
  283.    endwith
  284.  
  285.  
  286.    this.MENUWINDOW = new MENU(this)
  287.    with (this.MENUWINDOW)
  288.       text = "&Window"
  289.    endwith
  290.  
  291.  
  292.    this.MENUHELP = new MENU(this)
  293.    with (this.MENUHELP)
  294.       text = "&Help"
  295.    endwith
  296.  
  297.  
  298.    this.MENUHELP.MENUABOUT = new MENU(this.MENUHELP)
  299.    with (this.MENUHELP.MENUABOUT)
  300.       onClick = class::MENUABOUT_ONCLICK
  301.       text = "&About Mugs"
  302.    endwith
  303.  
  304.  
  305.    this.editCutMenu = this.menuedit.menucut
  306.    this.editCopyMenu = this.menuedit.menucopy
  307.    this.editPasteMenu = this.menuedit.menupaste
  308.    this.editUndoMenu = this.menuedit.menuundo
  309.    this.windowMenu = this.menuWindow
  310.  
  311.    // {Linked Method} form.root.menutable.menuabandon.onClick
  312.    function MENUABANDON_OnClick
  313.       local thisForm 
  314.       thisForm = this.parent.parent.parent
  315.    return ( thisForm.app.dataAction.abandonRow( thisForm ) )
  316.  
  317.    // {Linked Method} form.root.menuhelp.menuabout.onClick
  318.    function MENUABOUT_OnClick
  319.       local thisForm 
  320.       thisForm = this.parent.parent.parent
  321.    return ( thisForm.app.openAboutDialog() )         
  322.  
  323.    // {Linked Method} form.root.menutable.menuappend.onClick
  324.    function MENUAPPEND_OnClick
  325.       local thisForm 
  326.       thisForm = this.parent.parent.parent
  327.    return ( thisForm.app.dataAction.appendRow( thisForm ) )
  328.  
  329.    // {Linked Method} form.root.menutable.menurefresh.onClick
  330.    function MENUREFRESH_OnClick
  331.       local thisForm 
  332.       thisForm = this.parent.parent.parent
  333.    return ( thisForm.app.dataAction.refreshRow( thisForm ) )
  334.  
  335.    // {Linked Method} form.root.menureports.menucaddress.onClick
  336.    function MENUCADDRESS_OnClick
  337.       DO "customer.lab"
  338.    return true 
  339.  
  340.    // {Linked Method} form.root.menufile.menuclose.onClick
  341.    function MENUCLOSE_OnClick
  342.       // close current window
  343.       local bClose
  344.       if ( this.parent.parent.parent.className == "FRAMEWINDOW" )
  345.          MSGBOX("No child window to close. " + ;
  346.                 "You can select File | Exit to close the Mugs application", ;
  347.                 "Alert", 64) 
  348.          bClose = false
  349.       else
  350.          bClose = this.parent.parent.parent.close()
  351.       endif     
  352.    return ( bClose )
  353.  
  354.  
  355.    // {Linked Method} form.root.menufile.menuexit.onClick
  356.    function MENUEXIT_OnClick
  357.       local thisForm 
  358.       thisForm = this.parent.parent.parent
  359.    return ( thisForm.app.close() )
  360.  
  361.    // {Linked Method} form.root.menutable.menudelete.onClick
  362.    function MENUDELETE_OnClick
  363.       local thisForm 
  364.       thisForm = this.parent.parent.parent
  365.    return ( thisForm.app.dataAction.deleteRow( thisForm ) )   
  366.  
  367.    // {Linked Method} form.root.menutable.menulocate.onClick
  368.    function MENULOCATE_OnClick
  369.       local thisForm 
  370.       thisForm = this.parent.parent.parent
  371.    return ( thisForm.app.dataAction.locateRow( thisForm ) )    
  372.  
  373.    // {Linked Method} form.root.menutable.menufirst.onClick
  374.    function MENUFIRST_OnClick
  375.       local thisForm 
  376.       thisForm = this.parent.parent.parent
  377.    return ( thisForm.app.dataAction.goFirst( thisForm ) )
  378.  
  379.    // {Linked Method} form.root.menureports.menuichart.onClick
  380.    function MENUICHART_OnClick
  381.       local thisForm 
  382.       thisForm = this.parent.parent.parent
  383.    return ( thisForm.app.readIChart() )
  384.  
  385.    // {Linked Method} form.root.menureports.menuinventory.onClick
  386.    function MENUINVENTORY_onClick
  387.       do "inventory.rep"
  388.    return
  389.  
  390.    // {Linked Method} form.root.menureports.menuinvoice.onClick
  391.    function MENUINVOICE_onClick
  392.       local thisForm 
  393.       thisForm = this.parent.parent.parent
  394.    return ( thisForm.app.renderInvoice() )
  395.  
  396.    // {Linked Method} form.root.menutable.menulast.onClick
  397.    function MENULAST_OnClick   
  398.       local thisForm 
  399.       thisForm = this.parent.parent.parent
  400.    return ( thisForm.app.dataAction.goLast( thisForm ) )
  401.  
  402.    // {Linked Method} form.root.menutable.menunext.onClick
  403.    function MENUNEXT_OnClick
  404.       local thisForm 
  405.       thisForm = this.parent.parent.parent
  406.    return ( thisForm.app.dataAction.goNext( thisForm ) )   
  407.  
  408.    // {Linked Method} form.root.menufile.menuopen.onClick
  409.    function MENUOPEN_OnClick
  410.       local thisForm 
  411.       thisForm = this.parent.parent.parent
  412.    return ( thisForm.app.openFileOpenDialog() )    
  413.  
  414.    // {Linked Method} form.root.menutable.menuprev.onClick
  415.    function MENUPREV_OnClick
  416.       local thisForm 
  417.       thisForm = this.parent.parent.parent
  418.    return ( thisForm.app.dataAction.goPrev( thisForm ) )
  419.  
  420.    // {Linked Method} form.root.menutable.menusave.onClick
  421.    function MENUSAVE_OnClick
  422.       local thisForm 
  423.       thisForm = this.parent.parent.parent
  424.    return ( thisForm.app.dataAction.saveRow( thisForm ) )
  425.  
  426.    // {Linked Method} form.root.menuview.menuappbar.onClick
  427.    function MENUAPPBAR_onClick
  428.       local thisForm
  429.       thisForm = this.parent.parent.parent
  430.       this.checked := ( not this.checked )
  431.       thisForm.app.toolbars.appBar.visible := this.checked
  432.    return ( this.checked )
  433.  
  434.    // {Linked Method} form.root.menuview.menudatabar.onClick
  435.    function MENUDATABAR_onClick
  436.       local thisForm
  437.       thisForm = this.parent.parent.parent
  438.       this.checked := ( not this.checked )
  439.       thisForm.app.toolbars.dataBar.visible := this.checked
  440.    return ( this.checked )
  441.  
  442.  
  443.    // {Linked Method} form.root.menureports.menusupplier.onClick
  444.    function MENUSUPPLIER_OnClick
  445.       DO "supplier.rep"
  446.    return true
  447.  
  448.    // {Linked Method} form.root.menuview.menutoolbar.onClick
  449.    function MENUTOOLBAR_OnClick
  450.       local thisForm
  451.       thisForm = this.parent.parent.parent
  452.    return ( thisForm.app.openToolbarDialog() )
  453.  
  454.    // {Linked Method} form.root.onInitMenu
  455.    function ROOT_onInitMenu
  456.       local bRowset, bAtFirst, bAtLast
  457.       bRowset   = ( TYPE("this.parent.rowset.handle") == "N" )
  458.       bAtFirst  = true
  459.       bAtLast   = true
  460.       if ( bRowset )
  461.          bAtFirst := this.parent.rowset.atFirst()
  462.          bAtLast  := this.parent.rowset.atLast()
  463.       endif
  464.       with ( this.menuView )
  465.          menuAppBar.checked  := this.parent.app.toolbars.appBar.visible
  466.          menuDataBar.checked := this.parent.app.toolbars.dataBar.visible
  467.       endwith
  468.       with ( this.menuTable )
  469.          menuAppend.enabled  := ( bRowset )
  470.          menuDelete.enabled  := ( bRowset )
  471.          menuAbandon.enabled := ( bRowset )
  472.          menuSave.enabled    := ( bRowset )
  473.          menuLocate.enabled  := ( bRowset )
  474.          menuRefresh.enabled := ( bRowset )
  475.          menuFirst.enabled   := ( not bAtFirst )
  476.          menuPrev.enabled    := ( not bAtFirst )
  477.          menuNext.enabled    := ( not bAtLast )
  478.          menuLast.enabled    := ( not bAtLast ) 
  479.        endwith
  480.    return ( bRowset )
  481. endclass
  482.