]> git.saurik.com Git - wxWidgets.git/blob - include/wx/os2/textctrl.h
fixed displaying text in non default charset in the richedit control
[wxWidgets.git] / include / wx / os2 / textctrl.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: textctrl.h
3 // Purpose: wxTextCtrl class
4 // Author: David Webster
5 // Modified by:
6 // Created: 10/17/99
7 // RCS-ID: $Id$
8 // Copyright: (c) David Webster
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_TEXTCTRL_H_
13 #define _WX_TEXTCTRL_H_
14
15 class WXDLLEXPORT wxTextCtrl : public wxTextCtrlBase
16 {
17 public:
18 wxTextCtrl();
19 wxTextCtrl( wxWindow* pParent
20 ,wxWindowID vId
21 ,const wxString& rsValue = wxEmptyString
22 ,const wxPoint& rPos = wxDefaultPosition
23 ,const wxSize& rSize = wxDefaultSize
24 ,long lStyle = 0
25 #if wxUSE_VALIDATORS
26 ,const wxValidator& rValidator = wxDefaultValidator
27 #endif
28 ,const wxString& rsName = wxTextCtrlNameStr
29 )
30 {
31 Create(pParent, vId, rsValue, rPos, rSize, lStyle, rValidator, rsName);
32 }
33
34 bool Create( wxWindow* pParent
35 ,wxWindowID vId
36 ,const wxString& rsValue = wxEmptyString
37 ,const wxPoint& rPos = wxDefaultPosition
38 ,const wxSize& rSize = wxDefaultSize
39 ,long lStyle = 0
40 #if wxUSE_VALIDATORS
41 ,const wxValidator& rValidator = wxDefaultValidator
42 #endif
43 ,const wxString& rsName = wxTextCtrlNameStr
44 );
45
46 //
47 // Implement base class pure virtuals
48 // ----------------------------------
49 //
50 virtual wxString GetValue(void) const;
51 virtual void SetValue(const wxString& rsValue);
52
53 virtual int GetLineLength(long nLineNo) const;
54 virtual wxString GetLineText(long nLineNo) const;
55 virtual int GetNumberOfLines(void) const;
56
57 virtual bool IsModified(void) const;
58 virtual bool IsEditable(void) const;
59
60 virtual void GetSelection( long* pFrom
61 ,long* pTo
62 ) const;
63 //
64 // Operations
65 // ----------
66 //
67 virtual void Clear(void);
68 virtual void Replace( long lFrom
69 ,long lTo
70 ,const wxString& rsValue
71 );
72 virtual void Remove( long lFrom
73 ,long lTo
74 );
75
76 virtual bool LoadFile(const wxString& rsFile);
77
78 virtual void DiscardEdits(void);
79
80 virtual void WriteText(const wxString& rsText);
81 virtual void AppendText(const wxString& rsText);
82
83 virtual bool SetStyle( long lStart
84 ,long lEnd
85 ,const wxTextAttr& rStyle
86 );
87 virtual long XYToPosition( long lX
88 ,long lY
89 ) const;
90 virtual bool PositionToXY( long lPos
91 ,long* plX
92 ,long* plY
93 ) const;
94
95 virtual void ShowPosition(long lPos);
96
97 virtual void Copy(void);
98 virtual void Cut(void);
99 virtual void Paste(void);
100
101 virtual bool CanCopy(void) const;
102 virtual bool CanCut(void) const;
103 virtual bool CanPaste(void) const;
104
105 virtual void Undo(void);
106 virtual void Redo(void);
107
108 virtual bool CanUndo(void) const;
109 virtual bool CanRedo(void) const;
110
111 virtual void SetInsertionPoint(long lPos);
112 virtual void SetInsertionPointEnd(void);
113 virtual long GetInsertionPoint(void) const;
114 virtual long GetLastPosition(void) const;
115
116 virtual void SetSelection( long lFrom
117 ,long lTo
118 );
119 virtual void SetEditable(bool bEditable);
120
121 //
122 // Implementation from now on
123 // --------------------------
124 //
125 virtual void Command(wxCommandEvent& rEvent);
126 virtual bool OS2Command( WXUINT uParam
127 ,WXWORD wId
128 );
129
130 virtual WXHBRUSH OnCtlColor( WXHDC hDC
131 ,WXHWND pWnd
132 ,WXUINT nCtlColor
133 ,WXUINT message
134 ,WXWPARAM wParam
135 ,WXLPARAM lParam
136 );
137
138 virtual bool SetBackgroundColour(const wxColour& colour);
139 virtual bool SetForegroundColour(const wxColour& colour);
140
141 virtual void AdoptAttributesFromHWND(void);
142 virtual void SetupColours(void);
143
144 virtual bool AcceptsFocus(void) const;
145
146 // callbacks
147 void OnDropFiles(wxDropFilesEvent& rEvent);
148 void OnChar(wxKeyEvent& rEvent); // Process 'enter' if required
149
150 void OnCut(wxCommandEvent& rEvent);
151 void OnCopy(wxCommandEvent& rEvent);
152 void OnPaste(wxCommandEvent& rEvent);
153 void OnUndo(wxCommandEvent& rEvent);
154 void OnRedo(wxCommandEvent& rEvent);
155
156 void OnUpdateCut(wxUpdateUIEvent& rEvent);
157 void OnUpdateCopy(wxUpdateUIEvent& rEvent);
158 void OnUpdatePaste(wxUpdateUIEvent& rEvent);
159 void OnUpdateUndo(wxUpdateUIEvent& rEvent);
160 void OnUpdateRedo(wxUpdateUIEvent& rEvent);
161
162 inline bool IsMLE(void) {return m_bIsMLE;}
163 inline void SetMLE(bool bIsMLE) {m_bIsMLE = bIsMLE;}
164
165 protected:
166 //
167 // call this to increase the size limit (will do nothing if the current
168 // limit is big enough)
169 //
170 void AdjustSpaceLimit(void);
171 virtual wxSize DoGetBestSize(void) const;
172
173 private:
174 bool m_bIsMLE;
175 DECLARE_EVENT_TABLE()
176 DECLARE_DYNAMIC_CLASS(wxTextCtrl)
177 }; // end of CLASS wxTextCtrl
178
179 #endif
180 // _WX_TEXTCTRL_H_