home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 17
/
CD_ASCQ_17_101194.iso
/
vrac
/
ve2tv103.zip
/
TVEDIT.H
< prev
next >
Wrap
C/C++ Source or Header
|
1994-07-31
|
4KB
|
161 lines
// File : TVEDIT.H
// Author : Eric Woodruff, CIS ID: 72134,1150
// Updated : Sun 07/31/94 15:56:28
// Note : Copyright 1994, Eric Woodruff, All rights reserved
// Compiler: Borland C++ 3.1 to 4.02
//
// Header file for the Virtual Memory Text Editor demo.
//
#if !defined(__FLAT__)
#if !defined(_NEAR)
#define _NEAR near
#endif
#if !defined(_FAR)
#define _FAR far
#endif
#endif
const
cmAbout = 100, // Standard event values.
cmRepaint = 101,
cmColors = 102,
cmChangePalettes = 103,
cmLoadCfg = 104,
cmSaveCfg = 105,
cmScreenSize = 106,
cmUserScreen = 107,
#if _TV_VERSION == 0x0103 // Other command values.
cmNew = 108, // These first few are already defined
cmOpen = 109, // in TV 2.0.
cmChDir = 110,
cmDosShell = 111,
cmCloseAll = 112,
#endif
cmShowClip = 113,
cmRecord = 114,
cmPlay = 115,
cmDefaultEditorOpt = 116,
cmStartUpOpt = 117,
cmMemoDemo = 118, // Demo stuff.
cmKeyHelp = 119,
cmMsgViewer = 120,
cmReplaceKeyMaps = 121;
// Start up options structure
struct StartUp
{
ushort EdOpts;
#if !defined(__DPMI16__) && !defined(__DPMI32__)
ushort VirtualMemory;
short bufSizeInK;
#else
short bufSizeInK;
short MaxAllocatable;
#endif
};
#define IndAtTop 0x01
#define SaveDeskTop 0x02
// Data structure for the demo.
struct DemoData
{
ushort Size1; // The real size of this memo.
char ShortText[255]; // A short memo.
ushort Size2; // The real size of this memo.
char LongText[1024]; // A long memo.
};
#if defined(Uses_TVMEditorApp)
#if !defined(__STDIO_H)
#include <stdio.h> // Needed by FILE * for the macro file.
#endif
// Exit code values.
#define EXIT_NOERR 0
#define EXIT_RSCERR 1
#define EXIT_SYNTAX 2
#define EXIT_SWERR 3
#define EXIT_GENERR 4
class _FAR TDeskTop;
class _FAR TDialog;
class _FAR TEvent;
class _FAR TMenuBar;
class _FAR TStatusLine;
class _FAR TPalette;
class _FAR TVMEditWindow;
#ifdef INCLUDE_HEAPVIEW
class _FAR THeapView;
#endif
class TVMEditorApp : public TApplication
{
public:
static FILE * _NEAR MacroFile; // Macro file pointer.
static ushort _NEAR MacroStatus; // Macro play/record status.
TVMEditorApp(void);
static TMenuBar *initMenuBar(TRect r);
static TStatusLine *initStatusLine(TRect r);
static TDeskTop *initDeskTop(TRect r);
virtual void initScreen(); // Sets correct palette.
virtual void idle(void);
virtual void getEvent(TEvent &event);
virtual void handleEvent(TEvent &event);
virtual void outOfMemory(void);
virtual TPalette& getPalette() const;
void loadConfig(Boolean UseFileSetting);
void saveConfig(void);
void saveDeskTop(void);
void restoreDeskTop(void);
private:
#ifdef INCLUDE_HEAPVIEW
THeapView *heap;
#endif
// State of CAPS, ScrollLock, and NumLock for the editors.
// NOTE: This variable along with the overridden idle() function must
// be present in the application class if the editor indicators are to
// display the proper CAPS, ScrollLock, and NumLock settings at all times.
uchar kbFlags;
TVMEditWindow *openEditor(char *fileName, Boolean visible);
void ReplaceKeyMaps(void);
void MemoDemo(void);
void DemoMsgViewer(void);
};
// A couple of useful functions.
#if _TV_VERSION == 0x0103
ushort executeDialog(TDialog *d, void *data);
#endif
Boolean isTileable(TView *p, void *);
// Other stuff.
extern TVMEditWindow *clipWindow;
class _FAR TDialog;
ushort doEditDialog(int dialog, ...);
ushort doMemoEditDialog(int dialog, ...);
#ifdef __TVMEDITOR_CODES
void doSignsOfLife(SignsOfLife lifeSign, ushort cmnd, long count, long total);
#endif
#endif