Use AllWebAppClasses.pkg
Use cConnection.pkg
Use cWebMenuItemLoadView.pkg

Object oApplication is a cApplication

    Object oConnection is a cConnection
        Use LoginEncryption.pkg
    End_Object
    
    Property String psSyncfusionLicense ""
    
    // Don't use, it's only here so I do not have to put the license code in
    // the source.
    Function ReadLicenseFromDisk Returns String
      Integer iChan
      String  sLicense
      
      Move (Seq_New_Channel()) to iChan
      Direct_Input channel iChan "C:\SyncfusionLicense.txt"
      Readln channel iChan sLicense
      Close_Input channel iChan
      Send Seq_Release_Channel iChan
      Function_Return sLicense
    End_Function
    
    Function SyncFusionLicenseKey Returns String
      String sLicenseKey
      Get psSyncfusionLicense to sLicenseKey
      If (sLicenseKey="") Begin
        Get ReadLicenseFromDisk to sLicenseKey
      End
      Function_Return sLicenseKey
    End_Function

End_Object

Object oWebApp is a cWebApp
    Set psTheme to "Df_Flat_Desktop"
    Set psApplicationTitle to ("SyncFusion Demo " + String(PKG_Version) + "." + String(PKG_Revision))

    // It is important to set this so that all views will default
    // to drill down style views.
    Set peApplicationStyle to wvsDrillDown //wvsDesktop

    Object oViewStack is a cWebViewStack
    End_Object

    // this will do an automatic login (we do not care about that in this demo)
    Procedure OnLoad
        Boolean bOk
#IF (!@ > 240)
        Set pbPasswordHashing of ghoWebSessionManager to False
