#REM DFM.SRC  -  SOME TOOLS FOR VISUAL DATAFLEX 9/10
#HEADER
Use APS          // Auto Positioning and Sizing classes for VDF

Use LangSymb.pkg // Language symbols
define lng_default for LNG_ENGLISH

Use Splash.utl   // Graphic splish-splash
Use About.utl    // About dialog

/DFMatrix.Log
DFMatrix for Windows

--- Version 10 ---

27-03-04 Added "Explore folder sizes"

--- Version 9.1 ---

16-02-04 Create Empty Tables function has
         been fixed.

         The Compare All Table Definitions
         function is now able to handle
         alias files.

--- Version 2.9 ---

07-09-03 New load/dump utility

25-08-03 Now able to open by filelist.

--- Version 2.6+ ---

22-01-02 Generate field name changed
         files (*.fdn) and take them into
         account when generating restruc-
         ture programs.

--- Version 2.6 ---

18-11-01 If field type changed then also
         field length is set (regardless
         if it is the same)

11-11-01 Made compliant with VDF 8 (RC1)

16-10-01 'Compare table definitions' now
         refuses to compare if one of the
         sides are 'empty'.

17-09-01 Table selector now sorts table
         numbers lager than 999 correctly.
       - Check definitions no longer checks
         presence of HDR and VLD files if
         driver is not "DATAFLEX"

--- Version 2.5 ---

22-08-01 4095 tables support

--- Version 2.492 ---

06-08-01 Added 'Open current definitions'
         to the 'Select workspace' function.
15-07-01 Import text file feature.

--- Version 2.3 ---

11-07-01 DAW utilities pulldown added
27-06-01 ODBC viewer added
07-05-01 Search for stray index files re-
         vitalized.
06-05-01 Compare synchro fixed again!!!

--- Version 2.2 ---

01-05-01 Compare synchro fixed.
       - No more complaints about setting
         'main index' to 0.
28-04-01 Transaction type and lock type
         added to 'Change parameters for
         selected tables'.
23-04-01 Escape now works in all 'views'.

--- Version 2.1 ---

12-04-01 Filter in 'Compare directories'.
11-04-01 Auto copy directory name in
         'Compare directories'.
       - 'Copy files' feature in 'Find file,
         result' view.
09-04-01 Trace view taken out of main menu.
02-04-01 'Find file' rewritten from scratch.
28-03-01 MakePath in File Find fixed.
26-03-01 Ctrl+W in 'Check definitions'
25-03-01 Sorting on directory comp. grid.
24-03-01 Copy files on Ctrl+C in file grids.
       - Tolerance on timestamps when
         comparing files.
21-03-01 Absolute path on temp.txt file.
20-03-01 Ctrl+W moves grid data to editor.
/DFMatrix.About
DFMatrix was programmed by:

  Sture Andersen
  e-mail: sture.aps@mail.tele.dk
