Use OrderPrecompile.pkg

Use DfAllent.pkg
Use cCJStandardCommandBarSystem.pkg
Use cToolTipController.pkg
Use cCJCommandBarSystem.pkg

Object oHtmlHelp is a cHtmlHelp
End_Object

Object oApplication is a cApplication
    Set psCompany to "Data Access Worldwide"
    Set psProduct to "Visual DataFlex Examples"
    Set psVersion to "17.1"
    Set psProgram to "Order"
    Set psHelpFile to "Examples.chm"
    Set peHelpType to htHtmlHelp

    //Audit
    Property String gpsLoginID "GM"     //Set to explict value here - use your security to do what you want.
End_Object

// Audit: Open Files
Open AudFiles
Open AudDet
Open AudInfo

Object oToolTipController is a cToolTipController
    Move Self to ghoToolTipController
End_Object

Use oEditContextMenu.pkg
Use oDEOEditContextMenu17.pkg

Object oMain is a Panel
    Set Label to "DAW Sacred Text - Table Audit Demo"
    Set Location to 4 3
    Set Size to 300 450
    Set Icon to "scroll.ico"

    Object oCommandBarSystem is a cCJCommandBarSystem
    
        Set pbTimerUpdate to True
    
        Procedure OnCreateCommandBars
            Handle hoOptions
            Get OptionsObject to hoOptions
            Forward Send OnCreateCommandBars
        End_Procedure
    
        Object oMenuBar is a cCJMenuBar            
            Object oFileMenu is a cCJMenuItem
                
                Set peControlType to xtpControlPopup          
                Set psCaption   to "&File"
                Set psDescription to "Find, Save, Delete, Clear information or quit this application."
                Set psCategory to "Menus"
    
                Object oClearMenuItem is a cCJClearMenuItem
                    Set pbAddToDesignerMenu to True
                End_Object
    
                Object oClearAllMenu is a cCJClearAllMenuItem
                    Set pbAddToDesignerMenu to True
                End_Object
    
                Object oPromptMenuItem is a cCJPromptMenuItem
                    Set pbAddToDesignerMenu to True
                    Set pbControlBeginGroup to True
                End_Object
    
                Object oFindMenuItem is a cCJFindMenuItem
                    Set pbAddToDesignerMenu to True
                    Set pbControlBeginGroup to True
                End_Object
    
                Object oFindNextMenu is a cCJFindNextMenuItem
                    Set pbAddToDesignerMenu to True
                End_Object
    
                Object oFindPreviousMenu is a cCJFindPreviousMenuItem
                    Set pbAddToDesignerMenu to True
                End_Object
    
                Object oFindFirstMenu is a cCJFindFirstMenuItem
                    Set pbAddToDesignerMenu to True
                End_Object
    
                Object oFindLastMenu is a cCJFindLastMenuItem
                    Set pbAddToDesignerMenu to True
                End_Object
    
                Object oSaveMenuItem is a cCJSaveMenuItem
                    Set pbAddToDesignerMenu to True
                    Set pbControlBeginGroup to True
                End_Object
    
                Object oDeleteMenuItem is a cCJDeleteMenuItem
                    Set pbAddToDesignerMenu to True
                End_Object
    
                Object oExitMenu is a cCJExitMenuItem
                    Set pbControlBeginGroup to True
                End_Object
    
            End_Object
            
            Object oViewMenu is a cCJMenuItem
                
                Set peControlType to xtpControlPopup
                Set psCaption to "&View"
                Set psToolTip to "View"
                Set psDescription to "Available Views"
    
                Object oCustomerEntryViewMenuItem is a cCJMenuItem
                    Set psCaption to "Customer Entry View"
                    Set psShortcut to "Ctrl+1"
                    Set psDescription to "Add, edit and delete Customer data."
                    Set psToolTip to "Customer Entry View"
                
                    Procedure OnExecute Variant vCommandBarControl
                        Handle hoClient
                        Get Client_Id to hoClient
                        Send Activate_oCustomerView of hoClient
                    End_Procedure
                End_Object
    
                Object oInventoryItemViewMenuItem is a cCJMenuItem
                    Set psCaption to "Inventory Item View"
                    Set psShortcut to "Ctrl+2"
                    Set psDescription to "Add, edit and delete Inventory data."
                    Set psToolTip to "Inventory Item View"
                
                    Procedure OnExecute Variant vCommandBarControl
                        Handle hoClient
                        Get Client_Id to hoClient
                        Send Activate_oInventoryView of hoClient
                    End_Procedure
                End_Object
    
                Object oOrderEntryMenuItem is a cCJMenuItem
                    Set psCaption to "Order Entry"
                    Set psShortcut to "Ctrl+3"
                    Set psDescription to "Add, edit and delete Order data."
                    Set psToolTip to "Order Entry"
                
                    Procedure OnExecute Variant vCommandBarControl
                        Handle hoClient
                        Get Client_Id to hoClient
                        Send Activate_oOrderEntryView of hoClient
                    End_Procedure
                End_Object
    
                Object oSalesPersonEntryViewMenuItem is a cCJMenuItem
                    Set psCaption to "Sales Person Entry View"
                    Set psShortcut to "Ctrl+4"
                    Set psDescription to "Add, edit and delete Sales Person data."
                    Set psToolTip to "Sales Person Entry View"
                
                    Procedure OnExecute Variant vCommandBarControl
                        Handle hoClient
                        Get Client_Id to hoClient
                        Send Activate_oSalesPersonView of hoClient
                    End_Procedure
                End_Object
    
                Object oVendorEntryViewMenuItem is a cCJMenuItem
                    Set psCaption to "Vendor Entry View"
                    Set psShortcut to "Ctrl+5"
                    Set psDescription to "Add, edit and delete Vendor data."
                    Set psToolTip to "Vendor Entry View"
                
                    Procedure OnExecute Variant vCommandBarControl
                        Handle hoClient
                        Get Client_Id to hoClient
                        Send Activate_oVendorView of hoClient
                    End_Procedure
                End_Object

                Object oAuditChangedDeletedRecordsMenuItem is a cCJMenuItem
                    Set psCaption to "Audit: Changed/Deleted Records"
                    Set psTooltip to "Audit: Changed/Deleted Records"
                
                    Procedure OnExecute Variant vCommandBarControl
                        Handle hoClient
                        Get Client_Id to hoClient
                        Send Activate_oAuditListing of hoClient
                    End_Procedure
                End_Object

                Object oTablestoAuditMenuItem is a cCJMenuItem
                    Set psCaption to "Tables to Audit"
                    Set psTooltip to "Tables to Audit"
                
                    Procedure OnExecute Variant vCommandBarControl
                        Handle hoClient
                        Get Client_Id to hoClient
                        Send Activate_oAudFiles of hoClient
                    End_Procedure
                End_Object
    
            End_Object
            
            Object oReportMenu is a cCJMenuItem
                
                Set peControlType to xtpControlPopup
                Set psCaption to "&Report"
                Set psToolTip to "Report"
                Set psDescription to "Available Reports"
    
                Object oBasicReportsMenuItem is a cCJMenuItem
                    Set psCaption to "Basic Reports"
                    Set peControlType to xtpControlPopup
                    Set psToolTip to "Basic Reports"
                    Set psDescription to "Reports based on the Basic Report class."
    
                    Object oCustomerListMenuItem is a cCJMenuItem
                        Set psCaption to "Customer List"
                        Set psToolTip to "Customer List (Basic)"
                    
                        Procedure OnExecute Variant vCommandBarControl
                            Handle hoClient
                            Get Client_Id to hoClient
                            Send Activate_oCustomerListBR of hoClient
                        End_Procedure
                    End_Object
                End_Object
    
                Object oWinPrintReportsMenuItem is a cCJMenuItem
                    Set psCaption to "WinPrint Reports"
                    Set peControlType to xtpControlPopup
                    Set psToolTip to "WinPrint Reports"
                    Set psDescription to "Reports based on the WinPrint class."
    
                    Object oCustomerListMenuItem2 is a cCJMenuItem
                        Set psCaption to "Customer List"
                        Set psShortcut to "Ctrl+6"
                        Set psToolTip to "Customer List (WinPrint)"
                        Set psDescription to "Print Customer data."
                    
                        Procedure OnExecute Variant vCommandBarControl
                            Handle hoClient
                            Get Client_Id to hoClient
                            Send Activate_oCustomerListWP of hoClient
                        End_Procedure
                    End_Object
    
                    Object oItemsperOrderMenuItem is a cCJMenuItem
                        Set psCaption to "Items per Order"
                        Set psShortcut to "Ctrl+7"
                        Set psToolTip to "Items per Order (WinPrint)"
                        Set psDescription to "Print line items for all Orders."
                    
                        Procedure OnExecute Variant vCommandBarControl
                            Handle hoClient
                            Get Client_Id to hoClient
                            Send Activate_oItemsPerOrderWP of hoClient
                        End_Procedure
                    End_Object
    
                    Object oOrdersbyCustomerMenuItem1 is a cCJMenuItem
                        Set psCaption to "Orders by Customer"
                        Set psShortcut to "Ctrl+8"
                        Set psToolTip to "Orders by Customer (WinPrint)"
                        Set psDescription to "Print Order data sorted by Customer."
                    
                        Procedure OnExecute Variant vCommandBarControl
                            Handle hoClient
                            Get Client_Id to hoClient
                            Send Activate_oOrdersByCustomerWP of hoClient
                        End_Procedure
                    End_Object
    
                    Object oOrdersbyOrderNumberMenuItem is a cCJMenuItem
                        Set psCaption to "Orders by Order Number"
                        Set psShortcut to "Ctrl+9"
                        Set psToolTip to "Orders by Order Number (WinPrint)"
                        Set psDescription to "Print Order data."
                    
                        Procedure OnExecute Variant vCommandBarControl
                            Handle hoClient
                            Get Client_Id to hoClient
                            Send Activate_oOrdersWP of hoClient
                        End_Procedure
                    End_Object
                End_Object
    
                Object oCrystalReportsMenuItem is a cCJMenuItem
                    Set psCaption to "Crystal Reports"
                    Set peControlType to xtpControlPopup
    
                    Object oAddressLabelsMenuItem is a cCJMenuItem
                        Set psCaption to "Address Labels"
                        Set psToolTip to "Address Labels (Crystal)"
                        Set psDescription to "Print address labels for Customers or Vendors."
                    
                        Procedure OnExecute Variant vCommandBarControl
                            Handle hoClient
                            Get Client_Id to hoClient
                            Send Activate_oAddressLabelsCR of hoClient
                        End_Procedure
                    End_Object
    
                    Object oCustomerListMenuItem1 is a cCJMenuItem
                        Set psCaption to "Customer List"
                        Set psToolTip to "Customer List (Crystal)"
                        Set psDescription to "Print or export Customer data."
                    
                        Procedure OnExecute Variant vCommandBarControl
                            Handle hoClient
                            Get Client_Id to hoClient
                            Send Activate_oCustomerListCR of hoClient
                        End_Procedure
                    End_Object
    
                    Object oOrdersbyCustomerMenuItem is a cCJMenuItem
                        Set psCaption to "Orders by Customer"
                        Set psToolTip to "Orders by Customer (Crystal)"
                        Set psDescription to "Print Order data sorted by Customer."
                    
                        Procedure OnExecute Variant vCommandBarControl
                            Handle hoClient
                            Get Client_Id to hoClient
                            Send Activate_oOrdersByCustomerCR of hoClient
                        End_Procedure
                    End_Object
    
                    Object oOrdersMenuItem is a cCJMenuItem
                        Set psCaption to "Orders"
                        Set psToolTip to "Orders (Crystal)"
                        Set psDescription to "Print Order data."
                    
                        Procedure OnExecute Variant vCommandBarControl
                            Handle hoClient
                            Get Client_Id to hoClient
                            Send Activate_oOrdersCR of hoClient
                        End_Procedure
                    End_Object
    
                    Object oReportInformationMenuItem is a cCJMenuItem
                        Set psCaption to "Report Information"
                        Set psToolTip to "Report Information (Crystal)"
                        Set psDescription to "Select any Crystal Report and examine its structure.."
                    
                        Procedure OnExecute Variant vCommandBarControl
                            Handle hoClient
                            Get Client_Id to hoClient
                            Send Activate_oReportInformationCR of hoClient
                        End_Procedure
                    End_Object
    
                    Object oCrystalReportsPreviewerMenuItem is a cCJMenuItem
                        Set psCaption to "Crystal Reports Previewer"
                        Set psToolTip to "Crystal Reports Previewer"
                        Set psDescription to "Select any Crystal Report to run in Preview."
                    
                        Procedure OnExecute Variant vCommandBarControl
                            Handle hoClient
                            Get Client_Id to hoClient
                            Send Activate_oReportPreviewCR of hoClient
                        End_Procedure
                    End_Object
                End_Object

                Object oOrdersPlainMenuItem is a cCJMenuItem
                    Set psCaption to "Orders Plain"
                    Set psTooltip to "Orders Plain"
                
                    Procedure OnExecute Variant vCommandBarControl
                        Handle hoClient
                        Get Client_Id to hoClient
                        Send Activate_OrdersPlain of hoClient
                    End_Procedure
                End_Object
    
            End_Object
                        
            Object oNavigateMenu is a cCJMenuItem
                Set peControlType to xtpControlPopup      
                Set psCaption to "&Navigate"    
                Set psTooltip to "Navigate"    
                Set psDescription to "Move to different areas of the application"
                
                Object oNextAreaMenu is a cCJNextAreaMenu
                End_Object
                
                Object oPriorAreaMenu is a cCJPriorAreaMenu
                End_Object
                
                Object oNextViewMenu is a cCJNextViewMenu
                End_Object
                
                Object oPriorViewMenu is a cCJPriorViewMenu
                End_Object
                
                Object oPromptMenu is a cCJPromptMenuItem
                    Set pbControlBeginGroup to True
                End_Object
    
                Object oZoomMenu is a cCJZoomMenuItem
                End_Object
    
            End_Object
    
            Object oWindowMenu is a cCJMDIWindowsMenuItem
                Set peControlType to xtpControlPopup      
                Set psCaption to "&Window"
                Set psToolTip to "Window"
                Set psDescription to "Display Current Views and set other display options."    
                
                // These are the static windows items. More will be created in onInitPopup 
                Object oDisplayOptionsMenu is a cCJMenuItem
                    Set peControlType to xtpControlPopup          
                    Set psCaption to "&Display Options"
                    Set psToolTip to "Display Options"
                    Set psDescription to "Set display options"
    
                    Object oStatusbarMenu is a cCJStatusbarMenuItem
                    End_Object
    
                    Object oAutoArrangeIconsMenu is a cCJAutoArrangeIconsMenuItem
                    End_Object
    
                    Object oRestoreMenusMenu is a cCJRestoreMenusMenuItem
                        Set pbControlBeginGroup to True
                    End_Object
                    
                End_Object
        
                Object oCascadeMenu is a cCJCascadeMenuItem
                    Set pbControlBeginGroup to True
                End_Object
    
                Object oHorizTile is a cCJTileHorizontally
                End_Object
    
                Object oVertTile is a cCJTileVertically
                End_Object
    
                Object oMinimizeMenuItem is a cCJMinimizeWindowsMenuItem
                    Set pbControlBeginGroup to True
                End_Object
    
                Object oRestoreMenuItem is a cCJRestoreWindowsMenuItem
                End_Object
    
                Object oArrangeIconsMenuItem is a cCJAutoArrangeIconsMenuItem
                    Set pbControlBeginGroup to True
                End_Object
    
            End_Object
            
            Object oHelpMenu is a cCJMenuItem
                Set peControlType to xtpControlPopup    
                Set psCaption to "&Help"
                Set psDescription to "Access Information for learning and using this DataFlex application."
                Set psToolTip to "Help"
                
                Object oHelpMenuItem is a cCJHelpMenuItem 
                End_Object
    
                Object oAboutMenuItem is a cCJAboutMenuItem
                End_Object
           
            End_Object
    
        End_Object
    
        Object oFindToolBar is a cCJToolbar
            Set psTitle to "Finding Toolbar"
    
            Object oFindFirstTool is a cCJFindFirstMenuItem
            End_Object
    
            Object oFindPreviousTool is a cCJFindPreviousMenuItem
            End_Object
    
            Object oFindMenuTool is a cCJFindMenuItem
            End_Object
    
            Object oFindNextTool is a cCJFindNextMenuItem
            End_Object
    
            Object oFindLastTool is a cCJFindLastMenuItem
            End_Object
    
            Object oPromptToolItem is a cCJPromptMenuItem
                Set pbControlBeginGroup to True
            End_Object
    
        End_Object
            
        Object oFileToolBar is a cCJToolbar
            Set psTitle to "Data Entry Toolbar"
    
            Object oClearToolItem is a cCJClearMenuItem
                Set peControlStyle to xtpButtonIconAndCaption
            End_Object
            
            Object oClearAllToolItem2 is a cCJClearAllMenuItem
                Set peControlStyle to xtpButtonIconAndCaption
            End_Object
                
            Object oSaveToolItem is a cCJSaveMenuItem
                Set peControlStyle to xtpButtonIconAndCaption
                Set pbControlBeginGroup to True
            End_Object
    
            Object oDeleteToolItem is a cCJDeleteMenuItem
                Set peControlStyle to xtpButtonIconAndCaption
            End_Object
    
        End_Object
    
        Object oEditToolBar is a cCJToolbar
            Set psTitle to "Edit Toolbar"
            
            Object oCutToolbarItem is a cCJCutMenuItem
            End_Object
    
            Object oCopyToolbarItem is a cCJCopyMenuItem
            End_Object
    
            Object oPasteToolbarItem is a cCJPasteMenuItem
            End_Object
    
            Object oDeleteEditToolbarItem is a cCJDeleteEditMenuItem
                Set pbControlBeginGroup to True
            End_Object
    
        End_Object
                
        Object oRememberToolbar is a cCJToolbar

            Object oRememberItems is a cCJMenuItem

                Set peControlType to xtpControlPopup
                Set peControlStyle to xtpButtonCaption
                Set psCaption to C_$Remember
                
                Object oMenuItem is a cCJRememberFieldMenuItem
                    Set peControlStyle to xtpButtonIconAndCaption
                End_Object
                
                Object oMenuItem is a cCJRememberLastFieldMenuItem
                    Set peControlStyle to xtpButtonIconAndCaption
                End_Object
                
                Object oMenuItem is a cCJUnRememberFieldMenuItem
                    Set peControlStyle to xtpButtonIconAndCaption
                End_Object
                
                Object oMenuItem is a cCJUnRememberFieldAllMenuItem
                    Set peControlStyle to xtpButtonIconAndCaption
                End_Object

            End_Object

        End_Object


        Object oStatusBar is a cCJStatusBar
            
            Object oStatusPane1 is a cCJStatusBarPane
                Set piID to sbpIDIdlePane
                Set pbStyleStretch to True
            End_Object
    
            Object oStatusPane2 is a cCJStatusBarPane
                Set phoViewPane to Self
                Set pbStyleStretch to True
            End_Object
    
        End_Object
    
    End_Object

    Object oClientArea is a ClientArea
        Use Customer.vw
        Use Invt.vw
        Use Order.vw
        Use SalesP.vw
        Use Vendor.vw
        
        Use Basic\CustomerListBR.rv
        Use Crystal\AddressLabelsCR.rv
        Use Crystal\CustomerListCR.rv
        Use Crystal\OrdersCR.rv
        Use Crystal\OrdersByCustomerCR.rv
        Use Crystal\ReportInformationCR.rv
        Use Crystal\ReportPreviewCR.rv
        Use WinPrint\CustomerListWP.rv
        Use WinPrint\ItemsPerOrderWP.rv
        Use WinPrint\OrdersWP.rv
        Use WinPrint\OrdersByCustomerWP.rv

        On_Key Key_Ctrl+Key_1 Send Activate_oCustomerView
        On_Key Key_Ctrl+Key_2 Send Activate_oInventoryView
        On_Key Key_Ctrl+Key_3 Send Activate_oOrderEntryView
        On_Key Key_Ctrl+Key_4 Send Activate_oSalesPersonView
        On_Key Key_Ctrl+Key_5 Send Activate_oVendorView
        On_Key Key_Ctrl+Key_6 Send Activate_oCustomerListWP
        On_Key Key_Ctrl+Key_7 Send Activate_oItemsPerOrderWP
        On_Key Key_Ctrl+Key_8 Send Activate_oOrdersByCustomerWP
        On_Key Key_Ctrl+Key_9 Send Activate_oOrdersWP

        Use StdAbout.pkg
        Use Crystal\OrdersCRLoop.rv
        Use OrdersPlain.rv
        Use AuditListing.vw
    
        Procedure Activate_About
            Send DoAbout "Order Entry Sample Application" "17.1.1.0" "Copyright (c) 2013 Data Access Corporation" "Data Access Worldwide" ""
        End_Procedure
    
    End_Object


End_Object

// open Order Entry view on application startup
Send Activate_oOrderEntryView of (oClientArea(oMain))
Start_UI