#ENDIF        
        Get UserLogin of ghoWebSessionManager "john" "John" to bOk
    End_Procedure
    
    Procedure OnPostInitialize
      Forward Send OnPostInitialize
      If (IsDebuggerPresent()) Begin
          Set pbShowAllRefindErrors to True
      End
    End_Procedure

    Object oCommandbar is a cWebCommandBar

        Object oMenuBar is a cWebMenuBar
          Object oViewMenu is a cWebMenuItem
              Set psCaption to "Demo Menu"

              Object oDashboard_itm is a cWebMenuItem
                  Set psCaption to "Dashboard"

                  Procedure OnClick
                      Register_Object oDashboard
                      Send NavigateBegin of oDashboard self true
                  End_Procedure
              End_Object
      
              Object oSyncFusionWebListMenuItem is a cWebMenuItem
                  Set psCaption to "SyncFusion WebList"
          
                  Object oSyncFusionGridJsonDataMenuItem is a cWebMenuItemLoadView
                      Set psCaption to "Grid JSON Data"
                      Set psLoadViewOnClick to "oSyncFusionGridJsonData"
                  End_Object
          
                  Object oSyncFusionGridCustomerListManuallyMenuItem is a cWebMenuItemLoadView
                      Set psCaption to "Customer List (Manual)"
                      Set psLoadViewOnClick to "oSyncFusionGridCustomerListManually"
                  End_Object
          
                  Object oSyncFusionGridCustomerListMenuItem is a cWebMenuItemLoadView
                      Set psCaption to "Customer List"
                      Set psLoadViewOnClick to "oSyncFusionGridCustomerList"
                  End_Object
                  
                  Object oSyncFusionSalesPersonListMenuItem is a cWebMenuItemLoadView
                      Set psCaption to "Sales Person List"
                      Set psLoadViewOnClick to "oSyncFusionGridSalesPersonList"
                  End_Object
                  
                  Object oOrderListWebListMenuItem is a cWebMenuItemLoadView
                      Set psCaption to "Order List demo"
                      Set psLoadViewOnClick to "oSyncFusionOrderList"
                  End_Object
                  
                  Object oOrderGridSwedishMenuItem is a cWebMenuItemLoadView
                      Set psCaption to "Order List Swedish"
                      Set psLoadViewOnClick to "oSyncFusionOrderSwedish"
                  End_Object
                  
                  Object oSyncFusionOrderWebListMenuItem is a cWebMenuItemLoadView
                      Set psCaption to "SyncFusion Order Entry WebList"
                      Set psLoadViewOnClick to "oSyncFusionOrder"
                  End_Object
              End_Object
              
              Object oDAWWebGridMenuItem is a cWebMenuItem
                  Set psCaption to "DAW Grids"
                  
                  Object oDAWOrderMenuItem is a cWebMenuItemLoadView
                      Set psCaption to "DAW Order Entry"
                      Set psLoadViewOnClick to "oDAWOrder"
                  End_Object
                  
                  Object oDAWCustomerWebListMenuItem is a cWebMenuItemLoadView
                      Set psCaption to "DAW Customer WebList"
                      Set psLoadViewOnClick to "oDAWWebListCustomerList"
                  End_Object
              End_Object
              
              Object oSyncFusionWebChartMenuItem is a cWebMenuItem
                  Set psCaption to "SyncFusion WebChart"
                  
                  Object oLineChartMenuItem is a cWebMenuItemLoadView
                      Set psCaption to "Line Chart"
                      Set psLoadViewOnClick to "oLineChartDemo"
                  End_Object
                  
                  Object oLogLineChartMenuItem is a cWebMenuItemLoadView
                      Set psCaption to "Logarithmic Line Chart"
                      Set psLoadViewOnClick to "oLogLineChartDemo"
                  End_Object
                  
                  Object oDynamicLineChartMenuItem is a cWebMenuItemLoadView
                      Set psCaption to "Dynamic Line Chart"
                      Set psLoadViewOnClick to "oDynamicLineChartDemo"
                  End_Object
                  
                  Object oBarChartWebListMenuItem is a cWebMenuItemLoadView
                      Set psCaption to "Bar Chart"
                      Set psLoadViewOnClick to "oBarChartDemo"
                  End_Object
                  
                  Object oPieChartWebListMenuItem is a cWebMenuItemLoadView
                      Set psCaption to "Pie Chart"
                      Set psLoadViewOnClick to "oPieChartDemo"
                  End_Object
              End_Object
              
              Object oPdfViewerMenuItem is a cWebMenuItemLoadView
                  Set psCaption to "Pdf Viewer"
                  Set psLoadViewOnClick to "oPdfViewerDemo"
              End_Object
  
              Object oSyncFusionRichTextMenuItem is a cWebMenuItem
                  Set psCaption to "Rich Text Editor"
                  
                  Object oRichTextEditorMenuItem is a cWebMenuItemLoadView
                      Set psCaption to "RichTextEditor"
                      Set psLoadViewOnClick to "oRichTextEditorDemo"
                  End_Object
                  
                  Object odbRichTextEditorMenuItem is a cWebMenuItemLoadView
                      Set psCaption to "dbRichTextEditor"
                      Set psLoadViewOnClick to "odbRichTextEditorDemo"
                  End_Object
                  
                  Object oSelectCustomerMenuItem is a cWebMenuItemLoadView
                      Set psCaption to "Select Customer"
                      Set psLoadViewOnClick to "oSelectCustomer"
                  End_Object
              End_Object
              
              Object oCarouselDemoMenuItem is a cWebMenuItemLoadView
                  Set psCaption to "Web Carousel"
                  Set psLoadViewOnClick to "oCarouselDemo"
              End_Object
              
              Object oToastDemoMenuItem is a cWebMenuItemLoadView
                  Set psCaption to "Toast"
                  Set psLoadViewOnClick to "oToastDemo"
              End_Object
              
          End_Object
        End_Object

        Object oFindToolBar is a cWebToolBar
            Object oFirstMenuItem is a cWebMenuFindFirst
            End_Object

            Object oPreviousMenuItem is a cWebMenuFindPrevious
            End_Object

            Object oFindMenuItem is a cWebMenuFind
            End_Object

            Object oNextMenuItem is a cWebMenuFindNext
            End_Object

            Object oLastMenuItem is a cWebMenuFindLast
            End_Object

            Object oPromptMenuItem is a cWebMenuPrompt
            End_Object
        End_Object

        Object oFileToolBar is a cWebToolBar
            Set pbShowCaption to True

            Object oClearMenuItem is a cWebMenuClear
            End_Object

            Object oClearAllMenuItem is a cWebMenuClearAll
            End_Object

            Object oSaveMenuItem is a cWebMenuSave
            End_Object

            Object oDeleteMenuItem is a cWebMenuDelete
            End_Object
        End_Object
    End_Object

    Set psEncryptPassword to 'ipUI$&^YGKJuy4785686'

    Use SessionManager.wo
    Use WebResourceManager.wo
    Use Dashboard.wo
    Use SyncFusionGridJsonData.wo
    Use dbRichTextEditorDemo.wo
    Use RichTextEditorDemo.wo
    Use PdfViewerDemo.wo
    Use LineChartDemo.wo
    Use DynamicLineChartDemo.wo
    Use LogLineChartDemo.wo
    Use BarChartDemo.wo
    Use PieChartDemo.wo
    Use SyncFusionGridCustomerListManually.wo
    Use SyncFusionGridCustomerList.wo
    Use SyncFusionGridSalesPersonList.wo
    Use SyncFusionOrderList.wo
    Use SyncFusionOrderSwedish.wo
    Use cWebListCustomerList.wo
    Use CarouselDemo.wo
    Use OrderHeaderPopup.wo
    Use FileUploadTest.wo
    Use Order.wo
    Use SyncFusionOrder.wo
    Use SelectCustomer.wo
    Use ToastDemo.wo
    Use CustomerEdit.wo
    Set phoDefaultView to oDashboard
    
End_Object


// DAW FIXES
//
//
// https://support.dataaccess.com/Forums/showthread.php?70980-Odd-Saving-Issue-DF20&p=387782#post387782
// Fix for modal dialog issue causing field errors to not show on their DEO (DF-4059)
#IF (!@ < 241)
    #IF (!@ > 191)
Procedure HideView for cWebApp Handle hoView
    String sView sCurrent sInvoking
    String[] aParams

    Get Object_Label of hoView to sView
    
    WebGet psCurrentView to sCurrent
    If (sView = sCurrent) Begin
        WebGet psInvokingView of hoView to sInvoking
        WebSet psCurrentView to sInvoking
    End
    
    Move sView to aParams[0]       // Pass the view name as the 1st parameter.
    Move False to aParams[1]       // We do want to send OnHide if needed
    Send ClientAction "hideView" aParams 
End_Procedure
    #ENDIF
#ENDIF



Send StartWebApp of oWebApp
