]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk/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
49 DECLARE_DYNAMIC_CLASS(wxTextCtrl
);
53 wxTextCtrl( wxWindow
*parent
, wxWindowID id
, const wxString
&value
= "",
54 const wxPoint
&pos
= wxDefaultPosition
, const wxSize
&size
= wxDefaultSize
,
55 int style
= 0, const wxValidator
& validator
= wxDefaultValidator
,
56 const wxString
&name
= wxTextCtrlNameStr
);
57 bool Create( wxWindow
*parent
, wxWindowID id
, const wxString
&value
= "",
58 const wxPoint
&pos
= wxDefaultPosition
, const wxSize
&size
= wxDefaultSize
,
59 int style
= 0, const wxValidator
& validator
= wxDefaultValidator
,
60 const wxString
&name
= wxTextCtrlNameStr
);
61 wxString
GetValue() const;
62 void SetValue( const wxString
&value
);
63 void WriteText( const wxString
&text
);
65 bool LoadFile( const wxString
&file
);
66 bool SaveFile( const wxString
&file
);
67 bool IsModified() const { return m_modified
; }
68 void SetModified() { m_modified
= TRUE
; }
69 void DiscardEdits() { m_modified
= FALSE
; }
70 wxString
GetLineText( long lineNo
) const;
71 void OnDropFiles( wxDropFilesEvent
&event
);
72 long PositionToXY( long pos
, long *x
, long *y
) const;
73 long XYToPosition( long x
, long y
) const;
74 int GetLineLength(long lineNo
) const;
75 int GetNumberOfLines() const;
76 virtual void SetInsertionPoint( long pos
);
77 virtual void SetInsertionPointEnd();
78 virtual void SetEditable( bool editable
);
79 virtual void SetSelection( long from
, long to
);
80 void ShowPosition( long pos
);
81 virtual long GetInsertionPoint() const;
82 virtual long GetLastPosition() const;
83 virtual void Remove( long from
, long to
);
84 virtual void Replace( long from
, long to
, const wxString
&value
);
90 void OnChar( wxKeyEvent
&event
);
96 wxTextCtrl
& operator<<(const wxString
& s
);
97 wxTextCtrl
& operator<<(int i
);
98 wxTextCtrl
& operator<<(long i
);
99 wxTextCtrl
& operator<<(float f
);
100 wxTextCtrl
& operator<<(double d
);
101 wxTextCtrl
& operator<<(const char c
);
103 void SetFont( const wxFont
&font
);
104 void SetForegroundColour(const wxColour
&colour
);
105 void SetBackgroundColour(const wxColour
&colour
);
109 GtkWidget
* GetConnectWidget(void);
110 bool IsOwnGtkWindow( GdkWindow
*window
);
111 void ApplyWidgetStyle();
119 #endif // __GTKTEXTCTRLH__