]>
Commit | Line | Data |
---|---|---|
c801d85f KB |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: textctrl.h | |
3 | // Purpose: | |
4 | // Author: Robert Roebling | |
5 | // Created: 01/02/97 | |
6 | // Id: | |
7 | // Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem | |
8 | // Licence: wxWindows licence | |
9 | ///////////////////////////////////////////////////////////////////////////// | |
10 | ||
11 | ||
12 | #ifndef __GTKTEXTCTRLH__ | |
13 | #define __GTKTEXTCTRLH__ | |
14 | ||
15 | #ifdef __GNUG__ | |
16 | #pragma interface | |
17 | #endif | |
18 | ||
19 | #include "wx/defs.h" | |
20 | #include "wx/object.h" | |
21 | #include "wx/string.h" | |
22 | #include "wx/control.h" | |
23 | ||
24 | #if USE_IOSTREAMH | |
25 | #include <iostream.h> | |
26 | #else | |
27 | #include <iostream> | |
28 | #endif | |
29 | ||
30 | //----------------------------------------------------------------------------- | |
31 | // classes | |
32 | //----------------------------------------------------------------------------- | |
33 | ||
34 | class wxTextCtrl; | |
35 | ||
36 | //----------------------------------------------------------------------------- | |
37 | // global data | |
38 | //----------------------------------------------------------------------------- | |
39 | ||
40 | extern const char *wxTextCtrlNameStr; | |
41 | ||
42 | //----------------------------------------------------------------------------- | |
43 | // wxTextCtrl | |
44 | //----------------------------------------------------------------------------- | |
45 | ||
46 | class wxTextCtrl: public wxControl, public streambuf | |
47 | { | |
48 | DECLARE_DYNAMIC_CLASS(wxTextCtrl); | |
49 | ||
50 | public: | |
51 | ||
52 | wxTextCtrl(void); | |
53 | wxTextCtrl( wxWindow *parent, const wxWindowID id, const wxString &value = "", | |
54 | const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize, | |
55 | const int style = 0, const wxString &name = wxTextCtrlNameStr ); | |
56 | bool Create( wxWindow *parent, const wxWindowID id, const wxString &value = "", | |
57 | const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize, | |
58 | const int style = 0, const wxString &name = wxTextCtrlNameStr ); | |
59 | wxString GetValue(void) const; | |
60 | void SetValue( const wxString &value ); | |
61 | void WriteText( const wxString &text ); | |
62 | /* | |
63 | wxString GetLineText( const long lineNo ) const; | |
64 | bool LoadFile( const wxString &file ); | |
65 | bool SaveFile( const wxString &file ); | |
66 | void DiscardEdits(void); | |
67 | bool IsModified(void); | |
68 | void OnDropFiles( wxDropFilesEvent &event ); | |
69 | long PositionToXY( const long pos, long *x, long *y ) const; | |
70 | long XYToPosition( const long x, const long y ); | |
71 | int GetNumberOfLines(void); | |
72 | */ | |
73 | virtual void SetInsertionPoint( const long pos ); | |
74 | virtual void SetInsertionPointEnd(void); | |
75 | virtual void SetEditable( const bool editable ); | |
76 | virtual void SetSelection( const long from, const long to ); | |
77 | void ShowPosition( const long pos ); | |
78 | virtual long GetInsertionPoint(void) const; | |
79 | virtual long GetLastPosition(void) const; | |
80 | virtual void Remove( const long from, const long to ); | |
81 | virtual void Replace( const long from, const long to, const wxString &value ); | |
82 | void Cut(void); | |
83 | void Copy(void); | |
84 | void Paste(void); | |
85 | void Delete(void); | |
86 | ||
87 | void OnChar( wxKeyEvent &event ); | |
88 | ||
89 | int overflow(int i); | |
90 | int sync(void); | |
91 | int underflow(void); | |
92 | ||
93 | wxTextCtrl& operator<<(const wxString& s); | |
94 | wxTextCtrl& operator<<(const int i); | |
95 | wxTextCtrl& operator<<(const long i); | |
96 | wxTextCtrl& operator<<(const float f); | |
97 | wxTextCtrl& operator<<(const double d); | |
98 | wxTextCtrl& operator<<(const char c); | |
99 | ||
100 | DECLARE_EVENT_TABLE() | |
101 | ||
102 | }; | |
103 | ||
104 | #endif // __GTKTEXTCTRLH__ | |
105 | ||
106 |