home *** CD-ROM | disk | FTP | other *** search
- /*=====[ The TesSeRact(TM) CXL User Interface Development System ]======*
- | Copyright (c) 1987-1991, Innovative Data Concepts, Inc.
- | All Rights Reserved.
- |
- | This Library is part of IDC's TesSeRact Development Tools product
- | line. For information about other IDC products, call 1-215-443-9705.
- *-V--------------------------------------------------------------------*
- | $Header: tcxlsel.h 552.2 24 May 1991 14:57:04 $
- |
- | $Log: tcxlsel.h $
- *-D--------------------------------------------------------------------*
- | <TCXLsel.h> : Definitions and prototypes for TCXL selection system
- | (User level).
- *-N-----------------------[ Notes and Caveats ]------------------------*
- | 1) The data-objects marked internal here are NOT for direct caller
- | access.
- | 2) The Slst selection-list object exists and the SelPtr and SelNdx
- | macros are valid ONLY while _Select() is active (i.e., when called
- | by SelFile(), SelStr() or SelTxt()). SelNdx and SelPtr are intended
- | to provide access to the CURRENT selected item from user-defined
- | functions, such as those assigned to hot-keys.
- | 3) The SelCur and SelItm access-macros for the _SelCtl object will
- | return the LAST selected item when _Select() returns, even if the
- | exit key is an [Esc]. SelCur and SelItm remain valid and unchanged,
- | while SelPtr and SelNdx are TRANSIENT.
- | 4) SelFree() MUST be called after SelFile() to free the returned
- | pathname buffer.
- | 5) _SelCtl is declared in _Select.C
- *======================================================================*/
- #ifndef _TCXLsel_
- # define _TCXLsel_ 1 /* Only once! */
- # ifndef _TCXLwin_
- # include <TCXLwin.h> /* Window definitions */
- # endif
- # ifndef _TCXLeng_
- # include <TCXLeng.h> /* Page Selection Engine */
- # endif
- #define MAX_FIL 511 /* SelFile() maximum files */
- #define MAX_NAM 81 /* SelFile() maximum length of pathname */
- /*- SelFlg control bits ------------------*/
- #define SEL_BAR 0x01 /* Frame scroll-bar ON */
- #define SEL_DIR 0x02 /* SelFile() directories ON */
- #define SEL_PAR 0x04 /* SelFile() parent directory ON */
-
- /*------------------[ Data-objects and access-macros ]------------------*/
-
- TYP struct _Sel SelT; /* Object, pointer types */
- TYP struct _Slst SlstT, *SlstP;
-
- struct _Sel /*- Selection-control object -------------*/
- { SlstP slst; /* 00|00 : SelLst : Selection-list object */
- ChrP sitm; /* 02|04 : SelItm : Selected-item pointer */
- ChrP snam; /* 04|08 : SelNam : Selected-item buffer */
- ChrP sfsp[4]; /* 06|0C : SelFsp : Internal pointers */
- VfvCP sgfo; /* 0E|1C : SelGfo : Internal pointer */
- IntT scur; /* 10|20 : SelCur : Selected-item index */
- FlgT sflg; /* 12|22 : SelFlg : Control flags */
- FlgT sgtf; /* 13|23 : SelGtf : Internal flags */
- }; /* 14|24 ]--------------------------------*/
-
- GBL SelT CDC _SelCtl; /*- Global selection-control object ------*/
- #define SelLst (_SelCtl.slst) /* Selection-list */
- #define SelItm (_SelCtl.sitm) /* Selected pointer */
- #define SelNam (_SelCtl.snam) /* Selected pathname */
- #define SelCur (_SelCtl.scur) /* Selected index */
- #define SelFlg (_SelCtl.sflg) /* Control flags */
- #define SelBar (0 != (SelFlg & SEL_BAR)) /* Scroll-bar ON */
- #define SelDir (0 != (SelFlg & SEL_DIR)) /* Directories OFF */
- #define SelPar (0 != (SelFlg & SEL_PAR)) /* Parent OFF */
-
- struct _Slst /*- Internal selection-list object -------*/
- { ChrI sitm; /* 00|00 : Item string array */
- ElstP seng; /* 02|04 : Page Selection Engine */
- IntT scnt; /* 04|08 : Total item count */
- IntT smax; /* 06|0A : Last item */
- IntT scur; /* 08|0C : Current item */
- IntT sbeg; /* 0A|0E : First item on page */
- IntT send; /* 0C|10 : Last item on page */
- IntT swid; /* 0E|12 : Items per line */
- IntT spag; /* 10|14 : Items per page */
- IntT slen; /* 12|16 : Maximum item length */
- IntT sdep; /* 14|18 : Page depth in lines */
- AtrT swat; /* 16|18 : Window attribute */
- AtrT ssat; /* 17|19 : Bar attribute */
- FlgT sflg; /* 18|1A : Control bits */
- BytT sfut; /* 19|1B : Reserved for future */
- }; /* 1A|1C ]--------------------------------*/
-
- /*------------------[ Transient selected-item macros ]------------------*
- | SelNdx is the index of the selected-item string. SelPtr points to the
- | selected-item string. CAVEAT : These macros are ONLY valid while
- | _Select() is active!
- *----------------------------------------------------------------------*/
-
- #define SelNdx (EngCur(SelLst->seng) + SelLst->sbeg)
- #define SelPtr (SelLst->sitm[SelNdx])
-
- /*------------------------[ Function prototypes ]-----------------------*/
-
- #ifdef __cplusplus /* No mangling, please */
- extern "C" {
- #endif
- IntT CTYP _Select(IntT sr, IntT sc, /* Internal selection engine */
- IntT er, IntT ec, BytT bt, AtrT ab, AtrT aw, AtrT as, ChrP sa[],
- IntT ie, VfvCP fo);
- IntT CTYP SelAttr(IntT sr, IntT sc, /* Select attribute */
- BytT bt, AtrT ba, FlgT ab, VfvCP fo);
- VOID SelBarOn(NOARG); /* Frame scroll-bar ON */
- VOID SelBarOff(NOARG); /* Frame scroll-bar OFF */
- VOID SelDirOn(NOARG); /* SelFile() directories ON */
- VOID SelDirOff(NOARG); /* SelFile() directories OFF */
- ChrP CTYP SelFile(IntT sr, IntT sc, /* Select file */
- IntT er, IntT ec, BytT bt, AtrT ba,
- AtrT wa, AtrT sa, FlgT ti, ChrP fs,
- VfvCP fo);
- VOID CTYP SelFree(NOARG); /* Free SelFile() path buffer */
- VOID SelParOn(NOARG); /* SelFile() parent directory ON */
- VOID SelParOff(NOARG); /* SelFile() parent directory OFF*/
- IntT CTYP SelStr(IntT sr, IntT sc, /* Select string */
- IntT er, IntT ec, BytT bt, AtrT ba,
- AtrT wa, AtrT sa, ChrP as[],
- IntT ie, VfvCP fo);
- IntT CTYP SelTxt(BytT wr, BytT wc, /* Select text (active window) */
- AtrT at, ChrP as[], IntT in);
- #define SelBarOn() (SelFlg |= SEL_BAR)
- #define SelBarOff() (SelFlg &= ~SEL_BAR)
- #define SelDirOn() (SelFlg |= SEL_DIR)
- #define SelDirOff() (SelFlg &= ~SEL_DIR)
- #define SelParOn() (SelFlg |= SEL_PAR)
- #define SelParOff() (SelFlg &= ~SEL_PAR)
- #ifdef __cplusplus
- }
- #endif
- #endif /*- _TCXLsel_ : End of TCXLsel.h ------------------------------*/