]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk1/textctrl.h
1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Robert Roebling
7 // Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
12 #ifndef __GTKTEXTCTRLH__
13 #define __GTKTEXTCTRLH__
20 #include "wx/object.h"
21 #include "wx/string.h"
22 #include "wx/control.h"
30 //-----------------------------------------------------------------------------
32 //-----------------------------------------------------------------------------
36 //-----------------------------------------------------------------------------
38 //-----------------------------------------------------------------------------
40 extern const char *wxTextCtrlNameStr
;
42 //-----------------------------------------------------------------------------
44 //-----------------------------------------------------------------------------
46 class wxTextCtrl
: public wxControl
, public streambuf
48 DECLARE_DYNAMIC_CLASS(wxTextCtrl
);
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
);
63 bool LoadFile( const wxString
&file
);
64 bool SaveFile( const wxString
&file
);
65 bool IsModified(void);
66 void DiscardEdits(void);
68 wxString GetLineText( const long lineNo ) const;
69 void OnDropFiles( wxDropFilesEvent &event );
70 long PositionToXY( const long pos, long *x, long *y ) const;
71 long XYToPosition( const long x, const long y );
72 int GetNumberOfLines(void);
74 virtual void SetInsertionPoint( const long pos
);
75 virtual void SetInsertionPointEnd(void);
76 virtual void SetEditable( const bool editable
);
77 virtual void SetSelection( const long from
, const long to
);
78 void ShowPosition( const long pos
);
79 virtual long GetInsertionPoint(void) const;
80 virtual long GetLastPosition(void) const;
81 virtual void Remove( const long from
, const long to
);
82 virtual void Replace( const long from
, const long to
, const wxString
&value
);
88 void OnChar( wxKeyEvent
&event
);
94 wxTextCtrl
& operator<<(const wxString
& s
);
95 wxTextCtrl
& operator<<(const int i
);
96 wxTextCtrl
& operator<<(const long i
);
97 wxTextCtrl
& operator<<(const float f
);
98 wxTextCtrl
& operator<<(const double d
);
99 wxTextCtrl
& operator<<(const char c
);
105 DECLARE_EVENT_TABLE()
109 #endif // __GTKTEXTCTRLH__