!XTREE.DEF [142] - XTREE definitions
!-------------------.-------------------.-------------------.-------------------.
!EDIT HISTORY
! VEDIT=141
! Note: history reformatted 9-Feb-17
! [142] 22-Nov-20 / jdm / Add XTSBF_DBLCLK, XTSBF_LCLICK
! [141] 25-Jul-18 / jdm / Add XTF2_AUTOFILTER
! [140] 07-Aug-16 / jdm / Add XTMF_NOEXTARGET,XTF2_UTF8,XTF2_AUTOEXPROW
! [139] 07-May-13 / jdm / Add XTMF_EDITONLY
! [101] 05-May-13 / jdm / Add XTF_TOTALS
! [138] 17-Apr-13 / jdm / Add XTF2_CTRLC_COPY, XTMF_STDPRGBAR, XTMF_CUSPRGBAR, 
!                           XTMF_LOADABORT
! [137] 04-Mar-13 / jdm / Add XTF2_ITEMICONS
! [136] 21-Jun-12 / jdm / Add XTF2_PIXCOORDS
! [135] 14-Jun-12 / jdm / Change ++ifnmap to ++ifdef (because ++ifnmap doesn't 
!                           prevent harmless-but-wasteful multiple inclusion 
!                           within different funcs/procs.
! [134] 19-Aug-11 / jdm / Add XTF2_ENTERNAVDOWN
! [133] 22-Jun-11 / jdm / Add XTF2_POPUP
! [132] 10-Jun-11 / jdm / Add XTF2_SAVRES
! [129] 12-Dec-10 / jdm / Add XTF2_NORESPONSE
! [128] 01-Dec-10 / jdm / Add XTSBF_xx
! [127] 12-Nov-10 / jdm / Add XTF2_CLRDEFER  (clear deferred events), 
!                           XTF2_NORECOLDEF (don't reprocess COLDEF if unchanged)
! [126] 02-Nov-10 / jdm / Add XTUCFG_COLSRT,XTUCFG_COLACT, redefine XTUCFG_SRTORD
! [125] 23-Jun-10 / jdm / Add XTUCFG_FONT
! [124] 24-Feb-10 / jdm / Add NUL_XFILE$, NUL_MMOCLR
! [131] 27-Jan-10 / jdm / Add XTF2_DRAGDROP2
! [123] 20-Jan-10 / jdm / Add XTF2_DOWN, XTF2_PGUPDN
! [130] 11-Jan-10 / jdm / Add XTF2_PROPSHEET, XTF2_ANSEQDATA
! [122] 14-Aug-09 / jdm / Add XTF2_CSV2 flags
! [121] 07-Aug-09 / jdm / Add XTF2_AUTOEXPCOL flags
! [120] 21-Jul-09 / jdm / Add XTF2_xxx flags
! [119] 05-Jun-09 / jdm / Add XTMF_TRUNCATED
! [118] 03-Jun-09 / jdm / Add XTRHF_xxx, XTMF_xxx
! [117] 22-May 09 / jdm / Add XTHSF_NOHIGHTLIGHT
! [116] 19-Apr-09 / jdm / Add XTF2_HOME_CTRL, XTF2_END_CTRL, XTF2_NAVCOL
! [115] 15-Mar-09 / jdm / Add XTHSF_xxx flags for HEADERSTYLE, 
!                           XTNFS_xxx NFSELSTYLE flags
! [114] 25-Feb-09 / jdm / Add MAX_XTREE_COLS
! [113] 08-Jan-09 / jdm / Add XTEXPF_SAVE, XTEXPF_RESTORE
! [112] 01-Jan-09 / jdm / Add XTRSEL_STY_NONE, ++ifnmap condition
! [111] 03-Oct-08 / jdm / Add XTUCFG_xxx flags for XTR'USRCFG
! [110] 07-Sep-08 / jdm / Add VERSYS
! [109] 09-Jul-08 / jdm / Add XTRSEL_STY_ALL_GRAD, XTRSEL_STY_CELL1T_GRAD, 
!                           XTRSRCH_xxx (XTR'SEARCHMODE symbols), XTRGRID_xxx
! [108] 20-Feb-08 / jdm / Add XTROP_PRINT
! [107] 15-Aug-07 / jdm / Transfer XTROP_xxx, XTRSEL_xxx symbols here from 
!                           ASHELL.DEF
! [106] 06-Dec-06 / jdm / Add XTF_NOZEROEX
! [105] 29-Aug-06 / jdm / Add XTF_SPLIT
! [104] 16-May-06 / jdm / Add XTF_DRAGDROP
! [103] 02-Dec-05 / jdm / Add XTF_ENTESC
! [102] 23-May-05 / jdm / Add XTF_NOREDRAW
! [101] 13-May-05 / jdm / Add XTF_TOTALS
! [100] 10-Mar-05 / jdm / Originally defined as MAPs in XTREE.MAP, 
!                           these are the new versions (using underlines); 
!                           see XTROLD.DEF for old versions
!------------------------------------------------------------------------

![134]++ifnmap VERSYS_XTREE_DEF       ! [112]

++ifndef INC_XTREE_DEF                ! [135]
define INC_XTREE_DEF = 1              ! [135]

![110] This is the only map statement here
![110] VERSYS_XTREE_DEF needs to be a map so it is included in the run
![110] (to be displayed with VERSYS.LIT)

map1 VERSYS_XTREE_DEF,s,40,">>@VERSYS(1)->>xtree.def[140]"

define MAX_XTREE_COLS = 80          ! [114]

! XTREE FLAGS (combine as many as apply)

    define XTF_FKEY     = &h00000001        ! Allow F1-F16 (1)
                                            !  (return EXITCODES -1 thru -16)
    define XTF_LEFT     = &h00000002        ! Left arrow (Exitcode -40) (2)
    define XTF_RIGHT    = &h00000004        ! Right arrow (Exitcode -41) (4)
    define XTF_UP       = &h00000008        ! Up arrow (Exitcode -42) (8)
    define XTF_TAB      = &h00000020        ! TAB (Exitcode -44) (32)
    define XTF_HOME     = &h00000040        ! Right arrow (Exitcode -45) (64)
    define XTF_END      = &h00000080        ! Right arrow (Exitcode -46) (128)
    define XTF_NOAS     = &h00000100        ! Disable auto-shrink of box height (256)
                                            ! (Always active in GUI mode)
    define XTF_ENTESC   = &h00000100        ! In edit mode, ENTER exits xtree from
                                            ! last cell, and ESC doesn't cancel cell edit
    define XTF_MODELESS = &h00000200        ! Leave box on screen after exit
    define XTF_TIMOUT   = &h00000400        ! 200 sec timeout (auto ESC)
    define XTF_FST      = &h00000800        ! Fast mode (text mode only)
    define XTF_FCOLDEF  = &h00001000        ! In file mode, first row is
                                            ! interpreted as simple coldef syntax
    define XTF_XYXY     = &h00002000        ! Alt. coordinate semantics
                                            ! (first pair is upper left row,col)
                                            ! (second pair is lower right row,col)
    define XTF_SORT     = &h00004000        ! Allow column sorting
    define XTF_REORD    = &h00008000        ! Allow reordering of columns
    define XTF_MSEL     = &h00010000        ! Multi-selection (array mode only)
    define XTF_MLVL     = &h00020000        ! Multi-level (parent/child) rows
                                            ! Set automatically if first col
                                            ! defined as type @ in COLDEF
    define XTF_COLDFX   = &h00040000        ! COLDEF param uses complex syntax
    define XTF_VARY     = &h00080000        ! Vari. ht rows (see XTR_ITEMLINES)
    define XTF_NOSEL    = &h00100000        ! Exit immediately (use with MODELESS)
    define XTF_DISABLE  = &h00200000        ! Disable control on exit (use only
                                            ! with XTF_MODELESS)
    define XTF_DEL      = &h00400000        ! DEL (Exitcode -47)
    define XTF_FILANS   = &h00800000        ! In file mode, use ANSWER param
                                            ! as in array mode.
    define XTF_CTRLC    = &h01000000        ! ^c returns exitcode 10 (instead of 1)
    define XTF_EDITABLE = &h02000000        ! list contains editable text
                                            ! or checkbox column(s)
    define XTF_TOTALS   = &h04000000        ! [101] last line of data is a totals line
    define XTF_NOREDRAW = &h08000000        ! [102] don't redraw on opcode 4
    define XTF_DRAGDROP = &h10000000        ! [104] allow drag/drop (intra-tree)
    define XTF_SPLIT    = &h20000000        ! [105] split mode
    define XTF_NOZEROEX = &h40000000        ! [106] don't allow exit with exitcode 0

! [116] bits in 2nd bank of flags (see ST_XFLAGS in XTREE.SDF)

! [116] XTF2_xxx_CTRL: if XTF_xxx set,, then XTF_xxx_CTRL means that the xxx
! [116] key will exit w/o requiring Control+.  Otherwise, xxx moves to
! [116] first/last row and Control+HOME/END exits.
! [116] But if XTF_xxx not set, then XTF_xxx_CTRL causes HOME/END to
! [116] move to first/last column, and Control+HOME/END to first/last row
    define XTF2_HOME_CTRL   = &h00000001 ! [116] exit on HOME w/o CTRL+
    define XTF2_END_CTRL    = &h00000002 ! [116] exit on END w/o CTRL+
    define XTF2_NAVCOL      = &h00000003 ! [116] combo of above for edit/nav
    define XTF2_PORTRAIT    = &h00000004 ! [120] portrait printing
    define XTF2_LANDSCAPE   = &h00000008 ! [120] landscape printing
    define XTF2_AUTOEXPCOL  = &h00000010 ! [121] auto expand cols to fill tree
    define XTF2_CSV         = &h00000020 ! [122] CSV input
    define XTF2_PGUPDN      = &h00000040 ! [123] Enable PgUp/PgDn (exitcodes 4, 6)
    define XTF2_DOWN        = &h00000080 ! [123] Enable Ctrl+Down on last row (exitcode -43)
    define XTF2_CLRDEFER    = &h00000100 ! [127] Clear (ignore) prior deferred events
    define XTF2_NORECOLDEF  = &h00000200 ! [127] Don't reproc coldef if no chg or ""
    define XTF2_NORESPONSE  = &h00000400 ! [129] (with XTF_NOSEL,ATE) no respnse
    define XTF2_PROPSHEET   = &h00000800 ! [130] Property sheet mode
    define XTF2_ANSEQDATA   = &h00001000 ! [130] Ansary and data are same layout (or same variable)
    define XTF2_DRAGDROP2   = &h00002000 ! [131] Inter-tree drag/drop
    define XTF2_SAVRES      = &h00008000 ! [132] (PCKLST) save or restore area
    define XTF2_POPUP       = &h00010000 ! [133] Use popup window (thick border)
    define XTF2_ENTERNAVDOWN= &h00020000 ! [134] Default nav mode down
    define XTF2_PIXCOORDS   = &h00040000 ! [136] coordinates are in pixels
    define XTF2_ITEMICONS   = &h00080000 ! [137] use item/level icons
    define XTF2_CTRLC_COPY  = &h00100000 ! [138] ^c copy to clipboard
    define XTF2_UTF8        = &h00200000 ! [140] strings assumed to contains UTF8 chars
    define XTF2_AUTOEXPROW  = &h00400000 ! [140] Expand row height to fill vertical space
    define XTF2_AUTOFILTER  = &h00800000 ! [141] 6.5.1640.0+

! *** [107] XTREE XTR'SELECTAREA symbols
!   (define where you can click to select an item)
    define XTRSEL_AREA_ANY    = &h0000    ! click anywhere on row
    define XTRSEL_AREA_CELLS  = &h0001    ! click on any cell on row
    define XTRSEL_AREA_CELL1  = &h0002    ! click first cell only
    define XTRSEL_AREA_CELL1T = &h0003    ! click only text in first cell

! *** [107] more XTR'SELECTAREA symbols
!   (define how selected item is highlighted - note that since XTREE is
!   not a grid but a tree, it does not offer an option to highlight
!   an individual cell; only options are to limit the selection bar to:)
    define XTRSEL_STY_ALL        = &h0000 ! highlight entire row
    define XTRSEL_STY_CELLS      = &h0010 ! highlight all cells of row
    define XTRSEL_STY_NONE       = &h0020 ! no highlight [112]
    define XTRSEL_STY_CELL1      = &h0030 ! highlight first cell only [140] was 20
    define XTRSEL_STY_CELL1T     = &h0040 ! highlight only text in first cell
    define XTRSEL_STY_ALL_GRD    = &h0050 ! [109] STY_ALL + gradiant
    define XTRSEL_STY_CELLS_GRD  = &h0060 ! [109] STY_CELLS + gradiant
    define XTRSEL_STY_CELL1_GRD  = &h0070 ! [109] STY_CELL1T + gradiant
    define XTRSEL_EDIT_KEEP      = &h0080 ! [171] keep row sel bar active during editing

!*** [107] XTR'OPCODE symbols
    define XTROP_CREATE     = 0           ! add
    define XTROP_REPLACE    = 1           ! replace data
    define XTROP_APPEND     = 2           ! append to existing data
    define XTROP_DELETE     = 3           ! delete xtree
    define XTROP_RESELECT   = 4           ! reselect (existing ctl, data)
    define XTROP_DELSEL     = 5           ! delete selected rows, then resel
    define XTROP_PRINT      = 6           ! print selected control (5.1+)

!***[109] XTR'SEARCHMODE symbols
    define XTRSRCH_TOP_ALL  = 0     ! [109] all chars, items, from top
    define XTRSRCH_TOP_ONE  = 1     ! [109] one char, all items, from top
    define XTRSRCH_NONE     = 2     ! [109] no search
    define XTRSRCH_TOP_ALLX = 3     ! [109] like TOP_ALL but skip collapsed dependents
    define XTRSRCH_TOP_ONEX = 4     ! [109] like TOP_ONE but "  "
    define XTRSRCH_NXT_ONE  = 5     ! [109] like TOP_ONE but start from cur itm, wrap
    define XTRSRCH_NXT_ONEX = 6     ! [109] like TOP_ONEX but "  "   "
    define XTRSRCH_NXT_ALL  = 7     ! [109] like TOP_ALL but start from cur item
    define XTRSRCH_NXT_ALLX = 8     ! [109] like NXT_ALL but skip collapsed dependents

!***[109] XTR'GRIDSTYLE symbols
    define XTRGRID_VERT     = 0     ! [109] solid vert lines
    define XTRGRID_HORZ     = 1     ! [109] solid horz lines
    define XTRGRID_BOTH     = 2     ! [109] solid vert & horz lines
    define XTRGRID_VERT_D0T = 3     ! [109] dotted vert lines
    define XTRGRID_HORZ_DOT = 4     ! [109] dotted horz lines
    define XTRGRID_BOTH_DOT = 5     ! [109] dotted vert & horz lines

!***[111] XTR'USRCFG symbol (controls which config features from user's
!***[111] previous session override parameters passed by application)
    define XTUCFG_COLWID    = &h0001     ! [111] column widths (Dspwid)
![126]define XTUCFG_SRTORD    = 2        ! [111] columnactive,columnsort(),sortorder()
    define XTUCFG_COLSRT    = &h0002     ! [125] columnsort(),sortorder()
    define XTUCFG_COLORD    = &h0004     ! [111] colorder()
    define XTUCFG_FONT      = &h0008     ! [125] used saved font
    define XTUCFG_COLACT    = &h0010     ! [126] columnactive (now separate)
    define XTUCFG_SRTORD    = &h0012     ! [126] COLSRT + COLACT
    define XTUCFG_ALL       = &h00FF     ! [111] all features available

!***[113] XTR'EXPANDLEVEL flags (in addition to values 0-9)
    define XTEXPF_SAVE      = &h40  ! [113] save expand/contract status
    define XTEXPF_RESTORE   = &h80  ! [113] restore status (XTROP_REPLACE)

!***[115] XTR'HEADERSTYLE flags (and XTR'ROWHDRSTYLE)
    define XTHSF_VCENTER     = &h00   ! [115] horizontal alignment
    define XTHSF_TOP         = &h01   ! [115] top alignment
    define XTHSF_BOTTOM      = &h02   ! [115] horizontal alignment
    define XTHSF_NOTBTN      = &h20   ! [115] headers are simple titles, not buttons
    define XTHSF_NOHIGHLIGHT = &h20   ! [117] new name for NOTBTN flag
    define XTHSF_BTNSTAY     = &h40   ! [115] header buttons stay down when clicked (if not NOTBTN)
    define XTHSF_DISABLED    = &h80   ! [115] header disabled, cannot be clicked

!***[118] XTR'SHOWROWHDR flags
    define XTRHF_NONE      = 0     ! [118] no row headers
    define XTRHF_BTNCNT0   = 3     ! [118] numeric buttons, from 0
    define XTRHF_TITLECNT0 = 4     ! [118] numeric titles, from 0
    define XTRHF_BTNCNT1   = 5     ! [118] numeric buttons, from 1
    define XTRHF_TITLECNT1 = 6     ! [118] numeric titles, from 1

!***[115] XTR'NFSELSTYLE flags
    define XTNFS_GRAY      = 0      ! [115] inactive sel bar is gray
    define XTNFS_BLUE      = 1      ! [115] inactive sel bar is blue
    define XTNFS_FRAME     = 2      ! [115] inactive sel bar is frame
    define XTNFS_NONE      = 3      ! [115] no inactive sel bar
    define XTNFS_NOFOCRECT = &h80   ! [115] don't display focus rect (dotted)

!***[118] XTR'MISCFLAGS flags
![119] define XTMF_SHOW3D     = &h01   ! [118] 3D mode
    define XTMF_TRUNCATED  = &h01   ! [119] show ... when truncating column
    define XTMF_INTHEIGHT  = &h02   ! [118] make height integral # of rows
    define XTMF_INHERITBG  = &h04   ! [118] left edge inherits 1st col bg
    define XTMF_STDPRGBAR  = &h08   ! [138] display std progress bar during ATE load
    define XTMF_CUSPRGBAR  = &h10   ! [138] display custom progress bar (parent id in DELCTLID)
    define XTMF_LOADABORT  = &h20   ! [138] allow ESC abort during ATE load
    define XTMF_EDITONLY   = &h40   ! [139] remain in cell editing mode if possible
    define XTMF_NOEXTARGET = &h80   ! [140] ignore external xtree click location (see doc)
    
![124] NUL_MMOCLR needs to be a map so it has ams often unneeded
    define NUL_XFILE$ = ""               ! [124] no file param (array mode)
    define NUL_XMMOCLR = "             " ! [124] dummy MMOCLR param

![128] XTR'SHOWBUTTONS flags
    define XTSBF_HIDE0  = &h02  ! [128] hide lvl 0 +/- buttons
    define XTSFB_HIDE   = &h04  ! [128] typo - use XTSFB_HIDE
    define XTSBF_HIDE   = &h04  ! [142] hide lvl 1 and below buttons
    define XTSBF_LCLICK = &h40  ! [142] treat leftclick like click on +/- if not leaf
    define XTSBF_DBLCLK = &h80  ! [142] treat dblclk or ENTER like click on +/- if not leaf
    
    ! note: other bits currently ignored, default is to show them

++else
++message Skipping XTREE.DEF - already included
++endif
