[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
struct   _Tmni                /*-[ TUI menu item object ]---------------*/
{  ChrP     istr;             /*       : TmniStr : Item string          */
   TuiMniP  ilst;             /*       : TmniLst : Array of child items */
   VposP    ipos;             /*       : TmniPos : Positon Array        */
   ChrP     ikey;             /*       : TmniKey : Array of Hotkeys     */
   WrdT     iflg;             /*       : TmniFlg : Flags                */
   TagT     itag;             /*       : TmniTag : Item ID tag          */
   TagT     ihlp;             /*       : TmniHlp : Help ID tag          */
   IntT     icnt;             /*       : TmniCnt : Count of Items       */
   IntT     icur;             /*       : TmniCur : Current Item         */
};
#define  TmniStr(i)  ((i)->istr)
#define  TmniLst(i)  ((i)->ilst)
#define  TmniFlg(i)  ((i)->iflg)
#define  TmniTag(i)  ((i)->itag)
#define  TmniHlp(i)  ((i)->ihlp)
#define  TmniPos(i)  ((i)->ipos)
#define  TmniCnt(i)  ((i)->icnt)
#define  TmniCur(i)  ((i)->icur)
#define  TmniKey(i)  ((i)->ikey)

#define  NULL_MNU    { NULL, NULL, NULL, NULL, 0, NULL_TAG, 0, 0, 0 }
#define  SEP_MNU     { NULL, NULL, NULL, NULL, TMNU_ENA | TMNU_SEP, 0, 0, 0, 0 }

struct   _Tmnu                /*-[ TUI menu object ]--------------------*/
{  ChrP     mnam;             /*       : TmnuNam : Menu name            */
   TuiMniP  mlst;             /*       : TmnuLst : Array of child items */
   VposP    mpos;             /*       : TmnuPos : Positon Array        */
   ChrP     mkey;             /*       : TmnuKey : Array of Hotkeys     */
   WrdT     mflg;             /*       : TmnuFlg : Flags                */
   TagT     mitg;             /*       : TmnuItg : Item ID tag          */
   IntT     mcnt;             /*       : TmnuCnt : Count of Items       */
   IntT     mcur;             /*       : TmnuCur : Current Item         */
};                            /*       ]--------------------------------*/
#define  TmnuNam(m)  ((m)->mnam)
#define  TmnuLst(m)  ((m)->mlst)
#define  TmnuFlg(m)  ((m)->mflg)
#define  TmnuItg(m)  ((m)->mitg)
#define  TmnuPos(m)  ((m)->mpos)
#define  TmnuCnt(m)  ((m)->mcnt)
#define  TmnuCur(m)  ((m)->mcur)
#define  TmnuKey(m)  ((m)->mkey)

struct   _Tdli                /*-[ TUI dialog item object ]-------------*/
{  ChrP     istr;             /*       : TdliStr : Text string          */
   TuiIcoP  iico;             /*       : TdliIco : Icon object          */
   WrdT     ityp;             /*       : TdliTyp : Dialog item type     */
   WrdT     ifl1;             /*       : TdliFl1 : General flags        */
   WrdT     ifl2;             /*       : TdliFl2 : Type-specific flags  */
   WrdT     irow;             /*       : TdliRow : Starting row         */
   WrdT     icol;             /*       : TdliCol : Starting column      */
   WrdT     iwid;             /*       : TdliWid : Width                */
   WrdT     idep;             /*       : TdliDep : Depth                */
   IntT     ihil;             /*       : TdliHil : Highlight index      */
   KeyT     ikey;             /*       : TdliKey : Hotkey               */
   TagT     itag;             /*       : TdliTag : Item ID tag          */
   TagT     ihlp;             /*       : TdlgHlp : Help tag             */
};                            /*       ]--------------------------------*/
#define  TdliStr(i)  ((i)->istr)
#define  TdliIco(i)  ((i)->iico)
#define  TdliTyp(i)  ((i)->ityp)
#define  TdliFl1(i)  ((i)->ifl1)
#define  TdliFl2(i)  ((i)->ifl2)
#define  TdliRow(i)  ((i)->irow)
#define  TdliCol(i)  ((i)->icol)
#define  TdliWid(i)  ((i)->iwid)
#define  TdliDep(i)  ((i)->idep)
#define  TdliHil(i)  ((i)->ihil)
#define  TdliKey(i)  ((i)->ikey)
#define  TdliTag(i)  ((i)->itag)
#define  TdliHlp(i)  ((i)->ihlp)
#define  NULL_DLI    { NULL, NULL, 0, 0, 0, 0, 0, 0, 0, -1, 0, NULL_TAG, 0 }

struct   _Tdlg                /*-[ TUI dialog object ]------------------*/
{  ChrP     dnam;             /*       : TdlgNam : Dialog name          */
   ChrP     dttl;             /*       : TdlgTtl : Title/caption        */
   ChrP     dmnu;             /*       : TdlgMnu : Attached menu        */
   TuiDliP  ddli;             /*       : TdlgCtl : Array of dialog items*/
   TuiFntP  dfnt;             /*       : TdlgFnt : Attached font        */
   DwdT     dflg;             /*       : TdlgFlg : Flags                */
   WrdT     drow;             /*       : TdlgRow : Starting row         */
   WrdT     dcol;             /*       : TdlgCol : Starting column      */
   WrdT     dwid;             /*       : TdlgWid : Width                */
   WrdT     ddep;             /*       : TdlgDep : Depth                */
   TagT     ddtg;             /*       : TdlgDtg : tag of default item  */
};                            /*       ]--------------------------------*/
#define  TdlgNam(d)  ((d)->dnam)
#define  TdlgTtl(d)  ((d)->dttl)
#define  TdlgDli(d)  ((d)->ddli)
#define  TdlgMnu(d)  ((d)->dmnu)
#define  TdlgFnt(d)  ((d)->dfnt)
#define  TdlgFlg(d)  ((d)->dflg)
#define  TdlgRow(d)  ((d)->drow)
#define  TdlgCol(d)  ((d)->dcol)
#define  TdlgWid(d)  ((d)->dwid)
#define  TdlgDep(d)  ((d)->ddep)
#define  TdlgDtg(d)  ((d)->ddtg)

#define  NULL_DLG    { NULL, NULL, NULL, NULL, NULL, 0L, \
                       NEG1, NEG1, NEG1, NEG1, NULL_TAG }

