home *** CD-ROM | disk | FTP | other *** search
- /*
- * File: wx_text.h
- * Purpose: wxTextWindow - simple text subwindow class
- *
- * wxWindows 1.40
- * Copyright (c) 1993 Artificial Intelligence Applications Institute,
- * The University of Edinburgh
- *
- * Author: Julian Smart
- * Date: 18-4-93
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose is hereby granted without fee, provided
- * that the above copyright notice, author statement and this permission
- * notice appear in all copies of this software and related documentation.
- *
- * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, EXPRESS,
- * IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
- * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
- *
- * IN NO EVENT SHALL THE ARTIFICIAL INTELLIGENCE APPLICATIONS INSTITUTE OR THE
- * UNIVERSITY OF EDINBURGH BE LIABLE FOR ANY SPECIAL, INCIDENTAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER RESULTING FROM
- * LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF THE POSSIBILITY OF
- * DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH
- * THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
- #ifndef wx_texth
- #define wx_texth
- #include "common.h"
- #include "wx_frame.h"
-
- /*
- * I would make this also derived from ostream:
- *
- * class wxTextWindow: public wxWindow, public virtual ostream
- *
- * but weirdly, the operator << isn't declared virtual in (isn't even
- * a member of) ostream, so we can't use a wxTextWindow in place of an ostream.
- *
- */
-
- class wxTextWindow: public wxWindow
- {
- char *file_name;
- #ifdef wx_motif
- long textPosition;
- Bool textModified;
- #endif
- public:
- wxTextWindow(wxFrame *frame, int x=-1, int y=-1, int width=-1, int height=-1,
- int style=0);
- ~wxTextWindow(void);
-
- Bool LoadFile(char *file);
- Bool SaveFile(char *file);
- void WriteText(char *text);
- void SetSize(int x, int y, int width, int height);
- void Clear(void);
- void DiscardEdits(void);
- Bool Modified(void);
- char *GetContents(void);
-
- wxTextWindow& operator<<(char *s);
- wxTextWindow& operator<<(int i);
- wxTextWindow& operator<<(long i);
- wxTextWindow& operator<<(float f);
- wxTextWindow& operator<<(double d);
- wxTextWindow& operator<<(char c);
- };
-
- #define wxTEXT_MAX_LINES 1000
-
- #endif // wx_texth
-