home *** CD-ROM | disk | FTP | other *** search
- //
- // *************************************************************************
- // * *
- // * OMEGA C++ Windowing Class Library *
- // * ================================= *
- // * *
- // * Copyright 1991,92 Tom Clancy *
- // * Submitted to the public domain, April 1992 *
- // * *
- // *************************************************************************
- // * *
- // * IO Screep Prompt Class Object *
- // * *
- // *************************************************************************
- //
-
- #ifndef _OMIO
- #define _OMIO
- #endif
-
- #ifndef _OMWINDOW
- #include "omwin.hpp"
- #endif
-
- #include <string.h>
-
- class oIO : virtual public oWindow {
-
- int Done;
- int Cursor;
- int InsertMode;
- int Pointer;
- int Fstartx;
-
- char IOFillchar;
-
- int UpperMode;
- int Accepted;
- int Canescape;
- int Current;
- int Donekey;
- int MessX,MessY;
- int Nf;
- int Pfg, Pbk, Ffg, Fbk;
- int Cfg, Cbk;
- int Mfg, Mbk;
-
- struct field {
- char *message;
- char *prompt;
- char *info;
- int x;
- int y;
- int len;
- int Ffg,Fbk;
- int next, prev;
- };
-
- struct field *Field[255];
-
-
- public:
-
- oIO();
- ~oIO();
-
- void setIO(int pfg, int pbk, int ffg, int fbk, int cfg, int cbk,
- int mfg, int mbk, int messx, int messy);
-
- void addfield(int x, int y, int len, int nextf, int prevf, char *p, char *m);
-
-
- // Generic string functions (move to omstring if created)
-
- int insertstr(char *s, char c, int pos);
- int overtpstr(char *s, char c, int pos);
- int deletestr(char *s, int pos);
-
- // IO functions
-
- void setPfg(int fg) {Pfg=fg;} // Prompt fore and background
- void setPbk(int bk) {Pbk=bk;}
- void setFfg(int fg) {Field[Current]->Ffg=fg;} // Field '' '' '' ''
- void setFbk(int bk) {Field[Current]->Fbk=bk;}
- void setfillchar(char c) {IOFillchar=c;}
- void setdone(int d) {Done=d;}
- void clearfield(int f);
- void clearallfields();
- void showfield(int f);
- void setuppermode(int m) {UpperMode=m;}
-
- void goendstr();
- void gohomestr();
-
-
- int getPfg(void) {return Pfg;} // Prompt fore and background
- int getPbk(void) {return Pbk;}
- int getFfg(void) {return Ffg;} // Field '' '' '' ''
- int getFbk(void) {return Fbk;}
- int getcurrent() {return Current;}
- void iosetcurrent(int c){Current=c;}
- int getMfg() {return Mfg;}
- int getMbk() {return Mbk;}
- int getx(int f) {return Field[f]->x;}
- int gety(int f) {return Field[f]->y;}
- int getmessy() {return MessY;}
- int getmessx() {return MessX;}
- int getfieldlen(int f) {return Field[f]->len;}
- int getiolen(int f) {return strlen(Field[f]->prompt)+Field[f]->len;}
- int withinIO();
- int isdone() {return Done;}
-
-
- char *getfield(int fn);
- void setfield(char *s, int fn);
- char *getmessage(int mn);
- void display_field(int fn);
- int withinfield(int fn);
- int whichfield();
- void display_form();
- void assigndonekey(int k) {Donekey=k;}
- void releasecurrent();
- void markcurrent();
- void gonextfield();
- void goprevfield();
- void setescape(int yn) {Canescape=yn;}
-
- void initfieldinfo();
-
- int numfields() {return Nf;}
- int isformdone() {return Done;}
- int isaccepted() {return Accepted;}
-
- virtual void display_message();
- virtual void clear_message();
- void display_info();
- int handle_mouse_event();
- int handle_key_event();
-
- void goIO();
-
- };
-
-
-