]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/os2/textctrl.h
b4408f36e9622f0189d655f4c23fe354c919445d
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
25 ,const wxValidator
& rValidator
= wxDefaultValidator
26 ,const wxString
& rsName
= wxTextCtrlNameStr
29 Create(pParent
, vId
, rsValue
, rPos
, rSize
, lStyle
, rValidator
, rsName
);
33 bool Create( wxWindow
* pParent
35 ,const wxString
& rsValue
= wxEmptyString
36 ,const wxPoint
& rPos
= wxDefaultPosition
37 ,const wxSize
& rSize
= wxDefaultSize
39 ,const wxValidator
& rValidator
= wxDefaultValidator
40 ,const wxString
& rsName
= wxTextCtrlNameStr
44 // Implement base class pure virtuals
45 // ----------------------------------
47 virtual wxString
GetValue(void) const;
48 virtual void SetValue(const wxString
& rsValue
);
50 virtual int GetLineLength(long nLineNo
) const;
51 virtual wxString
GetLineText(long nLineNo
) const;
52 virtual int GetNumberOfLines(void) const;
54 virtual bool IsModified(void) const;
55 virtual bool IsEditable(void) const;
57 virtual void GetSelection( long* pFrom
64 virtual void Clear(void);
65 virtual void Replace( long lFrom
67 ,const wxString
& rsValue
69 virtual void Remove( long lFrom
73 virtual bool LoadFile(const wxString
& rsFile
);
75 virtual void DiscardEdits(void);
77 virtual void WriteText(const wxString
& rsText
);
78 virtual void AppendText(const wxString
& rsText
);
79 virtual bool EmulateKeyPress(const wxKeyEvent
& rEvent
);
81 virtual bool SetStyle( long lStart
83 ,const wxTextAttr
& rStyle
85 virtual long XYToPosition( long lX
88 virtual bool PositionToXY( long lPos
93 virtual void ShowPosition(long lPos
);
95 virtual void Copy(void);
96 virtual void Cut(void);
97 virtual void Paste(void);
99 virtual bool CanCopy(void) const;
100 virtual bool CanCut(void) const;
101 virtual bool CanPaste(void) const;
103 virtual void Undo(void);
104 virtual void Redo(void);
106 virtual bool CanUndo(void) const;
107 virtual bool CanRedo(void) const;
109 virtual void SetInsertionPoint(long lPos
);
110 virtual void SetInsertionPointEnd(void);
111 virtual long GetInsertionPoint(void) const;
112 virtual long GetLastPosition(void) const;
114 virtual void SetSelection( long lFrom
117 virtual void SetEditable(bool bEditable
);
118 virtual void SetWindowStyleFlag(long lStyle
);
121 // Implementation from now on
122 // --------------------------
124 virtual void Command(wxCommandEvent
& rEvent
);
125 virtual bool OS2Command( WXUINT uParam
129 virtual WXHBRUSH
OnCtlColor( WXHDC hDC
137 virtual bool SetBackgroundColour(const wxColour
& colour
);
138 virtual bool SetForegroundColour(const wxColour
& colour
);
140 virtual void AdoptAttributesFromHWND(void);
141 virtual void SetupColours(void);
143 virtual bool AcceptsFocus(void) const;
146 void OnDropFiles(wxDropFilesEvent
& rEvent
);
147 void OnChar(wxKeyEvent
& rEvent
); // Process 'enter' if required
149 void OnCut(wxCommandEvent
& rEvent
);
150 void OnCopy(wxCommandEvent
& rEvent
);
151 void OnPaste(wxCommandEvent
& rEvent
);
152 void OnUndo(wxCommandEvent
& rEvent
);
153 void OnRedo(wxCommandEvent
& rEvent
);
154 void OnDelete(wxCommandEvent
& rEvent
);
155 void OnSelectAll(wxCommandEvent
& rEvent
);
157 void OnUpdateCut(wxUpdateUIEvent
& rEvent
);
158 void OnUpdateCopy(wxUpdateUIEvent
& rEvent
);
159 void OnUpdatePaste(wxUpdateUIEvent
& rEvent
);
160 void OnUpdateUndo(wxUpdateUIEvent
& rEvent
);
161 void OnUpdateRedo(wxUpdateUIEvent
& rEvent
);
162 void OnUpdateDelete(wxUpdateUIEvent
& rEvent
);
163 void OnUpdateSelectAll(wxUpdateUIEvent
& rEvent
);
165 inline bool IsMLE(void) {return m_bIsMLE
;}
166 inline void SetMLE(bool bIsMLE
) {m_bIsMLE
= bIsMLE
;}
170 // call this to increase the size limit (will do nothing if the current
171 // limit is big enough)
173 void AdjustSpaceLimit(void);
174 virtual wxSize
DoGetBestSize(void) const;
175 virtual bool OS2ShouldPreProcessMessage(WXMSG
* pMsg
);
177 virtual WXDWORD
OS2GetStyle( long lStyle
182 DECLARE_EVENT_TABLE()
183 DECLARE_DYNAMIC_CLASS(wxTextCtrl
)
184 }; // end of CLASS wxTextCtrl