home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD 24 / PCPLUS115.iso / dbasewin / samples / music / view.mnu < prev   
Encoding:
Text File  |  1994-08-02  |  11.2 KB  |  340 lines

  1. *******************************************************************************
  2. *  PROGRAM:      View.mnu
  3. *
  4. *  WRITTEN BY:   Borland Samples Group
  5. *
  6. *  DATE:         1/94
  7. *
  8. *  UPDATED:      6/94
  9. *
  10. *  REVISION:     $Revision:   1.25  $
  11. *
  12. *  VERSION:      dBASE FOR WINDOWS 5.0
  13. *
  14. *  DESCRIPTION:  This is a menu file used by all view forms in the Musical
  15. *                Methods application.  It allows seeing information in different
  16. *                orders (depending on which view you are running), setting
  17. *                filters, searching, printing reports, and bringing up as many
  18. *                possible views as you like.  All these views are kept track of
  19. *                in the Windows menu.
  20. *
  21. *  PARAMETERS:   F  (parent form)
  22. *
  23. *  CALLS:        None
  24. *
  25. *  USAGE:        F.MenuFile = "View.mnu"
  26. *
  27. *******************************************************************************
  28. #include <Messdlg.h>
  29. ** END HEADER -- do not remove this line*
  30. * Generated on 05/16/94
  31. *
  32. Parameter FormObj
  33. NEW VIEW(FormObj,"Root")
  34. CLASS VIEW(FormObj,Name) OF MENU(FormObj,Name)
  35.    this.Text = ""
  36.    this.HelpFile = ""
  37.    this.HelpId = ""
  38.  
  39.    DEFINE MENU FILEMENU OF THIS;
  40.        PROPERTY;
  41.          Text "&File",;
  42.          HelpFile "",;
  43.          HelpId ""
  44.  
  45.          DEFINE MENU EXIT OF THIS.FILEMENU;
  46.              PROPERTY;
  47.                OnClick CLASS::EXITMUSIC,;
  48.                Text "E&xit",;
  49.                HelpFile "",;
  50.                HelpId "",;
  51.                Shortcut "CTRL-Q"
  52.  
  53.    DEFINE MENU VIEWMENU OF THIS;
  54.        PROPERTY;
  55.          Text "&View",;
  56.          HelpFile "",;
  57.          HelpId ""
  58.  
  59.          DEFINE MENU MUSICVIEW OF THIS.VIEWMENU;
  60.              PROPERTY;
  61.                OnClick {;do MusiView.wfm},;
  62.                StatusMessage "Display available musical items.",;
  63.                Text "&Music",;
  64.                HelpFile "",;
  65.                HelpId ""
  66.  
  67.          DEFINE MENU CATEGORIES OF THIS.VIEWMENU;
  68.              PROPERTY;
  69.                OnClick {;do Categors.wfm},;
  70.                StatusMessage "Display the musical categories available.",;
  71.                Text "&Categories",;
  72.                HelpFile "",;
  73.                HelpId ""
  74.  
  75.          DEFINE MENU RANKINGS OF THIS.VIEWMENU;
  76.              PROPERTY;
  77.                OnClick {;do Priorits.wfm},;
  78.                StatusMessage "Display the sales rankings of the current musical items.",;
  79.                Text "&Rankings",;
  80.                HelpFile "",;
  81.                HelpId ""
  82.  
  83.          DEFINE MENU MEDIATYPES OF THIS.VIEWMENU;
  84.              PROPERTY;
  85.                OnClick {;do Configs.wfm},;
  86.                StatusMessage "Display the media types available.",;
  87.                Text "M&edia Types",;
  88.                HelpFile "",;
  89.                HelpId ""
  90.  
  91.          DEFINE MENU SEPARATEVIEWS1 OF THIS.VIEWMENU;
  92.              PROPERTY;
  93.                HelpFile "",;
  94.                HelpId "",;
  95.                Separator .T.
  96.  
  97.          DEFINE MENU ORGANIZEVIEW OF THIS.VIEWMENU;
  98.              PROPERTY;
  99.                Text "&Organization",;
  100.                StatusMessage "Change viewing order of displayed information.",;
  101.                HelpFile "",;
  102.                HelpId ""
  103.  
  104.  
  105.                DEFINE MENU BYRANK OF THIS.VIEWMENU.ORGANIZEVIEW;
  106.                    PROPERTY;
  107.                      OnClick CLASS::CALLSHOWRANKVIEW,;
  108.                      StatusMessage "Order items by Rank.",;
  109.                      Text "&Rank",;
  110.                      HelpFile "",;
  111.                      HelpId "",;
  112.                      Checked .T.
  113.  
  114.                DEFINE MENU BYARTIST OF THIS.VIEWMENU.ORGANIZEVIEW;
  115.                    PROPERTY;
  116.                      OnClick CLASS::CALLSHOWARTISTSVIEW,;
  117.                      StatusMessage "Order items by Artist.",;
  118.                      Text "&Artist",;
  119.                      HelpFile "",;
  120.                      HelpId ""
  121.  
  122.                DEFINE MENU BYTITLE OF THIS.VIEWMENU.ORGANIZEVIEW;
  123.                    PROPERTY;
  124.                      OnClick CLASS::CALLSHOWTITLESVIEW,;
  125.                      StatusMessage "Order items by Title",;
  126.                      Text "&Title",;
  127.                      HelpFile "",;
  128.                      HelpId ""
  129.  
  130.          DEFINE MENU SEPARATEVIEWS2 OF THIS.VIEWMENU;
  131.              PROPERTY;
  132.                HelpFile "",;
  133.                HelpId "",;
  134.                Separator .T.
  135.  
  136.          DEFINE MENU FILTERVIEW OF THIS.VIEWMENU;
  137.              PROPERTY;
  138.                OnClick CLASS::FILTERVIEW,;
  139.                StatusMessage "Select a group of items to view.",;
  140.                Text "&Filter",;
  141.                HelpFile "",;
  142.                HelpId ""
  143.  
  144.          DEFINE MENU BROWSE OF THIS.VIEWMENU;
  145.              PROPERTY;
  146.                OnClick CLASS::CALLBROWSEVIEW,;
  147.                StatusMessage "View the items in Browse mode.",;
  148.                Text "&Browse",;
  149.                HelpFile "",;
  150.                HelpId ""
  151.  
  152.    DEFINE MENU SEARCHMENU OF THIS;
  153.        PROPERTY;
  154.          Text "&Search",;
  155.          HelpFile "",;
  156.          HelpId ""
  157.  
  158.          DEFINE MENU SEARCH_FOR OF THIS.SEARCHMENU;
  159.              PROPERTY;
  160.                OnClick CLASS::SEARCHFOR,;
  161.                Text "&Search for...",;
  162.                HelpFile "",;
  163.                HelpId "",;
  164.                Shortcut "CTRL-S"
  165.          DEFINE MENU SKIP OF THIS.SEARCHMENU;
  166.              PROPERTY;
  167.                OnClick CLASS::SKIP,;
  168.                Text "S&kip...",;
  169.                HelpFile "",;
  170.                HelpId "",;
  171.                Shortcut "CTRL-K"
  172.  
  173.    DEFINE MENU OPTIONSMENU OF THIS;
  174.        PROPERTY;
  175.          Text "&Options",;
  176.          HelpFile "",;
  177.          HelpId ""
  178.  
  179.          DEFINE MENU REPORTSMENU OF THIS.OPTIONSMENU;
  180.              PROPERTY;
  181.                OnClick CLASS::REPORT,;
  182.                StatusMessage "View report of top ten artists.",;
  183.                Text "&Report -- Top Ten Artists",;
  184.                HelpFile "",;
  185.                HelpId ""
  186.  
  187.  
  188.    *******************************************************************************
  189.    procedure ExitMusic
  190.    *******************************************************************************
  191.  
  192.    * This is the last procedure to be executed before the program completes.
  193.    private i,strCnt,winMenu,f
  194.    if type("form") <> "U"  && If forms are open, close them
  195.       if windowCnt > 0
  196.          winMenu = this.parent.parent.WindowMenu
  197.          for i = 1 to windowCnt
  198.             strCnt = ltrim(str(i))
  199.             if type("winMenu.Window&strCnt") <> "U"      && if there is a form
  200.                f = winMenu.Window&strCnt..form
  201.                f.Onclose = .f.        && don't need to do onclose calculations
  202.                f.Close()
  203.             endif
  204.          next i
  205.       else
  206.          form.Close()     && Original image form
  207.       endif
  208.    endif
  209.    if type("oldFrameText") <> "U"     && If not running this form standalone
  210.       _app.framewin.text = oldFrameText
  211.       start.Close()
  212.       set path to &savePath
  213.       release oldFrameText,savePath,focusForm,windowCnt,startForm
  214.    endif
  215.    set message to     && Clear reference to help file
  216.    set help to
  217.  
  218.    shell(.t.)
  219.  
  220.    *******************************************************************************
  221.    procedure FilterView
  222.  
  223.    *******************************************************************************
  224.    private filterForm, selected, tempFilt, curTable
  225.  
  226.    curTable = alias()
  227.    if .not. empty(form.filter)
  228.       if ConfirmationMessage(FormatStr(;
  229.                                        "Current filter is\n %1.\n" +;
  230.                                        "Do you want to turn it off?",;
  231.                                        form.filter),;
  232.                              "Confirmation") = YES
  233.          select music
  234.          set filter to
  235.          go top
  236.          select &curTable
  237.          set filter to
  238.          go top
  239.          form.filter = ""
  240.          SetTopBotRecs(form)
  241.       endif
  242.    else
  243.       set procedure to filter.wfm additive
  244.       filterForm = new FilterForm()
  245.       filterForm.mdi = .f.
  246.       filterForm.viewForm = form
  247.       selected = filterForm.ReadModal()
  248.       if type("selected") = "O" .and. selected.id <> 0
  249.                                                     && If Cancel wasn't pressed
  250.          SetTopBotRecs(form)
  251.       endif
  252.       filterForm.Release()
  253.       form.SetFocus()
  254.       if alias() = "MUSIC"     && If in Musiview form view, call its OnNavigate
  255.          form.OnNavigate()
  256.       endif
  257.    endif
  258.  
  259.  
  260.  
  261.    *******************************************************************************
  262.    procedure CallShowArtistsView
  263.    *******************************************************************************
  264.    ShowArtistsView(this,form)
  265.  
  266.    *******************************************************************************
  267.    procedure CallShowTitlesView
  268.    *******************************************************************************
  269.    ShowTitlesView(this,form)
  270.  
  271.    *******************************************************************************
  272.    procedure CallShowRankView
  273.    *******************************************************************************
  274.    ShowRankView(this,form)
  275.  
  276.  
  277.    *******************************************************************************
  278.    procedure CallBrowseView
  279.    *******************************************************************************
  280.    BrowseView(this,form)  && In the current form's file
  281.  
  282.  
  283.    *******************************************************************************
  284.    procedure SearchFor
  285.    *******************************************************************************
  286.    private searchForm, searchResult, saveFields, field2
  287.    if .not. empty(form.filter)
  288.       if ConfirmationMessage(FormatStr(;
  289.                                        "Current filter is\n %1.\n" +;
  290.                                        "Do you want to turn it off?",;
  291.                                        form.filter),;
  292.                              "Confirmation") = YES
  293.          set filter to
  294.          form.filter = ""
  295.       endif
  296.    endif
  297.    saveFields = setto("fields")
  298.    if alias() <> "MUSIC"    && Make only the Descript field available.
  299.       field2 = field(2)
  300.       set fields to
  301.       set fields to &field2
  302.    else
  303.       set fields to
  304.    endif
  305.    set procedure to search.wfm additive
  306.    searchForm = new SearchForm()
  307.    searchForm.mdi = .f.
  308.    searchResult = searchForm.Readmodal()
  309.    searchForm.Release()
  310.    set fields to &saveFields
  311.    if alias() = "MUSIC"     && If in Musiview form view, call its OnNavigate
  312.       form.OnNavigate()
  313.    endif
  314.  
  315.    *******************************************************************************
  316.    procedure Skip
  317.    *******************************************************************************
  318.    local skipForm
  319.  
  320.    set procedure to Skip.wfm additive
  321.    skipForm = new SkipForm()
  322.    skipForm.mdi = .f.       && Do this here so can use Form Designer on form
  323.    skipForm.ReadModal()
  324.    skipForm.Release()
  325.    if alias() = "MUSIC"     && If in Musiview form view, call its OnNavigate
  326.       form.OnNavigate()
  327.    endif
  328.  
  329.  
  330.  
  331.  
  332.    *******************************************************************************
  333.    procedure Report
  334.    *******************************************************************************
  335.    report form Top10Ar      && Top 10 Artists
  336.  
  337. ENDCLASS
  338.  
  339.  
  340.