]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/os2/textctrl.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxTextCtrl class
4 // Author: David Webster
8 // Copyright: (c) David Webster
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_TEXTCTRL_H_
13 #define _WX_TEXTCTRL_H_
15 class WXDLLEXPORT wxTextCtrl
: public wxTextCtrlBase
19 wxTextCtrl( wxWindow
* pParent
21 ,const wxString
& rsValue
= wxEmptyString
22 ,const wxPoint
& rPos
= wxDefaultPosition
23 ,const wxSize
& rSize
= wxDefaultSize
26 ,const wxValidator
& rValidator
= wxDefaultValidator
28 ,const wxString
& rsName
= wxTextCtrlNameStr
31 Create(pParent
, vId
, rsValue
, rPos
, rSize
, lStyle
, rValidator
, rsName
);
35 bool Create( wxWindow
* pParent
37 ,const wxString
& rsValue
= wxEmptyString
38 ,const wxPoint
& rPos
= wxDefaultPosition
39 ,const wxSize
& rSize
= wxDefaultSize
42 ,const wxValidator
& rValidator
= wxDefaultValidator
44 ,const wxString
& rsName
= wxTextCtrlNameStr
48 // Implement base class pure virtuals
49 // ----------------------------------
51 virtual wxString
GetValue(void) const;
52 virtual void SetValue(const wxString
& rsValue
);
54 virtual int GetLineLength(long nLineNo
) const;
55 virtual wxString
GetLineText(long nLineNo
) const;
56 virtual int GetNumberOfLines(void) const;
58 virtual bool IsModified(void) const;
59 virtual bool IsEditable(void) const;
61 virtual void GetSelection( long* pFrom
68 virtual void Clear(void);
69 virtual void Replace( long lFrom
71 ,const wxString
& rsValue
73 virtual void Remove( long lFrom
77 virtual bool LoadFile(const wxString
& rsFile
);
79 virtual void DiscardEdits(void);
81 virtual void WriteText(const wxString
& rsText
);
82 virtual void AppendText(const wxString
& rsText
);
83 virtual bool EmulateKeyPress(const wxKeyEvent
& rEvent
);
85 virtual bool SetStyle( long lStart
87 ,const wxTextAttr
& rStyle
89 virtual long XYToPosition( long lX
92 virtual bool PositionToXY( long lPos
97 virtual void ShowPosition(long lPos
);
99 virtual void Copy(void);
100 virtual void Cut(void);
101 virtual void Paste(void);
103 virtual bool CanCopy(void) const;
104 virtual bool CanCut(void) const;
105 virtual bool CanPaste(void) const;
107 virtual void Undo(void);
108 virtual void Redo(void);
110 virtual bool CanUndo(void) const;
111 virtual bool CanRedo(void) const;
113 virtual void SetInsertionPoint(long lPos
);
114 virtual void SetInsertionPointEnd(void);
115 virtual long GetInsertionPoint(void) const;
116 virtual long GetLastPosition(void) const;
118 virtual void SetSelection( long lFrom
121 virtual void SetEditable(bool bEditable
);
122 virtual void SetWindowStyleFlag(long lStyle
);
125 // Implementation from now on
126 // --------------------------
128 virtual void Command(wxCommandEvent
& rEvent
);
129 virtual bool OS2Command( WXUINT uParam
133 virtual WXHBRUSH
OnCtlColor( WXHDC hDC
141 virtual bool SetBackgroundColour(const wxColour
& colour
);
142 virtual bool SetForegroundColour(const wxColour
& colour
);
144 virtual void AdoptAttributesFromHWND(void);
145 virtual void SetupColours(void);
147 virtual bool AcceptsFocus(void) const;
150 void OnDropFiles(wxDropFilesEvent
& rEvent
);
151 void OnChar(wxKeyEvent
& rEvent
); // Process 'enter' if required
153 void OnCut(wxCommandEvent
& rEvent
);
154 void OnCopy(wxCommandEvent
& rEvent
);
155 void OnPaste(wxCommandEvent
& rEvent
);
156 void OnUndo(wxCommandEvent
& rEvent
);
157 void OnRedo(wxCommandEvent
& rEvent
);
158 void OnDelete(wxCommandEvent
& rEvent
);
159 void OnSelectAll(wxCommandEvent
& rEvent
);
161 void OnUpdateCut(wxUpdateUIEvent
& rEvent
);
162 void OnUpdateCopy(wxUpdateUIEvent
& rEvent
);
163 void OnUpdatePaste(wxUpdateUIEvent
& rEvent
);
164 void OnUpdateUndo(wxUpdateUIEvent
& rEvent
);
165 void OnUpdateRedo(wxUpdateUIEvent
& rEvent
);
166 void OnUpdateDelete(wxUpdateUIEvent
& rEvent
);
167 void OnUpdateSelectAll(wxUpdateUIEvent
& rEvent
);
169 inline bool IsMLE(void) {return m_bIsMLE
;}
170 inline void SetMLE(bool bIsMLE
) {m_bIsMLE
= bIsMLE
;}
174 // call this to increase the size limit (will do nothing if the current
175 // limit is big enough)
177 void AdjustSpaceLimit(void);
178 virtual wxSize
DoGetBestSize(void) const;
179 virtual bool OS2ShouldPreProcessMessage(WXMSG
* pMsg
);
181 virtual WXDWORD
OS2GetStyle( long lStyle
186 DECLARE_EVENT_TABLE()
187 DECLARE_DYNAMIC_CLASS(wxTextCtrl
)
188 }; // end of CLASS wxTextCtrl