]>
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
);
34 bool Create( wxWindow
* pParent
36 ,const wxString
& rsValue
= wxEmptyString
37 ,const wxPoint
& rPos
= wxDefaultPosition
38 ,const wxSize
& rSize
= wxDefaultSize
41 ,const wxValidator
& rValidator
= wxDefaultValidator
43 ,const wxString
& rsName
= wxTextCtrlNameStr
47 // Implement base class pure virtuals
48 // ----------------------------------
50 virtual wxString
GetValue(void) const;
51 virtual void SetValue(const wxString
& rsValue
);
53 virtual int GetLineLength(long nLineNo
) const;
54 virtual wxString
GetLineText(long nLineNo
) const;
55 virtual int GetNumberOfLines(void) const;
57 virtual bool IsModified(void) const;
58 virtual bool IsEditable(void) const;
60 virtual void GetSelection( long* pFrom
67 virtual void Clear(void);
68 virtual void Replace( long lFrom
70 ,const wxString
& rsValue
72 virtual void Remove( long lFrom
76 virtual bool LoadFile(const wxString
& rsFile
);
78 virtual void DiscardEdits(void);
80 virtual void WriteText(const wxString
& rsText
);
81 virtual void AppendText(const wxString
& rsText
);
82 virtual bool EmulateKeyPress(const wxKeyEvent
& rEvent
);
84 virtual bool SetStyle( long lStart
86 ,const wxTextAttr
& rStyle
88 virtual long XYToPosition( long lX
91 virtual bool PositionToXY( long lPos
96 virtual void ShowPosition(long lPos
);
98 virtual void Copy(void);
99 virtual void Cut(void);
100 virtual void Paste(void);
102 virtual bool CanCopy(void) const;
103 virtual bool CanCut(void) const;
104 virtual bool CanPaste(void) const;
106 virtual void Undo(void);
107 virtual void Redo(void);
109 virtual bool CanUndo(void) const;
110 virtual bool CanRedo(void) const;
112 virtual void SetInsertionPoint(long lPos
);
113 virtual void SetInsertionPointEnd(void);
114 virtual long GetInsertionPoint(void) const;
115 virtual long GetLastPosition(void) const;
117 virtual void SetSelection( long lFrom
120 virtual void SetEditable(bool bEditable
);
121 virtual void SetFocus(void);
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
);
159 void OnUpdateCut(wxUpdateUIEvent
& rEvent
);
160 void OnUpdateCopy(wxUpdateUIEvent
& rEvent
);
161 void OnUpdatePaste(wxUpdateUIEvent
& rEvent
);
162 void OnUpdateUndo(wxUpdateUIEvent
& rEvent
);
163 void OnUpdateRedo(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