Program: VFXMAIN

******************************************************************************
* Project...........: Visual Extend 7.0
*                     Copyright (c) Devigus Engineering AG.
*                     All Rights Reserved.
*
* Program...........: VFXMAIN.PRG
* Author ...........: DEAG
* Created...........: September 2000
* Version...........: 07.00.000
*
* Description.......:
* Calling Samples...:
* Parameter List....:
* Major change list.:
*
#include "INCLUDE\VFX.H"
CLEAR ALL
CLEAR DLLS
CLEAR PROGRAM
CLEAR
CLOSE ALL
* Limit the memory occupied.
* This may be modified for your personal needs.
=SYS(3050,1,2048000)
=SYS(3050,2,2048000)
* Wait for locks in CDX and FPT-files like done with DBF files
=SYS(3052,1,.T.)
=SYS(3052,2,.T.)
IF VERSION(2)=2
    SET ASSERT ON
ELSE
    CD (JUSTPATH(SYS(16)))
ENDIF
PUBLIC goenvironment,glclientsupport
glclientsupport=.F.
goenvironment = CREATEOBJECT("CEnvironment")
IF VARTYPE(goenvironment) # "O"
    IF VARTYPE(_VFP)="O"
        _VFP.VISIBLE = .T.
    ENDIF
    _SCREEN.WINDOWSTATE = 2
    RETURN .F.
ENDIF
goenvironment.SET()
PUBLIC govfptoolbar
govfptoolbar = CREATEOBJECT("CVFPToolBar")
LOCAL lcoldcaption, lcoldicon
lcoldcaption = _SCREEN.CAPTION
lcoldicon    = _SCREEN.ICON
PUBLIC __vfx_runtime
__vfx_runtime = .F.
IF ".EXE" $ UPPER(SYS(16)) OR ".APP" $ UPPER(SYS(16))
    __vfx_runtime = .T.
    SET SYSMENU TO
    _SCREEN.CAPTION = cap_application_title
    _SCREEN.ICON    = mainicon_loc
ENDIF
PUBLIC goprogram
goprogram = CREATEOBJECT("CApplication", cap_application_title)
IF VARTYPE(goprogram) = "O"
    RELEASE gcoldtalk, gcolddir, gcoldpath, gcoldclasslib, gcoldescape, gcoldresource
    #ifdef _debug_mode
        IF VERSION(2)=2
            goprogram.debugmode(.T.)
        ENDIF
    #ENDIF
    IF VARTYPE(_VFP)="O"
        _VFP.VISIBLE = .T.
    ENDIF
    goprogram.setlangid(id_language)
    IF goprogram.onuserlogin()
        *--prepare connection manager, if used, replace "conXY" with your connection name
        *goProgram.oConnMgr.setConnectionName("conXY")
        *--
        goprogram.START()
        goprogram.onuserlogout()
    ENDIF
ENDIF
RELEASE govfptoolbar
RELEASE goprogram
RELEASE goenvironment
CLOSE ALL
_SCREEN.CAPTION = lcoldcaption
_SCREEN.ICON    = lcoldicon
CLEAR ALL
CLEAR DLLS
CLEAR PROGRAM
RELEASE ALL EXTENDED
SET MESSAGE TO
* If started in VFP.exe reopen the project file.
IF VERSION(2)=2
    IF ADIR(laproj,"*.pjx")=1
        _SHELL="MODIFY PROJECT "+laproj[1,1]
    ENDIF
ENDIF
RETURN .T.
*****************************************************************************
**
DEFINE CLASS capplication AS cfoxapp
    ***********************************************************
    **  User Settings
    ** cHelpFile          = [Help File]
    ** cMainMenu          = [Main Menu - Blank if none]
    ** cMainForm          = "VFXOPEN"
    ** cMainTitle         = [Main Title]
    cmainicon             = mainicon_loc
    cintrobitmap          = introform_loc
    ** cIntroForm         = [Class name used for the splash screen - Blank if none]
    ** cLoginForm         = [SCX for login dialog if other]
    ** lShowIntroForm     = .T. && if you want display the splash screen
    **    lcentury           = .T. && If you want use SET CENTURY ON
    **    nshowgridordertype = 2    && Use Colors
    ** cAscOrderRGB       = "RGB(255,255,0)"
    ** cDescOrderRGB      = "RGB(255,0,0)"
    nAskToSave = 1
    nAutoEditMode = 1
    **    nHideWhenEmpty     = 1    && 0 - None, 1 - .T., 2 - .F.
    nEnterIsEditInGrid = 2
    nEnableHook = 2
    **    nonsearchusegrid    =0    && 0=use form setting, 1=use fields from grid in all forms, 2=use all fields in all forms
    **    nresizefont    =1    && 0=use form setting, 1=.T. 2=.F.
    ** lClearIDXMsg       = .F. && Don't show the 'Deleting Tmp. Index'
    ** lDisableFormResize = .F. && Don't resize the forms
    ** lAutoLogin         = .T. && Enables automatic login when the application starts
    ** nAddUserToCaption  = 2   && 0 - None, 1 - username, 2 - name
    ************************************************************
    ** CAppToolBar    - Tooolbar without Navigation Buttons
    ** CAppNavBar    - Tooolbar with    Navigation Buttons
    cMainToolBar = "CAppNavBar"
    ************************************************************
    ** Database definitions
    cdatadir             = datapath_loc
    cmaindatabase        = database_loc
    cins_usr         = "INS_USR"
    cins_date         = "INS_DATE"
    cedt_usr         = "EDT_USR"
    cedt_date         = "EDT_DATE"
    ************************************************************
    ** File to exclude int CDatabaseTools
    cexcludefiles        = "DBCXREG.DBF;CDBKMETA.DBF;SDTMETA.DBF;SDTUSER.DBF;COREMETA.DBF"
    ** lRelogonQuit = .T.    && .T. - quit the application, .F. - relogon last user.
    ** Allow to delete child data in onetomany forms even if the deletion of parent records is not allowed.
    ** lAllowDeleteChilddata = .T.
    **    See VFP help SET CENTURY TO for explanation!
    ncentury = 19    && numeric value of the standard century.
    nrollover = 49    && numeric value for the rollover clause.
    ** Temporary Index files of type IDX:
    ** By design, VFX clears IDX indexes when edit, insert or delete operations occur to prevent
    ** VFP from crashing since IDX files cannot be open when transactions are used.
    ** Usually the stored procedures use transactions, that's why VFX by design clears IDX
    ** indexes before it continues with edit, insert or delete operations. If however you don't use
    ** stored procedure logic in update, insert or delete triggers, you may like to avoid the deletion
    ** of temporary IDX files whenever possible. The following properties allow you to do this:
    ** lnoclearidxonedit     = .t.    && only if you don't use TRANSACTIONS in your referential integrity code
    ** lnoclearidxoninsert = .t.    && only if you don't use TRANSACTIONS in your referential integrity code
    ** lnoclearidxondelete = .t.    && only if you don't use TRANSACTIONS in your referential integrity code
    ** luseActiveDesktop = .T.        && set to .t. to use ActiveDesktop
    ** luseAgent = .T.                && set to .t. to use Agent Control
    ** lremakeidxafterclear = .T.    && set to .t. if you want auto recreation of idx files after clear
    ** ndonthidelistpage     = 1    && 0 - None (use form setting), 1 - .T., 2 - .F.