/*

set AppInfo AI_TITLE     to "DFMatrix"
set AppInfo AI_SUBTITLE  to "Windows"
set AppInfo AI_VERSION   to "10"
set AppInfo AI_REVISION  to ""
set AppInfo AI_AUTHOR    to "Sture ApS"
set AppInfo AI_WATERMARK to "2004"

set AppInfo AI_LOG_IMAGE to DFMatrix.Log.N

object oSplash is a cGraphicSplash
  procedure Draw_BackGround.i integer liColor
    local integer lhGA
    forward send Draw_BackGround.i liColor
    move (oGA(self)) to lhGA
    send SetTTFont to lhGA "Courier New" 12 0 0 0 0
    send SetTextAlign to lhGA (VDFGR_TA_CENTER+VDFGR_TA_VCENTER)
    send SetTextColor to lhGA liColor
    send AddText to lhGA "NUM  FIELD NAME       TYPE SIZE  OFFST IX   RELATES TO FILE.FIELD            "   500 5000
    send AddText to lhGA "---  ---------------  ---- ----- ----- --   ---------------------------------"  1000 5000
    send AddText to lhGA "  1  TYPE             ASC      2     1  1   TYPES.FIELD_1 (10,1)             "  1500 5000
    send AddText to lhGA "  2  SIZE             ASC      2     3      SIZES.FIELD_1 (11,1)             "  2000 5000
    send AddText to lhGA "  3  ORIGIN           ASC      3     5      LOCATIONS.FIELD_1 (12,1)         "  2500 5000
    send AddText to lhGA "  4  YEAR             NUM    2.0     8  1   DRIVER NAME                      "  3000 5000
    send AddText to lhGA "  5  VINTNER          ASC     30     9  1   FILE ROOT NAME                   "  3500 5000
    send AddText to lhGA "  6  COST             NUM    4.2    39      USER DISPLAY NAME                "  4000 5000
    send AddText to lhGA "  7  PURCHASE_PLACE   ASC     25    42      DATAFLEX FILE NAME               "  4500 5000
    send AddText to lhGA "  8  PURCHASE_DATE    DAT      3    67      -------------------------        "  5000 5000
    send AddText to lhGA "  9  OPEN_DATE        DAT      3    70      RECORD LENGTH                    "  5500 5000
    send AddText to lhGA " 10  TASTING_NOTES    TEX   2048    73      MAX NUMBER OF RECORDS            "  6000 5000
    send AddText to lhGA " 11  SHORT_NAME       ASC     48  2121      FILE COMPRESSION                 "  6500 5000
    send AddText to lhGA " 12  RESERVE          ASC      1  2169      RE-USE DELETED SPACE             "  7000 5000
    send AddText to lhGA " 13  COMMENTS         TEX   1024  2170      LOCKING TYPE                     "  7500 5000
    send AddText to lhGA " 14  SUGAR_CONTENT    NUM    2.2  3194      HEADER INTEGRITY CHECKING        "  8000 5000
    send AddText to lhGA " 15  ALCOHOL_CONTENT  NUM    2.2  3196      TRANSACTION TYPE                 "  8500 5000
    send AddText to lhGA " 16  WHO_DRANK        ASC     50  3198      RECORD IDENTITY INDEX            "  9000 5000
    send AddText to lhGA " 17  BIN              ASC     10  3248  3   FILE LOGIN PARAMETER             "  9500 5000
    send AddText to lhGA " 18  WINE_SPEC_RATE   NUM    2.0  3258      SYSTEM FILE                      " 10000 5000
  end_procedure
end_object
send activate to (oSplash(self))

//Use Output.utl   // Basic sequential output service
Use FDX.nui      // cFDX class
Use Fdx1.utl     // FDX aware display global attributes (FDX_DisplayGlobalAttributes procedure)
Use Fdx2.utl     // FDX aware object for displaying a table definiton
Use Fdx4.utl     // FDX aware cFileList_List selector object

Use Version.nui

Use cApplication.pkg
Object oApplication is a cApplication
  set pbEnterKeyAsTabKey to DFTRUE
// Procedure OnCreate
//   Send DoOpenWorkspace CURRENT$WORKSPACE
// End_Procedure
End_Object // oApplication

// procedure SmadrHeleLortet
//   runprogram background "Afreager.exe"
// end_procedure
// on_key key_ctrl+key_h send SmadrHeleLortet


Use DFMatrix.utl //
Use MdiExt.utl   // MDI Extensions
Use StrucTrc.utl // Object for tracing a restructure operation

//use vdfquery.utl

Use OpenStat.pkg // Call DFMatrix, Display open tables ...

#ENDHEADER

// open employee
// find gt employee by index.1
// find gt employee by index.1
// find gt employee by index.1
//
Object Main is a Panel
  DFCreate_Menu Main_Menu
    DFCreate_Menu "&File" FilePullDown is a ViewPopupMenu
      on_item "Select &workspace"         send DFMatrix_Select_WorkSpace
      on_item "Select &filelist"          send DFMatrix_Select_FileList
      on_item "&Open FDX file..."         send DFMatrix_PrimaryOpenFdxFile
      on_item ""                          send none
      on_item "&Save as..."               send DFMatrix_PrimarySaveFdxAs
      on_item ""                          send none
      on_item "Table selector"            send Activate_Table_Selector
      on_item ""                          send none
      on_item "&DBMS Login"               send DFMatrix_Login
      on_item ""                          send none
      on_item "E&xit \aAlt+F4"            send exit_application
//    on_item "Open &current definitions" send DFMatrix_PrimaryOpenCurrentFilelist
//    on_item "C&lose"                    send DFMatrix_CloseAll
//    on_item "Lo&gout"                   send DFMatrix_Logout
      Procedure OnInitMenu
        local integer Shade_CloseAndSave# fdx# fdx_state#
        move (fdx.object_id(0)) to fdx#
        get piDataOrigin of fdx# to fdx_state#
        move (fdx_state#=FDX_EMPTY) to Shade_CloseAndSave#
        set Shadow_State item 4 to Shade_CloseAndSave#
      End_Procedure
    End_Menu
    DFCreate_Menu "Fu&nctions" FunctionsPullDown is a ViewPopupMenu
      on_item "Check definitions"       send Activate_FdxCheck_Vw
      on_item "&Find stray index files" send Popup_FindStrayIndexFiles
      on_item "&Restructure tables" send Activate_RestructPrograms
      on_item "Create empty tables"     send Popup_CreateFromFdx
      on_item "Test file locking"       send Popup_TestLockPanel
//      on_item "Create DEF/FD files"     send Popup_CreateDEF_FD
      on_item ""                        send none
      on_item "Reindex"                 send Activate_SortUtil_Vw
      on_item "Year 2000 check"         send Activate_Conv2000_Vw
      on_item "Import/Export data"      send Popup_ImportExport
      on_item "Dump/Load data"          send Activate_ImportExport_View
      on_item "Field statistics"        send Activate_DataSampler_Vw
      on_item ""                        send none
//    on_item "ODBC Viewer"             send Activate_ODBCViewer
      on_item "Import data"             send Activate_FdxImport_Vw
      on_item "Miscellaneous"           send Activate_SmallDfmThings_Vw
      on_item ""                        send none
      on_item "Find file"               send Activate_SetDirTestVw
      on_item "Compare directories"     send Activate_Dircomp_Vw
      on_item "Explore folder sizes"    send Activate_oFolderSizeTreePanel
//    on_item "Query current data..."   send DFMatrix_Activate_Query_Vw
//    DFCreate_Menu "Maybe's" TestPullDown is a ViewPopupMenu
//      on_item "DF-Script..."         send activate_dfscript_ide
//    End_Menu
    End_Menu
    DFCreate_Menu "DAW-&Utilities" DawPullDown is a ViewPopupMenu
      on_item "Database &Builder"  send OpenStat.Chain_DbBuilder
      on_item "Database &Explorer" send OpenStat.Chain_DbExplor
      on_item ""                   send none
      on_item "About"              send DoAbout
    End_Menu
  End_Menu

  Object Client_Area IS A AppClientArea
    use DFMatrix.vw  // Table selector, Global attr and table definition
    Use StrucTrc.vw  // Object for tracing a restructure operation
    Use DFScript.vw  // DFScript test
//    Use FindFile.vw  // View for finding files along DFPath (Activate_FindFile)
    Use FdxCheck.vw  // View for interfacing validity check of table definitions

    Use FDXSet.vw    // Display contents of cSetOfFiles cSetOfFields
    Use DfmFnc01.pkg // Create table definitions (Popup_CreateFromFdx)
    Use DfmFnc03.pkg // Find stray index files (Popup_FindStrayIndexFiles)
    Use DfmFnc05.pkg // Import Export data
    Use DfmFnc07.pkg // Create DEF/FD files (Popup_CreateDEF_FD)
    Use StrucPgm.vw  // View for creating and executing RS programs
    Use DataSamp.vw  // Field statistics
    Use Conv2000.vw  // Activate_Conv2000_Vw (for use in the DFMatrix environment)
    Use SortUtil.vw  // Activate_SortUtil_Vw (for use in the DFMatrix environment)
    Use DirComp.vw   // Activate_Dircomp
    Use SetDir.vw    // Activate_SetDirTestVw
    Use DFM_ODBC.vw  // Activate_ODBCViewer
    Use dfm_importexport.vw

    Use FdxImpor.vw  // Activate_FdxImport_Vw

    Use DfmSmall.vw

    Use TestLock.Vw
    Use FolderTree.Vw

    ///////////////////////////
//  use vdfsort.vw
//  use vdfquery.rv
    ///////////////////////////


  //procedure DFMatrix_Activate_Query_Vw
  //  if (DFMatrix_RealData_Check()) send Activate_Query_Vw
  //end_procedure
  End_Object  // Client_Area

End_Object // Main

procedure set DFMatrix_App_Label string lsValue
  set label of (Main(self)) to lsValue
end_procedure
send DFMatrix_Update_App_Title
//send DoDfMatrixCommandLine to (Client_Area(Main(self)))
send deactivate to (oSplash(self))

Start_UI