union    _Tobj                /*-[ TUI object-chain data object ]-------*/
{  TuiResP  res;              /*       : TobjRes : Resource list        */
   TuiActP  act;              /*       : TobjAct : Action list          */
   TuiHlpP  hlp;              /*       : TobjHlp : Help list            */
};                            /*       ]--------------------------------*/
#define  TobjRes(o)  ((o)->res)
#define  TobjAct(o)  ((o)->act)
#define  TobjHlp(o)  ((o)->hlp)

struct   _Tlnk                /*-[ TUI object-chain link object ]-------*/
{  TuiLnkP     lprv;          /*       : TlnkPrv : Prev link in chain   */
   TuiLnkP     lnxt;          /*       : TlnkNxt : Next link in chain   */
   TuiObjP     lobj;          /*       : TlnkObj : Object list          */
   IntT        lcnt;          /*       : TlnkCnt : Object count in list */
};                            /*       ]--------------------------------*/
#define  TlnkPrv(n)  ((n)->lprv)
#define  TlnkNxt(n)  ((n)->lnxt)
#define  TlnkObj(n)  ((n)->lobj)
#define  TlnkCnt(n)  ((n)->lcnt)
#define  NULL_LNK    { NULL, NULL, NULL, 0 }

struct   _Ftyp                /*-[ File type object for file dialogs ]--*/
{  ChrP     fdsc;             /*       : FtypDsc : Description string   */
   ChrP     fspc;             /*       : FtypSpc : Filespec             */
};                            /*       ]--------------------------------*/
#define  FtypDsc(f)  ((f)->fdsc)
#define  FtypSpc(f)  ((f)->fspc)
#define  NULL_FTYP   { NULL, NULL }

struct   _Fsel                /*-[ File dialog parameter/return object ]*/
{  FtypP    ftyp;             /*       : FselTyp : List of file types   */
   StagP    ftag;             /*       : FselTag : Head tag object      */
   ChrP     fttl;             /*       : FselTtl : Dialog title         */
   ChrP     fdpt;             /*       : FselDpt : Default path         */
   ChrP     fsel;             /*       : FselSel : Resulting filename   */
   WrdT     fflg;             /*       : FselFlg : Flags                */
   IntT     ftid;             /*       : FselTid : Type index           */
   IntT     fnum;             /*       : FselNum : Number of selections */
};                            /*       ]--------------------------------*/
#define  FselTyp(f)     ((f)->ftyp)
#define  FselTypT(f,i)  (((f)->ftyp)[(i)])
#define  FselTag(f)     ((f)->ftag)
#define  FselTtl(f)     ((f)->fttl)
#define  FselDpt(f)     ((f)->fdpt)
#define  FselFlg(f)     ((f)->fflg)
#define  FselSng(f)     (0 != (FselFlg(f) & FSEL_SNG))
#define  FselMul(f)     (0 != (FselFlg(f) & FSEL_MUL))
#define  FselRdo(f)     (0 != (FselFlg(f) & FSEL_RDO))
#define  FselHrd(f)     (0 != (FselFlg(f) & FSEL_HRD))
#define  FselSrt(f)     (0 != (FselFlg(f) & FSEL_SRT))
#define  FselSel(f)     ((f)->fsel)
#define  FselTid(f)     ((f)->ftid)
#define  FselNum(f)     ((f)->fnum)

