├── Include ├── APP.H ├── BUFFERS.H ├── COLORSEL.H ├── CONFIG.H ├── DIALOGS.H ├── DRAWBUF.H ├── EDITORS.H ├── HARDWARE.H ├── HELP.H ├── HELPBASE.H ├── MENUS.H ├── MSGBOX.H ├── OBJECTS.H ├── OUTLINE.H ├── RESOURCE.H ├── STDDLG.H ├── SYSTEM.H ├── TEXTVIEW.H ├── TKEYS.H ├── TOBJSTRM.H ├── TTYPES.H ├── TV.H ├── TVOBJS.H ├── UTIL.H ├── VALIDATE.H └── VIEWS.H ├── LICENSE ├── Source ├── COLORSEL.CPP ├── DRIVERS.CPP ├── DRIVERS2.CPP ├── EDITS.ASM ├── EDITSTAT.CPP ├── FRAMELIN.ASM ├── GENINC.CPP ├── GRP.CPP ├── HARDWARE.ASM ├── HARDWRVR.CPP ├── HELP.CPP ├── HELPBASE.CPP ├── HISTLIST.CPP ├── MAKEFILE ├── MAPCOLOR.CPP ├── MENU.CPP ├── MISC.CPP ├── MSGBOX.CPP ├── NEW.CPP ├── NEWSTR.CPP ├── NMBKGRND.CPP ├── NMBUTTON.CPP ├── NMCHDRDL.CPP ├── NMCHKBOX.CPP ├── NMCLRSEL.CPP ├── NMCLUSTR.CPP ├── NMCOLLCT.CPP ├── NMDIALOG.CPP ├── NMDIRBOX.CPP ├── NMDIRCOL.CPP ├── NMDSKTOP.CPP ├── NMEDITOR.CPP ├── NMFILCOL.CPP ├── NMFILDLG.CPP ├── NMFILLST.CPP ├── NMFRAME.CPP ├── NMGROUP.CPP ├── NMHIST.CPP ├── NMINPTLN.CPP ├── NMLABEL.CPP ├── NMLSTBOX.CPP ├── NMLSTVWR.CPP ├── NMMNUBAR.CPP ├── NMMNUBOX.CPP ├── NMMNUPOP.CPP ├── NMMNUVW.CPP ├── NMMULCHK.CPP ├── NMOUTLIN.CPP ├── NMPRMTXT.CPP ├── NMRBTNS.CPP ├── NMRESCOL.CPP ├── NMSCOLL.CPP ├── NMSCRBAR.CPP ├── NMSCROLL.CPP ├── NMSTCTXT.CPP ├── NMSTDDLG.CPP ├── NMSTLINE.CPP ├── NMSTRCOL.CPP ├── NMSTRLST.CPP ├── NMVALIDA.CPP ├── NMVIEW.CPP ├── NMWINDOW.CPP ├── PALETTE.CPP ├── SBKGRND.CPP ├── SBUTTON.CPP ├── SCHDRDLG.CPP ├── SCHECKBO.CPP ├── SCLRSEL.CPP ├── SCLUSTER.CPP ├── SDESKTOP.CPP ├── SDIALOG.CPP ├── SDIRCOLL.CPP ├── SDIRLIST.CPP ├── SEDITORS.CPP ├── SFILCOLL.CPP ├── SFILDLG.CPP ├── SFILELST.CPP ├── SFINFPNE.CPP ├── SFINPUTL.CPP ├── SFRAME.CPP ├── SGROUP.CPP ├── SHISTORY.CPP ├── SINPUTLI.CPP ├── SLABEL.CPP ├── SLISTBOX.CPP ├── SLSTVIEW.CPP ├── SMENUBAR.CPP ├── SMENUBOX.CPP ├── SMENUPOP.CPP ├── SMNUVIEW.CPP ├── SMULCHKB.CPP ├── SOUTLINE.CPP ├── SPARAMTE.CPP ├── SRADIOBU.CPP ├── SRESCOLL.CPP ├── SSCRLBAR.CPP ├── SSCROLLE.CPP ├── SSTATICT.CPP ├── SSTATUSL.CPP ├── SSTRCOLL.CPP ├── SSTRLST.CPP ├── STDDLG.CPP ├── STRMSTAT.CPP ├── SVALID.CPP ├── SVIEW.CPP ├── SWAPST.ASM ├── SWINDOW.CPP ├── SYSERR.CPP ├── SYSINT.ASM ├── TAPPLICA.CPP ├── TBKGRND.CPP ├── TBUTTON.CPP ├── TCHDRDLG.CPP ├── TCHECKBO.CPP ├── TCLUSTER.CPP ├── TCMDSET.CPP ├── TCOLLECT.CPP ├── TDESKTOP.CPP ├── TDIALOG.CPP ├── TDIRCOLL.CPP ├── TDIRLIST.CPP ├── TEDITOR1.CPP ├── TEDITOR2.CPP ├── TEDITWND.CPP ├── TEVENT.CPP ├── TEXTVIEW.CPP ├── TFILDLG.CPP ├── TFILECOL.CPP ├── TFILEDTR.CPP ├── TFILLIST.CPP ├── TFRAME.CPP ├── TGRMV.ASM ├── TGROUP.CPP ├── THISTORY.CPP ├── THISTWIN.CPP ├── THSTVIEW.CPP ├── TINDICTR.CPP ├── TINPUTLI.CPP ├── TLABEL.CPP ├── TLISTBOX.CPP ├── TLSTVIEW.CPP ├── TMEMO.CPP ├── TMENUBAR.CPP ├── TMENUBOX.CPP ├── TMENUPOP.CPP ├── TMNUVIEW.CPP ├── TMOUSE.CPP ├── TMULCHKB.CPP ├── TOBJECT.CPP ├── TOBJSTRM.CPP ├── TOUTLINE.CPP ├── TPARAMTE.CPP ├── TPOINT.CPP ├── TPROGRAM.CPP ├── TRADIOBU.CPP ├── TRESCOLL.CPP ├── TRESFILE.CPP ├── TSCREEN.CPP ├── TSCRLBAR.CPP ├── TSCROLLE.CPP ├── TSORTCOL.CPP ├── TSTATICT.CPP ├── TSTATUSL.CPP ├── TSTRCOLL.CPP ├── TSTRLIST.CPP ├── TTPRVLNS.ASM ├── TV.INC ├── TVALIDAT.CPP ├── TVCURSOR.ASM ├── TVEXPOSD.ASM ├── TVIEW.CPP ├── TVTEXT1.CPP ├── TVTEXT2.CPP ├── TVWRITE.ASM └── TWINDOW.CPP ├── disclaim.txt └── readme.txt /Include/BUFFERS.H: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------------*/ 2 | /* */ 3 | /* BUFFERS.H */ 4 | /* */ 5 | /* defines the functions getBufMem() and freeBufMem() for use */ 6 | /* in allocating and freeing viedo buffers */ 7 | /* */ 8 | /* ------------------------------------------------------------------------*/ 9 | /* 10 | * Turbo Vision - Version 2.0 11 | * 12 | * Copyright (c) 1994 by Borland International 13 | * All Rights Reserved. 14 | * 15 | */ 16 | 17 | #pragma option -Vo- 18 | #if defined( __BCOPT__ ) && !defined (__FLAT__) 19 | #pragma option -po- 20 | #endif 21 | 22 | #if defined( Uses_TVMemMgr ) && !defined( __TVMemMgr ) 23 | #define __TVMemMgr 24 | 25 | const DEFAULT_SAFETY_POOL_SIZE = 4096; 26 | 27 | class TBufListEntry 28 | { 29 | 30 | private: 31 | 32 | TBufListEntry( void*& ); 33 | ~TBufListEntry(); 34 | 35 | void *operator new( size_t, size_t ); 36 | void *operator new( size_t ); 37 | void operator delete( void * ); 38 | 39 | TBufListEntry *next; 40 | TBufListEntry *prev; 41 | void*& owner; 42 | 43 | static TBufListEntry *_NEAR bufList; 44 | static Boolean freeHead(); 45 | 46 | friend class TVMemMgr; 47 | friend void *operator new( size_t ); 48 | friend void * allocBlock( size_t ); 49 | 50 | }; 51 | 52 | class TVMemMgr 53 | { 54 | 55 | public: 56 | 57 | TVMemMgr(); 58 | 59 | static void resizeSafetyPool( size_t = DEFAULT_SAFETY_POOL_SIZE ); 60 | static int safetyPoolExhausted(); 61 | 62 | static void allocateDiscardable( void *&, size_t ); 63 | static void freeDiscardable( void * ); 64 | 65 | private: 66 | 67 | static void * _NEAR safetyPool; 68 | static size_t _NEAR safetyPoolSize; 69 | static int _NEAR inited; 70 | static int initMemMgr(); 71 | 72 | }; 73 | 74 | #endif // Uses_TVMemMgr 75 | 76 | #pragma option -Vo. 77 | #if defined( __BCOPT__ ) && !defined (__FLAT__) 78 | #pragma option -po. 79 | #endif 80 | 81 | 82 | -------------------------------------------------------------------------------- /Include/CONFIG.H: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------------*/ 2 | /* */ 3 | /* CONFIG.H */ 4 | /* */ 5 | /* miscellaneous system-wide configuration parameters */ 6 | /* FOR INTERNAL USE ONLY */ 7 | /* */ 8 | /* ------------------------------------------------------------------------*/ 9 | /* 10 | * Turbo Vision - Version 2.0 11 | * 12 | * Copyright (c) 1994 by Borland International 13 | * All Rights Reserved. 14 | * 15 | */ 16 | 17 | #if !defined( __CONFIG_H ) 18 | #define __CONFIG_H 19 | 20 | #if !defined( __LIMITS_H ) 21 | #include 22 | #endif // __LIMITS_H 23 | 24 | const eventQSize = 16; 25 | const maxCollectionSize = (int)(( (long) UINT_MAX - 16)/sizeof( void * )); 26 | 27 | const maxViewWidth = 132; 28 | 29 | const maxFindStrLen = 80; 30 | const maxReplaceStrLen = 80; 31 | 32 | #endif // __CONFIG_H 33 | -------------------------------------------------------------------------------- /Include/DRAWBUF.H: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------------*/ 2 | /* */ 3 | /* DRAWBUF.H */ 4 | /* */ 5 | /* defines the class TDrawBuffer, which provides the high-level */ 6 | /* interface to the Screen Manager. */ 7 | /* */ 8 | /* ------------------------------------------------------------------------*/ 9 | /* 10 | * Turbo Vision - Version 2.0 11 | * 12 | * Copyright (c) 1994 by Borland International 13 | * All Rights Reserved. 14 | * 15 | */ 16 | 17 | #pragma option -Vo- 18 | #if defined( __BCOPT__ ) && !defined (__FLAT__) 19 | #pragma option -po- 20 | #endif 21 | 22 | #if defined( Uses_TDrawBuffer ) && !defined( __TDrawBuffer ) 23 | #define __TDrawBuffer 24 | 25 | class TDrawBuffer 26 | { 27 | 28 | friend class TSystemError; 29 | friend class TView; 30 | friend void genRefs(); 31 | 32 | public: 33 | 34 | void moveChar( ushort indent, char c, ushort attr, ushort count ); 35 | void moveStr( ushort indent, const char _FAR *str, ushort attrs ); 36 | void moveCStr( ushort indent, const char _FAR *str, ushort attrs ); 37 | void moveBuf( ushort indent, const void _FAR *source, 38 | ushort attr, ushort count ); 39 | 40 | void putAttribute( ushort indent, ushort attr ); 41 | void putChar( ushort indent, ushort c ); 42 | 43 | protected: 44 | 45 | ushort data[maxViewWidth]; 46 | 47 | }; 48 | 49 | #define loByte(w) (((uchar *)&w)[0]) 50 | #define hiByte(w) (((uchar *)&w)[1]) 51 | 52 | inline void TDrawBuffer::putAttribute( ushort indent, ushort attr ) 53 | { 54 | hiByte(data[indent]) = uchar(attr); 55 | } 56 | 57 | inline void TDrawBuffer::putChar( ushort indent, ushort c ) 58 | { 59 | loByte(data[indent]) = uchar(c); 60 | } 61 | 62 | #endif // Uses_TDrawBuffer 63 | 64 | #pragma option -Vo. 65 | #if defined( __BCOPT__ ) && !defined (__FLAT__) 66 | #pragma option -po. 67 | #endif 68 | 69 | -------------------------------------------------------------------------------- /Include/HELP.H: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------------*/ 2 | /* */ 3 | /* HELP.H */ 4 | /* */ 5 | /* defines the classes THelpViewer and THelpWindow */ 6 | /* */ 7 | /* ------------------------------------------------------------------------*/ 8 | /* 9 | * Turbo Vision - Version 2.0 10 | * 11 | * Copyright (c) 1994 by Borland International 12 | * All Rights Reserved. 13 | * 14 | */ 15 | 16 | #if !defined( __HELP_H ) 17 | #define __HELP_H 18 | 19 | #define Uses_TStreamable 20 | #define Uses_ipstream 21 | #define Uses_opstream 22 | #define Uses_fpstream 23 | #define Uses_TObject 24 | #define Uses_TPoint 25 | #define Uses_TRect 26 | #define Uses_TEvent 27 | #define Uses_TScroller 28 | #define Uses_TScrollBar 29 | #define Uses_TWindow 30 | #include 31 | 32 | #include 33 | 34 | // THelpViewer 35 | 36 | class THelpViewer : public TScroller 37 | { 38 | public: 39 | 40 | THelpViewer( const TRect&, TScrollBar*, TScrollBar*, THelpFile*, ushort ); 41 | ~THelpViewer(); 42 | 43 | virtual void changeBounds( const TRect& ); 44 | virtual void draw(); 45 | virtual TPalette& getPalette() const; 46 | virtual void handleEvent( TEvent& ); 47 | void makeSelectVisible( int, TPoint&, uchar&, int& ); 48 | void switchToTopic( int ); 49 | 50 | THelpFile *hFile; 51 | THelpTopic *topic; 52 | int selected; 53 | }; 54 | 55 | // THelpWindow 56 | 57 | class THelpWindow : public TWindow 58 | { 59 | 60 | static const char * _NEAR helpWinTitle; 61 | 62 | public: 63 | 64 | THelpWindow( THelpFile*, ushort ); 65 | 66 | virtual TPalette& getPalette() const; 67 | }; 68 | 69 | 70 | extern void notAssigned( opstream& s, int value ); 71 | 72 | extern TCrossRefHandler crossRefHandler; 73 | 74 | #endif // __HELP_H 75 | -------------------------------------------------------------------------------- /Include/MSGBOX.H: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------------*/ 2 | /* */ 3 | /* MSGBOX.H */ 4 | /* */ 5 | /* defines the functions messageBox(), messageBoxRect(), */ 6 | /* inputBox(), and inputBoxRect() */ 7 | /* */ 8 | /* ------------------------------------------------------------------------*/ 9 | /* 10 | * Turbo Vision - Version 2.0 11 | * 12 | * Copyright (c) 1994 by Borland International 13 | * All Rights Reserved. 14 | * 15 | */ 16 | 17 | #if defined( Uses_MsgBox ) && !defined( __MsgBox ) 18 | #define __MsgBox 19 | 20 | #if !defined( __STDARG_H ) 21 | #include 22 | #endif // __STDARG_H 23 | 24 | #pragma option -Vo- 25 | #if defined( __BCOPT__ ) && !defined (__FLAT__) 26 | #pragma option -po- 27 | #endif 28 | 29 | class _FAR TRect; 30 | 31 | ushort messageBox( const char *msg, ushort aOptions ); 32 | ushort messageBox( unsigned aOptions, const char *msg, ... ); 33 | 34 | ushort messageBoxRect( const TRect &r, const char *msg, ushort aOptions ); 35 | ushort messageBoxRect( const TRect &r, ushort aOptions, const char *msg, ... ); 36 | 37 | ushort inputBox( const char *Title, const char *aLabel, char *s, uchar limit ); 38 | 39 | ushort inputBoxRect( const TRect &bounds, const char *title, 40 | const char *aLabel, char *s, uchar limit ); 41 | 42 | const 43 | 44 | // Message box classes 45 | 46 | mfWarning = 0x0000, // Display a Warning box 47 | mfError = 0x0001, // Dispaly a Error box 48 | mfInformation = 0x0002, // Display an Information Box 49 | mfConfirmation = 0x0003, // Display a Confirmation Box 50 | 51 | // Message box button flags 52 | 53 | mfYesButton = 0x0100, // Put a Yes button into the dialog 54 | mfNoButton = 0x0200, // Put a No button into the dialog 55 | mfOKButton = 0x0400, // Put an OK button into the dialog 56 | mfCancelButton = 0x0800, // Put a Cancel button into the dialog 57 | 58 | mfYesNoCancel = mfYesButton | mfNoButton | mfCancelButton, 59 | // Standard Yes, No, Cancel dialog 60 | mfOKCancel = mfOKButton | mfCancelButton; 61 | // Standard OK, Cancel dialog 62 | 63 | class MsgBoxText 64 | { 65 | 66 | public: 67 | 68 | static const char * _NEAR yesText; 69 | static const char * _NEAR noText; 70 | static const char * _NEAR okText; 71 | static const char * _NEAR cancelText; 72 | static const char * _NEAR warningText; 73 | static const char * _NEAR errorText; 74 | static const char * _NEAR informationText; 75 | static const char * _NEAR confirmText; 76 | }; 77 | 78 | #pragma option -Vo. 79 | #if defined( __BCOPT__ ) && !defined (__FLAT__) 80 | #pragma option -po. 81 | #endif 82 | 83 | #endif // Uses_MsgBox 84 | 85 | 86 | -------------------------------------------------------------------------------- /Include/TEXTVIEW.H: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------------*/ 2 | /* */ 3 | /* TEXTVIEW.H */ 4 | /* */ 5 | /* defines the classes TTextDevice and TTerminal */ 6 | /* */ 7 | /* ------------------------------------------------------------------------*/ 8 | /* 9 | * Turbo Vision - Version 2.0 10 | * 11 | * Copyright (c) 1994 by Borland International 12 | * All Rights Reserved. 13 | * 14 | */ 15 | 16 | #pragma option -Vo- 17 | #if defined( __BCOPT__ ) && !defined (__FLAT__) 18 | #pragma option -po- 19 | #endif 20 | 21 | #if defined( Uses_TTextDevice ) && !defined( __TTextDevice ) 22 | #define __TTextDevice 23 | 24 | #include 25 | #pragma option -Vo- 26 | #if defined( __BCOPT__ ) && !defined (__FLAT__) 27 | #pragma option -po- 28 | #endif 29 | 30 | class _FAR TRect; 31 | class _FAR TScrollBar; 32 | 33 | class TTextDevice : public TScroller, public streambuf 34 | { 35 | 36 | public: 37 | 38 | TTextDevice( const TRect& bounds, 39 | TScrollBar *aHScrollBar, 40 | TScrollBar *aVScrollBar 41 | ); 42 | 43 | virtual int do_sputn( const char *s, int count ) = 0; 44 | virtual int overflow( int = EOF ); 45 | 46 | }; 47 | 48 | #endif // Uses_TTextDevice 49 | 50 | #if defined( Uses_TTerminal ) && !defined( __TTerminal ) 51 | #define __TTerminal 52 | 53 | class _FAR TRect; 54 | class _FAR TScrollBar; 55 | 56 | class TTerminal: public TTextDevice 57 | { 58 | 59 | public: 60 | 61 | friend void genRefs(); 62 | 63 | TTerminal( const TRect& bounds, 64 | TScrollBar *aHScrollBar, 65 | TScrollBar *aVScrollBar, 66 | ushort aBufSize 67 | ); 68 | ~TTerminal(); 69 | 70 | virtual int do_sputn( const char *s, int count ); 71 | 72 | void bufInc( ushort& val ); 73 | Boolean canInsert( ushort amount ); 74 | short calcWidth(); 75 | virtual void draw(); 76 | ushort nextLine( ushort pos ); 77 | ushort prevLines( ushort pos, ushort lines ); 78 | Boolean queEmpty(); 79 | 80 | protected: 81 | 82 | ushort bufSize; 83 | char *buffer; 84 | ushort queFront, queBack; 85 | void bufDec(ushort& val); 86 | }; 87 | 88 | #endif // Uses_TTerminal 89 | 90 | #if defined( Uses_otstream ) && !defined( __otstream ) 91 | #define __otstream 92 | 93 | #include 94 | #pragma option -Vo- 95 | #if defined( __BCOPT__ ) && !defined (__FLAT__) 96 | #pragma option -po- 97 | #endif 98 | 99 | 100 | class otstream : public ostream 101 | { 102 | 103 | public: 104 | 105 | otstream( TTerminal * ); 106 | 107 | }; 108 | 109 | 110 | #endif 111 | 112 | #pragma option -Vo. 113 | #if defined( __BCOPT__ ) && !defined (__FLAT__) 114 | #pragma option -po. 115 | #endif 116 | -------------------------------------------------------------------------------- /Include/TTYPES.H: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------------*/ 2 | /* */ 3 | /* TTYPES.H */ 4 | /* */ 5 | /* provides miscellaneous types used throughout Turbo Vision */ 6 | /* */ 7 | /* ------------------------------------------------------------------------*/ 8 | /* 9 | * Turbo Vision - Version 2.0 10 | * 11 | * Copyright (c) 1994 by Borland International 12 | * All Rights Reserved. 13 | * 14 | */ 15 | 16 | #if !defined( __TTYPES_H ) 17 | #define __TTYPES_H 18 | 19 | #if !defined(_NEAR) 20 | #define _NEAR near 21 | #endif 22 | 23 | #include <_defs.h> 24 | 25 | #define I asm 26 | 27 | enum Boolean { False, True }; 28 | 29 | typedef unsigned short ushort; 30 | typedef unsigned char uchar; 31 | typedef unsigned int uint; 32 | typedef unsigned long ulong; 33 | 34 | const char EOS = '\0'; 35 | 36 | enum StreamableInit { streamableInit }; 37 | 38 | class _FAR ipstream; 39 | class _FAR opstream; 40 | class _FAR TStreamable; 41 | class _FAR TStreamableTypes; 42 | 43 | typedef int ccIndex; 44 | typedef Boolean (*ccTestFunc)( void *, void * ); 45 | typedef void (*ccAppFunc)( void *, void * ); 46 | 47 | const ccNotFound = -1; 48 | 49 | extern const uchar specialChars[]; 50 | 51 | #if !defined ( __FLAT__ ) 52 | #define _genInt(i) __int__(i) 53 | #endif 54 | 55 | #endif // __TTYPES_H 56 | -------------------------------------------------------------------------------- /Include/TVOBJS.H: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------------*/ 2 | /* */ 3 | /* TVOBJS.H */ 4 | /* */ 5 | /* defines the classes TObject, TNSCollection, and TNSSortedCollection. */ 6 | /* */ 7 | /* The NS variants of collections are Not Streamable. These are */ 8 | /* needed for internal use in the stream manager. There are */ 9 | /* streamable variants of each of these classes for use by the */ 10 | /* rest of the library. */ 11 | /* */ 12 | /* ------------------------------------------------------------------------*/ 13 | /* 14 | * Turbo Vision - Version 2.0 15 | * 16 | * Copyright (c) 1994 by Borland International 17 | * All Rights Reserved. 18 | * 19 | */ 20 | 21 | #pragma option -Vo- 22 | #if defined( __BCOPT__ ) && !defined (__FLAT__) 23 | #pragma option -po- 24 | #endif 25 | 26 | #if defined( Uses_TObject ) && !defined( __TObject ) 27 | #define __TObject 28 | 29 | #if !defined( __STDDEF_H ) 30 | #include 31 | #endif // __STDDEF_H 32 | 33 | class TObject 34 | { 35 | 36 | public: 37 | 38 | virtual ~TObject(); 39 | 40 | static void destroy( TObject * ); 41 | virtual void shutDown(); 42 | 43 | private: 44 | 45 | }; 46 | 47 | inline void TObject::destroy( TObject *o ) 48 | { 49 | if( o != 0 ) 50 | o->shutDown(); 51 | delete o; 52 | } 53 | 54 | #endif // Uses_TObject 55 | 56 | #if defined( Uses_TNSCollection ) && !defined( __TNSCollection ) 57 | #define __TNSCollection 58 | 59 | class TNSCollection : public TObject 60 | { 61 | 62 | public: 63 | 64 | TNSCollection( ccIndex aLimit, ccIndex aDelta ); 65 | ~TNSCollection(); 66 | 67 | virtual void shutDown(); 68 | 69 | void *at( ccIndex index ); 70 | virtual ccIndex indexOf( void *item ); 71 | 72 | void atFree( ccIndex index ); 73 | void atRemove( ccIndex index ); 74 | void remove( void *item ); 75 | void removeAll(); 76 | void free( void *item ); 77 | void freeAll(); 78 | 79 | void atInsert( ccIndex index, void *item ); 80 | void atPut( ccIndex index, void *item ); 81 | virtual ccIndex insert( void *item ); 82 | 83 | static void error( ccIndex code, ccIndex info ); 84 | 85 | void *firstThat( ccTestFunc Test, void *arg ); 86 | void *lastThat( ccTestFunc Test, void *arg ); 87 | void forEach( ccAppFunc action, void *arg ); 88 | 89 | void pack(); 90 | virtual void setLimit( ccIndex aLimit ); 91 | 92 | ccIndex getCount() 93 | { return count; } 94 | 95 | protected: 96 | 97 | TNSCollection(); 98 | 99 | void **items; 100 | ccIndex count; 101 | ccIndex limit; 102 | ccIndex delta; 103 | Boolean shouldDelete; 104 | 105 | private: 106 | 107 | virtual void freeItem( void *item ); 108 | 109 | }; 110 | 111 | #endif // Uses_TNSCollection 112 | 113 | #if defined( Uses_TNSSortedCollection ) && !defined( __TNSSortedCollection ) 114 | #define __TNSSortedCollection 115 | 116 | class TNSSortedCollection: public virtual TNSCollection 117 | { 118 | 119 | public: 120 | 121 | TNSSortedCollection( ccIndex aLimit, ccIndex aDelta) : 122 | TNSCollection( aLimit, aDelta ), duplicates(False) 123 | { delta = aDelta; setLimit( aLimit ); } 124 | 125 | virtual Boolean search( void *key, ccIndex& index ); 126 | 127 | virtual ccIndex indexOf( void *item ); 128 | virtual ccIndex insert( void *item ); 129 | 130 | Boolean duplicates; 131 | virtual void *keyOf( void *item ); 132 | 133 | protected: 134 | 135 | TNSSortedCollection() : duplicates(False) {} 136 | 137 | private: 138 | 139 | virtual int compare( void *key1, void *key2 ) = 0; 140 | 141 | }; 142 | 143 | #endif // Uses_TNSSortedCollection 144 | 145 | #pragma option -Vo. 146 | #if defined( __BCOPT__ ) && !defined (__FLAT__) 147 | #pragma option -po. 148 | #endif 149 | 150 | -------------------------------------------------------------------------------- /Include/UTIL.H: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------------*/ 2 | /* */ 3 | /* UTIL.H */ 4 | /* */ 5 | /* defines various utility functions used throughout Turbo Vision */ 6 | /* */ 7 | /* ------------------------------------------------------------------------*/ 8 | /* 9 | * Turbo Vision - Version 2.0 10 | * 11 | * Copyright (c) 1994 by Borland International 12 | * All Rights Reserved. 13 | * 14 | */ 15 | 16 | #if !defined( __UTIL_H ) 17 | #define __UTIL_H 18 | 19 | inline int min( int a, int b ) 20 | { 21 | return (a>b) ? b : a; 22 | } 23 | 24 | inline int max( int a, int b ) 25 | { 26 | return (a 20 | 21 | /*------------------------------------------------------------------------*/ 22 | /* */ 23 | /* ctrlToArrow */ 24 | /* */ 25 | /* argument: */ 26 | /* */ 27 | /* keyCode - scan code to be mapped to keypad arrow code */ 28 | /* */ 29 | /* returns: */ 30 | /* */ 31 | /* scan code for arrow key corresponding to Wordstar key, */ 32 | /* or original key code if no correspondence exists */ 33 | /* */ 34 | /*------------------------------------------------------------------------*/ 35 | ushort ctrlToArrow(ushort keyCode) 36 | { 37 | 38 | const uchar ctrlCodes[] = 39 | { 40 | kbCtrlS, kbCtrlD, kbCtrlE, kbCtrlX, kbCtrlA, 41 | kbCtrlF, kbCtrlG, kbCtrlV, kbCtrlR, kbCtrlC, kbCtrlH 42 | }; 43 | 44 | const ushort arrowCodes[] = 45 | { 46 | kbLeft, kbRight, kbUp, kbDown, kbHome, 47 | kbEnd, kbDel, kbIns,kbPgUp, kbPgDn, kbBack 48 | }; 49 | 50 | for( int i = 0; i < sizeof(ctrlCodes); i++ ) 51 | if( (keyCode & 0x00ff) == ctrlCodes[i] ) 52 | return arrowCodes[i]; 53 | return keyCode; 54 | } 55 | 56 | /*------------------------------------------------------------------------*/ 57 | /* */ 58 | /* cstrlen */ 59 | /* */ 60 | /* argument: */ 61 | /* */ 62 | /* s - pointer to 0-terminated string */ 63 | /* */ 64 | /* returns */ 65 | /* */ 66 | /* length of string, ignoring '~' characters. */ 67 | /* */ 68 | /* Comments: */ 69 | /* */ 70 | /* Used in determining the displayed length of command strings, */ 71 | /* which use '~' to toggle between display attributes */ 72 | /* */ 73 | /*------------------------------------------------------------------------*/ 74 | 75 | int cstrlen( const char *s ) 76 | { 77 | int len = 0; 78 | while( *s != EOS ) 79 | { 80 | if( *s++ != '~' ) 81 | len++; 82 | } 83 | return len; 84 | } 85 | 86 | -------------------------------------------------------------------------------- /Source/EDITSTAT.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - editstat.cpp */ 3 | /* */ 4 | /* defines the static members of class TEditor */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #define Uses_TEditor 15 | #define Uses_TEditorDialog 16 | #include 17 | 18 | ushort defEditorDialog( int, ... ) 19 | { 20 | return cmCancel; 21 | } 22 | 23 | TEditorDialog _NEAR TEditor::editorDialog = defEditorDialog; 24 | ushort _NEAR TEditor::editorFlags = efBackupFiles | efPromptOnReplace; 25 | char _NEAR TEditor::findStr[maxFindStrLen] = ""; 26 | char _NEAR TEditor::replaceStr[maxReplaceStrLen] = ""; 27 | TEditor * _NEAR TEditor::clipboard = 0; 28 | 29 | -------------------------------------------------------------------------------- /Source/GENINC.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------*/ 2 | /* filename - geninc.cpp */ 3 | /* */ 4 | /* generates assembler EQUates for offsets of */ 5 | /* class data members */ 6 | /* */ 7 | /* Used only before build! Compile to produce GENINC.EXE, */ 8 | /* then execute GENINC >TVWRITE.INC to produce the .INC */ 9 | /* file needed by the assembler files */ 10 | /* */ 11 | /*------------------------------------------------------------------------*/ 12 | /* 13 | * Turbo Vision - Version 2.0 14 | * 15 | * Copyright (c) 1994 by Borland International 16 | * All Rights Reserved. 17 | * 18 | */ 19 | 20 | #define Uses_TPoint 21 | #define Uses_TView 22 | #define Uses_TGroup 23 | #define Uses_TEvent 24 | #define Uses_TFrame 25 | #define Uses_TDrawBuffer 26 | #define Uses_TEditor 27 | #define Uses_TTerminal 28 | #include 29 | 30 | #if !defined( __IOSTREAM_H ) 31 | #include 32 | #endif // __IOSTREAM_H 33 | 34 | #if !defined( __IOMANIP_H ) 35 | #include 36 | #endif // __IOMANIP_H 37 | 38 | #if !defined( __STDDEF_H ) 39 | #include 40 | #endif // __STDDEF_H 41 | 42 | #define genConst( n ) generate( #n, n ) 43 | 44 | #define gen( n, c, o ) generate( #n, offsetof( c, o ) ) 45 | 46 | void generate( const char *name, size_t offset ) 47 | { 48 | cout << setw( 19 ) << setiosflags( ios::left ) 49 | << name << " equ " << offset << endl; 50 | } 51 | 52 | void genRefs() 53 | { 54 | gen( TPointX, TPoint, x ); 55 | gen( TPointY, TPoint, y ); 56 | 57 | gen( TViewSizeX, TView, size.x ); 58 | gen( TViewSizeY, TView, size.y ); 59 | gen( TViewState, TView, state ); 60 | gen( TViewOwner, TView, owner ); 61 | gen( TViewOriginY, TView, origin.y ); 62 | gen( TViewOriginX, TView, origin.x ); 63 | gen( TViewCursorY, TView, cursor.y ); 64 | gen( TViewCursorX, TView, cursor.x ); 65 | gen( TViewNext, TView, next ); 66 | gen( TViewOptions, TView, options ); 67 | 68 | gen( TGroupClipAY, TGroup, clip.a.y ); 69 | gen( TGroupClipAX, TGroup, clip.a.x ); 70 | gen( TGroupClipBY, TGroup, clip.b.y ); 71 | gen( TGroupClipBX, TGroup, clip.b.x ); 72 | gen( TGroupLast, TGroup, last ); 73 | gen( TGroupBuffer, TGroup, buffer ); 74 | gen( TGroupLockFlag, TGroup, lockFlag ); 75 | 76 | gen( MsEventWhereX, MouseEventType, where.x ); 77 | gen( MsEventWhereY, MouseEventType, where.y ); 78 | 79 | gen( TFrameSizeX, TFrame, size.x ); 80 | gen( TFrameOwner, TFrame, owner ); 81 | 82 | gen( TDrawBufferData, TDrawBuffer, data ); 83 | gen( TEditorCurPtr, TEditor, curPtr ); 84 | gen( TEditorGapLen, TEditor, gapLen ); 85 | gen( TEditorBuffer, TEditor, buffer ); 86 | gen( TEditorSelStart, TEditor, selStart ); 87 | gen( TEditorSelEnd, TEditor, selEnd ); 88 | gen( TEditorBufSize, TEditor, bufSize ); 89 | gen( TEditorBufLen, TEditor, bufLen ); 90 | gen( TTerminalBuffer, TTerminal, buffer ); 91 | gen( TTerminalBufSize, TTerminal, bufSize ); 92 | gen( TTerminalQueBack, TTerminal, queBack ); 93 | 94 | genConst( sfVisible ); 95 | genConst( sfCursorVis ); 96 | genConst( sfCursorIns ); 97 | genConst( sfFocused ); 98 | genConst( sfShadow ); 99 | genConst( sfExposed ); 100 | genConst( ofFramed ); 101 | } 102 | 103 | int main() 104 | { 105 | genRefs(); 106 | return 0; 107 | } 108 | -------------------------------------------------------------------------------- /Source/GRP.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - grp.cpp */ 3 | /* */ 4 | /* function(s) */ 5 | /* TGroup member functions */ 6 | /*------------------------------------------------------------*/ 7 | /* 8 | * Turbo Vision - Version 2.0 9 | * 10 | * Copyright (c) 1994 by Borland International 11 | * All Rights Reserved. 12 | * 13 | */ 14 | 15 | #define Uses_TGroup 16 | #include 17 | 18 | TView *TGroup::at( short index ) 19 | { 20 | TView *temp = last; 21 | while( index-- > 0 ) 22 | temp = temp->next; 23 | return temp; 24 | } 25 | 26 | TView *TGroup::firstThat( Boolean (*func)(TView *, void *), void *args ) 27 | { 28 | TView *temp = last; 29 | if( temp == 0 ) 30 | return 0; 31 | 32 | do { 33 | temp = temp->next; 34 | if( func( temp, args ) == True ) 35 | return temp; 36 | } while( temp != last ); 37 | return 0; 38 | } 39 | 40 | void TGroup::forEach( void (*func)(TView*, void *), void *args ) 41 | { 42 | TView *term = last; 43 | TView *temp = last; 44 | if( temp == 0 ) 45 | return; 46 | 47 | TView *next = temp->next; 48 | do { 49 | temp = next; 50 | next = temp->next; 51 | func( temp, args ); 52 | } while( temp != term ); 53 | 54 | } 55 | 56 | short TGroup::indexOf( TView *p ) 57 | { 58 | if( last == 0 ) 59 | return 0; 60 | 61 | short index = 0; 62 | TView *temp = last; 63 | do { 64 | index++; 65 | temp = temp->next; 66 | } while( temp != p && temp != last ); 67 | if( temp != p ) 68 | return 0; 69 | else 70 | return index; 71 | } 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /Source/HARDWARE.ASM: -------------------------------------------------------------------------------- 1 | ;/*------------------------------------------------------------*/ 2 | ;/* filename - hardware.cpp */ 3 | ;/* */ 4 | ;/* function(s) */ 5 | ;/* THardwareInfo member functions and */ 6 | ;/* variables. */ 7 | ;/*------------------------------------------------------------*/ 8 | 9 | ; 10 | ; Turbo Vision - Version 2.0 11 | ; 12 | ; Copyright (c) 1994 by Borland International 13 | ; All Rights Reserved. 14 | ; 15 | 16 | INCLUDE TV.INC 17 | 18 | 19 | IFNDEF __FLAT__ 20 | PUBLIC @THardwareInfo@$bctr$qv 21 | PUBLIC @THardwareInfo@getBiosEquipmentFlag$qi 22 | PUBLIC @THardwareInfo@getBiosSelector$qv 23 | 24 | EXTRN @THardwareInfo@dpmiFlag : BYTE 25 | EXTRN @THardwareInfo@colorSel : WORD 26 | EXTRN @THardwareInfo@monoSel : WORD 27 | EXTRN @THardwareInfo@biosSel : WORD 28 | ENDIF 29 | 30 | CODESEG 31 | ASSUME DS:DGROUP 32 | 33 | ; THardwareInfo non-inline functions 34 | 35 | IFNDEF __FLAT__ 36 | 37 | @THardwareInfo@$bctr$qv PROC FAR 38 | 39 | ; Are we running in protected mode? 40 | MOV AX, 0FB42H 41 | MOV BX, 01H 42 | INT 2FH 43 | CMP AX, 01H 44 | JNE @@nodpmi 45 | 46 | ; Yes, in protected mode, thus we need to allocate selectors... 47 | MOV [@THardwareInfo@dpmiFlag], 01H 48 | 49 | MOV AX, 02H 50 | MOV BX, 0040H 51 | INT 31H 52 | MOV [@THardwareInfo@biosSel], AX 53 | 54 | MOV AX, 02H 55 | MOV BX, 0B000H 56 | INT 31H 57 | MOV [@THardwareInfo@monoSel], AX 58 | 59 | MOV AX, 02H 60 | MOV BX, 0B800H 61 | INT 31H 62 | MOV [@THardwareInfo@colorSel], AX 63 | 64 | RET 65 | 66 | @@nodpmi: 67 | MOV [@THardwareInfo@dpmiFlag], 00H 68 | MOV [@THardwareInfo@biosSel], 00040H 69 | MOV [@THardwareInfo@monoSel], 0B000H 70 | MOV [@THardwareInfo@colorSel], 0B800H 71 | 72 | RET 73 | @THardwareInfo@$bctr$qv ENDP 74 | 75 | 76 | @THardwareInfo@getBiosEquipmentFlag$qi PROC FAR 77 | PUSH DS 78 | MOV AX, SEG DGROUP 79 | MOV DS, AX 80 | 81 | MOV BX, 10H 82 | MOV ES, WORD PTR DGROUP:[@THardwareInfo@biosSel] 83 | MOV AX, ES:[BX] 84 | 85 | POP DS 86 | RET 87 | @THardwareInfo@getBiosEquipmentFlag$qi ENDP 88 | 89 | @THardwareInfo@getBiosSelector$qv PROC FAR 90 | PUSH DS 91 | MOV AX, SEG DGROUP 92 | MOV DS, AX 93 | MOV AX, WORD PTR DGROUP:[@THardwareInfo@biosSel] 94 | POP DS 95 | RET 96 | @THardwareInfo@getBiosSelector$qv ENDP 97 | 98 | ENDIF 99 | 100 | END 101 | -------------------------------------------------------------------------------- /Source/MAPCOLOR.CPP: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------------------------------*/ 2 | /* filename - mapcolor.cpp */ 3 | /* */ 4 | /* function(s) */ 5 | /* mapColor -- maps a color into a pointer into the current */ 6 | /* palette. */ 7 | /*-------------------------------------------------------------------*/ 8 | /* 9 | * Turbo Vision - Version 2.0 10 | * 11 | * Copyright (c) 1994 by Borland International 12 | * All Rights Reserved. 13 | * 14 | */ 15 | 16 | #define Uses_TView 17 | #define Uses_TGroup 18 | #include 19 | 20 | uchar TView::mapColor( uchar color ) 21 | { 22 | if( color == 0 ) 23 | return errorAttr; 24 | TView *cur = this; 25 | do { 26 | TPalette& p = cur->getPalette(); 27 | if( p[0] != 0 ) 28 | { 29 | if( color > p[0] ) 30 | return errorAttr; 31 | color = p[color]; 32 | if( color == 0 ) 33 | return errorAttr; 34 | } 35 | cur = cur->owner; 36 | } while( cur != 0 ); 37 | return color; 38 | } 39 | -------------------------------------------------------------------------------- /Source/MENU.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - menu.cpp */ 3 | /* */ 4 | /* function(s) */ 5 | /* TSubMenu member functions */ 6 | /*------------------------------------------------------------*/ 7 | /* 8 | * Turbo Vision - Version 2.0 9 | * 10 | * Copyright (c) 1994 by Borland International 11 | * All Rights Reserved. 12 | * 13 | */ 14 | 15 | #define Uses_TKeys 16 | #define Uses_TSubMenu 17 | #define Uses_TStatusDef 18 | #define Uses_TStatusItem 19 | #define Uses_TMenu 20 | #include 21 | 22 | #if !defined( __STRING_H ) 23 | #include 24 | #endif // __STRING_H 25 | 26 | TSubMenu::TSubMenu( const char *nm, ushort key, ushort helpCtx ) : 27 | TMenuItem( nm, 0, key, helpCtx ) 28 | { 29 | } 30 | 31 | TSubMenu& operator + ( TSubMenu& s, TMenuItem& i ) 32 | { 33 | TSubMenu *sub = &s; 34 | while( sub->next != 0 ) 35 | sub = (TSubMenu *)(sub->next); 36 | 37 | if( sub->subMenu == 0 ) 38 | sub->subMenu = new TMenu( i ); 39 | else 40 | { 41 | TMenuItem *cur = sub->subMenu->items; 42 | while( cur->next != 0 ) 43 | cur = cur->next; 44 | cur->next = &i; 45 | } 46 | return s; 47 | } 48 | 49 | TSubMenu& operator + ( TSubMenu& s1, TSubMenu& s2 ) 50 | { 51 | TMenuItem *cur = &s1; 52 | while( cur->next != 0 ) 53 | cur = cur->next; 54 | cur->next = &s2; 55 | return s1; 56 | } 57 | 58 | TStatusDef& operator + ( TStatusDef& s1, TStatusItem& s2 ) 59 | { 60 | TStatusDef *def = &s1; 61 | while( def->next != 0 ) 62 | def = def->next; 63 | if( def->items == 0 ) 64 | def->items = &s2; 65 | else 66 | { 67 | TStatusItem *cur = def->items; 68 | while( cur->next != 0 ) 69 | cur = cur->next; 70 | cur->next = &s2; 71 | } 72 | return s1; 73 | } 74 | 75 | TStatusDef& operator + ( TStatusDef& s1, TStatusDef& s2 ) 76 | { 77 | TStatusDef *cur = &s1; 78 | while( cur->next != 0 ) 79 | cur = cur->next; 80 | cur->next = &s2; 81 | return s1; 82 | } 83 | 84 | 85 | -------------------------------------------------------------------------------- /Source/MISC.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - misc.cpp */ 3 | /* */ 4 | /* function(s) */ 5 | /* message -- sends a message to an object */ 6 | /*------------------------------------------------------------*/ 7 | /* 8 | * Turbo Vision - Version 2.0 9 | * 10 | * Copyright (c) 1994 by Borland International 11 | * All Rights Reserved. 12 | * 13 | */ 14 | 15 | #define Uses_TView 16 | #define Uses_TEvent 17 | #define Uses_TObject 18 | #define Uses_TVMemMgr 19 | #include 20 | 21 | void *message( TView *receiver, ushort what, ushort command, void *infoPtr) 22 | { 23 | if( receiver == 0 ) 24 | return 0; 25 | 26 | TEvent event; 27 | event.what = what; 28 | event.message.command = command; 29 | event.message.infoPtr = infoPtr; 30 | receiver->handleEvent( event ); 31 | if( event.what == evNothing ) 32 | return event.message.infoPtr; 33 | else 34 | return 0; 35 | } 36 | 37 | Boolean lowMemory() 38 | { 39 | return Boolean(TVMemMgr::safetyPoolExhausted()); 40 | } 41 | 42 | -------------------------------------------------------------------------------- /Source/NEW.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - new.cpp */ 3 | /*------------------------------------------------------------*/ 4 | /* 5 | * Turbo Vision - Version 2.0 6 | * 7 | * Copyright (c) 1994 by Borland International 8 | * All Rights Reserved. 9 | * 10 | */ 11 | 12 | #define NDEBUG 13 | #include 14 | 15 | #if !defined( __MEM_H ) 16 | #include 17 | #endif // __MEM_H 18 | 19 | #if !defined( __ALLOC_H ) 20 | 21 | #include 22 | #endif // __ALLOC_H 23 | 24 | #if !defined( __STDLIB_H ) 25 | #include 26 | #endif // __STDLIB_H 27 | 28 | #define Uses_TVMemMgr 29 | #include 30 | 31 | TBufListEntry * _NEAR TBufListEntry::bufList = 0; 32 | 33 | TBufListEntry::TBufListEntry( void*& o ) : owner( o ) 34 | { 35 | next = bufList; 36 | prev = 0; 37 | bufList = this; 38 | if( next != 0 ) 39 | next->prev = this; 40 | } 41 | 42 | TBufListEntry::~TBufListEntry() 43 | { 44 | owner = 0; 45 | if( prev == 0 ) 46 | bufList = next; 47 | else 48 | prev->next = next; 49 | if( next != 0 ) 50 | next->prev = prev; 51 | } 52 | 53 | void *TBufListEntry::operator new( size_t sz, size_t extra ) 54 | { 55 | return malloc( sz + extra*sizeof( unsigned ) ); 56 | } 57 | 58 | void *TBufListEntry::operator new( size_t ) 59 | { 60 | return 0; 61 | } 62 | 63 | void TBufListEntry::operator delete( void *b ) 64 | { 65 | free( b ); 66 | } 67 | 68 | Boolean TBufListEntry::freeHead() 69 | { 70 | if( bufList == 0 ) 71 | return False; 72 | else 73 | { 74 | delete bufList; 75 | return True; 76 | } 77 | } 78 | 79 | void * _NEAR TVMemMgr::safetyPool = 0; 80 | size_t _NEAR TVMemMgr::safetyPoolSize = 0; 81 | int _NEAR TVMemMgr::inited = 0; 82 | 83 | TVMemMgr memMgr; 84 | 85 | TVMemMgr::TVMemMgr() 86 | { 87 | if( !inited ) 88 | resizeSafetyPool(); 89 | }; 90 | 91 | void TVMemMgr::resizeSafetyPool( size_t sz ) 92 | { 93 | inited = 1; 94 | free( safetyPool ); 95 | if( sz == 0 ) 96 | safetyPool = 0; 97 | else 98 | safetyPool = malloc( sz ); 99 | safetyPoolSize = sz; 100 | } 101 | 102 | int TVMemMgr::safetyPoolExhausted() 103 | { 104 | return inited && (safetyPool == 0); 105 | } 106 | 107 | void TVMemMgr::allocateDiscardable( void *&adr, size_t sz ) 108 | { 109 | if( safetyPoolExhausted() ) 110 | adr = 0; 111 | else 112 | { 113 | TBufListEntry *newEntry = new( sz ) TBufListEntry( adr ); 114 | if( newEntry == 0 ) 115 | adr = 0; 116 | else 117 | adr = (char *)newEntry + sizeof(TBufListEntry); 118 | } 119 | } 120 | 121 | void TVMemMgr::freeDiscardable( void *block ) 122 | { 123 | delete (TBufListEntry *)((char *)block - sizeof(TBufListEntry)); 124 | } 125 | 126 | 127 | #if !defined( NDEBUG ) 128 | const BLK_SIZE = 16; 129 | const BLK_DATA = 0xA6; 130 | #else 131 | const BLK_SIZE = 0; 132 | #endif 133 | 134 | static void * allocBlock( size_t sz ) 135 | { 136 | assert( heapcheck() >= 0 ); 137 | 138 | sz += BLK_SIZE; 139 | if( sz == 0 ) 140 | sz = 1; 141 | 142 | void *temp = malloc( sz ); 143 | while( temp == 0 && TBufListEntry::freeHead() == True ) 144 | temp = malloc( sz ); 145 | if( temp == 0 ) 146 | if( TVMemMgr::safetyPoolExhausted() ) 147 | abort(); 148 | else 149 | { 150 | TVMemMgr::resizeSafetyPool( 0 ); 151 | temp = malloc( sz ); 152 | if( temp == 0 ) 153 | abort(); 154 | } 155 | #if !defined( NDEBUG ) 156 | memset( temp, BLK_DATA, BLK_SIZE ); 157 | #endif 158 | return (char *)temp + BLK_SIZE; 159 | } 160 | 161 | void * operator new[] ( size_t sz ) 162 | { 163 | return allocBlock(sz); 164 | } 165 | 166 | void * operator new ( size_t sz ) 167 | { 168 | return allocBlock(sz); 169 | } 170 | 171 | #if !defined( NDEBUG ) 172 | static void check( void *blk ) 173 | { 174 | for( int i = 0; i < BLK_SIZE; i++ ) 175 | assert( *((unsigned char *)blk + i) == BLK_DATA ); 176 | } 177 | #endif 178 | 179 | static void deleteBlock( void *blk ) 180 | { 181 | assert( heapcheck() >= 0 ); 182 | if( blk == 0 ) 183 | return; 184 | void *tmp = (char *)blk - BLK_SIZE; 185 | #if !defined( NDEBUG ) 186 | check( tmp ); 187 | #endif 188 | free( tmp ); 189 | if( TVMemMgr::safetyPoolExhausted() ) 190 | TVMemMgr::resizeSafetyPool(); 191 | } 192 | 193 | void operator delete ( void *blk ) 194 | { 195 | deleteBlock(blk); 196 | } 197 | 198 | void operator delete[] ( void *blk ) 199 | { 200 | deleteBlock(blk); 201 | } 202 | -------------------------------------------------------------------------------- /Source/NEWSTR.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - newstr.cpp */ 3 | /* */ 4 | /* function(s) */ 5 | /* newStr member function */ 6 | /*------------------------------------------------------------*/ 7 | /* 8 | * Turbo Vision - Version 2.0 9 | * 10 | * Copyright (c) 1994 by Borland International 11 | * All Rights Reserved. 12 | * 13 | */ 14 | 15 | 16 | #include 17 | 18 | #if !defined( __STRING_H ) 19 | #include 20 | #endif // __STRING_H 21 | 22 | 23 | char *newStr( const char *s ) 24 | { 25 | if( s == 0 ) 26 | return 0; 27 | char *temp = new char[ strlen(s)+1 ]; 28 | strcpy( temp, s ); 29 | return temp; 30 | } 31 | -------------------------------------------------------------------------------- /Source/NMBKGRND.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - nmbkgrnd.cpp */ 3 | /* */ 4 | /* defines the streamable name for class TBackground */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #if !defined(NO_STREAMABLE) 15 | #define Uses_TBackground 16 | #include 17 | 18 | const char * const _NEAR TBackground::name = "TBackground"; 19 | #endif 20 | 21 | 22 | -------------------------------------------------------------------------------- /Source/NMBUTTON.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - nmbutton.cpp */ 3 | /* */ 4 | /* defines the streamable name for class TButton */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #if !defined(NO_STREAMABLE) 15 | #define Uses_TButton 16 | #include 17 | 18 | const char * const _NEAR TButton::name = "TButton"; 19 | #endif 20 | 21 | -------------------------------------------------------------------------------- /Source/NMCHDRDL.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - nmchdrdl.cpp */ 3 | /* */ 4 | /* defines the streamable name for class TChDirDialog */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #if !defined(NO_STREAMABLE) 15 | #define Uses_TChDirDialog 16 | #include 17 | 18 | const char * const _NEAR TChDirDialog::name = "TChDirDialog"; 19 | #endif 20 | 21 | -------------------------------------------------------------------------------- /Source/NMCHKBOX.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - nmchkbox.cpp */ 3 | /* */ 4 | /* defines the streamable name for class TCheckBoxes */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #if !defined(NO_STREAMABLE) 15 | #define Uses_TCheckBoxes 16 | #include 17 | 18 | const char * const _NEAR TCheckBoxes::name = "TCheckBoxes"; 19 | #endif 20 | 21 | -------------------------------------------------------------------------------- /Source/NMCLRSEL.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - nmclrsel.cpp */ 3 | /* */ 4 | /* defines the streamable names for classes */ 5 | /* TColorSelector, TMonoSelector, TColorDisplay, */ 6 | /* TColorGroupList, TColorItemList, TColorDialog */ 7 | /*------------------------------------------------------------*/ 8 | /* 9 | * Turbo Vision - Version 2.0 10 | * 11 | * Copyright (c) 1994 by Borland International 12 | * All Rights Reserved. 13 | * 14 | */ 15 | 16 | #if !defined(NO_STREAMABLE) 17 | #define Uses_TColorSelector 18 | #define Uses_TMonoSelector 19 | #define Uses_TColorDisplay 20 | #define Uses_TColorGroupList 21 | #define Uses_TColorItemList 22 | #define Uses_TColorDialog 23 | #include 24 | 25 | const char * const _NEAR TColorSelector::name = "TColorSelector"; 26 | const char * const _NEAR TMonoSelector::name = "TMonoSelector"; 27 | const char * const _NEAR TColorDisplay::name = "TColorDisplay"; 28 | const char * const _NEAR TColorGroupList::name = "TColorGroupList"; 29 | const char * const _NEAR TColorItemList::name = "TColorItemList"; 30 | const char * const _NEAR TColorDialog::name = "TColorDialog"; 31 | #endif 32 | 33 | -------------------------------------------------------------------------------- /Source/NMCLUSTR.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - nmclustr.cpp */ 3 | /* */ 4 | /* defines the streamable name for class TCluster */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #if !defined(NO_STREAMABLE) 15 | #define Uses_TCluster 16 | #include 17 | 18 | const char * const _NEAR TCluster::name = "TCluster"; 19 | #endif 20 | -------------------------------------------------------------------------------- /Source/NMCOLLCT.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - nmcollct.cpp */ 3 | /* */ 4 | /* defines the streamable name for class TCollection */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #define Uses_TCollection 15 | #include 16 | 17 | const char * const _NEAR TCollection::name = "TCollection"; 18 | -------------------------------------------------------------------------------- /Source/NMDIALOG.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - nmdialog.cpp */ 3 | /* */ 4 | /* defines the streamable name for class TDialog */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #if !defined(NO_STREAMABLE) 15 | #define Uses_TDialog 16 | #include 17 | 18 | const char * const _NEAR TDialog::name = "TDialog"; 19 | #endif 20 | -------------------------------------------------------------------------------- /Source/NMDIRBOX.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - nmdirbox.cpp */ 3 | /* */ 4 | /* defines the streamable name for class TDirListBox */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #if !defined(NO_STREAMABLE) 15 | #define Uses_TDirListBox 16 | #include 17 | 18 | const char * const _NEAR TDirListBox::name = "TDirListBox"; 19 | #endif 20 | -------------------------------------------------------------------------------- /Source/NMDIRCOL.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - nmdircol.cpp */ 3 | /* */ 4 | /* defines the streamable name for class TDirCollection */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #define Uses_TDirCollection 15 | #include 16 | 17 | const char * const _NEAR TDirCollection::name = "TDirCollection"; 18 | -------------------------------------------------------------------------------- /Source/NMDSKTOP.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - nmdsktop.cpp */ 3 | /* */ 4 | /* defines the streamable name for class TDeskTop */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #if !defined(NO_STREAMABLE) 15 | #define Uses_TDeskTop 16 | #include 17 | 18 | const char * const _NEAR TDeskTop::name = "TDeskTop"; 19 | #endif 20 | -------------------------------------------------------------------------------- /Source/NMEDITOR.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - nmeditor.cpp */ 3 | /* */ 4 | /* defines the streamable names for classes */ 5 | /* TIndicator, TEditor, TMemo, TFileEditor, TEditWindow */ 6 | /*------------------------------------------------------------*/ 7 | /* 8 | * Turbo Vision - Version 2.0 9 | * 10 | * Copyright (c) 1994 by Borland International 11 | * All Rights Reserved. 12 | * 13 | */ 14 | 15 | #if !defined(NO_STREAMABLE) 16 | #define Uses_TIndicator 17 | #define Uses_TEditor 18 | #define Uses_TMemo 19 | #define Uses_TFileEditor 20 | #define Uses_TEditWindow 21 | #include 22 | 23 | const char * const _NEAR TIndicator::name = "TIndicator"; 24 | const char * const _NEAR TEditor::name = "TEditor"; 25 | const char * const _NEAR TMemo::name = "TMemo"; 26 | const char * const _NEAR TFileEditor::name = "TFileEditor"; 27 | const char * const _NEAR TEditWindow::name = "TEditWindow"; 28 | #endif 29 | 30 | -------------------------------------------------------------------------------- /Source/NMFILCOL.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - nmfilcol.cpp */ 3 | /* */ 4 | /* defines the streamable name for class TFileCollection */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #define Uses_TFileCollection 15 | #include 16 | 17 | const char * const _NEAR TFileCollection::name = "TFileCollection"; 18 | -------------------------------------------------------------------------------- /Source/NMFILDLG.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - nmfildlg.cpp */ 3 | /* */ 4 | /* defines the streamable name for class TFileDialog */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #if !defined(NO_STREAMABLE) 15 | #define Uses_TFileDialog 16 | #include 17 | 18 | const char * const _NEAR TFileDialog::name = "TFileDialog"; 19 | #endif 20 | -------------------------------------------------------------------------------- /Source/NMFILLST.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - nmfillst.cpp */ 3 | /* */ 4 | /* defines the streamable name for class TFileList */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #if !defined(NO_STREAMABLE) 15 | #define Uses_TFileList 16 | #include 17 | 18 | const char * const _NEAR TFileList::name = "TFileList"; 19 | #endif 20 | -------------------------------------------------------------------------------- /Source/NMFRAME.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - nmframe.cpp */ 3 | /* */ 4 | /* defines the streamable name for class TFrame */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #if !defined(NO_STREAMABLE) 15 | #define Uses_TFrame 16 | #include 17 | 18 | const char * const _NEAR TFrame::name = "TFrame"; 19 | #endif 20 | -------------------------------------------------------------------------------- /Source/NMGROUP.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - nmgroup.cpp */ 3 | /* */ 4 | /* defines the streamable name for class TGroup */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #if !defined(NO_STREAMABLE) 15 | #define Uses_TGroup 16 | #include 17 | 18 | const char * const _NEAR TGroup::name = "TGroup"; 19 | #endif 20 | -------------------------------------------------------------------------------- /Source/NMHIST.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - nmhist.cpp */ 3 | /* */ 4 | /* defines the streamable name for class THistory */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #if !defined(NO_STREAMABLE) 15 | #define Uses_THistory 16 | #include 17 | 18 | const char * const _NEAR THistory::name = "THistory"; 19 | #endif 20 | -------------------------------------------------------------------------------- /Source/NMINPTLN.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - nminputli.cpp */ 3 | /* */ 4 | /* defines the streamable name for class TInputLine */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #if !defined( NO_STREAMABLE ) 15 | #define Uses_TInputLine 16 | #include 17 | 18 | const char * const _NEAR TInputLine::name = "TInputLine"; 19 | #endif 20 | -------------------------------------------------------------------------------- /Source/NMLABEL.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - nmlabel.cpp */ 3 | /* */ 4 | /* defines the streamable name for class TLabel */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #if !defined(NO_STREAMABLE) 15 | #define Uses_TLabel 16 | #include 17 | 18 | const char * const _NEAR TLabel::name = "TLabel"; 19 | #endif 20 | -------------------------------------------------------------------------------- /Source/NMLSTBOX.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - nmlstbox.cpp */ 3 | /* */ 4 | /* defines the streamable name for class TListBox */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #if !defined(NO_STREAMABLE) 15 | #define Uses_TListBox 16 | #include 17 | 18 | const char * const _NEAR TListBox::name = "TListBox"; 19 | #endif 20 | -------------------------------------------------------------------------------- /Source/NMLSTVWR.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - nmlstvwr.cpp */ 3 | /* */ 4 | /* defines the streamable name for class TListViewer */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #if !defined(NO_STREAMABLE) 15 | #define Uses_TListViewer 16 | #include 17 | 18 | const char * const _NEAR TListViewer::name = "TListViewer"; 19 | #endif 20 | -------------------------------------------------------------------------------- /Source/NMMNUBAR.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - nmmnubar.cpp */ 3 | /* */ 4 | /* defines the streamable name for class TMenuBar */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #if !defined(NO_STREAMABLE) 15 | #define Uses_TMenuBar 16 | #include 17 | 18 | const char * const _NEAR TMenuBar::name = "TMenuBar"; 19 | #endif 20 | -------------------------------------------------------------------------------- /Source/NMMNUBOX.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - nmmnubox.cpp */ 3 | /* */ 4 | /* defines the streamable name for class TMenuBox */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #if !defined(NO_STREAMABLE) 15 | #define Uses_TMenuBox 16 | #include 17 | 18 | const char * const _NEAR TMenuBox::name = "TMenuBox"; 19 | #endif 20 | -------------------------------------------------------------------------------- /Source/NMMNUPOP.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - nmmnupop.cpp */ 3 | /* */ 4 | /* defines the streamable name for class TMenuPopup */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #if !defined(NO_STREAMABLE) 15 | #define Uses_TMenuPopup 16 | #include 17 | 18 | const char * const _NEAR TMenuPopup::name = "TMenuPopup"; 19 | #endif 20 | -------------------------------------------------------------------------------- /Source/NMMNUVW.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - nmmnuvw.cpp */ 3 | /* */ 4 | /* defines the streamable name for class TMenuView */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #if !defined(NO_STREAMABLE) 15 | #define Uses_TMenuView 16 | #include 17 | 18 | const char * const _NEAR TMenuView::name = "TMenuView"; 19 | #endif 20 | -------------------------------------------------------------------------------- /Source/NMMULCHK.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - nmmulchk.cpp */ 3 | /* */ 4 | /* defines the streamable name for class TMultiCheckBoxes */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #if !defined(NO_STREAMABLE) 15 | #define Uses_TMultiCheckBoxes 16 | #include 17 | 18 | const char * const _NEAR TMultiCheckBoxes::name = "TMultiCheckBoxes"; 19 | #endif 20 | 21 | -------------------------------------------------------------------------------- /Source/NMOUTLIN.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - nmoutlin.cpp */ 3 | /* */ 4 | /* defines the streamable name for TOutline class */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #if !defined(NO_STREAMABLE) 15 | #define Uses_TOutline 16 | #include 17 | 18 | const char * const _NEAR TOutline::name = "TOutline"; 19 | #endif 20 | -------------------------------------------------------------------------------- /Source/NMPRMTXT.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - nmprmtxt.cpp */ 3 | /* */ 4 | /* defines the streamable name for class TParamText */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #if !defined(NO_STREAMABLE) 15 | #define Uses_TParamText 16 | #include 17 | 18 | const char * const _NEAR TParamText::name = "TParamText"; 19 | #endif 20 | -------------------------------------------------------------------------------- /Source/NMRBTNS.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - nnrbtns.cpp */ 3 | /* */ 4 | /* defines the streamable name for class TRadioButtons */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #if !defined(NO_STREAMABLE) 15 | #define Uses_TRadioButtons 16 | #include 17 | 18 | const char * const _NEAR TRadioButtons::name = "TRadioButtons"; 19 | #endif 20 | -------------------------------------------------------------------------------- /Source/NMRESCOL.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - nmrescol.cpp */ 3 | /* */ 4 | /* defines the streamable name for class TResourceCollection */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #define Uses_TResourceCollection 15 | #include 16 | 17 | const char * const _NEAR TResourceCollection::name = "TResourceCollection"; 18 | -------------------------------------------------------------------------------- /Source/NMSCOLL.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - nmscoll.cpp */ 3 | /* */ 4 | /* defines the streamable name for class TSortedCollection */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #define Uses_TSortedCollection 15 | #include 16 | 17 | const char * const _NEAR TSortedCollection::name = "TSortedCollection"; 18 | -------------------------------------------------------------------------------- /Source/NMSCRBAR.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - nmscrbar.cpp */ 3 | /* */ 4 | /* defines the streamable name for class TScrollBar */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #if !defined(NO_STREAMABLE) 15 | #define Uses_TScrollBar 16 | #include 17 | 18 | const char * const _NEAR TScrollBar::name = "TScrollBar"; 19 | #endif 20 | -------------------------------------------------------------------------------- /Source/NMSCROLL.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - nmscroll.cpp */ 3 | /* */ 4 | /* defines the streamable name for class TScroller */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #if !defined(NO_STREAMABLE) 15 | #define Uses_TScroller 16 | #include 17 | 18 | const char * const _NEAR TScroller::name = "TScroller"; 19 | #endif 20 | -------------------------------------------------------------------------------- /Source/NMSTCTXT.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - nmstctxt.cpp */ 3 | /* */ 4 | /* defines the streamable name for class TStaticText */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #if !defined(NO_STREAMABLE) 15 | #define Uses_TStaticText 16 | #include 17 | 18 | const char * const _NEAR TStaticText::name = "TStaticText"; 19 | #endif 20 | -------------------------------------------------------------------------------- /Source/NMSTDDLG.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - nmstddlg.cpp */ 3 | /* */ 4 | /* defines the streamable names for classes */ 5 | /* TFileInputLine, TSortedListBox, TFileInfoPane */ 6 | /*------------------------------------------------------------*/ 7 | /* 8 | * Turbo Vision - Version 2.0 9 | * 10 | * Copyright (c) 1994 by Borland International 11 | * All Rights Reserved. 12 | * 13 | */ 14 | 15 | #if !defined(NO_STREAMABLE) 16 | #define Uses_TFileInputLine 17 | #define Uses_TSortedListBox 18 | #define Uses_TFileInfoPane 19 | #include 20 | 21 | const char * const _NEAR TFileInputLine::name = "TFileInputLine"; 22 | const char * const _NEAR TSortedListBox::name = "TSortedListBox"; 23 | const char * const _NEAR TFileInfoPane::name = "TFileInfoPane"; 24 | #endif 25 | 26 | -------------------------------------------------------------------------------- /Source/NMSTLINE.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - nmstline.cpp */ 3 | /* */ 4 | /* defines the streamable name for class TStatusLine */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #if !defined(NO_STREAMABLE) 15 | #define Uses_TStatusLine 16 | #include 17 | 18 | const char * const _NEAR TStatusLine::name = "TStatusLine"; 19 | #endif 20 | -------------------------------------------------------------------------------- /Source/NMSTRCOL.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - nmstrcol.cpp */ 3 | /* */ 4 | /* defines the streamable name for class TStringCollection */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #define Uses_TStringCollection 15 | #include 16 | 17 | const char * const _NEAR TStringCollection::name = "TStringCollection"; 18 | -------------------------------------------------------------------------------- /Source/NMSTRLST.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - nmstrlst.cpp */ 3 | /* */ 4 | /* defines the streamable name for class TStringList */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #if !defined(NO_STREAMABLE) 15 | #define Uses_TStringList 16 | #include 17 | 18 | const char * const _NEAR TStringList::name = "TStringList"; 19 | #endif 20 | -------------------------------------------------------------------------------- /Source/NMVALIDA.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - nmvalida.cpp */ 3 | /* */ 4 | /* defines the streamable name for TValidator classes */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #if !defined(NO_STREAMABLE) 15 | #define Uses_TValidator 16 | #define Uses_TPXPictureValidator 17 | #define Uses_TRangeValidator 18 | #define Uses_TFilterValidator 19 | #define Uses_TLookupValidator 20 | #define Uses_TStringLookupValidator 21 | #include 22 | 23 | const char * const _NEAR TValidator::name = "TValidator"; 24 | const char * const _NEAR TPXPictureValidator::name = "TPXPictureValidator"; 25 | const char * const _NEAR TRangeValidator::name = "TRangeValidator"; 26 | const char * const _NEAR TFilterValidator::name = "TFilterValidator"; 27 | const char * const _NEAR TLookupValidator::name = "TLookupValidator"; 28 | const char * const _NEAR TStringLookupValidator::name = "TStringLookupValidator"; 29 | #endif 30 | -------------------------------------------------------------------------------- /Source/NMVIEW.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - nmview.cpp */ 3 | /* */ 4 | /* defines the streamable name for class TView */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #if !defined(NO_STREAMABLE) 15 | #define Uses_TView 16 | #include 17 | 18 | const char * const _NEAR TView::name = "TView"; 19 | #endif 20 | -------------------------------------------------------------------------------- /Source/NMWINDOW.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - nmwindow.cpp */ 3 | /* */ 4 | /* defines the streamable name for class TWindow */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #if !defined(NO_STREAMABLE) 15 | #define Uses_TWindow 16 | #include 17 | 18 | const char * const _NEAR TWindow::name = "TWindow"; 19 | #endif 20 | -------------------------------------------------------------------------------- /Source/PALETTE.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - palette.cpp */ 3 | /* */ 4 | /* function(s) */ 5 | /* TPalette member functions */ 6 | /*------------------------------------------------------------*/ 7 | /* 8 | * Turbo Vision - Version 2.0 9 | * 10 | * Copyright (c) 1994 by Borland International 11 | * All Rights Reserved. 12 | * 13 | */ 14 | 15 | #define Uses_TPalette 16 | #include 17 | 18 | #if !defined( __MEM_H ) 19 | #include 20 | #endif // __MEM_H 21 | 22 | 23 | TPalette::TPalette( const char* d, ushort len ) : 24 | data( new uchar[ len+1 ] ) 25 | { 26 | data[0] = len; 27 | memcpy( data+1, d, len ); 28 | } 29 | 30 | TPalette::TPalette( const TPalette& tp ) : 31 | data( new uchar[ tp.data[0] + 1 ] ) 32 | { 33 | memcpy( data, tp.data, tp.data[0] + 1 ); 34 | } 35 | 36 | TPalette::~TPalette() 37 | { 38 | delete data; 39 | } 40 | 41 | TPalette& TPalette::operator = ( const TPalette& tp ) 42 | { 43 | if( data != tp.data ) 44 | { 45 | if( data[0] != tp.data[0] ) 46 | { 47 | delete data; 48 | data = new uchar[ tp.data[0] + 1 ]; 49 | data[0] = tp.data[0]; 50 | } 51 | memcpy( data+1, tp.data+1, data[0] ); 52 | } 53 | return *this; 54 | } 55 | 56 | uchar& TPalette::operator[]( int index ) const 57 | { 58 | return data[index]; 59 | } 60 | -------------------------------------------------------------------------------- /Source/SBKGRND.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - sbkgrnd.cpp */ 3 | /* */ 4 | /* Registeration object for the class TBackground */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #if !defined(NO_STREAMABLE) 15 | #define Uses_TStreamableClass 16 | #define Uses_TBackground 17 | #include 18 | __link( RView ) 19 | 20 | TStreamableClass RBackground( TBackground::name, 21 | TBackground::build, 22 | __DELTA(TBackground) 23 | ); 24 | #endif 25 | 26 | -------------------------------------------------------------------------------- /Source/SBUTTON.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - sbutton.cpp */ 3 | /* */ 4 | /* Registeration object for the class TButton */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #if !defined(NO_STREAMABLE) 15 | #define Uses_TButton 16 | #define Uses_TStreamableClass 17 | #include 18 | __link( RView ) 19 | 20 | TStreamableClass RButton( TButton::name, 21 | TButton::build, 22 | __DELTA(TButton) 23 | ); 24 | #endif 25 | -------------------------------------------------------------------------------- /Source/SCHDRDLG.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - schdrdlg.cpp */ 3 | /* */ 4 | /* Registeration object for the class TChDirDialog */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #if !defined(NO_STREAMABLE) 15 | #define Uses_TChDirDialog 16 | #define Uses_TStreamableClass 17 | #include 18 | __link( RDialog ) 19 | __link( RButton ) 20 | __link( RDirListBox ) 21 | __link( RInputLine ) 22 | __link( RHistory ) 23 | __link( RLabel ) 24 | __link( RScrollBar ) 25 | 26 | TStreamableClass RChDirDialog( TChDirDialog::name, 27 | TChDirDialog::build, 28 | __DELTA(TChDirDialog) 29 | ); 30 | #endif 31 | -------------------------------------------------------------------------------- /Source/SCHECKBO.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - scheckbo.cpp */ 3 | /* */ 4 | /* Registeration object for the class TCheckBoxes */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #if !defined(NO_STREAMABLE) 15 | #define Uses_TCheckBoxes 16 | #define Uses_TStreamableClass 17 | #include 18 | 19 | __link( RCluster ); 20 | 21 | TStreamableClass RCheckBoxes( TCheckBoxes::name, 22 | TCheckBoxes::build, 23 | __DELTA(TCheckBoxes) 24 | ); 25 | #endif 26 | 27 | -------------------------------------------------------------------------------- /Source/SCLRSEL.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - sclrsel.cpp */ 3 | /* */ 4 | /* Registeration objects for the following classes: */ 5 | /* TColorSelector */ 6 | /* TMonoSelector */ 7 | /* TColorDisplay */ 8 | /* TColorGroupList */ 9 | /* TColorItemList */ 10 | /* TColorDialog */ 11 | /*------------------------------------------------------------*/ 12 | /* 13 | * Turbo Vision - Version 2.0 14 | * 15 | * Copyright (c) 1994 by Borland International 16 | * All Rights Reserved. 17 | * 18 | */ 19 | 20 | #if !defined(NO_STREAMABLE) 21 | #define Uses_TColorSelector 22 | #define Uses_TMonoSelector 23 | #define Uses_TColorDisplay 24 | #define Uses_TColorGroupList 25 | #define Uses_TColorItemList 26 | #define Uses_TColorDialog 27 | #define Uses_TStreamableClass 28 | #include 29 | __link( RCluster ) 30 | __link( RView ) 31 | __link( RLabel ) 32 | __link( RButton ) 33 | __link( RListViewer ) 34 | __link( RDialog ) 35 | 36 | TStreamableClass RColorSelector( TColorSelector::name, 37 | TColorSelector::build, 38 | __DELTA(TColorSelector) 39 | ); 40 | 41 | TStreamableClass RMonoSelector( TMonoSelector::name, 42 | TMonoSelector::build, 43 | __DELTA(TMonoSelector) 44 | ); 45 | 46 | TStreamableClass RColorDisplay( TColorDisplay::name, 47 | TColorDisplay::build, 48 | __DELTA(TColorDisplay) 49 | ); 50 | 51 | TStreamableClass RColorGroupList( TColorGroupList::name, 52 | TColorGroupList::build, 53 | __DELTA(TColorGroupList) 54 | ); 55 | 56 | 57 | TStreamableClass RColorItemList( TColorItemList::name, 58 | TColorItemList::build, 59 | __DELTA(TColorItemList) 60 | ); 61 | 62 | TStreamableClass RColorDialog( TColorDialog::name, 63 | TColorDialog::build, 64 | __DELTA(TColorDialog) 65 | ); 66 | 67 | #endif 68 | -------------------------------------------------------------------------------- /Source/SCLUSTER.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - scluster.cpp */ 3 | /* */ 4 | /* Registeration object for the class TCluster */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #if !defined(NO_STREAMABLE) 15 | #define Uses_TStreamableClass 16 | #define Uses_TCluster 17 | #include 18 | __link( RView ) 19 | __link( RStringCollection ) 20 | 21 | TStreamableClass RCluster( TCluster::name, 22 | TCluster::build, 23 | __DELTA(TCluster) 24 | ); 25 | #endif 26 | 27 | -------------------------------------------------------------------------------- /Source/SDESKTOP.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - sdesktop.cpp */ 3 | /* */ 4 | /* Registeration object for the class TDeskTop */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #if !defined(NO_STREAMABLE) 15 | #define Uses_TDeskTop 16 | #define Uses_TStreamableClass 17 | #include 18 | __link( RBackGround ) 19 | 20 | TStreamableClass RDeskTop( TDeskTop::name, 21 | TDeskTop::build, 22 | __DELTA(TDeskTop) 23 | ); 24 | #endif 25 | 26 | -------------------------------------------------------------------------------- /Source/SDIALOG.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - sdialog.cpp */ 3 | /* */ 4 | /* Registeration object for the class TDialog */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #if !defined(NO_STREAMABLE) 15 | #define Uses_TDialog 16 | #define Uses_TStreamableClass 17 | #include 18 | 19 | __link( RWindow ) 20 | 21 | TStreamableClass RDialog( TDialog::name, 22 | TDialog::build, 23 | __DELTA(TDialog) 24 | ); 25 | #endif 26 | 27 | -------------------------------------------------------------------------------- /Source/SDIRCOLL.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - sdircoll.cpp */ 3 | /* */ 4 | /* Registeration object for the class TDirCollection */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #define Uses_TDirCollection 15 | #define Uses_TDirEntry 16 | #define Uses_TStreamableClass 17 | #include 18 | 19 | TStreamableClass RDirCollection( TDirCollection::name, 20 | TDirCollection::build, 21 | __DELTA(TDirCollection) 22 | ); 23 | 24 | -------------------------------------------------------------------------------- /Source/SDIRLIST.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - sdirlist.cpp */ 3 | /* */ 4 | /* Registeration object for the class TDirListBox */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #if !defined(NO_STREAMABLE) 15 | #define Uses_TDirListBox 16 | #define Uses_TStreamableClass 17 | #include 18 | __link( RListBox ) 19 | 20 | TStreamableClass RDirListBox( TDirListBox::name, 21 | TDirListBox::build, 22 | __DELTA(TDirListBox) 23 | ); 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /Source/SEDITORS.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - seditors.cpp */ 3 | /* */ 4 | /* Registeration objects for the following classes: */ 5 | /* TIndicator */ 6 | /* TEditor */ 7 | /* TView */ 8 | /* TMemo */ 9 | /* TFileEditor */ 10 | /* TEditWindow */ 11 | /*------------------------------------------------------------*/ 12 | /* 13 | * Turbo Vision - Version 2.0 14 | * 15 | * Copyright (c) 1994 by Borland International 16 | * All Rights Reserved. 17 | * 18 | */ 19 | 20 | #if !defined(NO_STREAMABLE) 21 | #define Uses_TIndicator 22 | #define Uses_TEditor 23 | #define Uses_TMemo 24 | #define Uses_TFileEditor 25 | #define Uses_TEditWindow 26 | #define Uses_TStreamableClass 27 | #include 28 | __link( RView ) 29 | __link( RWindow ) 30 | __link( RScrollBar ) 31 | 32 | TStreamableClass RIndicator( TIndicator::name, 33 | TIndicator::build, 34 | __DELTA(TIndicator) 35 | ); 36 | 37 | TStreamableClass REditor( TEditor::name, 38 | TEditor::build, 39 | __DELTA(TEditor) 40 | ); 41 | 42 | TStreamableClass RMemo( TMemo::name, 43 | TMemo::build, 44 | __DELTA(TMemo) 45 | ); 46 | 47 | TStreamableClass RFileEditor( TFileEditor::name, 48 | TFileEditor::build, 49 | __DELTA(TFileEditor) 50 | ); 51 | 52 | TStreamableClass REditWindow( TEditWindow::name, 53 | TEditWindow::build, 54 | __DELTA(TEditWindow) 55 | ); 56 | #endif 57 | 58 | -------------------------------------------------------------------------------- /Source/SFILCOLL.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - sfilcoll.cpp */ 3 | /* */ 4 | /* Registeration object for the class TFileCollection */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #define Uses_TFileCollection 15 | #define Uses_TStreamableClass 16 | #include 17 | 18 | TStreamableClass RFileCollection( TFileCollection::name, 19 | TFileCollection::build, 20 | __DELTA(TFileCollection) 21 | ); 22 | 23 | -------------------------------------------------------------------------------- /Source/SFILDLG.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - sfildlg.cpp */ 3 | /* */ 4 | /* Registeration object for the class TFileDialog */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #if !defined(NO_STREAMABLE) 15 | #define Uses_TFileDialog 16 | #define Uses_TStreamableClass 17 | #include 18 | __link( RDialog ) 19 | __link( RFileInputLine ) 20 | __link( RFileList ) 21 | __link( RLabel ) 22 | __link( RHistory ) 23 | __link( RScrollBar ) 24 | __link( RButton ) 25 | __link( RFileInfoPane ) 26 | 27 | TStreamableClass RFileDialog( TFileDialog::name, 28 | TFileDialog::build, 29 | __DELTA(TFileDialog) 30 | ); 31 | #endif 32 | 33 | -------------------------------------------------------------------------------- /Source/SFILELST.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - sfilelst.cpp */ 3 | /* */ 4 | /* Registeration object for the class TFileList */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #if !defined(NO_STREAMABLE) 15 | #define Uses_TFileList 16 | #define Uses_TStreamableClass 17 | #include 18 | __link( RSortedListBox ) // In case the object below is moved 19 | // to another file. 20 | 21 | TStreamableClass RFileList( TFileList::name, 22 | TFileList::build, 23 | __DELTA(TFileList) 24 | ); 25 | 26 | /* TSortedListBox registration. */ 27 | __link( RListBox ) 28 | 29 | TStreamableClass RSortedListBox( TSortedListBox::name, 30 | TSortedListBox::build, 31 | __DELTA( TSortedListBox ) 32 | ); 33 | #endif 34 | 35 | -------------------------------------------------------------------------------- /Source/SFINFPNE.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - sfinfpne.cpp */ 3 | /* */ 4 | /* Registeration object for the class TFileInfoPane */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #if !defined(NO_STREAMABLE) 15 | #define Uses_TFileInfoPane 16 | #define Uses_TStreamableClass 17 | #include 18 | __link( RView ) 19 | 20 | TStreamableClass RFileInfoPane( TFileInfoPane::name, 21 | TFileInfoPane::build, 22 | __DELTA(TFileInfoPane) 23 | ); 24 | #endif 25 | 26 | -------------------------------------------------------------------------------- /Source/SFINPUTL.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - sfinputl.cpp */ 3 | /* */ 4 | /* Registeration object for the class TFileInputLine */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #if !defined(NO_STREAMABLE) 15 | #define Uses_TFileInputLine 16 | #define Uses_TStreamableClass 17 | #include 18 | __link( RInputLine ) 19 | 20 | TFileInputLine::TFileInputLine( StreamableInit ) : 21 | TInputLine( streamableInit) 22 | { 23 | } 24 | 25 | TStreamable *TFileInputLine::build() 26 | { 27 | return new TFileInputLine( streamableInit ); 28 | } 29 | 30 | TStreamableClass RFileInputLine( TFileInputLine::name, 31 | TFileInputLine::build, 32 | __DELTA(TFileInputLine) 33 | ); 34 | #endif 35 | 36 | -------------------------------------------------------------------------------- /Source/SFRAME.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - sframe.cpp */ 3 | /* */ 4 | /* Registeration object for the class TFrame */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #if !defined(NO_STREAMABLE) 15 | #define Uses_TFrame 16 | #define Uses_TStreamableClass 17 | #include 18 | 19 | TStreamableClass RFrame( TFrame::name, 20 | TFrame::build, 21 | __DELTA(TFrame) 22 | ); 23 | #endif 24 | 25 | -------------------------------------------------------------------------------- /Source/SGROUP.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - sgroup.cpp */ 3 | /* */ 4 | /* Registeration object for the class TGroup */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #if !defined(NO_STREAMABLE) 15 | #define Uses_TGroup 16 | #define Uses_TStreamableClass 17 | #include 18 | __link( RView ) 19 | 20 | TStreamableClass RGroup( TGroup::name, 21 | TGroup::build, 22 | __DELTA(TGroup) 23 | ); 24 | #endif 25 | 26 | -------------------------------------------------------------------------------- /Source/SHISTORY.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - shistory.cpp */ 3 | /* */ 4 | /* Registeration object for the class THistory */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #if !defined(NO_STREAMABLE) 15 | #define Uses_THistory 16 | #define Uses_TStreamableClass 17 | #include 18 | __link( RView ) 19 | __link( RInputLine ) 20 | 21 | TStreamableClass RHistory( THistory::name, 22 | THistory::build, 23 | __DELTA(THistory) 24 | ); 25 | #endif 26 | 27 | -------------------------------------------------------------------------------- /Source/SINPUTLI.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - sinputli.cpp */ 3 | /* */ 4 | /* Registeration object for the class TInputLine */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #if !defined(NO_STREAMABLE) 15 | #define Uses_TInputLine 16 | #define Uses_TStreamableClass 17 | #include 18 | __link( RView ) 19 | 20 | TStreamableClass RInputLine( TInputLine::name, 21 | TInputLine::build, 22 | __DELTA(TInputLine) 23 | ); 24 | #endif 25 | 26 | -------------------------------------------------------------------------------- /Source/SLABEL.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - slabel.cpp */ 3 | /* */ 4 | /* Registeration object for the class TLabel */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #if !defined(NO_STREAMABLE) 15 | #define Uses_TLabel 16 | #define Uses_TStreamableClass 17 | #include 18 | __link( RStaticText ) 19 | 20 | TStreamableClass RLabel( TLabel::name, 21 | TLabel::build, 22 | __DELTA(TLabel) 23 | ); 24 | #endif 25 | 26 | -------------------------------------------------------------------------------- /Source/SLISTBOX.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - slistbox.cpp */ 3 | /* */ 4 | /* Registeration object for the class TListBox */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #if !defined(NO_STREAMABLE) 15 | #define Uses_TListBox 16 | #define Uses_TStreamableClass 17 | #include 18 | __link( RListViewer ) 19 | 20 | TStreamableClass RListBox( TListBox::name, 21 | TListBox::build, 22 | __DELTA(TListBox) 23 | ); 24 | #endif 25 | 26 | -------------------------------------------------------------------------------- /Source/SLSTVIEW.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - slstview.cpp */ 3 | /* */ 4 | /* Registeration object for the class TListViewer */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #if !defined(NO_STREAMABLE) 15 | #define Uses_TListViewer 16 | #define Uses_TStreamableClass 17 | #include 18 | __link( RView ) 19 | __link( RScrollBar ) 20 | 21 | TStreamableClass RListViewer( TListViewer::name, 22 | TListViewer::build, 23 | __DELTA(TListViewer) 24 | ); 25 | #endif 26 | 27 | -------------------------------------------------------------------------------- /Source/SMENUBAR.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - smenubar.cpp */ 3 | /* */ 4 | /* Registeration object for the class TMenuBar */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #if !defined(NO_STREAMABLE) 15 | #define Uses_TMenuBar 16 | #define Uses_TStreamableClass 17 | #include 18 | 19 | TStreamableClass RMenuBar( TMenuBar::name, 20 | TMenuBar::build, 21 | __DELTA(TMenuBar) 22 | ); 23 | #endif 24 | 25 | -------------------------------------------------------------------------------- /Source/SMENUBOX.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - smenubox.cpp */ 3 | /* */ 4 | /* Registeration object for the class TMenuBox */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #if !defined(NO_STREAMABLE) 15 | #define Uses_TMenuBox 16 | #define Uses_TStreamableClass 17 | #include 18 | 19 | TStreamableClass RMenuBox( TMenuBox::name, 20 | TMenuBox::build, 21 | __DELTA(TMenuBox) 22 | ); 23 | #endif 24 | 25 | -------------------------------------------------------------------------------- /Source/SMENUPOP.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - smenupop.cpp */ 3 | /* */ 4 | /* Registeration object for the class TMenuPopup */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #if !defined(NO_STREAMABLE) 15 | #define Uses_TMenuPopup 16 | #define Uses_TStreamableClass 17 | #include 18 | 19 | TStreamableClass RMenuPopup( TMenuPopup::name, 20 | TMenuPopup::build, 21 | __DELTA(TMenuPopup) 22 | ); 23 | #endif 24 | -------------------------------------------------------------------------------- /Source/SMNUVIEW.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - smnuview.cpp */ 3 | /* */ 4 | /* Registeration object for the class TMenuView */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #if !defined(NO_STREAMABLE) 15 | #define Uses_TMenuView 16 | #define Uses_TStreamableClass 17 | #include 18 | __link( RView ) 19 | 20 | TStreamableClass RMenuView( TMenuView::name, 21 | TMenuView::build, 22 | __DELTA(TMenuView) 23 | ); 24 | #endif 25 | 26 | -------------------------------------------------------------------------------- /Source/SMULCHKB.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - smulchkb.cpp */ 3 | /* */ 4 | /* Registeration object for the class TMultiCheckBoxes */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #if !defined(NO_STREAMABLE) 15 | #define Uses_TMultiCheckBoxes 16 | #define Uses_TStreamableClass 17 | #include 18 | 19 | TStreamableClass RMultiCheckBoxes( TMultiCheckBoxes::name, 20 | TMultiCheckBoxes::build, 21 | __DELTA(TMultiCheckBoxes) 22 | ); 23 | #endif 24 | 25 | -------------------------------------------------------------------------------- /Source/SOUTLINE.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - soutline.cpp */ 3 | /* */ 4 | /* Registeration object for the class TOutline */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #if !defined(NO_STREAMABLE) 15 | #define Uses_TStreamableClass 16 | #define Uses_TOutline 17 | #include 18 | __link( RScroller ) 19 | 20 | TStreamableClass ROutline( TOutline::name, 21 | TOutline::build, 22 | __DELTA(TOutline) 23 | ); 24 | #endif 25 | 26 | -------------------------------------------------------------------------------- /Source/SPARAMTE.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - sparamte.cpp */ 3 | /* */ 4 | /* Registeration object for the class TParamText */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #if !defined(NO_STREAMABLE) 15 | #define Uses_TParamText 16 | #define Uses_TStreamableClass 17 | #include 18 | __link( RView ) 19 | __link( RStaticText ) 20 | 21 | TStreamableClass RParamText( TParamText::name, 22 | TParamText::build, 23 | __DELTA(TParamText) 24 | ); 25 | #endif 26 | 27 | -------------------------------------------------------------------------------- /Source/SRADIOBU.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - sradiobu.cpp */ 3 | /* */ 4 | /* Registeration object for the class TRadioButtons */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #if !defined(NO_STREAMABLE) 15 | #define Uses_TRadioButtons 16 | #define Uses_TStreamableClass 17 | #include 18 | 19 | __link( RCluster ); 20 | 21 | TStreamableClass RRadioButtons( TRadioButtons::name, 22 | TRadioButtons::build, 23 | __DELTA(TRadioButtons) 24 | ); 25 | #endif 26 | 27 | -------------------------------------------------------------------------------- /Source/SRESCOLL.CPP: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------*/ 2 | /* filename - srescoll.cpp */ 3 | /* */ 4 | /* Registeration object for the class TResourceCollection */ 5 | /*--------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #define Uses_TResourceCollection 15 | #define Uses_TStreamableClass 16 | #include 17 | 18 | TStreamableClass RResourceCollection( TResourceCollection::name, 19 | TResourceCollection::build, 20 | __DELTA(TResourceCollection) 21 | ); 22 | -------------------------------------------------------------------------------- /Source/SSCRLBAR.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - sscrlbar.cpp */ 3 | /* */ 4 | /* Registeration object for the class TScrollBar */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #if !defined(NO_STREAMABLE) 15 | #define Uses_TScrollBar 16 | #define Uses_TStreamableClass 17 | #include 18 | __link( RView ) 19 | 20 | TStreamableClass RScrollBar( TScrollBar::name, 21 | TScrollBar::build, 22 | __DELTA(TScrollBar) 23 | ); 24 | #endif 25 | 26 | -------------------------------------------------------------------------------- /Source/SSCROLLE.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - sscrolle.cpp */ 3 | /* */ 4 | /* Registeration object for the class TScroller */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #if !defined(NO_STREAMABLE) 15 | #define Uses_TScroller 16 | #define Uses_TStreamableClass 17 | #include 18 | __link( RView ) 19 | __link( RScrollBar ) 20 | 21 | TStreamableClass RScroller( TScroller::name, 22 | TScroller::build, 23 | __DELTA(TScroller) 24 | ); 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /Source/SSTATICT.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - sstatict.cpp */ 3 | /* */ 4 | /* Registeration object for the class TStaticText */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #if !defined(NO_STREAMABLE) 15 | #define Uses_TStaticText 16 | #define Uses_TStreamableClass 17 | #include 18 | __link( RView ) 19 | 20 | TStreamableClass RStaticText( TStaticText::name, 21 | TStaticText::build, 22 | __DELTA(TStaticText) 23 | ); 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /Source/SSTATUSL.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - sstatusl.cpp */ 3 | /* */ 4 | /* Registeration object for the class TStatusLine */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #if !defined(NO_STREAMABLE) 15 | #define Uses_TStatusLine 16 | #define Uses_TStreamableClass 17 | #include 18 | __link( RView ) 19 | 20 | TStreamableClass RStatusLine( TStatusLine::name, 21 | TStatusLine::build, 22 | __DELTA(TStatusLine) 23 | ); 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /Source/SSTRCOLL.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - sstrcoll.cpp */ 3 | /* */ 4 | /* Registeration object for the class TStringCollection */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #define Uses_TStringCollection 15 | #define Uses_TStreamableClass 16 | #include 17 | 18 | TStreamableClass RStringCollection( TStringCollection::name, 19 | TStringCollection::build, 20 | __DELTA(TStringCollection) 21 | ); 22 | 23 | -------------------------------------------------------------------------------- /Source/SSTRLST.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - sstrlst.cpp */ 3 | /* */ 4 | /* Registeration object for the class TStringList */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #define Uses_TStringList 15 | #define Uses_TStreamableClass 16 | #include 17 | 18 | TStreamableClass RStringList( TStringList::name, 19 | TStringList::build, 20 | __DELTA(TStringList) 21 | ); 22 | 23 | -------------------------------------------------------------------------------- /Source/STRMSTAT.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - strmstat.cpp */ 3 | /* */ 4 | /* defines the static members of class pstream */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #define Uses_pstream 15 | #include 16 | 17 | TStreamableTypes * _NEAR pstream::types; 18 | -------------------------------------------------------------------------------- /Source/SVALID.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - svalid.cpp */ 3 | /* */ 4 | /* Registeration object for the TValidator classes */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #if !defined(NO_STREAMABLE) 15 | #define Uses_TValidator 16 | #define Uses_TFilterValidator 17 | #define Uses_TRangeValidator 18 | #define Uses_TPXPictureValidator 19 | #define Uses_TLookupValidator 20 | #define Uses_TStringLookupValidator 21 | #define Uses_TStreamableClass 22 | 23 | #include 24 | 25 | TStreamableClass RValidator( TValidator::name, 26 | TValidator::build, 27 | __DELTA(TValidator) 28 | ); 29 | 30 | TStreamableClass RFilterValidator( TFilterValidator::name, 31 | TFilterValidator::build, 32 | __DELTA(TFilterValidator) 33 | ); 34 | 35 | TStreamableClass RRangeValidator( TRangeValidator::name, 36 | TRangeValidator::build, 37 | __DELTA(TRangeValidator) 38 | ); 39 | 40 | TStreamableClass RPXPictureValidator( TPXPictureValidator::name, 41 | TPXPictureValidator::build, 42 | __DELTA(TPXPictureValidator) 43 | ); 44 | 45 | TStreamableClass RLookupValidator( TLookupValidator::name, 46 | TLookupValidator::build, 47 | __DELTA(TLookupValidator) 48 | ); 49 | 50 | TStreamableClass RStringLookupValidator( TStringLookupValidator::name, 51 | TStringLookupValidator::build, 52 | __DELTA(TStringLookupValidator) 53 | ); 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /Source/SVIEW.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - sview.cpp */ 3 | /* */ 4 | /* Registeration object for the class TView */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #if !defined(NO_STREAMABLE) 15 | #define Uses_TView 16 | #define Uses_TStreamableClass 17 | #include 18 | 19 | TStreamableClass RView( TView::name, 20 | TView::build, 21 | __DELTA(TView) 22 | ); 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /Source/SWAPST.ASM: -------------------------------------------------------------------------------- 1 | ;/*------------------------------------------------------------*/ 2 | ;/* filename - swapst.asm */ 3 | ;/* */ 4 | ;/* function(s) */ 5 | ;/* TSystemError swapStatusLine function */ 6 | ;/*------------------------------------------------------------*/ 7 | 8 | ; 9 | ; Turbo Vision - Version 2.0 10 | ; 11 | ; Copyright (c) 1994 by Borland International 12 | ; All Rights Reserved. 13 | ; 14 | 15 | 16 | IFNDEF __FLAT__ 17 | PUBLIC @TSystemError@swapStatusLine$qm11TDrawBuffer 18 | ELSE 19 | PUBLIC @TSystemError@swapStatusLine$qr11TDrawBuffer 20 | ENDIF 21 | EXTRN @TScreen@screenWidth : BYTE 22 | EXTRN @TScreen@screenHeight : BYTE 23 | 24 | 25 | IFNDEF __FLAT__ 26 | EXTRN @TScreen@screenBuffer : FAR PTR 27 | ELSE 28 | EXTRN @TScreen@screenBuffer : FWORD 29 | ENDIF 30 | 31 | 32 | INCLUDE TV.INC 33 | CODESEG 34 | 35 | IFNDEF __FLAT__ 36 | @TSystemError@swapStatusLine$qm11TDrawBuffer PROC 37 | ELSE 38 | @TSystemError@swapStatusLine$qr11TDrawBuffer PROC 39 | ENDIF 40 | ARG Buffer : PTR 41 | IFNDEF __FLAT__ 42 | USES SI, DI 43 | 44 | MOV CL, BYTE PTR [@TScreen@screenWidth] 45 | XOR CH, CH 46 | MOV AL, [@TScreen@screenHeight] 47 | DEC AL 48 | MUL CL 49 | SHL AX, 1 50 | LES DI, [@TScreen@screenBuffer] 51 | ADD DI, AX 52 | PUSH DS 53 | LDS SI, [Buffer] 54 | @@1: 55 | MOV AX, ES:[DI] 56 | MOVSW 57 | MOV DS:[SI-2], AX 58 | LOOP @@1 59 | POP DS 60 | RET 61 | ELSE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 32-bit ;;;;;;;;;;;;;;;;;;;;;;;;;;;; 62 | USES ESI, EDI 63 | 64 | MOVZX ECX, BYTE PTR [LARGE @TScreen@screenWidth] 65 | MOV AL, BYTE PTR [LARGE @TScreen@screenHeight] 66 | DEC AL 67 | MUL CL 68 | MOVZX EAX, AX 69 | SHL EAX, 1 70 | LES EDI, [LARGE @TScreen@screenBuffer] 71 | ADD EDI, EAX 72 | MOV ESI, DWORD PTR [Buffer] 73 | @@1: 74 | MOV AX, ES:[EDI] 75 | MOVSW 76 | MOV [ESI-2], AX 77 | LOOP @@1 78 | RET 79 | ENDIF 80 | 81 | ENDP 82 | END 83 | -------------------------------------------------------------------------------- /Source/SWINDOW.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - swindow.cpp */ 3 | /* */ 4 | /* Registeration object for the class TWindow */ 5 | /*------------------------------------------------------------*/ 6 | /* 7 | * Turbo Vision - Version 2.0 8 | * 9 | * Copyright (c) 1994 by Borland International 10 | * All Rights Reserved. 11 | * 12 | */ 13 | 14 | #if !defined(NO_STREAMABLE) 15 | #define Uses_TWindow 16 | #define Uses_TStreamableClass 17 | #include 18 | __link( RGroup ) 19 | __link( RFrame ) 20 | 21 | TStreamableClass RWindow( TWindow::name, 22 | TWindow::build, 23 | __DELTA(TWindow) 24 | ); 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /Source/TAPPLICA.CPP: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------------------------------*/ 2 | /* filename - tapplica.cpp */ 3 | /* */ 4 | /* function(s) */ 5 | /* TApplication member functions (constructor & destructor) */ 6 | /*-------------------------------------------------------------------*/ 7 | /* 8 | * Turbo Vision - Version 2.0 9 | * 10 | * Copyright (c) 1994 by Borland International 11 | * All Rights Reserved. 12 | * 13 | */ 14 | 15 | #define Uses_TSystemError 16 | #define Uses_TEventQueue 17 | #define Uses_THardwareInfo 18 | #define Uses_TScreen 19 | #define Uses_TObject 20 | #define Uses_TMouse 21 | #define Uses_TApplication 22 | #include 23 | 24 | static THardwareInfo hwInfoManager; 25 | TMouse _NEAR TEventQueue::mouse; 26 | static TScreen tsc; 27 | static TEventQueue teq; 28 | static TSystemError sysErr; 29 | 30 | void initHistory(); 31 | void doneHistory(); 32 | 33 | TApplication::TApplication() : 34 | TProgInit( &TApplication::initStatusLine, 35 | &TApplication::initMenuBar, 36 | &TApplication::initDeskTop 37 | ) 38 | { 39 | initHistory(); 40 | } 41 | 42 | TApplication::~TApplication() 43 | { 44 | doneHistory(); 45 | } 46 | 47 | void TApplication::suspend() 48 | { 49 | TSystemError::suspend(); 50 | TEventQueue::suspend(); 51 | TScreen::suspend(); 52 | } 53 | 54 | void TApplication::resume() 55 | { 56 | TScreen::resume(); 57 | TEventQueue::resume(); 58 | TSystemError::resume(); 59 | } 60 | -------------------------------------------------------------------------------- /Source/TBKGRND.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - tbkgrnd.cpp */ 3 | /* */ 4 | /* function(s) */ 5 | /* TBackground member functions */ 6 | /*------------------------------------------------------------*/ 7 | /* 8 | * Turbo Vision - Version 2.0 9 | * 10 | * Copyright (c) 1994 by Borland International 11 | * All Rights Reserved. 12 | * 13 | */ 14 | 15 | #define Uses_TBackground 16 | #define Uses_TDrawBuffer 17 | #define Uses_opstream 18 | #define Uses_ipstream 19 | 20 | #include 21 | 22 | #define cpBackground "\x01" // background palette 23 | 24 | TBackground::TBackground( const TRect& bounds, char aPattern ) : 25 | TView(bounds), 26 | pattern( aPattern ) 27 | { 28 | growMode = gfGrowHiX | gfGrowHiY; 29 | } 30 | 31 | void TBackground::draw() 32 | { 33 | TDrawBuffer b; 34 | 35 | b.moveChar( 0, pattern, getColor(0x01), size.x ); 36 | writeLine( 0, 0, size.x, size.y, b ); 37 | } 38 | 39 | TPalette& TBackground::getPalette() const 40 | { 41 | static TPalette palette( cpBackground, sizeof( cpBackground )-1 ); 42 | return palette; 43 | } 44 | 45 | #if !defined(NO_STREAMABLE) 46 | 47 | TBackground::TBackground( StreamableInit ) : TView( streamableInit ) 48 | { 49 | } 50 | 51 | void TBackground::write( opstream& os ) 52 | { 53 | TView::write( os ); 54 | os << pattern; 55 | } 56 | 57 | void *TBackground::read( ipstream& is ) 58 | { 59 | TView::read( is ); 60 | is >> pattern; 61 | return this; 62 | } 63 | 64 | TStreamable *TBackground::build() 65 | { 66 | return new TBackground( streamableInit ); 67 | } 68 | 69 | #endif 70 | -------------------------------------------------------------------------------- /Source/TCHECKBO.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - tcheckbo.cpp */ 3 | /* */ 4 | /* function(s) */ 5 | /* TCheckBox member functions */ 6 | /*------------------------------------------------------------*/ 7 | /* 8 | * Turbo Vision - Version 2.0 9 | * 10 | * Copyright (c) 1994 by Borland International 11 | * All Rights Reserved. 12 | * 13 | */ 14 | 15 | #define Uses_TCheckBoxes 16 | #include 17 | 18 | void TCheckBoxes::draw() 19 | { 20 | drawMultiBox( button, " X" ); 21 | } 22 | 23 | Boolean TCheckBoxes::mark(int item) 24 | { 25 | return Boolean( (value & (1 << item)) != 0 ); 26 | } 27 | 28 | void TCheckBoxes::press(int item) 29 | { 30 | value = value^(1 << item); 31 | } 32 | 33 | #if !defined(NO_STREAMABLE) 34 | 35 | TStreamable *TCheckBoxes::build() 36 | { 37 | return new TCheckBoxes( streamableInit ); 38 | } 39 | 40 | TCheckBoxes::TCheckBoxes( StreamableInit ) : TCluster( streamableInit ) 41 | { 42 | } 43 | 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /Source/TCMDSET.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - tcmdset.cpp */ 3 | /* */ 4 | /* function(s) */ 5 | /* TCommandSet member functions */ 6 | /*------------------------------------------------------------*/ 7 | /* 8 | * Turbo Vision - Version 2.0 9 | * 10 | * Copyright (c) 1994 by Borland International 11 | * All Rights Reserved. 12 | * 13 | */ 14 | 15 | #define Uses_TCommandSet 16 | #include 17 | 18 | int _NEAR TCommandSet::masks[8] = 19 | { 20 | 0x0001, 21 | 0x0002, 22 | 0x0004, 23 | 0x0008, 24 | 0x0010, 25 | 0x0020, 26 | 0x0040, 27 | 0x0080 28 | }; 29 | 30 | TCommandSet::TCommandSet() 31 | { 32 | for( int i = 0; i < 32; i++ ) 33 | cmds[i] = 0; 34 | } 35 | 36 | TCommandSet::TCommandSet( const TCommandSet& tc ) 37 | { 38 | for( int i = 0; i < 32; i++ ) 39 | cmds[i] = tc.cmds[i]; 40 | } 41 | 42 | Boolean TCommandSet::has( int cmd ) 43 | { 44 | return Boolean( (cmds[ loc( cmd ) ] & mask( cmd )) != 0 ); 45 | } 46 | 47 | void TCommandSet::disableCmd( int cmd ) 48 | { 49 | cmds[ loc( cmd ) ] &= ~mask( cmd ); 50 | } 51 | 52 | void TCommandSet::enableCmd( const TCommandSet& tc ) 53 | { 54 | for( int i = 0; i < 32; i++ ) 55 | cmds[i] |= tc.cmds[i]; 56 | } 57 | 58 | void TCommandSet::disableCmd( const TCommandSet& tc ) 59 | { 60 | for( int i = 0; i < 32; i++ ) 61 | cmds[i] &= ~(tc.cmds[i]); 62 | } 63 | 64 | void TCommandSet::enableCmd( int cmd ) 65 | { 66 | cmds[ loc( cmd ) ] |= mask( cmd ); 67 | } 68 | 69 | TCommandSet& TCommandSet::operator &= ( const TCommandSet& tc ) 70 | { 71 | for( int i = 0; i < 32; i++ ) 72 | cmds[i] &= tc.cmds[i]; 73 | return *this; 74 | } 75 | 76 | TCommandSet& TCommandSet::operator |= ( const TCommandSet& tc ) 77 | { 78 | for( int i = 0; i < 32; i++ ) 79 | cmds[i] |= tc.cmds[i]; 80 | return *this; 81 | } 82 | 83 | TCommandSet operator & ( const TCommandSet& tc1, const TCommandSet& tc2 ) 84 | { 85 | TCommandSet temp( tc1 ); 86 | temp &= tc2; 87 | return temp; 88 | } 89 | 90 | TCommandSet operator | ( const TCommandSet& tc1, const TCommandSet& tc2 ) 91 | { 92 | TCommandSet temp( tc1 ); 93 | temp |= tc2; 94 | return temp; 95 | } 96 | 97 | Boolean TCommandSet::isEmpty() 98 | { 99 | for( int i = 0; i < 32; i++ ) 100 | if( cmds[i] != 0 ) 101 | return False; 102 | return True; 103 | } 104 | 105 | int operator == ( const TCommandSet& tc1, const TCommandSet& tc2 ) 106 | { 107 | for( int i = 0; i < 32; i++ ) 108 | if( tc1.cmds[i] != tc2.cmds[i] ) 109 | return 0; 110 | return 1; 111 | } 112 | 113 | -------------------------------------------------------------------------------- /Source/TDIALOG.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - tdialog.cpp */ 3 | /* */ 4 | /* function(s) */ 5 | /* TDialog member functions */ 6 | /*------------------------------------------------------------*/ 7 | /* 8 | * Turbo Vision - Version 2.0 9 | * 10 | * Copyright (c) 1994 by Borland International 11 | * All Rights Reserved. 12 | * 13 | */ 14 | 15 | #define Uses_TKeys 16 | #define Uses_TDialog 17 | #define Uses_TEvent 18 | #include 19 | 20 | // TMultiCheckboxes flags 21 | // hibyte = number of bits 22 | // lobyte = bit mask 23 | 24 | 25 | TDialog::TDialog( const TRect& bounds, const char *aTitle ) : 26 | TWindow( bounds, aTitle, wnNoNumber ), 27 | TWindowInit( &TDialog::initFrame ) 28 | { 29 | growMode = 0; 30 | flags = wfMove | wfClose; 31 | palette = dpGrayDialog; 32 | } 33 | 34 | TPalette& TDialog::getPalette() const 35 | { 36 | static TPalette paletteGray( cpGrayDialog, sizeof( cpGrayDialog )-1 ); 37 | static TPalette paletteBlue( cpBlueDialog, sizeof( cpBlueDialog )-1 ); 38 | static TPalette paletteCyan( cpCyanDialog, sizeof( cpCyanDialog )-1 ); 39 | 40 | switch (palette) 41 | { 42 | case dpGrayDialog: 43 | return paletteGray; 44 | case dpBlueDialog: 45 | return paletteBlue; 46 | case dpCyanDialog: 47 | return paletteCyan; 48 | } 49 | return paletteGray; 50 | } 51 | 52 | void TDialog::handleEvent(TEvent& event) 53 | { 54 | TWindow::handleEvent(event); 55 | switch (event.what) 56 | { 57 | case evKeyDown: 58 | switch (event.keyDown.keyCode) 59 | { 60 | case kbEsc: 61 | event.what = evCommand; 62 | event.message.command = cmCancel; 63 | event.message.infoPtr = 0; 64 | putEvent(event); 65 | clearEvent(event); 66 | break; 67 | case kbEnter: 68 | event.what = evBroadcast; 69 | event.message.command = cmDefault; 70 | event.message.infoPtr = 0; 71 | putEvent(event); 72 | clearEvent(event); 73 | break; 74 | } 75 | break; 76 | 77 | case evCommand: 78 | switch( event.message.command ) 79 | { 80 | case cmOK: 81 | case cmCancel: 82 | case cmYes: 83 | case cmNo: 84 | if( (state & sfModal) != 0 ) 85 | { 86 | endModal(event.message.command); 87 | clearEvent(event); 88 | } 89 | break; 90 | } 91 | break; 92 | } 93 | } 94 | 95 | Boolean TDialog::valid( ushort command ) 96 | { 97 | if( command == cmCancel ) 98 | return True; 99 | else 100 | return TGroup::valid( command ); 101 | } 102 | 103 | #if !defined(NO_STREAMABLE) 104 | 105 | TStreamable *TDialog::build() 106 | { 107 | return new TDialog( streamableInit ); 108 | } 109 | 110 | TDialog::TDialog( StreamableInit ) : 111 | TWindow( streamableInit ), 112 | TWindowInit( 0 ) 113 | { 114 | } 115 | 116 | #endif 117 | -------------------------------------------------------------------------------- /Source/TDIRCOLL.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - tdircoll.cpp */ 3 | /* */ 4 | /* function(s) */ 5 | /* TDirCollection member functions */ 6 | /*------------------------------------------------------------*/ 7 | /* 8 | * Turbo Vision - Version 2.0 9 | * 10 | * Copyright (c) 1994 by Borland International 11 | * All Rights Reserved. 12 | * 13 | */ 14 | 15 | #define Uses_TDirCollection 16 | #define Uses_TDirEntry 17 | #define Uses_opstream 18 | #define Uses_ipstream 19 | #include 20 | 21 | #if !defined( __DIR_H ) 22 | #include 23 | #endif // __DIR_H 24 | 25 | #if !defined( __STRING_H ) 26 | #include 27 | #endif // __STRING_H 28 | 29 | #if !defined( __DOS_H ) 30 | #include 31 | #endif // __DOS_H 32 | 33 | #pragma warn -asc 34 | 35 | Boolean driveValid( char drive ) 36 | { 37 | #if !defined( __FLAT__ ) 38 | I MOV AH, 19H // Save the current drive in BL 39 | I INT 21H 40 | I MOV BL, AL 41 | I MOV DL, drive // Select the given drive 42 | I SUB DL, 'A' 43 | I MOV AH, 0EH 44 | I INT 21H 45 | I MOV AH, 19H // Retrieve what DOS thinks is current 46 | I INT 21H 47 | I MOV CX, 0 // Assume false 48 | I CMP AL, DL // Is the current drive the given drive? 49 | I JNE __1 50 | I MOV CX, 1 // It is, so the drive is valid 51 | I MOV DL, BL // Restore the old drive 52 | I MOV AH, 0EH 53 | I INT 21H 54 | __1: 55 | I XCHG AX, CX // Put the return value into AX 56 | return Boolean(_AX); 57 | #else 58 | drive = (char) toupper( drive ); 59 | DWORD mask = 0x01 << (drive - 'A'); 60 | return (Boolean) (GetLogicalDrives() & mask); 61 | #endif 62 | } 63 | 64 | #pragma warn .asc 65 | 66 | Boolean isDir( const char *str ) 67 | { 68 | ffblk ff; 69 | return Boolean( findfirst( str, &ff, FA_DIREC ) == 0 && 70 | (ff.ff_attrib & FA_DIREC) != 0 ); 71 | } 72 | 73 | Boolean pathValid( const char *path ) 74 | { 75 | char expPath[MAXPATH]; 76 | strcpy( expPath, path ); 77 | fexpand( expPath ); 78 | int len = strlen(expPath); 79 | if( len <= 3 ) 80 | return driveValid(expPath[0]); 81 | 82 | if( expPath[len-1] == '\\' ) 83 | expPath[len-1] = EOS; 84 | 85 | return isDir( expPath ); 86 | } 87 | 88 | Boolean validFileName( const char *fileName ) 89 | { 90 | static const char * const illegalChars = ";,=+<>|\"[] \\"; 91 | 92 | char path[MAXPATH]; 93 | char dir[MAXDIR]; 94 | char name[MAXFILE]; 95 | char ext[MAXEXT]; 96 | 97 | fnsplit( fileName, path, dir, name, ext ); 98 | strcat( path, dir ); 99 | if( *dir != EOS && !pathValid( path ) ) 100 | return False; 101 | if( strpbrk( name, illegalChars ) != 0 || 102 | strpbrk( ext+1, illegalChars) != 0 || 103 | strchr( ext+1, '.' ) != 0 104 | ) 105 | return False; 106 | return True; 107 | } 108 | 109 | void getCurDir( char *dir ) 110 | { 111 | dir[0] = (char) (getdisk() + 'A'); 112 | dir[1] = ':'; 113 | dir[2] = '\\'; 114 | dir[3] = '\0'; 115 | getcurdir( 0, dir+3 ); 116 | if( strlen( dir ) > 3 ) 117 | strcat( dir, "\\" ); 118 | } 119 | 120 | Boolean isWild( const char *f ) 121 | { 122 | return Boolean( strpbrk( f, "?*" ) != 0 ); 123 | } 124 | 125 | 126 | TStreamable *TDirCollection::build() 127 | { 128 | return new TDirCollection( streamableInit ); 129 | } 130 | 131 | void TDirCollection::writeItem( void *obj, opstream& os ) 132 | { 133 | TDirEntry *item = (TDirEntry *)obj; 134 | os.writeString( item->text() ); 135 | os.writeString( item->dir() ); 136 | } 137 | 138 | void *TDirCollection::readItem( ipstream& is ) 139 | { 140 | char *txt = is.readString(); 141 | char *dir = is.readString(); 142 | TDirEntry *entry = new TDirEntry( txt, dir ); 143 | delete txt; 144 | delete dir; 145 | return entry; 146 | } 147 | 148 | -------------------------------------------------------------------------------- /Source/TEDITWND.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - teditwnd.cpp */ 3 | /* */ 4 | /* function(s) */ 5 | /* TEditWindow member functions */ 6 | /*------------------------------------------------------------*/ 7 | /* 8 | * Turbo Vision - Version 2.0 9 | * 10 | * Copyright (c) 1994 by Borland International 11 | * All Rights Reserved. 12 | * 13 | */ 14 | 15 | #define Uses_TFrame 16 | #define Uses_TWindow 17 | #define Uses_TRect 18 | #define Uses_TIndicator 19 | #define Uses_TEditor 20 | #define Uses_TMemo 21 | #define Uses_TFileEditor 22 | #define Uses_TEditWindow 23 | #define Uses_TEvent 24 | #define Uses_TScrollBar 25 | #define Uses_opstream 26 | #define Uses_ipstream 27 | #include 28 | 29 | const TPoint minEditWinSize = {24, 6}; 30 | 31 | TEditWindow::TEditWindow( const TRect& bounds, 32 | const char *fileName, 33 | int aNumber 34 | ) : 35 | TWindow( bounds, 0, aNumber ), 36 | TWindowInit( &TEditWindow::initFrame ) 37 | { 38 | options |= ofTileable; 39 | 40 | TScrollBar *hScrollBar = 41 | new TScrollBar( TRect( 18, size.y - 1, size.x - 2, size.y ) ); 42 | hScrollBar->hide(); 43 | insert(hScrollBar); 44 | 45 | TScrollBar *vScrollBar = 46 | new TScrollBar( TRect( size.x - 1, 1, size.x, size.y - 1 ) ); 47 | vScrollBar->hide(); 48 | insert(vScrollBar); 49 | 50 | TIndicator *indicator = 51 | new TIndicator( TRect( 2, size.y - 1, 16, size.y ) ); 52 | indicator->hide(); 53 | insert(indicator); 54 | 55 | 56 | TRect r( getExtent() ); 57 | r.grow(-1, -1); 58 | editor = new TFileEditor( r, hScrollBar, vScrollBar, indicator, fileName ); 59 | insert(editor); 60 | } 61 | 62 | void TEditWindow::close() 63 | { 64 | if( editor->isClipboard() == True ) 65 | hide(); 66 | else 67 | TWindow::close(); 68 | } 69 | 70 | const char *TEditWindow::getTitle( short ) 71 | { 72 | if( editor->isClipboard() == True ) 73 | return clipboardTitle; 74 | else if( *(editor->fileName) == EOS ) 75 | return untitled; 76 | else 77 | return editor->fileName; 78 | } 79 | 80 | void TEditWindow::handleEvent( TEvent& event ) 81 | { 82 | TWindow::handleEvent(event); 83 | if( event.what == evBroadcast && event.message.command == cmUpdateTitle ) 84 | { 85 | if( frame != 0 ) 86 | frame->drawView(); 87 | clearEvent(event); 88 | } 89 | } 90 | 91 | void TEditWindow::sizeLimits( TPoint& min, TPoint& max ) 92 | { 93 | TWindow::sizeLimits(min, max); 94 | min = minEditWinSize; 95 | } 96 | 97 | #if !defined(NO_STREAMABLE) 98 | 99 | void TEditWindow::write( opstream& os ) 100 | { 101 | TWindow::write( os ); 102 | os << editor; 103 | } 104 | 105 | void *TEditWindow::read( ipstream& is ) 106 | { 107 | TWindow::read( is ); 108 | is >> editor; 109 | return this; 110 | } 111 | 112 | TStreamable *TEditWindow::build() 113 | { 114 | return new TEditWindow( streamableInit ); 115 | } 116 | 117 | TEditWindow::TEditWindow( StreamableInit ) : 118 | TWindow( streamableInit ), 119 | TWindowInit( streamableInit ) 120 | { 121 | } 122 | 123 | #endif 124 | -------------------------------------------------------------------------------- /Source/TFILECOL.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - tfilecol.cpp */ 3 | /* */ 4 | /* function(s) */ 5 | /* TFileCollection member functions */ 6 | /*------------------------------------------------------------*/ 7 | /* 8 | * Turbo Vision - Version 2.0 9 | * 10 | * Copyright (c) 1994 by Borland International 11 | * All Rights Reserved. 12 | * 13 | */ 14 | 15 | 16 | #define Uses_TFileCollection 17 | #define Uses_TSearchRec 18 | #include 19 | 20 | #if !defined( __STRING_H ) 21 | #include 22 | #endif // __STRING_H 23 | 24 | #if !defined( __DOS_H ) 25 | #include 26 | #endif // __DOS_H 27 | 28 | inline const char *getName( void *k ) 29 | { 30 | return ((TSearchRec *)k)->name; 31 | } 32 | 33 | inline int attr( void *k ) 34 | { 35 | return ((TSearchRec *)k)->attr; 36 | } 37 | 38 | int TFileCollection::compare(void *key1, void *key2) 39 | { 40 | if( strcmp( getName( key1 ), getName( key2 ) ) == 0 ) 41 | return 0; 42 | 43 | if( strcmp( getName( key1 ), ".." ) == 0 ) 44 | return 1; 45 | if( strcmp( getName( key2 ), ".." ) == 0 ) 46 | return -1; 47 | 48 | if( (attr( key1 ) & FA_DIREC) != 0 && (attr( key2 ) & FA_DIREC) == 0 ) 49 | return 1; 50 | if( (attr( key2 ) & FA_DIREC) != 0 && (attr( key1 ) & FA_DIREC) == 0 ) 51 | return -1; 52 | 53 | return strcmp( getName( key1 ), getName( key2 ) ); 54 | } 55 | 56 | 57 | TStreamable *TFileCollection::build() 58 | { 59 | return new TFileCollection( streamableInit ); 60 | } 61 | 62 | void TFileCollection::writeItem( void *obj, opstream& os ) 63 | { 64 | TSearchRec *item = (TSearchRec *)obj; 65 | os << item->attr << item->time << item->size; 66 | os.writeString( item->name ); 67 | } 68 | 69 | void *TFileCollection::readItem( ipstream& is ) 70 | { 71 | TSearchRec *item = new TSearchRec; 72 | is >> item->attr >> item->time >> item->size; 73 | is.readString( item->name, sizeof(item->name) ); 74 | return item; 75 | } 76 | 77 | -------------------------------------------------------------------------------- /Source/TGRMV.ASM: -------------------------------------------------------------------------------- 1 | ;/*------------------------------------------------------------*/ 2 | ;/* filename - tgrmv.asm */ 3 | ;/* */ 4 | ;/* function(s) */ 5 | ;/* TGroup removeView member function */ 6 | ;/*------------------------------------------------------------*/ 7 | 8 | ; 9 | ; Turbo Vision - Version 2.0 10 | ; 11 | ; Copyright (c) 1994 by Borland International 12 | ; All Rights Reserved. 13 | ; 14 | 15 | ifndef __FLAT__ 16 | PUBLIC @TGroup@removeView$qn5TView 17 | else 18 | PUBLIC @TGroup@removeView$qp5TView 19 | endif 20 | 21 | INCLUDE TV.INC 22 | 23 | CODESEG 24 | 25 | IFNDEF __FLAT__ 26 | @TGroup@removeView$qn5TView PROC 27 | ELSE 28 | @TGroup@removeView$qp5TView PROC 29 | ENDIF 30 | ARG thisPtr : PTR, P : PTR 31 | IFNDEF __FLAT__ 32 | USES SI, DI, DS 33 | 34 | LDS SI, [thisPtr] 35 | LES DI, [P] 36 | LDS SI, DS:[SI+TGroupLast] 37 | PUSH BP 38 | MOV AX, DS 39 | OR AX, SI 40 | JE @@7 41 | MOV AX, SI 42 | MOV DX, DS 43 | MOV BP, ES 44 | @@1: 45 | MOV BX, WORD PTR DS:[SI+TViewNext] 46 | MOV CX, WORD PTR DS:[SI+TViewNext+2] 47 | CMP CX, BP 48 | JE @@5 49 | @@2: 50 | CMP CX, DX 51 | JE @@4 52 | @@3: 53 | MOV SI, BX 54 | MOV DS, CX 55 | JMP @@1 56 | @@4: 57 | CMP BX, AX 58 | JNE @@3 59 | JMP @@7 60 | @@5: 61 | CMP BX, DI 62 | JNE @@2 63 | MOV BX, WORD PTR ES:[DI+TViewNext] 64 | MOV CX, WORD PTR ES:[DI+TViewNext+2] 65 | MOV WORD PTR DS:[SI+TViewNext], BX 66 | MOV WORD PTR DS:[SI+TViewNext+2], CX 67 | CMP DX, BP 68 | JNE @@7 69 | CMP AX, DI 70 | JNE @@7 71 | CMP CX, BP 72 | JNE @@6 73 | CMP BX, DI 74 | JNE @@6 75 | XOR SI, SI 76 | MOV DS, SI 77 | @@6: 78 | POP BP 79 | PUSH BP 80 | LES DI, [thisPtr] 81 | MOV WORD PTR ES:[DI+TGroupLast], SI 82 | MOV WORD PTR ES:[DI+TGroupLast+2], DS 83 | @@7: 84 | POP BP 85 | RET 86 | ELSE ;;;;;;;;;;;;;;;;;;;;;;;; 32-bit version ;;;;;;;;;;;;;;;;;;;;;;;;;;; 87 | USES ESI,EDI,EBX 88 | 89 | MOV ESI, DWORD PTR [thisPtr] 90 | MOV EDI, DWORD PTR [P] 91 | MOV ESI, [ESI+TGroupLast] 92 | OR ESI, ESI 93 | JZ @@7 94 | MOV EAX, ESI 95 | @@1: 96 | MOV EBX, [ESI+TViewNext] 97 | JMP @@5 98 | @@3: 99 | MOV ESI, EBX 100 | JMP @@1 101 | @@4: 102 | CMP EBX, EAX 103 | JNE @@3 104 | JMP @@7 105 | @@5: 106 | CMP EBX, EDI 107 | JNE @@4 108 | MOV EBX, [EDI+TViewNext] 109 | MOV [ESI+TViewNext], EBX 110 | CMP EAX, EDI 111 | JNE @@7 112 | CMP EBX, EDI 113 | JNE @@6 114 | XOR ESI, ESI 115 | @@6: 116 | MOV EDI, DWORD PTR [thisPtr] 117 | MOV [EDI+TGroupLast], ESI 118 | @@7: 119 | RET 120 | ENDIF 121 | 122 | ENDP 123 | END 124 | -------------------------------------------------------------------------------- /Source/THISTORY.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - thistory.cpp */ 3 | /* */ 4 | /* function(s) */ 5 | /* THistory member functions */ 6 | /*------------------------------------------------------------*/ 7 | /* 8 | * Turbo Vision - Version 2.0 9 | * 10 | * Copyright (c) 1994 by Borland International 11 | * All Rights Reserved. 12 | * 13 | */ 14 | 15 | #define Uses_THistory 16 | #define Uses_TKeys 17 | #define Uses_TRect 18 | #define Uses_TEvent 19 | #define Uses_TInputLine 20 | #define Uses_THistoryWindow 21 | #define Uses_opstream 22 | #define Uses_ipstream 23 | #include 24 | 25 | #if !defined( __CTYPE_H ) 26 | #include 27 | #endif // __CTYPE_H 28 | 29 | #if !defined( __STRING_H ) 30 | #include 31 | #endif // __STRING_H 32 | 33 | #if !defined( __DOS_H ) 34 | #include 35 | #endif // __DOS_H 36 | 37 | #define cpHistory "\x16\x17" 38 | 39 | THistory::THistory( const TRect& bounds, 40 | TInputLine *aLink, 41 | ushort aHistoryId) : 42 | TView(bounds), 43 | link( aLink ), 44 | historyId( aHistoryId ) 45 | { 46 | options |= ofPostProcess; 47 | eventMask |= evBroadcast; 48 | } 49 | 50 | void THistory::shutDown() 51 | { 52 | link = 0; 53 | TView::shutDown(); 54 | } 55 | 56 | void THistory::draw() 57 | { 58 | TDrawBuffer b; 59 | 60 | b.moveCStr( 0, icon, getColor(0x0102) ); 61 | writeLine( 0, 0, size.x, size.y, b ); 62 | } 63 | 64 | TPalette& THistory::getPalette() const 65 | { 66 | static TPalette palette( cpHistory, sizeof( cpHistory )-1 ); 67 | return palette; 68 | } 69 | 70 | void THistory::handleEvent( TEvent& event ) 71 | { 72 | THistoryWindow *historyWindow; 73 | TRect r, p; 74 | ushort c; 75 | 76 | TView::handleEvent( event ); 77 | if( event.what == evMouseDown || 78 | ( event.what == evKeyDown && 79 | ctrlToArrow( event.keyDown.keyCode ) == kbDown && 80 | (link->state & sfFocused) != 0 81 | ) 82 | ) 83 | { 84 | if (!link->focus()) 85 | { 86 | clearEvent(event); 87 | return; 88 | } 89 | recordHistory(link->data); 90 | r = link->getBounds(); 91 | r.a.x--; 92 | r.b.x++; 93 | r.b.y += 7; 94 | r.a.y--; 95 | p = owner->getExtent(); 96 | r.intersect( p ); 97 | r.b.y--; 98 | historyWindow = initHistoryWindow( r ); 99 | if( historyWindow != 0 ) 100 | { 101 | c = owner->execView( historyWindow ); 102 | if( c == cmOK ) 103 | { 104 | char rslt[256]; 105 | historyWindow->getSelection( rslt ); 106 | strncpy( link->data, rslt, link->maxLen ); 107 | link->selectAll( True ); 108 | link->drawView(); 109 | } 110 | destroy( historyWindow ); 111 | } 112 | clearEvent( event ); 113 | } 114 | else 115 | if( event.what == evBroadcast ) 116 | if( (event.message.command == cmReleasedFocus && 117 | event.message.infoPtr == link) || 118 | event.message.command == cmRecordHistory 119 | ) 120 | recordHistory(link->data ); 121 | } 122 | 123 | THistoryWindow *THistory::initHistoryWindow( const TRect& bounds ) 124 | { 125 | THistoryWindow *p = new THistoryWindow( bounds, historyId ); 126 | p->helpCtx = link->helpCtx; 127 | return p; 128 | } 129 | 130 | void THistory::recordHistory(const char* s) 131 | { 132 | historyAdd(historyId, s); 133 | } 134 | 135 | #if !defined(NO_STREAMABLE) 136 | 137 | void THistory::write( opstream& os ) 138 | { 139 | TView::write( os ); 140 | os << link << historyId; 141 | } 142 | 143 | void *THistory::read( ipstream& is ) 144 | { 145 | TView::read( is ); 146 | is >> link >> historyId; 147 | return this; 148 | } 149 | 150 | TStreamable *THistory::build() 151 | { 152 | return new THistory( streamableInit ); 153 | } 154 | 155 | THistory::THistory( StreamableInit ) : TView( streamableInit ) 156 | { 157 | } 158 | 159 | #endif 160 | -------------------------------------------------------------------------------- /Source/THISTWIN.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - thistwin.cpp */ 3 | /* */ 4 | /* function(s) */ 5 | /* THistoryWindow member functions */ 6 | /*------------------------------------------------------------*/ 7 | /* 8 | * Turbo Vision - Version 2.0 9 | * 10 | * Copyright (c) 1994 by Borland International 11 | * All Rights Reserved. 12 | * 13 | */ 14 | 15 | #define Uses_THistoryWindow 16 | #define Uses_THistoryViewer 17 | #include 18 | 19 | THistInit::THistInit( TListViewer *(*cListViewer)( TRect, TWindow *, ushort ) ) : 20 | createListViewer( cListViewer ) 21 | { 22 | } 23 | 24 | #define cpHistoryWindow "\x13\x13\x15\x18\x17\x13\x14" 25 | 26 | THistoryWindow::THistoryWindow( const TRect& bounds, 27 | ushort historyId ) : 28 | THistInit( &THistoryWindow::initViewer ), 29 | TWindow( bounds, 0, wnNoNumber), 30 | TWindowInit( &THistoryWindow::initFrame ) 31 | { 32 | flags = wfClose; 33 | if( createListViewer != 0 && 34 | (viewer = createListViewer( getExtent(), this, historyId )) != 0 ) 35 | insert( viewer ); 36 | } 37 | 38 | TPalette& THistoryWindow::getPalette() const 39 | { 40 | static TPalette palette( cpHistoryWindow, sizeof( cpHistoryWindow )-1 ); 41 | return palette; 42 | } 43 | 44 | void THistoryWindow::getSelection( char *dest ) 45 | { 46 | viewer->getText( dest, viewer->focused, 255 ); 47 | } 48 | 49 | TListViewer *THistoryWindow::initViewer( TRect r, TWindow * win, ushort historyId ) 50 | { 51 | r.grow( -1, -1 ); 52 | return new THistoryViewer( r, 53 | win->standardScrollBar( sbHorizontal | sbHandleKeyboard ), 54 | win->standardScrollBar( sbVertical | sbHandleKeyboard ), 55 | historyId); 56 | } 57 | -------------------------------------------------------------------------------- /Source/THSTVIEW.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - thstview.cpp */ 3 | /* */ 4 | /* function(s) */ 5 | /* THistoryViewer member functions */ 6 | /*------------------------------------------------------------*/ 7 | /* 8 | * Turbo Vision - Version 2.0 9 | * 10 | * Copyright (c) 1994 by Borland International 11 | * All Rights Reserved. 12 | * 13 | */ 14 | 15 | #define Uses_TKeys 16 | #define Uses_THistoryViewer 17 | #define Uses_TScrollBar 18 | #define Uses_TEvent 19 | #include 20 | 21 | #if !defined( __CTYPE_H ) 22 | #include 23 | #endif // __CTYPE_H 24 | 25 | #if !defined( __STRING_H ) 26 | #include 27 | #endif // __STRING_H 28 | 29 | #if !defined( __DOS_H ) 30 | #include 31 | #endif // __DOS_H 32 | 33 | #define cpHistoryViewer "\x06\x06\x07\x06\x06" 34 | 35 | THistoryViewer::THistoryViewer( const TRect& bounds, 36 | TScrollBar *aHScrollBar, 37 | TScrollBar *aVScrollBar, 38 | ushort aHistoryId) : 39 | TListViewer(bounds, 1, aHScrollBar, aVScrollBar), 40 | historyId( aHistoryId ) 41 | { 42 | setRange( historyCount( aHistoryId ) ); 43 | if( range > 1 ) 44 | focusItem( 1 ); 45 | hScrollBar->setRange( 0, historyWidth() - size.x + 3 ); 46 | } 47 | 48 | TPalette& THistoryViewer::getPalette() const 49 | { 50 | static TPalette palette( cpHistoryViewer, sizeof( cpHistoryViewer )-1 ); 51 | return palette; 52 | } 53 | 54 | void THistoryViewer::getText( char *dest, short item, short maxChars ) 55 | { 56 | const char *str = historyStr( historyId, item ); 57 | if( str != 0 ) 58 | { 59 | strncpy( dest, str, maxChars ); 60 | dest[maxChars] = '\0'; 61 | } 62 | else 63 | *dest = EOS; 64 | } 65 | 66 | void THistoryViewer::handleEvent( TEvent& event ) 67 | { 68 | if( (event.what == evMouseDown && (event.mouse.eventFlags & meDoubleClick) ) || 69 | (event.what == evKeyDown && event.keyDown.keyCode == kbEnter) 70 | ) 71 | { 72 | endModal( cmOK ); 73 | clearEvent( event ); 74 | } 75 | else 76 | if( (event.what == evKeyDown && event.keyDown.keyCode == kbEsc) || 77 | (event.what == evCommand && event.message.command == cmCancel) 78 | ) 79 | { 80 | endModal( cmCancel ); 81 | clearEvent( event ); 82 | } 83 | else 84 | TListViewer::handleEvent( event ); 85 | } 86 | 87 | int THistoryViewer::historyWidth() 88 | { 89 | int width = 0; 90 | int count = historyCount( historyId ); 91 | for( int i = 0; i < count; i++ ) 92 | { 93 | int T = strlen( historyStr( historyId, i ) ); 94 | width = max( width, T ); 95 | } 96 | return width; 97 | } 98 | -------------------------------------------------------------------------------- /Source/TINDICTR.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - tindictr.cpp */ 3 | /* */ 4 | /* function(s) */ 5 | /* TIndicator member functions */ 6 | /*------------------------------------------------------------*/ 7 | /* 8 | * Turbo Vision - Version 2.0 9 | * 10 | * Copyright (c) 1994 by Borland International 11 | * All Rights Reserved. 12 | * 13 | */ 14 | 15 | #define Uses_TIndicator 16 | #define Uses_TDrawBuffer 17 | #define Uses_TEvent 18 | #define Uses_TView 19 | #define Uses_opstream 20 | #define Uses_ipstream 21 | #include 22 | 23 | #if !defined( __STRSTREA_H ) 24 | #include 25 | #endif // __STRSTREA_H 26 | 27 | #define cpIndicator "\x02\x03" 28 | 29 | TIndicator::TIndicator( const TRect& bounds ) : 30 | TView( bounds ) 31 | { 32 | growMode = gfGrowLoY | gfGrowHiY; 33 | } 34 | 35 | void TIndicator::draw() 36 | { 37 | uchar color, frame; 38 | TDrawBuffer b; 39 | char s[15]; 40 | 41 | if( (state & sfDragging) == 0 ) 42 | { 43 | color = getColor(1); 44 | frame = dragFrame; 45 | } 46 | else 47 | { 48 | color = getColor(2); 49 | frame = normalFrame; 50 | } 51 | 52 | b.moveChar( 0, frame, color, size.x ); 53 | if( modified ) 54 | b.putChar( 0, 15 ); 55 | ostrstream os( s, 15 ); 56 | 57 | os << ' ' << (location.y+1) 58 | << ':' << (location.x+1) << ' ' << ends; 59 | 60 | b.moveCStr( 8-int(strchr(s, ':')-s), s, color); 61 | writeBuf(0, 0, size.x, 1, b); 62 | } 63 | 64 | TPalette& TIndicator::getPalette() const 65 | { 66 | static TPalette palette( cpIndicator, sizeof( cpIndicator )-1 ); 67 | return palette; 68 | } 69 | 70 | void TIndicator::setState( ushort aState, Boolean enable ) 71 | { 72 | TView::setState(aState, enable); 73 | if( aState == sfDragging ) 74 | drawView(); 75 | } 76 | 77 | void TIndicator::setValue( const TPoint& aLocation, Boolean aModified ) 78 | { 79 | if( (location != aLocation) || (modified != aModified) ) 80 | { 81 | location = aLocation; 82 | modified = aModified; 83 | drawView(); 84 | } 85 | } 86 | 87 | #if !defined(NO_STREAMABLE) 88 | 89 | TStreamable *TIndicator::build() 90 | { 91 | return new TIndicator( streamableInit ); 92 | } 93 | 94 | TIndicator::TIndicator( StreamableInit ) : TView( streamableInit ) 95 | { 96 | } 97 | 98 | #endif 99 | -------------------------------------------------------------------------------- /Source/TLABEL.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - tlabel.cpp */ 3 | /* */ 4 | /* function(s) */ 5 | /* TLabel member functions */ 6 | /*------------------------------------------------------------*/ 7 | /* 8 | * Turbo Vision - Version 2.0 9 | * 10 | * Copyright (c) 1994 by Borland International 11 | * All Rights Reserved. 12 | * 13 | */ 14 | 15 | #define Uses_TLabel 16 | #define Uses_TEvent 17 | #define Uses_TDrawBuffer 18 | #define Uses_TGroup 19 | #define Uses_TView 20 | #define Uses_opstream 21 | #define Uses_ipstream 22 | #include 23 | 24 | #if !defined( __CTYPE_H ) 25 | #include 26 | #endif // __CTYPE_H 27 | 28 | #define cpLabel "\x07\x08\x09\x09" 29 | 30 | TLabel::TLabel( const TRect& bounds, const char *aText, TView* aLink) : 31 | TStaticText( bounds, aText ), 32 | link( aLink ), 33 | light( False ) 34 | { 35 | options |= ofPreProcess | ofPostProcess; 36 | eventMask |= evBroadcast; 37 | } 38 | 39 | void TLabel::shutDown() 40 | { 41 | link = 0; 42 | TStaticText::shutDown(); 43 | } 44 | 45 | void TLabel::draw() 46 | { 47 | ushort color; 48 | TDrawBuffer b; 49 | uchar scOff; 50 | 51 | if( light ) 52 | { 53 | color = getColor(0x0402); 54 | scOff = 0; 55 | } 56 | else 57 | { 58 | color = getColor(0x0301); 59 | scOff = 4; 60 | } 61 | 62 | b.moveChar( 0, ' ', color, size.x ); 63 | if( text != 0 ) 64 | b.moveCStr( 1, text, color ); 65 | if( showMarkers ) 66 | b.putChar( 0, specialChars[scOff] ); 67 | writeLine( 0, 0, size.x, 1, b ); 68 | } 69 | 70 | TPalette& TLabel::getPalette() const 71 | { 72 | static TPalette palette( cpLabel, sizeof( cpLabel )-1 ); 73 | return palette; 74 | } 75 | 76 | void TLabel::focusLink(TEvent& event) 77 | { 78 | if (link && (link->options & ofSelectable)) 79 | link->focus(); 80 | clearEvent(event); 81 | } 82 | 83 | void TLabel::handleEvent( TEvent& event ) 84 | { 85 | TStaticText::handleEvent(event); 86 | if( event.what == evMouseDown ) 87 | focusLink(event); 88 | 89 | else if( event.what == evKeyDown ) 90 | { 91 | char c = hotKey( text ); 92 | if( getAltCode(c) == event.keyDown.keyCode || 93 | ( c != 0 && owner->phase == TGroup::phPostProcess && 94 | toupper(event.keyDown.charScan.charCode) == c ) 95 | ) 96 | focusLink(event); 97 | } 98 | else if( event.what == evBroadcast && link && 99 | ( event.message.command == cmReceivedFocus || 100 | event.message.command == cmReleasedFocus ) 101 | ) 102 | { 103 | light = Boolean( (link->state & sfFocused) != 0 ); 104 | drawView(); 105 | } 106 | } 107 | 108 | #if !defined(NO_STREAMABLE) 109 | 110 | void TLabel::write( opstream& os ) 111 | { 112 | TStaticText::write( os ); 113 | os << link; 114 | } 115 | 116 | void *TLabel::read( ipstream& is ) 117 | { 118 | TStaticText::read( is ); 119 | is >> link; 120 | light = False; 121 | return this; 122 | } 123 | 124 | TStreamable *TLabel::build() 125 | { 126 | return new TLabel( streamableInit ); 127 | } 128 | 129 | TLabel::TLabel( StreamableInit ) : TStaticText( streamableInit ) 130 | { 131 | } 132 | 133 | 134 | #endif 135 | -------------------------------------------------------------------------------- /Source/TLISTBOX.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - tlistbox.cpp */ 3 | /* */ 4 | /* function(s) */ 5 | /* TListBox member functions */ 6 | /*------------------------------------------------------------*/ 7 | /* 8 | * Turbo Vision - Version 2.0 9 | * 10 | * Copyright (c) 1994 by Borland International 11 | * All Rights Reserved. 12 | * 13 | */ 14 | 15 | #define Uses_TListBox 16 | #define Uses_TEvent 17 | #define Uses_TCollection 18 | #define Uses_opstream 19 | #define Uses_ipstream 20 | #include 21 | 22 | #if !defined( __STRING_H ) 23 | #include 24 | #endif // __STRING_H 25 | 26 | 27 | TListBox::TListBox( const TRect& bounds, 28 | ushort aNumCols, 29 | TScrollBar *aScrollBar ) : 30 | TListViewer(bounds, aNumCols, 0, aScrollBar), 31 | items( 0 ) 32 | { 33 | setRange(0); 34 | } 35 | 36 | TListBox::~TListBox() 37 | { 38 | } 39 | 40 | ushort TListBox::dataSize() 41 | { 42 | return sizeof(TListBoxRec); 43 | } 44 | 45 | void TListBox::getData( void * rec ) 46 | { 47 | TListBoxRec *p = (TListBoxRec *)rec; 48 | p->items = items; 49 | p->selection = focused; 50 | } 51 | 52 | void TListBox::getText( char *dest, short item, short maxChars ) 53 | { 54 | if (items != 0 ) 55 | { 56 | strncpy( dest, (const char *)(items->at(item)), maxChars ); 57 | dest[maxChars] = '\0'; 58 | } 59 | else 60 | *dest = EOS; 61 | } 62 | 63 | void TListBox::newList( TCollection *aList ) 64 | { 65 | destroy( items ); 66 | items = aList; 67 | if( aList != 0 ) 68 | setRange( aList->getCount() ); 69 | else 70 | setRange(0); 71 | if( range > 0 ) 72 | focusItem(0); 73 | drawView(); 74 | } 75 | 76 | void TListBox::setData( void *rec ) 77 | { 78 | TListBoxRec *p = (TListBoxRec *)rec; 79 | newList(p->items); 80 | focusItem(p->selection); 81 | drawView(); 82 | } 83 | 84 | #if !defined(NO_STREAMABLE) 85 | 86 | void TListBox::write( opstream& os ) 87 | { 88 | TListViewer::write( os ); 89 | os << items; 90 | } 91 | 92 | void *TListBox::read( ipstream& is ) 93 | { 94 | TListViewer::read( is ); 95 | is >> items; 96 | return this; 97 | } 98 | 99 | TStreamable *TListBox::build() 100 | { 101 | return new TListBox( streamableInit ); 102 | } 103 | 104 | TListBox::TListBox( StreamableInit ) : TListViewer( streamableInit ) 105 | { 106 | } 107 | 108 | #endif 109 | -------------------------------------------------------------------------------- /Source/TMEMO.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - tmemo.cpp */ 3 | /* */ 4 | /* function(s) */ 5 | /* TMemo member functions 6 | /*------------------------------------------------------------*/ 7 | /* 8 | * Turbo Vision - Version 2.0 9 | * 10 | * Copyright (c) 1994 by Borland International 11 | * All Rights Reserved. 12 | * 13 | */ 14 | 15 | #define Uses_TKeys 16 | #define Uses_TEditor 17 | #define Uses_TMemo 18 | #define Uses_TEvent 19 | #define Uses_opstream 20 | #define Uses_ipstream 21 | #include 22 | 23 | #define cpMemo "\x1A\x1B" 24 | 25 | TMemo::TMemo( const TRect& bounds, 26 | TScrollBar *aHScrollBar, 27 | TScrollBar *aVScrollBar, 28 | TIndicator *aIndicator, 29 | ushort aBufSize ) : 30 | TEditor( bounds, aHScrollBar, aVScrollBar, aIndicator, aBufSize ) 31 | { 32 | } 33 | 34 | ushort TMemo::dataSize() 35 | { 36 | return bufSize + sizeof( ushort ); 37 | } 38 | 39 | void TMemo::getData( void *rec ) 40 | { 41 | TMemoData *data = (TMemoData *)rec; 42 | 43 | data->length = bufLen; 44 | memcpy(data->buffer, buffer, curPtr); 45 | memcpy(&data->buffer[curPtr], buffer+(curPtr + gapLen), bufLen - curPtr); 46 | memset(&data->buffer[bufLen], 0, bufSize - bufLen); 47 | } 48 | 49 | void TMemo::setData( void *rec ) 50 | { 51 | TMemoData *data = (TMemoData *)rec; 52 | 53 | memcpy(&buffer[bufSize - data->length], data->buffer, data->length); 54 | setBufLen(data->length); 55 | } 56 | 57 | TPalette& TMemo::getPalette() const 58 | { 59 | static TPalette palette( cpMemo, sizeof( cpMemo )-1 ); 60 | return palette; 61 | } 62 | 63 | void TMemo::handleEvent( TEvent& event ) 64 | { 65 | if( event.what != evKeyDown || event.keyDown.keyCode != kbTab ) 66 | TEditor::handleEvent(event); 67 | } 68 | 69 | #if !defined(NO_STREAMABLE) 70 | 71 | void TMemo::write( opstream& os ) 72 | { 73 | TEditor::write( os ); 74 | os << bufLen; 75 | os.writeBytes( buffer, curPtr ); 76 | os.writeBytes( buffer + gapLen, bufLen - curPtr ); 77 | } 78 | 79 | void *TMemo::read( ipstream& is ) 80 | { 81 | TEditor::read( is ); 82 | ushort length; 83 | is >> length; 84 | if( isValid ) 85 | { 86 | is.readBytes( buffer + bufSize - length, length ); 87 | setBufLen( length ); 88 | } 89 | else 90 | is.seekg( is.tellg() + length ); 91 | return this; 92 | } 93 | 94 | TStreamable *TMemo::build() 95 | { 96 | return new TMemo( streamableInit ); 97 | } 98 | 99 | TMemo::TMemo( StreamableInit ) : TEditor( streamableInit ) 100 | { 101 | } 102 | 103 | #endif 104 | -------------------------------------------------------------------------------- /Source/TMENUBAR.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - tmenubar.cpp */ 3 | /* */ 4 | /* function(s) */ 5 | /* TMenuBar member functions */ 6 | /*------------------------------------------------------------*/ 7 | /* 8 | * Turbo Vision - Version 2.0 9 | * 10 | * Copyright (c) 1994 by Borland International 11 | * All Rights Reserved. 12 | * 13 | */ 14 | 15 | #define Uses_TMenuBar 16 | #define Uses_TDrawBuffer 17 | #define Uses_TMenu 18 | #define Uses_TMenuItem 19 | #define Uses_TRect 20 | #define Uses_TSubMenu 21 | #include 22 | 23 | #if !defined( __STRING_H ) 24 | #include 25 | #endif // __STRING_H 26 | 27 | TMenuBar::TMenuBar( const TRect& bounds, TMenu *aMenu ) : 28 | TMenuView( bounds ) 29 | { 30 | menu = aMenu; 31 | growMode = gfGrowHiX; 32 | options |= ofPreProcess; 33 | } 34 | 35 | TMenuBar::TMenuBar( const TRect& bounds, TSubMenu& aMenu ) : 36 | TMenuView( bounds ) 37 | { 38 | menu = new TMenu( aMenu ); 39 | growMode = gfGrowHiX; 40 | options |= ofPreProcess; 41 | } 42 | 43 | TMenuBar::~TMenuBar() 44 | { 45 | delete menu; 46 | } 47 | 48 | void TMenuBar::draw() 49 | { 50 | ushort color; 51 | short x, l; 52 | TMenuItem *p; 53 | TDrawBuffer b; 54 | 55 | ushort cNormal = getColor(0x0301); 56 | ushort cSelect = getColor(0x0604); 57 | ushort cNormDisabled = getColor(0x0202); 58 | ushort cSelDisabled = getColor(0x0505); 59 | b.moveChar( 0, ' ', cNormal, size.x ); 60 | if( menu != 0 ) 61 | { 62 | x = 1; 63 | p = menu->items; 64 | while( p != 0 ) 65 | { 66 | if( p->name != 0 ) 67 | { 68 | l = cstrlen(p->name); 69 | if( x + l < size.x ) 70 | { 71 | if( p->disabled ) 72 | if( p == current ) 73 | color = cSelDisabled; 74 | else 75 | color = cNormDisabled; 76 | else 77 | if( p == current ) 78 | color = cSelect; 79 | else 80 | color = cNormal; 81 | 82 | b.moveChar( x, ' ', color, 1 ); 83 | b.moveCStr( x+1, p->name, color ); 84 | b.moveChar( x+l+1, ' ', color, 1 ); 85 | } 86 | x += l + 2; 87 | } 88 | p = p->next; 89 | } 90 | } 91 | writeBuf( 0, 0, size.x, 1, b ); 92 | } 93 | 94 | TRect TMenuBar::getItemRect( TMenuItem *item ) 95 | { 96 | TRect r( 1, 0, 1, 1 ); 97 | TMenuItem *p = menu->items; 98 | while( True ) 99 | { 100 | r.a.x = r.b.x; 101 | if( p->name != 0 ) 102 | r.b.x += cstrlen(p->name) + 2; 103 | if( p == item ) 104 | return r; 105 | p = p->next; 106 | } 107 | } 108 | 109 | #if !defined(NO_STREAMABLE) 110 | 111 | TStreamable *TMenuBar::build() 112 | { 113 | return new TMenuBar( streamableInit ); 114 | } 115 | 116 | TMenuBar::TMenuBar( StreamableInit ) : TMenuView( streamableInit ) 117 | { 118 | } 119 | 120 | #endif 121 | -------------------------------------------------------------------------------- /Source/TMENUBOX.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - tmenubox.cpp */ 3 | /* */ 4 | /* function(s) */ 5 | /* TMenuBox member functions */ 6 | /*------------------------------------------------------------*/ 7 | /* 8 | * Turbo Vision - Version 2.0 9 | * 10 | * Copyright (c) 1994 by Borland International 11 | * All Rights Reserved. 12 | * 13 | */ 14 | 15 | #define Uses_TRect 16 | #define Uses_TMenu 17 | #define Uses_TMenuItem 18 | #define Uses_TMenuBox 19 | #include 20 | 21 | #if !defined( __STRING_H ) 22 | #include 23 | #endif // __STRING_H 24 | 25 | static TRect getRect( const TRect& bounds, TMenu *aMenu ) 26 | { 27 | short w = 10; 28 | short h = 2; 29 | if( aMenu != 0 ) 30 | { 31 | for( TMenuItem *p = aMenu->items; p != 0; p = p->next ) 32 | { 33 | if( p->name != 0 ) 34 | { 35 | short l = cstrlen(p->name) + 6; 36 | if( p->command == 0 ) 37 | l += 3; 38 | else 39 | if( p->param != 0 ) 40 | l += cstrlen(p->param) + 2; 41 | w = max( l, w ); 42 | } 43 | h++; 44 | } 45 | } 46 | 47 | TRect r( bounds ); 48 | 49 | if( r.a.x + w < r.b.x ) 50 | r.b.x = r.a.x + w; 51 | else 52 | r.a.x = r.b.x - w; 53 | 54 | if (r.a.y + h < r.b.y) 55 | r.b.y = r.a.y + h; 56 | else 57 | r.a.y = r.b.y - h; 58 | 59 | return r; 60 | } 61 | 62 | TMenuBox::TMenuBox( const TRect& bounds, 63 | TMenu *aMenu, 64 | TMenuView *aParentMenu) : 65 | TMenuView( getRect( bounds, aMenu ), aMenu, aParentMenu ) 66 | { 67 | state |= sfShadow; 68 | options |= ofPreProcess; 69 | } 70 | 71 | static ushort cNormal, color; 72 | 73 | void TMenuBox::frameLine( TDrawBuffer& b, short n ) 74 | { 75 | b.moveBuf( 0, &frameChars[n], cNormal, 2 ); 76 | b.moveChar( 2, frameChars[n+2], color, size.x - 4 ); 77 | b.moveBuf( size.x-2, &frameChars[n+3], cNormal, 2 ); 78 | } 79 | 80 | void TMenuBox::draw() 81 | { 82 | TDrawBuffer b; 83 | 84 | cNormal = getColor(0x0301); 85 | ushort cSelect = getColor(0x0604); 86 | ushort cNormDisabled = getColor(0x0202); 87 | ushort cSelDisabled = getColor(0x0505); 88 | short y = 0; 89 | color = cNormal; 90 | frameLine( b, 0 ); 91 | writeBuf( 0, y++, size.x, 1, b ); 92 | if( menu != 0 ) 93 | { 94 | for( TMenuItem *p = menu->items; p != 0; p = p->next ) 95 | { 96 | color = cNormal; 97 | if( p->name == 0 ) 98 | frameLine( b, 15 ); 99 | else 100 | { 101 | if( p->disabled ) 102 | if( p == current ) 103 | color = cSelDisabled; 104 | else 105 | color = cNormDisabled; 106 | else if( p == current ) 107 | color = cSelect; 108 | frameLine( b, 10 ); 109 | b.moveCStr( 3, p->name, color ); 110 | if( p->command == 0 ) 111 | b.putChar( size.x-4, 16 ); 112 | else if( p->param != 0 ) 113 | b.moveStr( size.x-3-strlen(p->param), 114 | p->param, 115 | color); 116 | } 117 | writeBuf( 0, y++, size.x, 1, b ); 118 | } 119 | } 120 | color = cNormal; 121 | frameLine( b, 5 ); 122 | writeBuf( 0, y++, size.x, 1, b ); 123 | } 124 | 125 | TRect TMenuBox::getItemRect( TMenuItem *item ) 126 | { 127 | short y = 1; 128 | TMenuItem *p = menu->items; 129 | 130 | while( p != item ) 131 | { 132 | y++; 133 | p = p->next; 134 | } 135 | return TRect( 2, y, size.x-2, y+1 ); 136 | } 137 | 138 | #if !defined(NO_STREAMABLE) 139 | 140 | TStreamable *TMenuBox::build() 141 | { 142 | return new TMenuBox( streamableInit ); 143 | } 144 | 145 | TMenuBox::TMenuBox( StreamableInit ) : TMenuView( streamableInit ) 146 | { 147 | } 148 | 149 | #endif 150 | -------------------------------------------------------------------------------- /Source/TMENUPOP.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - tmenupop.cpp */ 3 | /* */ 4 | /* function(s) */ 5 | /* TMenuPopup member functions */ 6 | /*------------------------------------------------------------*/ 7 | /* 8 | * Turbo Vision - Version 2.0 9 | * 10 | * Copyright (c) 1994 by Borland International 11 | * All Rights Reserved. 12 | * 13 | */ 14 | 15 | #define Uses_TRect 16 | #define Uses_TMenu 17 | #define Uses_TMenuItem 18 | #define Uses_TMenuPopup 19 | #include 20 | 21 | TMenuPopup::TMenuPopup(TRect& bounds, TMenu* aMenu) : 22 | TMenuBox( bounds, aMenu ) 23 | { 24 | } 25 | 26 | TMenuPopup::handleEvent(Event& event) 27 | { 28 | switch (event.what) 29 | { 30 | case evKeyDown: 31 | TMenuItem* p = findItem(getCtrlChar(event.keyCode)); 32 | if (!p) 33 | p = hotKey(event.keyCode); 34 | if (p && commandEnabled(p->command)) 35 | { 36 | event.what = evCommand; 37 | event.command = p->command; 38 | event.infoPtr = NULL; 39 | putEvent(event); 40 | clearEvent(event); 41 | } 42 | else 43 | if (getAltChar(event.keyCode)) 44 | clearEvent(event); 45 | break; 46 | } 47 | TMenuBox::handleEvent(event); 48 | } 49 | -------------------------------------------------------------------------------- /Source/TMOUSE.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - tmouse.cpp */ 3 | /* */ 4 | /* function(s) */ 5 | /* TMouse and THWMouse member functions */ 6 | /*------------------------------------------------------------*/ 7 | /* 8 | * Turbo Vision - Version 2.0 9 | * 10 | * Copyright (c) 1994 by Borland International 11 | * All Rights Reserved. 12 | * 13 | */ 14 | 15 | #define Uses_TEvent 16 | #define Uses_TEventQueue 17 | #define Uses_THardwareInfo 18 | #include 19 | 20 | #if !defined( __FLAT__ ) 21 | #if !defined( __DOS_H ) 22 | #include 23 | #endif // __DOS_H 24 | #endif // __FLAT__ 25 | 26 | 27 | uchar _NEAR THWMouse::buttonCount = 0; 28 | Boolean _NEAR THWMouse::handlerInstalled = False; 29 | 30 | THWMouse::THWMouse() 31 | { 32 | resume(); 33 | } 34 | 35 | void THWMouse::resume() 36 | { 37 | #if defined( __FLAT__ ) 38 | buttonCount = THardwareInfo::getButtonCount(); 39 | show(); 40 | #else 41 | if( getvect( 0x33 ) == 0 ) 42 | return; 43 | 44 | _AX = 0; 45 | _genInt( 0x33 ); 46 | 47 | if( _AX == 0 ) 48 | return; 49 | buttonCount = _BL; 50 | 51 | _AX = 4; 52 | _CX = 0; 53 | _DX = 0; 54 | 55 | _genInt( 0x33 ); 56 | show(); 57 | #endif 58 | } 59 | 60 | THWMouse::~THWMouse() 61 | { 62 | suspend(); 63 | } 64 | 65 | void THWMouse::suspend() 66 | { 67 | #if defined(__FLAT__) 68 | hide(); 69 | buttonCount = 0; 70 | #else 71 | if( present() == False ) 72 | return; 73 | hide(); 74 | if( handlerInstalled == True ) 75 | { 76 | registerHandler( 0, 0 ); 77 | handlerInstalled = False; 78 | } 79 | buttonCount = 0; 80 | #endif 81 | } 82 | 83 | #pragma warn -asc 84 | 85 | void THWMouse::show() 86 | { 87 | #if defined( __FLAT__ ) 88 | THardwareInfo::cursorOn(); 89 | #else 90 | asm push ax; 91 | asm push es; 92 | 93 | if( present() ) 94 | { 95 | _AX = 1; 96 | _genInt( 0x33 ); 97 | } 98 | 99 | asm pop es; 100 | asm pop ax; 101 | #endif 102 | } 103 | 104 | void THWMouse::hide() 105 | { 106 | #if defined( __FLAT__ ) 107 | THardwareInfo::cursorOff(); 108 | #else 109 | asm push ax; 110 | asm push es; 111 | 112 | if( buttonCount != 0 ) 113 | { 114 | _AX = 2; 115 | _genInt( 0x33 ); 116 | } 117 | asm pop es; 118 | asm pop ax; 119 | #endif 120 | } 121 | 122 | #pragma warn .asc 123 | 124 | #pragma argsused 125 | void THWMouse::setRange( ushort rx, ushort ry ) 126 | { 127 | #if !defined( __FLAT__ ) 128 | if( buttonCount != 0 ) 129 | { 130 | _DX = rx; 131 | _DX <<= 3; 132 | _CX = 0; 133 | _AX = 7; 134 | _genInt( 0x33 ); 135 | 136 | _DX = ry; 137 | _DX <<= 3; 138 | _CX = 0; 139 | _AX = 8; 140 | _genInt( 0x33 ); 141 | } 142 | #endif 143 | } 144 | 145 | void THWMouse::getEvent( MouseEventType& me ) 146 | { 147 | #if defined( __FLAT__ ) 148 | me.buttons = 0; 149 | me.where.x = 0; 150 | me.where.y = 0; 151 | me.eventFlags = 0; 152 | #else 153 | _AX = 3; 154 | _genInt( 0x33 ); 155 | _AL = _BL; 156 | me.buttons = _AL; 157 | me.where.x = _CX >> 3; 158 | me.where.y = _DX >> 3; 159 | me.eventFlags = 0; 160 | #endif 161 | } 162 | 163 | #if !defined( __FLAT__ ) 164 | void THWMouse::registerHandler( unsigned mask, void (_FAR *func)() ) 165 | { 166 | if( !present() ) 167 | return; 168 | 169 | _AX = 12; 170 | _CX = mask; 171 | _DX = FP_OFF( func ); 172 | _ES = FP_SEG( func ); 173 | 174 | _genInt( 0x33 ); 175 | handlerInstalled = True; 176 | } 177 | #endif 178 | 179 | TMouse::TMouse() 180 | { 181 | // show(); 182 | } 183 | 184 | TMouse::~TMouse() 185 | { 186 | // hide(); 187 | } 188 | 189 | -------------------------------------------------------------------------------- /Source/TMULCHKB.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - tmulchkb.cpp */ 3 | /* */ 4 | /* function(s) */ 5 | /* TMultiCheckBox member functions */ 6 | /*------------------------------------------------------------*/ 7 | /* 8 | * Turbo Vision - Version 2.0 9 | * 10 | * Copyright (c) 1994 by Borland International 11 | * All Rights Reserved. 12 | * 13 | */ 14 | 15 | #define Uses_TMultiCheckBoxes 16 | #include 17 | 18 | TMultiCheckBoxes::TMultiCheckBoxes( TRect& bounds, TSItem* aStrings, 19 | uchar aSelRange, ushort aFlags, 20 | const char* aStates) : 21 | TCluster(bounds, aStrings) 22 | { 23 | selRange = aSelRange; 24 | flags = aFlags; 25 | states = newStr(aStates); 26 | } 27 | 28 | #if !defined(NO_STREAMABLE) 29 | 30 | TMultiCheckBoxes::TMultiCheckBoxes( StreamableInit ) : 31 | TCluster( streamableInit ) 32 | { 33 | } 34 | 35 | void* TMultiCheckBoxes::read( ipstream& is ) 36 | { 37 | TCluster::read(is); 38 | is >> selRange >> flags; 39 | states = is.readString(); 40 | 41 | return this; 42 | } 43 | 44 | void TMultiCheckBoxes::write( opstream& os ) 45 | { 46 | TCluster::write( os ); 47 | os << selRange << flags; 48 | os.writeString(states); 49 | } 50 | 51 | TStreamable* TMultiCheckBoxes::build() 52 | { 53 | return new TMultiCheckBoxes( streamableInit ); 54 | } 55 | 56 | #endif 57 | 58 | TMultiCheckBoxes::~TMultiCheckBoxes() 59 | { 60 | delete states; 61 | } 62 | 63 | void TMultiCheckBoxes::draw() 64 | { 65 | drawMultiBox(" [ ] ", states); 66 | } 67 | 68 | ushort TMultiCheckBoxes::dataSize() 69 | { 70 | return sizeof(long); 71 | } 72 | 73 | uchar TMultiCheckBoxes::multiMark(int item) 74 | { 75 | return (long)((value&((flags&0xff)<<(item*(flags>>8))))>>(item*(flags>>8))); 76 | } 77 | 78 | void TMultiCheckBoxes::getData(void* p) 79 | { 80 | *(unsigned long*)p = value; 81 | drawView(); 82 | } 83 | 84 | void TMultiCheckBoxes::press(int item) 85 | { 86 | short curState; 87 | 88 | int flo = flags & 0xff; 89 | int fhi = flags >> 8; 90 | 91 | curState = (long) (value & (flo << (item*fhi))) >> (item*fhi); 92 | 93 | curState--; 94 | 95 | if ((curState >= selRange) || (curState < 0)) 96 | curState = selRange - 1; 97 | 98 | value = (long)((value & ~(flo << (item*fhi))) | (curState<<(item * fhi))); 99 | } 100 | 101 | void TMultiCheckBoxes::setData(void* p) 102 | { 103 | value = *(unsigned long*)p; 104 | drawView(); 105 | } 106 | 107 | -------------------------------------------------------------------------------- /Source/TOBJECT.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - tobject.cpp */ 3 | /* */ 4 | /* function(s) */ 5 | /* TObject member functions */ 6 | /*------------------------------------------------------------*/ 7 | /* 8 | * Turbo Vision - Version 2.0 9 | * 10 | * Copyright (c) 1994 by Borland International 11 | * All Rights Reserved. 12 | * 13 | */ 14 | 15 | #define Uses_TObject 16 | #include 17 | 18 | TObject::~TObject() 19 | { 20 | } 21 | 22 | void TObject::shutDown() 23 | { 24 | } 25 | -------------------------------------------------------------------------------- /Source/TPARAMTE.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - tparamte.cpp */ 3 | /* */ 4 | /* function(s) */ 5 | /* TParamText member functions */ 6 | /*------------------------------------------------------------*/ 7 | /* 8 | * Turbo Vision - Version 2.0 9 | * 10 | * Copyright (c) 1994 by Borland International 11 | * All Rights Reserved. 12 | * 13 | */ 14 | 15 | #define Uses_TParamText 16 | #include 17 | 18 | #if !defined( __STDIO_H ) 19 | #include 20 | #endif // __STDIO_H 21 | 22 | #if !defined( __STDARG_H ) 23 | #include 24 | #endif // __STDARG_H 25 | 26 | #if !defined( __STRING_H ) 27 | #include 28 | #endif // __STRING_H 29 | 30 | TParamText::TParamText( const TRect& bounds ) : 31 | TStaticText(bounds, 0 ), 32 | str( new char [256] ) 33 | { 34 | str[0] = EOS; 35 | } 36 | 37 | TParamText::~TParamText() 38 | { 39 | delete str; 40 | } 41 | 42 | void TParamText::getText( char *s ) 43 | { 44 | if( str != 0 ) 45 | strcpy( s, str ); 46 | else 47 | *s = EOS; 48 | } 49 | 50 | int TParamText::getTextLen() 51 | { 52 | return (str != 0) ? strlen( str ) : 0; 53 | } 54 | 55 | void TParamText::setText( char *fmt, ... ) 56 | { 57 | va_list ap; 58 | 59 | va_start( ap, fmt ); 60 | vsprintf( str, fmt, ap ); 61 | va_end( ap ); 62 | 63 | drawView(); 64 | } 65 | 66 | #if !defined(NO_STREAMABLE) 67 | 68 | TStreamable *TParamText::build() 69 | { 70 | return new TParamText( streamableInit ); 71 | } 72 | 73 | TParamText::TParamText( StreamableInit ) : TStaticText( streamableInit ) 74 | { 75 | } 76 | 77 | #endif 78 | -------------------------------------------------------------------------------- /Source/TPOINT.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - tpoint.cpp */ 3 | /* */ 4 | /* function(s) */ 5 | /* TPoint member functions */ 6 | /*------------------------------------------------------------*/ 7 | /* 8 | * Turbo Vision - Version 2.0 9 | * 10 | * Copyright (c) 1994 by Borland International 11 | * All Rights Reserved. 12 | * 13 | */ 14 | 15 | #define Uses_TPoint 16 | #include 17 | 18 | TPoint operator - ( const TPoint& one, const TPoint& two ) 19 | { 20 | TPoint result; 21 | result.x = one.x - two.x; 22 | result.y = one.y - two.y; 23 | return result; 24 | } 25 | 26 | TPoint operator + ( const TPoint& one, const TPoint& two ) 27 | { 28 | TPoint result; 29 | result.x = one.x + two.x; 30 | result.y = one.y + two.y; 31 | return result; 32 | } 33 | 34 | int operator == ( const TPoint& one, const TPoint& two ) 35 | { 36 | return one.x == two.x && one.y == two.y; 37 | } 38 | 39 | int operator!= ( const TPoint& one, const TPoint& two ) 40 | { 41 | return one.x != two.x || one.y != two.y; 42 | } 43 | 44 | -------------------------------------------------------------------------------- /Source/TRADIOBU.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - tradiobu.cpp */ 3 | /* */ 4 | /* function(s) */ 5 | /* TRadioButton member functions */ 6 | /*------------------------------------------------------------*/ 7 | /* 8 | * Turbo Vision - Version 2.0 9 | * 10 | * Copyright (c) 1994 by Borland International 11 | * All Rights Reserved. 12 | * 13 | */ 14 | 15 | #define Uses_TRadioButtons 16 | #include 17 | 18 | void TRadioButtons::draw() 19 | { 20 | drawMultiBox( button, " \x7" ); 21 | } 22 | 23 | Boolean TRadioButtons::mark( int item ) 24 | { 25 | return Boolean( item == value ); 26 | } 27 | 28 | void TRadioButtons::press( int item ) 29 | { 30 | value = item; 31 | } 32 | 33 | void TRadioButtons::movedTo( int item ) 34 | { 35 | value = item; 36 | } 37 | 38 | void TRadioButtons::setData( void * rec ) 39 | { 40 | TCluster::setData(rec); 41 | sel = (int)value; 42 | } 43 | 44 | #if !defined(NO_STREAMABLE) 45 | 46 | TStreamable *TRadioButtons::build() 47 | { 48 | return new TRadioButtons( streamableInit ); 49 | } 50 | 51 | TRadioButtons::TRadioButtons( StreamableInit ) : TCluster( streamableInit ) 52 | { 53 | } 54 | 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /Source/TRESCOLL.CPP: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------*/ 2 | /* filename - trescoll.cpp */ 3 | /* */ 4 | /* function(s) */ 5 | /* TResourceCollection member functions */ 6 | /*--------------------------------------------------------------*/ 7 | /* 8 | * Turbo Vision - Version 2.0 9 | * 10 | * Copyright (c) 1994 by Borland International 11 | * All Rights Reserved. 12 | * 13 | */ 14 | 15 | #define Uses_TResourceCollection 16 | #define Uses_TResourceItem 17 | #include 18 | 19 | TResourceCollection::TResourceCollection( short aLimit, short aDelta) : 20 | TStringCollection( aLimit, aDelta) 21 | { 22 | } 23 | 24 | void TResourceCollection::freeItem( void* item ) 25 | { 26 | delete ((TResourceItem*)item)->key; 27 | delete (TResourceItem*)item; 28 | } 29 | 30 | void* TResourceCollection::keyOf( void* item ) 31 | { 32 | return ((TResourceItem *)item)->key; 33 | } 34 | 35 | #if !defined(NO_STREAMABLE) 36 | 37 | TStreamable *TResourceCollection::build() 38 | { 39 | return new TResourceCollection( streamableInit ); 40 | } 41 | 42 | void TResourceCollection::writeItem( void *obj, opstream& os ) 43 | { 44 | 45 | os << ((TResourceItem *)obj)->pos; 46 | os << ((TResourceItem *)obj)->size; 47 | os.writeString(((TResourceItem *)obj)->key); 48 | 49 | } 50 | 51 | void *TResourceCollection::readItem( ipstream& is ) 52 | { 53 | TResourceItem *obj; 54 | 55 | obj = new TResourceItem; 56 | is >> obj->pos; 57 | is >> obj->size; 58 | obj->key = is.readString(); 59 | return (void *)obj; 60 | } 61 | 62 | #endif 63 | 64 | -------------------------------------------------------------------------------- /Source/TSORTCOL.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - tsortcol.cpp */ 3 | /* */ 4 | /* function(s) */ 5 | /* TNSSortedCollection member functions */ 6 | /*------------------------------------------------------------*/ 7 | /* 8 | * Turbo Vision - Version 2.0 9 | * 10 | * Copyright (c) 1994 by Borland International 11 | * All Rights Reserved. 12 | * 13 | */ 14 | 15 | #define Uses_TNSSortedCollection 16 | #define Uses_opstream 17 | #define Uses_ipstream 18 | #define Uses_TSortedCollection 19 | #include 20 | 21 | 22 | ccIndex TNSSortedCollection::indexOf(void *item) 23 | { 24 | ccIndex i; 25 | 26 | if( search( keyOf(item), i ) == 0 ) 27 | return ccNotFound; 28 | else 29 | { 30 | if( duplicates ) 31 | { 32 | while( i < count && item != items[i] ) 33 | i++; 34 | } 35 | if( i < count ) 36 | return i; 37 | else 38 | return ccNotFound; 39 | } 40 | } 41 | 42 | ccIndex TNSSortedCollection::insert( void *item ) 43 | { 44 | ccIndex i; 45 | if( search( keyOf(item), i ) == 0 || duplicates ) // order dependency! 46 | atInsert( i, item ); // must do Search 47 | // before calling 48 | // AtInsert 49 | return i; 50 | } 51 | 52 | void *TNSSortedCollection::keyOf( void *item ) 53 | { 54 | return item; 55 | } 56 | 57 | Boolean TNSSortedCollection::search( void *key, ccIndex& index ) 58 | { 59 | ccIndex l = 0; 60 | ccIndex h = count - 1; 61 | Boolean res = False; 62 | while( l <= h ) 63 | { 64 | ccIndex i = (l + h) >> 1; 65 | ccIndex c = compare( keyOf( items[i] ), key ); 66 | if( c < 0 ) 67 | l = i + 1; 68 | else 69 | { 70 | h = i - 1; 71 | if( c == 0 ) 72 | { 73 | res = True; 74 | if( !duplicates ) 75 | l = i; 76 | } 77 | } 78 | } 79 | index = l; 80 | return res; 81 | } 82 | 83 | 84 | void TSortedCollection::write( opstream& os ) 85 | { 86 | TCollection::write( os ); 87 | os << (int)duplicates; 88 | } 89 | 90 | void *TSortedCollection::read( ipstream& is ) 91 | { 92 | TCollection::read( is ); 93 | int temp; 94 | is >> temp; 95 | duplicates = Boolean(temp); 96 | return this; 97 | } 98 | 99 | 100 | TSortedCollection::TSortedCollection( StreamableInit ) : 101 | TCollection( streamableInit ) 102 | { 103 | } 104 | 105 | -------------------------------------------------------------------------------- /Source/TSTATICT.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - tstatict.cpp */ 3 | /* */ 4 | /* function(s) */ 5 | /* TStaticText member functions */ 6 | /*------------------------------------------------------------*/ 7 | /* 8 | * Turbo Vision - Version 2.0 9 | * 10 | * Copyright (c) 1994 by Borland International 11 | * All Rights Reserved. 12 | * 13 | */ 14 | 15 | #define Uses_TStaticText 16 | #define Uses_TDrawBuffer 17 | #define Uses_opstream 18 | #define Uses_ipstream 19 | #include 20 | 21 | #if !defined( __CTYPE_H ) 22 | #include 23 | #endif // __CTYPE_H 24 | 25 | #if !defined( __STRING_H ) 26 | #include 27 | #endif // __STRING_H 28 | 29 | #define cpStaticText "\x06" 30 | 31 | TStaticText::TStaticText( const TRect& bounds, const char *aText ) : 32 | TView( bounds ), 33 | text( newStr( aText ) ) 34 | { 35 | growMode |= gfFixed; 36 | } 37 | 38 | TStaticText::~TStaticText() 39 | { 40 | delete (char *)text; 41 | } 42 | 43 | void TStaticText::draw() 44 | { 45 | uchar color; 46 | Boolean center; 47 | int i, j, l, p, y; 48 | TDrawBuffer b; 49 | char s[256]; 50 | 51 | color = getColor(1); 52 | getText(s); 53 | l = strlen(s); 54 | p = 0; 55 | y = 0; 56 | center = False; 57 | while (y < size.y) 58 | { 59 | b.moveChar(0, ' ', color, size.x); 60 | if (p < l) 61 | { 62 | if (s[p] == 3) 63 | { 64 | center = True; 65 | ++p; 66 | } 67 | i = p; 68 | do { 69 | j = p; 70 | while ((p < l) && (s[p] == ' ')) 71 | ++p; 72 | while ((p < l) && (s[p] != ' ') && (s[p] != '\n')) 73 | ++p; 74 | } while ((p < l) && (p < i + size.x) && (s[p] != '\n')); 75 | if (p > i + size.x) 76 | if (j > i) 77 | p = j; 78 | else 79 | p = i + size.x; 80 | if (center == True) 81 | j = (size.x - p + i) / 2 ; 82 | else 83 | j = 0; 84 | b.moveBuf(j, &s[i], color, (p - i)); 85 | while ((p < l) && (s[p] == ' ')) 86 | p++; 87 | if ((p < l) && (s[p] == '\n')) 88 | { 89 | center = False; 90 | p++; 91 | } 92 | } 93 | writeLine(0, y++, size.x, 1, b); 94 | } 95 | } 96 | 97 | TPalette& TStaticText::getPalette() const 98 | { 99 | static TPalette palette( cpStaticText, sizeof( cpStaticText )-1 ); 100 | return palette; 101 | } 102 | 103 | void TStaticText::getText( char *s ) 104 | { 105 | if( text == 0 ) 106 | *s = EOS; 107 | else 108 | { 109 | strncpy( s, text, 255 ); 110 | s[255] = EOS; 111 | } 112 | } 113 | 114 | #if !defined(NO_STREAMABLE) 115 | 116 | void TStaticText::write( opstream& os ) 117 | { 118 | TView::write( os ); 119 | os.writeString( text ); 120 | } 121 | 122 | void *TStaticText::read( ipstream& is ) 123 | { 124 | TView::read( is ); 125 | text = is.readString(); 126 | return this; 127 | } 128 | 129 | TStreamable *TStaticText::build() 130 | { 131 | return new TStaticText( streamableInit ); 132 | } 133 | 134 | TStaticText::TStaticText( StreamableInit ) : TView( streamableInit ) 135 | { 136 | } 137 | 138 | #endif 139 | -------------------------------------------------------------------------------- /Source/TSTRCOLL.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - tstrcoll.cpp */ 3 | /* */ 4 | /* function(s) */ 5 | /* TStringCollection member functions */ 6 | /*------------------------------------------------------------*/ 7 | /* 8 | * Turbo Vision - Version 2.0 9 | * 10 | * Copyright (c) 1994 by Borland International 11 | * All Rights Reserved. 12 | * 13 | */ 14 | 15 | #define Uses_TStringCollection 16 | #define Uses_opstream 17 | #define Uses_ipstream 18 | #include 19 | 20 | #if !defined( __STRING_H ) 21 | #include 22 | #endif // __STRING_H 23 | 24 | TStringCollection::TStringCollection( short aLimit, short aDelta ) : 25 | TSortedCollection(aLimit, aDelta) 26 | { 27 | } 28 | 29 | int TStringCollection::compare( void *key1, void *key2 ) 30 | { 31 | return strcmp( (char *)key1, (char *)key2 ); 32 | } 33 | 34 | void TStringCollection::freeItem( void* item ) 35 | { 36 | delete item; 37 | } 38 | 39 | TStreamable *TStringCollection::build() 40 | { 41 | return new TStringCollection( streamableInit ); 42 | } 43 | 44 | void TStringCollection::writeItem( void *obj, opstream& os ) 45 | { 46 | os.writeString( (const char *)obj ); 47 | } 48 | 49 | void *TStringCollection::readItem( ipstream& is ) 50 | { 51 | return is.readString(); 52 | } 53 | 54 | -------------------------------------------------------------------------------- /Source/TSTRLIST.CPP: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------*/ 2 | /* filename - tstrlist.cpp */ 3 | /* */ 4 | /* function(s) */ 5 | /* TStrListMaker member functions */ 6 | /*------------------------------------------------------------*/ 7 | /* 8 | * Turbo Vision - Version 2.0 9 | * 10 | * Copyright (c) 1994 by Borland International 11 | * All Rights Reserved. 12 | * 13 | */ 14 | 15 | #define Uses_TStringList 16 | #define Uses_TStrIndexRec 17 | #define Uses_TStrListMaker 18 | #define Uses_opstream 19 | #define Uses_ipstream 20 | #include 21 | 22 | #if !defined( __STRING_H ) 23 | #include 24 | #endif // __STRING_H 25 | 26 | #if !defined( __MEM_H ) 27 | #include 28 | #endif // __MEM_H 29 | 30 | const MAXKEYS = 16; 31 | 32 | TStrIndexRec::TStrIndexRec() : 33 | count(0) 34 | { 35 | } 36 | 37 | TStrListMaker::TStrListMaker( ushort aStrSize, ushort aIndexSize ) : 38 | strSize( aStrSize ), 39 | indexSize( aIndexSize ), 40 | strings( new char[aStrSize] ), 41 | index( new TStrIndexRec[aIndexSize] ), 42 | strPos( 0 ), 43 | indexPos( 0 ) 44 | { 45 | } 46 | 47 | #pragma warn -dsz 48 | 49 | TStrListMaker::~TStrListMaker() 50 | { 51 | delete strings; 52 | delete [indexSize] index; 53 | } 54 | 55 | #pragma warn .dsz 56 | 57 | void TStrListMaker::closeCurrent() 58 | { 59 | if( cur.count != 0 ) 60 | { 61 | index[indexPos++] = cur; 62 | cur.count = 0; 63 | } 64 | } 65 | 66 | void TStrListMaker::put( ushort key, char *str ) 67 | { 68 | if( cur.count == MAXKEYS || key != cur.key + cur.count ) 69 | closeCurrent(); 70 | if( cur.count == 0 ) 71 | { 72 | cur.key = key; 73 | cur.offset = strPos; 74 | } 75 | int len = strlen( str ); 76 | strings[strPos] = len; 77 | memcpy( strings+strPos+1, str, len); 78 | strPos += len+1; 79 | cur.count++; 80 | } 81 | 82 | #if !defined(NO_STREAMABLE) 83 | 84 | TStringList::TStringList( StreamableInit ) : 85 | indexSize(0), 86 | index(0), 87 | basePos(0) 88 | { 89 | } 90 | #endif 91 | 92 | #pragma warn -dsz 93 | 94 | TStringList::~TStringList() 95 | { 96 | delete [indexSize] index; 97 | } 98 | 99 | #pragma warn .dsz 100 | 101 | void TStringList::get( char *dest, ushort key ) 102 | { 103 | if( indexSize == 0 ) 104 | { 105 | *dest = EOS; 106 | return; 107 | } 108 | 109 | TStrIndexRec *cur = index; 110 | while( cur->key + cur->count -1 < key && cur - index < indexSize ) 111 | cur++; 112 | if( cur->key + cur->count - 1 < key ) 113 | { 114 | *dest = EOS; 115 | return; 116 | } 117 | ip->seekg( basePos + cur->offset ); 118 | int count = key - cur->key; 119 | do { 120 | uchar sz = ip->readByte(); 121 | ip->readBytes( dest, sz ); 122 | dest[sz] = EOS; 123 | } while( count-- > 0 ); 124 | } 125 | 126 | #if !defined(NO_STREAMABLE) 127 | 128 | void TStrListMaker::write( opstream& os ) 129 | { 130 | closeCurrent(); 131 | os << strPos; 132 | os.writeBytes( strings, strPos ); 133 | os << indexPos; 134 | os.writeBytes( index, indexPos * sizeof( TStrIndexRec ) ); 135 | } 136 | 137 | void *TStringList::read( ipstream& is ) 138 | { 139 | ip = &is; 140 | 141 | ushort strSize; 142 | is >> strSize; 143 | 144 | basePos = is.tellg(); 145 | is.seekg( basePos + strSize ); 146 | is >> indexSize; 147 | index = new TStrIndexRec[indexSize]; 148 | is.readBytes( index, indexSize * sizeof( TStrIndexRec ) ); 149 | return this; 150 | } 151 | 152 | TStreamable *TStringList::build() 153 | { 154 | return new TStringList( streamableInit ); 155 | } 156 | 157 | #endif 158 | -------------------------------------------------------------------------------- /Source/TTPRVLNS.ASM: -------------------------------------------------------------------------------- 1 | ;/*------------------------------------------------------------*/ 2 | ;/* filename - ttprvlns.asm */ 3 | ;/* */ 4 | ;/* function(s) */ 5 | ;/* TTerminal prevLines member function */ 6 | ;/*------------------------------------------------------------*/ 7 | 8 | ; 9 | ; Turbo Vision - Version 2.0 10 | ; 11 | ; Copyright (c) 1994 by Borland International 12 | ; All Rights Reserved. 13 | ; 14 | 15 | PUBLIC @TTerminal@prevLines$qusus 16 | INCLUDE TV.INC 17 | 18 | CODESEG 19 | 20 | DecDI PROC 21 | ifndef __FLAT__ 22 | CMP DI,WORD PTR [SI+TTerminalBuffer] 23 | JA short @@1 24 | ADD DI,WORD PTR [SI+TTerminalBufSize] 25 | @@1: DEC DI 26 | else 27 | CMP EDI,[ESI+TTerminalBuffer] 28 | JA short @@1 29 | ADD EDI,[ESI+TTerminalBufSize] 30 | @@1: DEC EDI 31 | endif 32 | RET 33 | ENDP 34 | 35 | 36 | IncDI PROC 37 | ifndef __FLAT__ 38 | INC DI 39 | MOV AX,WORD PTR [SI+TTerminalBuffer] 40 | ADD AX,[SI+TTerminalBufSize] 41 | CMP DI,AX 42 | JB short @@1 43 | MOV DI,WORD PTR [SI+TTerminalBuffer] 44 | @@1: 45 | RET 46 | else 47 | INC EDI 48 | MOV EAX,[ESI+TTerminalBuffer] 49 | ADD EAX,[ESI+TTerminalBufSize] 50 | CMP EDI,EAX 51 | JB short @@1 52 | MOV EDI,[ESI+TTerminalBuffer] 53 | @@1: 54 | RET 55 | endif 56 | ENDP 57 | 58 | 59 | @TTerminal@prevLines$qusus PROC 60 | ARG thisPtr :PTR, Pos : WORD, Lines : WORD 61 | LineSeparator EQU 10 62 | 63 | ifndef __FLAT__ 64 | USES DS,SI,DI 65 | 66 | LDS SI,[thisPtr] 67 | LES DI,[SI+TTerminalBuffer] 68 | ADD DI,[Pos] 69 | @@1: MOV CX,[Lines] 70 | JCXZ @@6 71 | MOV AX,[SI+TTerminalQueBack] 72 | ADD AX,WORD PTR [SI+TTerminalBuffer] 73 | CMP DI,AX 74 | JE @@7 75 | CALL DecDI 76 | @@2: MOV AX,[SI+TTerminalQueBack] 77 | ADD AX,WORD PTR [SI+TTerminalBuffer] 78 | CMP DI,AX 79 | JA @@3 80 | MOV CX,DI 81 | SUB CX,WORD PTR [SI+TTerminalBuffer] 82 | JMP @@4 83 | @@3: MOV CX,DI 84 | SUB CX,AX 85 | @@4: MOV AL,LineSeparator 86 | INC CX 87 | STD 88 | REPNE SCASB 89 | JE @@5 90 | MOV AX,DI 91 | SUB AX,WORD PTR [SI+TTerminalBuffer] 92 | INC AX 93 | CMP AX,[SI+TTerminalQueBack] 94 | JE @@8 95 | MOV DI,WORD PTR [SI+TTerminalBuffer] 96 | ADD DI,WORD PTR [SI+TTerminalBufSize] 97 | DEC DI 98 | JMP @@2 99 | @@5: DEC [Lines] 100 | JNZ @@2 101 | @@6: CALL IncDI 102 | CALL IncDI 103 | MOV AX,DI 104 | @@7: SUB AX,WORD PTR [SI+TTerminalBuffer] 105 | @@8: 106 | CLD 107 | RET 108 | else 109 | USES ESI,EDI 110 | 111 | MOV ESI, DWORD PTR [thisPtr] 112 | MOV EDI,[ESI+TTerminalBuffer] 113 | ADD DI,[Pos] 114 | @@1: XOR ECX,ECX 115 | MOV CX,[Lines] 116 | JECXZ short @@6 117 | MOV EAX,[ESI+TTerminalQueBack] 118 | ADD EAX,[ESI+TTerminalBuffer] 119 | CMP EDI,EAX 120 | JE short @@7 121 | CALL DecDI 122 | @@2: MOV EAX,[ESI+TTerminalQueBack] 123 | ADD EAX,[ESI+TTerminalBuffer] 124 | CMP EDI,EAX 125 | JA short @@3 126 | MOV ECX,EDI 127 | SUB ECX,[ESI+TTerminalBuffer] 128 | JMP short @@4 129 | @@3: MOV ECX,EDI 130 | SUB ECX,EAX 131 | @@4: MOV AL,LineSeparator 132 | INC ECX 133 | STD 134 | REPNE SCASB 135 | JE short @@5 136 | MOV EAX,EDI 137 | SUB EAX,[ESI+TTerminalBuffer] 138 | INC EAX 139 | CMP EAX,[ESI+TTerminalQueBack] 140 | JE @@8 141 | MOV EDI,[ESI+TTerminalBuffer] 142 | ADD EDI,[ESI+TTerminalBufSize] 143 | DEC EDI 144 | JMP @@2 145 | @@5: DEC [Lines] 146 | JNZ @@2 147 | @@6: CALL IncDI 148 | CALL IncDI 149 | MOV EAX,EDI 150 | @@7: SUB EAX,[ESI+TTerminalBuffer] 151 | @@8: 152 | CLD 153 | RET 154 | endif 155 | ENDP 156 | END 157 | -------------------------------------------------------------------------------- /Source/TV.INC: -------------------------------------------------------------------------------- 1 | ;/*------------------------------------------------------------*/ 2 | ;/* filename - tv.inc */ 3 | ;/* */ 4 | ;/* Header for Turbo Vision .asm files */ 5 | ;/*------------------------------------------------------------*/ 6 | 7 | ; 8 | ; Turbo Vision - Version 2.0 9 | ; 10 | ; Copyright (c) 1994 by Borland International 11 | ; All Rights Reserved. 12 | ; 13 | 14 | ifdef __FLAT__ ;;;;;;;;;;;;;;;;;;;;;;;; 32-bit ;;;;;;;;;;;;;;;;;;;;;;; 15 | 16 | P386 17 | MODEL FLAT, C 18 | 19 | ARGINT equ DWORD 20 | Dnear equ DD 21 | LocalRet equ db 0C3h 22 | _FAR equ 23 | 24 | 25 | INCLUDE TVWRIT32.INC 26 | 27 | 28 | else ;;;;;;;;;;;;;;;;;;;;;;;; 16-bit ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 29 | 30 | MODEL LARGE, PROLOG 31 | 32 | ARGINT equ WORD 33 | Dnear equ DW 34 | _FAR equ FAR 35 | 36 | INCLUDE TVWRITE.INC 37 | 38 | endif 39 | LOCALS @@ 40 | 41 | -------------------------------------------------------------------------------- /Source/TVTEXT1.CPP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FSharpCSharp/TurboVision/b73b2ed7672df5d8f789c309076752ddee1c8adf/Source/TVTEXT1.CPP -------------------------------------------------------------------------------- /disclaim.txt: -------------------------------------------------------------------------------- 1 | DISCLAIMER AND LIMITATION OF LIABILITY: Borland does not make 2 | or give any representation or warranty with respect to the 3 | usefulness or the efficiency of this software, it being 4 | understood that the degree of success with which equipment, 5 | software, modifications, and other materials can be applied to 6 | data processing is dependent upon many factors, many of which 7 | are not under Borland's control. ACCORDINGLY, THIS SOFTWARE IS 8 | PROVIDED 'AS IS' WITHOUT EXPRESS OR IMPLIED WARRANTIES, 9 | INCLUDING NO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 10 | PARTICULAR PURPOSE, OR NONINFRINGEMENT. THIS SOFTWARE IS 11 | PROVIDED GRATUITOUSLY AND, ACCORDINGLY, BORLAND SHALL NOT BE 12 | LIABLE UNDER ANY THEORY FOR ANY DAMAGES SUFFERED BY YOU OR ANY 13 | USER OF THE SOFTWARE. BORLAND WILL NOT SUPPORT THIS SOFTWARE 14 | AND IS UNDER NO OBLIGATION TO ISSUE UPDATES TO THIS SOFTWARE. 15 | 16 | WITHOUT LIMITING THE GENERALITY OF THE FOREGOING, NEITHER 17 | BORLAND NOR ITS SUPPLIERS SHALL BE LIABLE FOR (a) INCIDENTAL, 18 | CONSEQUENTIAL, SPECIAL OR INDIRECT DAMAGES OF ANY SORT, WHETHER 19 | ARISING IN TORT, CONTRACT OR OTHERWISE, EVEN IF BORLAND HAS BEEN 20 | INFORMED OF THE POSSIBILITY OF SUCH DAMAGES, OR (b) FOR ANY 21 | CLAIM BY ANY OTHER PARTY. SOME STATES DO NOT ALLOW THE 22 | EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, 23 | SO THIS LIMITATION AND EXCLUSION MAY NOT APPLY TO YOU. Use, 24 | duplication or disclosure by the Government is subject to 25 | restrictions set forth in subparagraphs (a) through (d) of the 26 | Commercial Computer-Restricted Rights clause at FAR 52.227-19 27 | when applicable, or in subparagraph (c) (1) (ii) of the Rights 28 | in Technical Data and Computer Software clause at DFARS 29 | 252.227-7013, and in similar clauses in the NASA AR Supplement. 30 | Contractor / manufacturer is Borland International, Inc., 31 | 100 Borland Way, Scotts Valley, CA 95066. 32 | -------------------------------------------------------------------------------- /readme.txt: -------------------------------------------------------------------------------- 1 | Borland TurboVision 2.0 2 | 3 | NOTE ON THE CONTENTS OF THIS ARCHIVE: 4 | ------------------------------------- 5 | The three enclosed .ZIP files comprise all necessary and 6 | available source and documentation for TurboVision 2.0. 7 | 8 | Note that no path information is stored in these archives. 9 | Typically, the contents of INCLUDE.ZIP are to be placed in 10 | \BCx\INCLUDE\TVISION; the contents of SOURCE.ZIP are to be 11 | placed in \BCx\SOURCE\TVISION. Also note that the source 12 | includes some assembly language (*.ASM) files. Successful 13 | generation of the TurboVision library will require use of 14 | Turbo Assembler to translate these source files into object 15 | files. DOCS.ZIP can be placed anywhere. 16 | 17 | 18 | DISCLAIMER AND LIMITATION OF LIABILITY: 19 | --------------------------------------- 20 | DISCLAIMER AND LIMITATION OF LIABILITY: Borland does not make or 21 | give any representation or warranty with respect to the 22 | usefulness or the efficiency of this software, it being 23 | understood that the degree of success with which equipment, 24 | software, modifications, and other materials can be applied to 25 | data processing is dependent upon many factors, many of which 26 | are not under Borland's control. ACCORDINGLY, THIS SOFTWARE IS 27 | PROVIDED 'AS IS' WITHOUT EXPRESS OR IMPLIED WARRANTIES, 28 | INCLUDING NO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 29 | PARTICULAR PURPOSE, OR NONINFRINGEMENT. THIS SOFTWARE IS 30 | PROVIDED GRATUITOUSLY AND, ACCORDINGLY, BORLAND SHALL NOT BE 31 | LIABLE UNDER ANY THEORY FOR ANY DAMAGES SUFFERED BY YOU OR ANY 32 | USER OF THE SOFTWARE. BORLAND WILL NOT SUPPORT THIS SOFTWARE 33 | AND IS UNDER NO OBLIGATION TO ISSUE UPDATES TO THIS SOFTWARE. 34 | 35 | WITHOUT LIMITING THE GENERALITY OF THE FOREGOING, NEITHER 36 | BORLAND NOR ITS SUPPLIERS SHALL BE LIABLE FOR (a) INCIDENTAL, 37 | CONSEQUENTIAL, SPECIAL OR INDIRECT DAMAGES OF ANY SORT, WHETHER 38 | ARISING IN TORT, CONTRACT OR OTHERWISE, EVEN IF BORLAND HAS BEEN 39 | INFORMED OF THE POSSIBILITY OF SUCH DAMAGES, OR (b) FOR ANY 40 | CLAIM BY ANY OTHER PARTY. SOME STATES DO NOT ALLOW THE 41 | EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, 42 | SO THIS LIMITATION AND EXCLUSION MAY NOT APPLY TO YOU. Use, 43 | duplication or disclosure by the Government is subject to 44 | restrictions set forth in subparagraphs (a) through (d) of the 45 | Commercial Computer-Restricted Rights clause at FAR 52.227-19 46 | when applicable, or in subparagraph (c) (1) (ii) of the Rights 47 | in Technical Data and Computer Software clause at DFARS 48 | 252.227-7013, and in similar clauses in the NASA AR Supplement. 49 | Contractor / manufacturer is Borland International, Inc., 50 | 100 Borland Way, Scotts Valley, CA 95066. 51 | --------------------------------------------------------------------------------