1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart and Markus Holzem
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
12 // ============================================================================
14 // ============================================================================
17 #pragma implementation "textctrl.h"
20 // ----------------------------------------------------------------------------
22 // ----------------------------------------------------------------------------
24 // For compilers that support precompilation, includes "wx.h".
25 #include "wx/wxprec.h"
32 #include "wx/textctrl.h"
33 #include "wx/settings.h"
41 #include "wx/clipbrd.h"
44 #include "wx/textfile.h"
48 #include "wx/msw/private.h"
52 #include <sys/types.h>
60 #if wxUSE_RICHEDIT && !defined(__GNUWIN32__)
64 #if !USE_SHARED_LIBRARY
66 // ----------------------------------------------------------------------------
67 // event tables and other macros
68 // ----------------------------------------------------------------------------
70 IMPLEMENT_DYNAMIC_CLASS(wxTextCtrl
, wxControl
)
72 BEGIN_EVENT_TABLE(wxTextCtrl
, wxControl
)
73 EVT_CHAR(wxTextCtrl::OnChar
)
74 EVT_DROP_FILES(wxTextCtrl::OnDropFiles
)
76 EVT_MENU(wxID_CUT
, wxTextCtrl::OnCut
)
77 EVT_MENU(wxID_COPY
, wxTextCtrl::OnCopy
)
78 EVT_MENU(wxID_PASTE
, wxTextCtrl::OnPaste
)
79 EVT_MENU(wxID_UNDO
, wxTextCtrl::OnUndo
)
80 EVT_MENU(wxID_REDO
, wxTextCtrl::OnRedo
)
82 EVT_UPDATE_UI(wxID_CUT
, wxTextCtrl::OnUpdateCut
)
83 EVT_UPDATE_UI(wxID_COPY
, wxTextCtrl::OnUpdateCopy
)
84 EVT_UPDATE_UI(wxID_PASTE
, wxTextCtrl::OnUpdatePaste
)
85 EVT_UPDATE_UI(wxID_UNDO
, wxTextCtrl::OnUpdateUndo
)
86 EVT_UPDATE_UI(wxID_REDO
, wxTextCtrl::OnUpdateRedo
)
89 #endif // USE_SHARED_LIBRARY
91 // ============================================================================
93 // ============================================================================
95 // ----------------------------------------------------------------------------
97 // ----------------------------------------------------------------------------
99 wxTextCtrl::wxTextCtrl()
106 bool wxTextCtrl::Create(wxWindow
*parent
, wxWindowID id
,
107 const wxString
& value
,
111 const wxValidator
& validator
,
112 const wxString
& name
)
114 // base initialization
115 if ( !CreateBase(parent
, id
, pos
, size
, style
, validator
, name
) )
118 SetValidator(validator
);
120 parent
->AddChild(this);
125 // translate wxWin style flags to MSW ones, checking for consistency while
127 long msStyle
= ES_LEFT
| WS_VISIBLE
| WS_CHILD
| WS_TABSTOP
;
128 if ( m_windowStyle
& wxTE_MULTILINE
)
130 wxASSERT_MSG( !(m_windowStyle
& wxTE_PROCESS_ENTER
),
131 _T("wxTE_PROCESS_ENTER style is ignored for multiline "
132 "text controls (they always process it)") );
134 msStyle
|= ES_MULTILINE
| ES_WANTRETURN
| WS_VSCROLL
;
135 m_windowStyle
|= wxTE_PROCESS_ENTER
;
138 msStyle
|= ES_AUTOHSCROLL
;
140 if (m_windowStyle
& wxTE_READONLY
)
141 msStyle
|= ES_READONLY
;
143 if (m_windowStyle
& wxHSCROLL
)
144 msStyle
|= (WS_HSCROLL
| ES_AUTOHSCROLL
);
145 if (m_windowStyle
& wxTE_PASSWORD
) // hidden input
146 msStyle
|= ES_PASSWORD
;
148 // we always want the characters and the arrows
149 m_lDlgCode
= DLGC_WANTCHARS
| DLGC_WANTARROWS
;
151 // we may have several different cases:
152 // 1. normal case: both TAB and ENTER are used for dialog navigation
153 // 2. ctrl which wants TAB for itself: ENTER is used to pass to the next
154 // control in the dialog
155 // 3. ctrl which wants ENTER for itself: TAB is used for dialog navigation
156 // 4. ctrl which wants both TAB and ENTER: Ctrl-ENTER is used to pass to
158 if ( m_windowStyle
& wxTE_PROCESS_ENTER
)
159 m_lDlgCode
|= DLGC_WANTMESSAGE
;
160 if ( m_windowStyle
& wxTE_PROCESS_TAB
)
161 m_lDlgCode
|= DLGC_WANTTAB
;
163 // do create the control - either an EDIT or RICHEDIT
164 const wxChar
*windowClass
= _T("EDIT");
167 if ( m_windowStyle
& wxTE_RICH
)
169 msStyle
|= ES_AUTOVSCROLL
;
171 windowClass
= _T("RICHEDIT");
178 WXDWORD exStyle
= Determine3DEffects(WS_EX_CLIENTEDGE
, &want3D
);
180 // Even with extended styles, need to combine with WS_BORDER for them to
182 if ( want3D
|| wxStyleHasBorder(m_windowStyle
) )
183 msStyle
|= WS_BORDER
;
185 // NB: don't use pos and size as CreateWindowEx arguments because they
186 // might be -1 in which case we should use the default values (and
187 // SetSize called below takes care of it)
188 m_hWnd
= (WXHWND
)::CreateWindowEx(exStyle
,
198 wxCHECK_MSG( m_hWnd
, FALSE
, _T("Failed to create text ctrl") );
203 Ctl3dSubclassCtl(GetHwnd());
211 // Have to enable events
212 ::SendMessage(GetHwnd(), EM_SETEVENTMASK
, 0,
213 ENM_CHANGE
| ENM_DROPFILES
| ENM_SELCHANGE
| ENM_UPDATE
);
217 SubclassWin(GetHWND());
219 // set font, position, size and initial value
220 wxFont
& fontParent
= parent
->GetFont();
221 if ( fontParent
.Ok() )
227 SetFont(wxSystemSettings::GetSystemFont(wxSYS_SYSTEM_FONT
));
230 // Causes a crash for Symantec C++ and WIN32 for some reason
231 #if !(defined(__SC__) && defined(__WIN32__))
232 if ( !value
.IsEmpty() )
238 SetSize(pos
.x
, pos
.y
, size
.x
, size
.y
);
243 // Make sure the window style (etc.) reflects the HWND style (roughly)
244 void wxTextCtrl::AdoptAttributesFromHWND()
246 wxWindow::AdoptAttributesFromHWND();
248 HWND hWnd
= GetHwnd();
249 long style
= GetWindowLong(hWnd
, GWL_STYLE
);
251 // retrieve the style to see whether this is an edit or richedit ctrl
255 GetClassName(hWnd
, buf
, WXSIZEOF(buf
));
257 if ( wxStricmp(buf
, _T("EDIT")) == 0 )
261 #endif // wxUSE_RICHEDIT
263 if (style
& ES_MULTILINE
)
264 m_windowStyle
|= wxTE_MULTILINE
;
265 if (style
& ES_PASSWORD
)
266 m_windowStyle
|= wxTE_PASSWORD
;
267 if (style
& ES_READONLY
)
268 m_windowStyle
|= wxTE_READONLY
;
269 if (style
& ES_WANTRETURN
)
270 m_windowStyle
|= wxTE_PROCESS_ENTER
;
273 void wxTextCtrl::SetupColours()
275 // FIXME why is bg colour not inherited from parent?
276 SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_WINDOW
));
277 SetForegroundColour(GetParent()->GetForegroundColour());
280 // ----------------------------------------------------------------------------
281 // set/get the controls text
282 // ----------------------------------------------------------------------------
284 wxString
wxTextCtrl::GetValue() const
286 return wxGetWindowText(GetHWND());
289 void wxTextCtrl::SetValue(const wxString
& value
)
291 wxString valueDos
= wxTextFile::Translate(value
, wxTextFileType_Dos
);
293 SetWindowText(GetHwnd(), valueDos
);
298 void wxTextCtrl::WriteText(const wxString
& value
)
300 wxString valueDos
= wxTextFile::Translate(value
, wxTextFileType_Dos
);
302 SendMessage(GetHwnd(), EM_REPLACESEL
, 0, (LPARAM
)valueDos
.c_str());
307 void wxTextCtrl::AppendText(const wxString
& text
)
309 SetInsertionPointEnd();
313 void wxTextCtrl::Clear()
315 SetWindowText(GetHwnd(), _T(""));
318 // ----------------------------------------------------------------------------
319 // Clipboard operations
320 // ----------------------------------------------------------------------------
322 void wxTextCtrl::Copy()
326 HWND hWnd
= GetHwnd();
327 SendMessage(hWnd
, WM_COPY
, 0, 0L);
331 void wxTextCtrl::Cut()
335 HWND hWnd
= GetHwnd();
336 SendMessage(hWnd
, WM_CUT
, 0, 0L);
340 void wxTextCtrl::Paste()
344 HWND hWnd
= GetHwnd();
345 SendMessage(hWnd
, WM_PASTE
, 0, 0L);
349 bool wxTextCtrl::CanCopy() const
351 // Can copy if there's a selection
353 GetSelection(& from
, & to
);
357 bool wxTextCtrl::CanCut() const
359 // Can cut if there's a selection
361 GetSelection(& from
, & to
);
365 bool wxTextCtrl::CanPaste() const
370 int dataFormat
= 0; // 0 == any format
371 return (::SendMessage( GetHwnd(), EM_CANPASTE
, (WPARAM
) (UINT
) dataFormat
, 0) != 0);
377 // Standard edit control: check for straight text on clipboard
378 bool isTextAvailable
= FALSE
;
379 if ( ::OpenClipboard(GetHwndOf(wxTheApp
->GetTopWindow())) )
381 isTextAvailable
= (::IsClipboardFormatAvailable(CF_TEXT
) != 0);
385 return isTextAvailable
;
388 // ----------------------------------------------------------------------------
390 // ----------------------------------------------------------------------------
392 void wxTextCtrl::SetEditable(bool editable
)
394 HWND hWnd
= GetHwnd();
395 SendMessage(hWnd
, EM_SETREADONLY
, (WPARAM
)!editable
, (LPARAM
)0L);
398 void wxTextCtrl::SetInsertionPoint(long pos
)
400 HWND hWnd
= GetHwnd();
408 SendMessage(hWnd
, EM_EXSETSEL
, 0, (LPARAM
) &range
);
409 SendMessage(hWnd
, EM_SCROLLCARET
, (WPARAM
)0, (LPARAM
)0);
412 #endif // wxUSE_RICHEDIT
414 SendMessage(hWnd
, EM_SETSEL
, pos
, pos
);
415 SendMessage(hWnd
, EM_SCROLLCARET
, (WPARAM
)0, (LPARAM
)0);
418 SendMessage(hWnd
, EM_SETSEL
, 0, MAKELPARAM(pos
, pos
));
421 static const char *nothing
= "";
422 SendMessage(hWnd
, EM_REPLACESEL
, 0, (LPARAM
)nothing
);
425 void wxTextCtrl::SetInsertionPointEnd()
427 long pos
= GetLastPosition();
428 SetInsertionPoint(pos
);
431 long wxTextCtrl::GetInsertionPoint() const
439 SendMessage(GetHwnd(), EM_EXGETSEL
, 0, (LPARAM
) &range
);
444 DWORD Pos
= (DWORD
)SendMessage(GetHwnd(), EM_GETSEL
, 0, 0L);
448 long wxTextCtrl::GetLastPosition() const
450 HWND hWnd
= GetHwnd();
452 // Will always return a number > 0 (according to docs)
453 int noLines
= (int)SendMessage(hWnd
, EM_GETLINECOUNT
, (WPARAM
)0, (LPARAM
)0L);
455 // This gets the char index for the _beginning_ of the last line
456 int charIndex
= (int)SendMessage(hWnd
, EM_LINEINDEX
, (WPARAM
)(noLines
-1), (LPARAM
)0L);
458 // Get number of characters in the last line. We'll add this to the character
459 // index for the last line, 1st position.
460 int lineLength
= (int)SendMessage(hWnd
, EM_LINELENGTH
, (WPARAM
)charIndex
, (LPARAM
)0L);
462 return (long)(charIndex
+ lineLength
);
465 // If the return values from and to are the same, there is no
467 void wxTextCtrl::GetSelection(long* from
, long* to
) const
473 ::SendMessage(GetHwnd(), EM_EXGETSEL
, 0, (LPARAM
) (CHARRANGE
*) & charRange
);
475 *from
= charRange
.cpMin
;
476 *to
= charRange
.cpMax
;
481 DWORD dwStart
, dwEnd
;
482 WPARAM wParam
= (WPARAM
) (DWORD
*) & dwStart
; // receives starting position
483 LPARAM lParam
= (LPARAM
) (DWORD
*) & dwEnd
; // receives ending position
485 ::SendMessage(GetHwnd(), EM_GETSEL
, wParam
, lParam
);
491 bool wxTextCtrl::IsEditable() const
493 long style
= ::GetWindowLong(GetHwnd(), GWL_STYLE
);
495 return ((style
& ES_READONLY
) == 0);
498 // ----------------------------------------------------------------------------
500 // ----------------------------------------------------------------------------
502 void wxTextCtrl::Replace(long from
, long to
, const wxString
& value
)
505 HWND hWnd
= GetHwnd();
506 long fromChar
= from
;
509 // Set selection and remove it
511 SendMessage(hWnd
, EM_SETSEL
, fromChar
, toChar
);
513 SendMessage(hWnd
, EM_SETSEL
, (WPARAM
)0, (LPARAM
)MAKELONG(fromChar
, toChar
));
515 SendMessage(hWnd
, WM_CUT
, (WPARAM
)0, (LPARAM
)0);
517 // Now replace with 'value', by pasting.
518 wxSetClipboardData(wxDF_TEXT
, (wxObject
*) (const wxChar
*)value
, 0, 0);
520 // Paste into edit control
521 SendMessage(hWnd
, WM_PASTE
, (WPARAM
)0, (LPARAM
)0L);
523 wxFAIL_MSG("wxTextCtrl::Replace not implemented if wxUSE_CLIPBOARD is 0.");
527 void wxTextCtrl::Remove(long from
, long to
)
529 HWND hWnd
= GetHwnd();
530 long fromChar
= from
;
533 // Cut all selected text
535 SendMessage(hWnd
, EM_SETSEL
, fromChar
, toChar
);
537 SendMessage(hWnd
, EM_SETSEL
, (WPARAM
)0, (LPARAM
)MAKELONG(fromChar
, toChar
));
539 SendMessage(hWnd
, WM_CUT
, (WPARAM
)0, (LPARAM
)0);
542 void wxTextCtrl::SetSelection(long from
, long to
)
544 HWND hWnd
= GetHwnd();
545 long fromChar
= from
;
548 // if from and to are both -1, it means (in wxWindows) that all text should
549 // be selected. Translate into Windows convention
550 if ((from
== -1) && (to
== -1))
557 SendMessage(hWnd
, EM_SETSEL
, (WPARAM
)fromChar
, (LPARAM
)toChar
);
558 SendMessage(hWnd
, EM_SCROLLCARET
, (WPARAM
)0, (LPARAM
)0);
560 // WPARAM is 0: selection is scrolled into view
561 SendMessage(hWnd
, EM_SETSEL
, (WPARAM
)0, (LPARAM
)MAKELONG(fromChar
, toChar
));
565 bool wxTextCtrl::LoadFile(const wxString
& file
)
567 if ( wxTextCtrlBase::LoadFile(file
) )
569 // update the size limit if needed
578 bool wxTextCtrl::IsModified() const
580 return (SendMessage(GetHwnd(), EM_GETMODIFY
, 0, 0) != 0);
583 // Makes 'unmodified'
584 void wxTextCtrl::DiscardEdits()
586 SendMessage(GetHwnd(), EM_SETMODIFY
, FALSE
, 0L);
589 int wxTextCtrl::GetNumberOfLines() const
591 return (int)SendMessage(GetHwnd(), EM_GETLINECOUNT
, (WPARAM
)0, (LPARAM
)0);
594 long wxTextCtrl::XYToPosition(long x
, long y
) const
596 HWND hWnd
= GetHwnd();
598 // This gets the char index for the _beginning_ of this line
599 int charIndex
= (int)SendMessage(hWnd
, EM_LINEINDEX
, (WPARAM
)y
, (LPARAM
)0);
600 return (long)(x
+ charIndex
);
603 bool wxTextCtrl::PositionToXY(long pos
, long *x
, long *y
) const
605 HWND hWnd
= GetHwnd();
607 // This gets the line number containing the character
612 lineNo
= (int)SendMessage(hWnd
, EM_EXLINEFROMCHAR
, 0, (LPARAM
)pos
);
615 #endif // wxUSE_RICHEDIT
616 lineNo
= (int)SendMessage(hWnd
, EM_LINEFROMCHAR
, (WPARAM
)pos
, 0);
624 // This gets the char index for the _beginning_ of this line
625 int charIndex
= (int)SendMessage(hWnd
, EM_LINEINDEX
, (WPARAM
)lineNo
, (LPARAM
)0);
626 if ( charIndex
== -1 )
631 // The X position must therefore be the different between pos and charIndex
633 *x
= (long)(pos
- charIndex
);
640 void wxTextCtrl::ShowPosition(long pos
)
642 HWND hWnd
= GetHwnd();
644 // To scroll to a position, we pass the number of lines and characters
645 // to scroll *by*. This means that we need to:
646 // (1) Find the line position of the current line.
647 // (2) Find the line position of pos.
648 // (3) Scroll by (pos - current).
649 // For now, ignore the horizontal scrolling.
651 // Is this where scrolling is relative to - the line containing the caret?
652 // Or is the first visible line??? Try first visible line.
653 // int currentLineLineNo1 = (int)SendMessage(hWnd, EM_LINEFROMCHAR, (WPARAM)-1, (LPARAM)0L);
655 int currentLineLineNo
= (int)SendMessage(hWnd
, EM_GETFIRSTVISIBLELINE
, (WPARAM
)0, (LPARAM
)0L);
657 int specifiedLineLineNo
= (int)SendMessage(hWnd
, EM_LINEFROMCHAR
, (WPARAM
)pos
, (LPARAM
)0L);
659 int linesToScroll
= specifiedLineLineNo
- currentLineLineNo
;
661 if (linesToScroll
!= 0)
662 (void)SendMessage(hWnd
, EM_LINESCROLL
, (WPARAM
)0, (LPARAM
)linesToScroll
);
665 int wxTextCtrl::GetLineLength(long lineNo
) const
667 long charIndex
= XYToPosition(0, lineNo
);
668 int len
= (int)SendMessage(GetHwnd(), EM_LINELENGTH
, charIndex
, 0);
672 wxString
wxTextCtrl::GetLineText(long lineNo
) const
674 size_t len
= (size_t)GetLineLength(lineNo
) + 1;
675 char *buf
= (char *)malloc(len
);
677 int noChars
= (int)SendMessage(GetHwnd(), EM_GETLINE
, lineNo
, (LPARAM
)buf
);
687 // ----------------------------------------------------------------------------
689 // ----------------------------------------------------------------------------
691 void wxTextCtrl::Undo()
695 ::SendMessage(GetHwnd(), EM_UNDO
, 0, 0);
699 void wxTextCtrl::Redo()
703 // Same as Undo, since Undo undoes the undo, i.e. a redo.
704 ::SendMessage(GetHwnd(), EM_UNDO
, 0, 0);
708 bool wxTextCtrl::CanUndo() const
710 return (::SendMessage(GetHwnd(), EM_CANUNDO
, 0, 0) != 0);
713 bool wxTextCtrl::CanRedo() const
715 return (::SendMessage(GetHwnd(), EM_CANUNDO
, 0, 0) != 0);
718 // ----------------------------------------------------------------------------
719 // implemenation details
720 // ----------------------------------------------------------------------------
722 void wxTextCtrl::Command(wxCommandEvent
& event
)
724 SetValue(event
.GetString());
725 ProcessCommand (event
);
728 void wxTextCtrl::OnDropFiles(wxDropFilesEvent
& event
)
730 // By default, load the first file into the text window.
731 if (event
.GetNumberOfFiles() > 0)
733 LoadFile(event
.GetFiles()[0]);
737 WXHBRUSH
wxTextCtrl::OnCtlColor(WXHDC pDC
, WXHWND pWnd
, WXUINT nCtlColor
,
738 WXUINT message
, WXWPARAM wParam
,
744 HBRUSH hbrush
= Ctl3dCtlColorEx(message
, wParam
, lParam
);
745 return (WXHBRUSH
) hbrush
;
750 SetBkMode(hdc
, GetParent()->GetTransparentBackground() ? TRANSPARENT
753 ::SetBkColor(hdc
, RGB(GetBackgroundColour().Red(), GetBackgroundColour().Green(), GetBackgroundColour().Blue()));
754 ::SetTextColor(hdc
, RGB(GetForegroundColour().Red(), GetForegroundColour().Green(), GetForegroundColour().Blue()));
756 wxBrush
*backgroundBrush
= wxTheBrushList
->FindOrCreateBrush(GetBackgroundColour(), wxSOLID
);
758 return (WXHBRUSH
) backgroundBrush
->GetResourceHandle();
761 void wxTextCtrl::OnChar(wxKeyEvent
& event
)
763 switch ( event
.KeyCode() )
766 if ( !(m_windowStyle
& wxTE_MULTILINE
) )
768 wxCommandEvent
event(wxEVT_COMMAND_TEXT_ENTER
, m_windowId
);
769 event
.SetEventObject( this );
770 if ( GetEventHandler()->ProcessEvent(event
) )
773 //else: multiline controls need Enter for themselves
778 // always produce navigation event - even if we process TAB
779 // ourselves the fact that we got here means that the user code
780 // decided to skip processing of this TAB - probably to let it
781 // do its default job.
783 // NB: Notice that Ctrl-Tab is handled elsewhere and Alt-Tab is
784 // handled by Windows
786 wxNavigationKeyEvent eventNav
;
787 eventNav
.SetDirection(!event
.ShiftDown());
788 eventNav
.SetWindowChange(FALSE
);
789 eventNav
.SetEventObject(this);
791 if ( GetEventHandler()->ProcessEvent(eventNav
) )
801 // don't just call event.Skip() because this will cause TABs and ENTERs
802 // be passed upwards and we don't always want this - instead process it
809 bool wxTextCtrl::MSWCommand(WXUINT param
, WXWORD
WXUNUSED(id
))
816 wxFocusEvent
event(param
== EN_KILLFOCUS
? wxEVT_KILL_FOCUS
819 event
.SetEventObject( this );
820 GetEventHandler()->ProcessEvent(event
);
826 wxCommandEvent
event(wxEVT_COMMAND_TEXT_UPDATED
, m_windowId
);
827 wxString
val(GetValue());
829 event
.m_commandString
= WXSTRINGCAST val
;
830 event
.SetEventObject( this );
831 ProcessCommand(event
);
836 // the text size limit has been hit - increase it
840 // the other notification messages are not processed
853 void wxTextCtrl::AdjustSpaceLimit()
856 unsigned int len
= ::GetWindowTextLength(GetHwnd()),
857 limit
= ::SendMessage(GetHwnd(), EM_GETLIMITTEXT
, 0, 0);
860 limit
= len
+ 0x8000; // 32Kb
863 if ( m_isRich
|| limit
> 0xffff )
865 if ( limit
> 0xffff )
867 ::SendMessage(GetHwnd(), EM_LIMITTEXT
, 0, limit
);
869 ::SendMessage(GetHwnd(), EM_LIMITTEXT
, limit
, 0);
874 bool wxTextCtrl::AcceptsFocus() const
876 // we don't want focus if we can't be edited
877 return IsEditable() && wxControl::AcceptsFocus();
880 wxSize
wxTextCtrl::DoGetBestSize()
883 wxGetCharSize(GetHWND(), &cx
, &cy
, &GetFont());
885 int wText
= DEFAULT_ITEM_WIDTH
;
887 int hText
= EDIT_HEIGHT_FROM_CHAR_HEIGHT(cy
);
888 if ( m_windowStyle
& wxTE_MULTILINE
)
890 hText
*= wxMin(GetNumberOfLines(), 5);
892 //else: for single line control everything is ok
894 return wxSize(wText
, hText
);
897 // ----------------------------------------------------------------------------
898 // standard handlers for standard edit menu events
899 // ----------------------------------------------------------------------------
901 void wxTextCtrl::OnCut(wxCommandEvent
& event
)
906 void wxTextCtrl::OnCopy(wxCommandEvent
& event
)
911 void wxTextCtrl::OnPaste(wxCommandEvent
& event
)
916 void wxTextCtrl::OnUndo(wxCommandEvent
& event
)
921 void wxTextCtrl::OnRedo(wxCommandEvent
& event
)
926 void wxTextCtrl::OnUpdateCut(wxUpdateUIEvent
& event
)
928 event
.Enable( CanCut() );
931 void wxTextCtrl::OnUpdateCopy(wxUpdateUIEvent
& event
)
933 event
.Enable( CanCopy() );
936 void wxTextCtrl::OnUpdatePaste(wxUpdateUIEvent
& event
)
938 event
.Enable( CanPaste() );
941 void wxTextCtrl::OnUpdateUndo(wxUpdateUIEvent
& event
)
943 event
.Enable( CanUndo() );
946 void wxTextCtrl::OnUpdateRedo(wxUpdateUIEvent
& event
)
948 event
.Enable( CanRedo() );