struct   _Inf                 /*-[ Info box parameter object ]----------*/
{  ChrP  ittl;                /*       : InfTtl : Title string          */
   ChrP  istr;                /*       : InfStr : Message string        */
   TagT  itag;                /*       : InfTag : String resource tag   */
   TagT  iico;                /*       : InfIco : Icon tag              */
   WrdT  iflg;                /*       : InfFlg : Flags                 */
};                            /*       ]--------------------------------*/
#define  InfTtl(i)   ((i)->ittl)
#define  InfStr(i)   ((i)->istr)
#define  InfTag(i)   ((i)->itag)
#define  InfIco(i)   ((i)->iico)
#define  InfFlg(i)   ((i)->iflg)
#define  InfBel(i)   (0 != (InfFlg(i) & INF_BEL))
#define  InfBt1(i)   (0 != (InfFlg(i) & INF_BT1))
#define  InfBt2(i)   (0 != (InfFlg(i) & INF_BT2))
#define  InfBt3(i)   (0 != (InfFlg(i) & INF_BT3))
#define  InfAbt(i)   (0 != (InfFlg(i) & INF_ABT))
#define  InfCan(i)   (0 != (InfFlg(i) & INF_CAN))
#define  InfIgn(i)   (0 != (InfFlg(i) & INF_IGN))
#define  InfNo(i)    (0 != (InfFlg(i) & INF_NO))
#define  InfOk(i)    (0 != (InfFlg(i) & INF_OK))
#define  InfRty(i)   (0 != (InfFlg(i) & INF_RTY))
#define  InfYes(i)   (0 != (InfFlg(i) & INF_YES))

/*------------------------[ Function prototypes ]-----------------------*/

#ifdef   __cplusplus                   /* no mangling, please           */
   extern   "C"   {
#endif

WndT  CTYP  TuiInit(TuiWinP Win,       /* Start up TUI, main window     */
   TuiResP Res, TuiActP Act,
   TuiHlpP Hlp);
VOID  CTYP  TuiGet(NOARG);             /* Initiate user events          */
#if (_TCXL_ccp_ == (_IDC_BORLAND_ | _IDC_OS232_))
VOID  _stdcall _TuiTerm(NOARG);        /* INTERNAL                      */
#else
VOID  CDC   _TuiTerm(NOARG);           /* INTERNAL                      */
#endif
KeyT  CTYP  TuiKeyGetc(NOARG);         /* Get key/mouse event           */
FlgT  CTYP  _IsLastItm(TuiDliP q);
VOID  CTYP  TuiSetCur(TuiWinP s);

#ifdef   __cplusplus
int   CDC  TcxlMain(int, char **);     /* Must have prototype for C++   */
#endif

                                       /*-[ Menu routines ]-------------*/
IntT  CTYP  TuiMenu(WndT wh,           /* Add/replace menu in window    */
   TagT tag);
FlgT  CTYP  TuiMnuGetChk(TagT tag);    /* Get checked state             */
FlgT  CTYP  TuiMnuSetChk(TagT tag,     /* Set/reset checked state       */
   FlgT f);
FlgT  CTYP  TuiMnuGetEna(TagT tag);    /* Get enabled state             */
FlgT  CTYP  TuiMnuSetEna(TagT tag,     /* Set/reset enabled state       */
   FlgT f);

                                       /*-[ Dialog routines ]-----------*/
IntT  CTYP  TuiDialog(TagT tag);       /* Display/process dialog        */

IntT  CTYP  TuiDliGetNum(TagT tag,     /* Get number from item          */
   WrdP num, FlgT sign);
VOID  CTYP  TuiDliSetNum(TagT tag,     /* Put number in item            */
   WrdT num, FlgT sign);

IntT  CTYP  TuiDliGetStr(TagT tag,     /* Get string from item          */
   ChrP buf, IntT ndx);
VOID  CTYP  TuiDliSetStr(TagT tag,     /* Put string in item            */
   ChrP buf);
VOID  CTYP  TuiDliSetLst(TagT tag,     /* Put string list in item       */
   ChrI buf);
IntT  CTYP  TuiDliSetFil(TagT tag,     /* Put file list in item         */
   TagT tag2, WrdT atr, ChrP fs);

FlgT  CTYP  TuiDliGetFlg(TagT tag);    /* Get item on/off state         */
VOID  CTYP  TuiDliSetFlg(TagT tag,     /* Set item on/off state         */
   FlgT f);

FlgT  CTYP  TuiDliGetSta(TagT tag);    /* Get item enable status        */
VOID  CTYP  TuiDliSetSta(TagT tag,     /* Set item enable status        */
   FlgT f);

IntT  CTYP  TuiInform(InfP inf);       /* Popup message box             */
FlgT  CTYP  _TuiSelFile(FselP sel,     /* Select a filename             */
   FlgT f);
#define  TuiSelFile(sel)   _TuiSelFile((sel),TRUE)
#define  TuiSelFileAs(sel) _TuiSelFile((sel),FALSE)
VOID  CTYP  TuiSelFree(FselP sel);

                                       /*-[ Help routines ]-------------*/
VOID  CTYP  TuiHelp(TagT tag);         /* Get help by tag-id            */
VOID  CTYP  TuiHelpMsg(WrdT msg);      /* Get help by msg/topic number  */
VOID  CTYP  _TuiHelp(NOARG);           /* Get help by default tag       */

                                       /*-[ String tables ]-------------*/
VOID  CTYP  TuiStrGet(TagT tag,        /* Get a string resource         */
   ChrP buf, IntT max);

                                       /*-[ Window routines ]-----------*/
WndT  CTYP  TuiWindow(TuiWinP Win);    /* Create window                 */
VOID  CTYP  TuiActiv(WndT wh);         /* Activate TUI window           */
VOID  CTYP  TuiClose(NOARG);           /* Close a TUI window            */
VOID  CTYP  TuiRestore(NOARG);         /* Resotore size/position        */
VOID  CTYP  TuiNext(NOARG);            /* Goto next window              */
VOID  CTYP  TuiMaximize(NOARG);        /* Maximize (full screen)        */
VOID  CTYP  TuiMinimize(NOARG);        /* Minimize (iconic)             */
VOID  CTYP  TuiSizeM(NOARG);           /* Resize with mouse             */
VOID  CTYP  TuiMoveM(NOARG);           /* Move with mouse               */
VOID  CTYP  TuiSizeK(NOARG);           /* Resize with keyboard          */
VOID  CTYP  TuiMoveK(NOARG);           /* Move with keyboard            */
VOID  CTYP  TuiSysMenu(NOARG);         /* Activate system menu          */
VOID  CTYP  TuiMainMenu(NOARG);        /* Activate main menu            */
VOID  CTYP  TuiTitle(WndT wh,          /* Add/replace title string      */
   ChrP ttl);
VOID  CTYP  TuiChange(WndT wh,         /* Change virtual size           */
   WrdT vrow, WrdT vcol);
VOID  CTYP  TuiScrlClient(WdfP w,      /* Scroll client area            */
   IntT cmd, WrdT or);

WrdT  CTYP  TuiGetW(WdfP w);           /* Get events                    */
WrdT  CTYP  TuiGetD(WdfP w);           /* Get events                    */

                                       /*-[ Screen output ]-------------*/
VOID  CTYP  TuiPutc(WndT wh, WrdT wr,  /* Write a character             */
   WrdT wc, ChrT c);
VOID  CTYP  TuiPuts(WndT wh, WrdT wr,  /* Write a string (no wrapping)  */
   WrdT wc, ChrP fs);
VOID  CTYP  TuiPutsw(WndT wh, WrdT wr, /* Write a string (auto-wrap)    */
   WrdT wc, ChrP fs);

                                       /*-[ Internals ]-----------------*/
#if (_TCXL_gui_ == 0)
#  define _TuiTerm()
#endif

                                       /*-[ Event handlers ]------------*/
#if (_TCXL_gui_ == 1)

VOID  CTYP  _SetScrlBar(WdfP w);
VOID  CTYP  _TuiMswScrH(WdfP w, WrdT msg, WrdT pos);
VOID  CTYP  _TuiMswScrV(WdfP w, WrdT msg, WrdT pos);

#elif (_TCXL_gui_ == 2)

VOID  CTYP  _SetScrlBar(WdfP w);
VOID  CTYP  _TuiTpmScrH(WdfP w, WrdT msg, WrdT pos);
VOID  CTYP  _TuiTpmScrV(WdfP w, WrdT msg, WrdT pos);

#else

VOID  CTYP  TuiDrwMenu(WdfP w, TuiMnuP m, FlgT f);
VOID  CTYP  _TuiFrame(WdfP w);
WrdT  CTYP  _TuiReSize(WevtP h, WrdT k);
WrdT  CTYP  _TuiSize(WevtP h, WrdT k);
WrdT  CTYP  _TuiMove(WevtP h, WrdT k);
WrdT  CTYP  _TuiIcon(WevtP h, WrdT k);
WrdT  CTYP  _TuiMoutyp(WevtP h, WrdT k);
WrdT  CTYP  _TuiBackg(WevtP h, WrdT k);
WrdT  CTYP  _TuiKeys(WevtP h, WrdT k);
WrdT  CTYP  _TuiMous(WevtP h, WrdT k);
WrdT  CTYP  _TuiMenu(WevtP h, WrdT k);
WrdT  CTYP  _TuiKey(WdfP w);
WrdT  CTYP  _TuiAccKey1(WevtP h, WrdT k);
WrdT  CTYP  _TuiAccKey2(WevtP h, WrdT k);
WrdT  CTYP  _TuiSch(WevtP h, WrdT k);
WrdT  CTYP  _TuiScv(WevtP h, WrdT k);
VOID  CTYP  _TuiAdjustWin(WdfP w, WrdT rs);
WrdT  CTYP  _ScrlCalcPos(WdfP w, IntT typ);
VOID  CTYP  _DrwScrlBar(WdfP w, IntT typ);
WrdT  CTYP  _TuiMouHlp(WevtP h, WrdT k);
WrdT  CTYP  _TuiDlg(WevtP h, WrdT k);
#endif

                                       /*-[ Object chain internals ]----*/
FlgT     CTYP  __ChainAdd(BytT typ, AnyP list);
#define  _ChainAddRes(list)   __ChainAdd(TOBJ_RES,(AnyP)(list))
#define  _ChainAddAct(list)   __ChainAdd(TOBJ_ACT,(AnyP)(list))
#define  _ChainAddHlp(list)   __ChainAdd(TOBJ_HLP,(AnyP)(list))
#define  _ChainAddDlg(list)   __ChainAdd(TOBJ_DLG,(AnyP)(list))
#define  _ChainAddHla(list)   __ChainAdd(TOBJ_HLA,(AnyP)(list))

TuiResP  CTYP  _FindResStr(ChrP str);
TuiResP  CTYP  _FindRes(TagT tag);
TuiHlpP  CTYP  _FindHlp(TagT tag);

TuiActP  CTYP  __FindAct(BytT typ, TagT tag);
#define  _FindAct(tag)        __FindAct(TOBJ_ACT,(tag))
#define  _FindDlgAct(tag)     __FindAct(TOBJ_DLG,(tag))
#define  _FindHlpAct(tag)     __FindAct(TOBJ_HLA,(tag))

VOID     CTYP  _ChainKill(TuiLnkP chain);

                                       /*-[ Action internals ]----------*/
VOID  CTYP  __TuiDispatch(BytT typ, TagT tag);
#define  _TuiDispatch(tag)    __TuiDispatch(TOBJ_ACT,(tag))
#define  _TuiDispatchDlg(tag) __TuiDispatch(TOBJ_DLG,(tag))
#define  _TuiDispatchHlp(tag) __TuiDispatch(TOBJ_HLA,(tag))

#if (_TCXL_gui_ == 0)                  /*-[ Event handler helpers ]-----*/
VOID  CTYP  TuiEvtAdd(WdfP w, WfepwCP h);
VOID  CTYP  TuiEvtStop(WdfP w, WfepwCP e);
VOID  CTYP  TuiEvtFree(WdfP w);
                                       /*-[ Dialog internals ]----------*/
VOID  CTYP  _GrpLim(WrdT i, WrdP fst, WrdP lst);
VOID  CTYP  _ButTog(WrdT i);
VOID  CTYP  _ItmAct(WrdT i, FlgT f);
WrdT  CTYP  _NxtNdx(FlgT f);
WrdT  CTYP  _PrvNdx(FlgT f);
#endif

                                       /*-[ Macros ]--------------------*/
#define  TuiDesktopOff()   (TctlFlg |= TCTL_NBK)
#define  TuiShadowOn()     (TctlFlg |= TCTL_SHA)

#ifdef __cplusplus
   }
#endif
#endif   /*- _TCXLtui_ : End of TCXLtui.h ----------------------------- */

This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson