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>
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
) )
119 parent
->AddChild(this);
124 // translate wxWin style flags to MSW ones, checking for consistency while
126 long msStyle
= ES_LEFT
| WS_VISIBLE
| WS_CHILD
| WS_TABSTOP
;
127 if ( m_windowStyle
& wxTE_MULTILINE
)
129 wxASSERT_MSG( !(m_windowStyle
& wxTE_PROCESS_ENTER
),
130 wxT("wxTE_PROCESS_ENTER style is ignored for multiline "
131 "text controls (they always process it)") );
133 msStyle
|= ES_MULTILINE
| ES_WANTRETURN
;
134 if ((m_windowStyle
& wxTE_NO_VSCROLL
) == 0)
135 msStyle
|= WS_VSCROLL
;
136 m_windowStyle
|= wxTE_PROCESS_ENTER
;
139 msStyle
|= ES_AUTOHSCROLL
;
141 if (m_windowStyle
& wxHSCROLL
)
142 msStyle
|= (WS_HSCROLL
| ES_AUTOHSCROLL
);
144 if (m_windowStyle
& wxTE_READONLY
)
145 msStyle
|= ES_READONLY
;
147 if (m_windowStyle
& wxHSCROLL
)
148 msStyle
|= (WS_HSCROLL
| ES_AUTOHSCROLL
);
149 if (m_windowStyle
& wxTE_PASSWORD
) // hidden input
150 msStyle
|= ES_PASSWORD
;
152 // we always want the characters and the arrows
153 m_lDlgCode
= DLGC_WANTCHARS
| DLGC_WANTARROWS
;
155 // we may have several different cases:
156 // 1. normal case: both TAB and ENTER are used for dialog navigation
157 // 2. ctrl which wants TAB for itself: ENTER is used to pass to the next
158 // control in the dialog
159 // 3. ctrl which wants ENTER for itself: TAB is used for dialog navigation
160 // 4. ctrl which wants both TAB and ENTER: Ctrl-ENTER is used to pass to
162 if ( m_windowStyle
& wxTE_PROCESS_ENTER
)
163 m_lDlgCode
|= DLGC_WANTMESSAGE
;
164 if ( m_windowStyle
& wxTE_PROCESS_TAB
)
165 m_lDlgCode
|= DLGC_WANTTAB
;
167 // do create the control - either an EDIT or RICHEDIT
168 const wxChar
*windowClass
= wxT("EDIT");
171 if ( m_windowStyle
& wxTE_RICH
)
173 static bool s_errorGiven
= FALSE
; // MT-FIXME
175 // only give the error msg once if the DLL can't be loaded
178 // first try to load the RichEdit DLL (will do nothing if already
180 if ( !wxTheApp
->InitRichEdit() )
182 wxLogError(_("Impossible to create a rich edit control, "
183 "using simple text control instead."));
195 msStyle
|= ES_AUTOVSCROLL
;
197 windowClass
= wxT("RICHEDIT");
205 WXDWORD exStyle
= Determine3DEffects(WS_EX_CLIENTEDGE
, &want3D
);
207 // Even with extended styles, need to combine with WS_BORDER for them to
209 if ( want3D
|| wxStyleHasBorder(m_windowStyle
) )
210 msStyle
|= WS_BORDER
;
212 // NB: don't use pos and size as CreateWindowEx arguments because they
213 // might be -1 in which case we should use the default values (and
214 // SetSize called below takes care of it)
215 m_hWnd
= (WXHWND
)::CreateWindowEx(exStyle
,
225 wxCHECK_MSG( m_hWnd
, FALSE
, wxT("Failed to create text ctrl") );
230 Ctl3dSubclassCtl(GetHwnd());
238 // Have to enable events
239 ::SendMessage(GetHwnd(), EM_SETEVENTMASK
, 0,
240 ENM_CHANGE
| ENM_DROPFILES
| ENM_SELCHANGE
| ENM_UPDATE
);
244 SubclassWin(GetHWND());
246 // set font, position, size and initial value
247 wxFont
& fontParent
= parent
->GetFont();
248 if ( fontParent
.Ok() )
254 SetFont(wxSystemSettings::GetSystemFont(wxSYS_SYSTEM_FONT
));
257 // Causes a crash for Symantec C++ and WIN32 for some reason
258 #if !(defined(__SC__) && defined(__WIN32__))
259 if ( !value
.IsEmpty() )
265 SetSize(pos
.x
, pos
.y
, size
.x
, size
.y
);
270 // Make sure the window style (etc.) reflects the HWND style (roughly)
271 void wxTextCtrl::AdoptAttributesFromHWND()
273 wxWindow::AdoptAttributesFromHWND();
275 HWND hWnd
= GetHwnd();
276 long style
= GetWindowLong(hWnd
, GWL_STYLE
);
278 // retrieve the style to see whether this is an edit or richedit ctrl
282 GetClassName(hWnd
, buf
, WXSIZEOF(buf
));
284 if ( wxStricmp(buf
, wxT("EDIT")) == 0 )
288 #endif // wxUSE_RICHEDIT
290 if (style
& ES_MULTILINE
)
291 m_windowStyle
|= wxTE_MULTILINE
;
292 if (style
& ES_PASSWORD
)
293 m_windowStyle
|= wxTE_PASSWORD
;
294 if (style
& ES_READONLY
)
295 m_windowStyle
|= wxTE_READONLY
;
296 if (style
& ES_WANTRETURN
)
297 m_windowStyle
|= wxTE_PROCESS_ENTER
;
300 void wxTextCtrl::SetupColours()
302 // FIXME why is bg colour not inherited from parent?
303 SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_WINDOW
));
304 SetForegroundColour(GetParent()->GetForegroundColour());
307 // ----------------------------------------------------------------------------
308 // set/get the controls text
309 // ----------------------------------------------------------------------------
311 wxString
wxTextCtrl::GetValue() const
313 return wxGetWindowText(GetHWND());
316 void wxTextCtrl::SetValue(const wxString
& value
)
318 wxString valueDos
= wxTextFile::Translate(value
, wxTextFileType_Dos
);
320 if ( valueDos
!= GetValue() )
322 SetWindowText(GetHwnd(), valueDos
);
328 void wxTextCtrl::WriteText(const wxString
& value
)
330 wxString valueDos
= wxTextFile::Translate(value
, wxTextFileType_Dos
);
332 SendMessage(GetHwnd(), EM_REPLACESEL
, 0, (LPARAM
)valueDos
.c_str());
337 void wxTextCtrl::AppendText(const wxString
& text
)
339 SetInsertionPointEnd();
343 void wxTextCtrl::Clear()
345 SetWindowText(GetHwnd(), wxT(""));
348 // ----------------------------------------------------------------------------
349 // Clipboard operations
350 // ----------------------------------------------------------------------------
352 void wxTextCtrl::Copy()
356 HWND hWnd
= GetHwnd();
357 SendMessage(hWnd
, WM_COPY
, 0, 0L);
361 void wxTextCtrl::Cut()
365 HWND hWnd
= GetHwnd();
366 SendMessage(hWnd
, WM_CUT
, 0, 0L);
370 void wxTextCtrl::Paste()
374 HWND hWnd
= GetHwnd();
375 SendMessage(hWnd
, WM_PASTE
, 0, 0L);
379 bool wxTextCtrl::CanCopy() const
381 // Can copy if there's a selection
383 GetSelection(& from
, & to
);
387 bool wxTextCtrl::CanCut() const
389 // Can cut if there's a selection
391 GetSelection(& from
, & to
);
395 bool wxTextCtrl::CanPaste() const
400 int dataFormat
= 0; // 0 == any format
401 return (::SendMessage( GetHwnd(), EM_CANPASTE
, (WPARAM
) (UINT
) dataFormat
, 0) != 0);
407 // Standard edit control: check for straight text on clipboard
408 bool isTextAvailable
= FALSE
;
409 if ( ::OpenClipboard(GetHwndOf(wxTheApp
->GetTopWindow())) )
411 isTextAvailable
= (::IsClipboardFormatAvailable(CF_TEXT
) != 0);
415 return isTextAvailable
;
418 // ----------------------------------------------------------------------------
420 // ----------------------------------------------------------------------------
422 void wxTextCtrl::SetEditable(bool editable
)
424 HWND hWnd
= GetHwnd();
425 SendMessage(hWnd
, EM_SETREADONLY
, (WPARAM
)!editable
, (LPARAM
)0L);
428 void wxTextCtrl::SetInsertionPoint(long pos
)
430 HWND hWnd
= GetHwnd();
438 SendMessage(hWnd
, EM_EXSETSEL
, 0, (LPARAM
) &range
);
439 SendMessage(hWnd
, EM_SCROLLCARET
, (WPARAM
)0, (LPARAM
)0);
442 #endif // wxUSE_RICHEDIT
444 SendMessage(hWnd
, EM_SETSEL
, pos
, pos
);
445 SendMessage(hWnd
, EM_SCROLLCARET
, (WPARAM
)0, (LPARAM
)0);
448 SendMessage(hWnd
, EM_SETSEL
, 0, MAKELPARAM(pos
, pos
));
451 static const char *nothing
= "";
452 SendMessage(hWnd
, EM_REPLACESEL
, 0, (LPARAM
)nothing
);
455 void wxTextCtrl::SetInsertionPointEnd()
457 long pos
= GetLastPosition();
458 SetInsertionPoint(pos
);
461 long wxTextCtrl::GetInsertionPoint() const
469 SendMessage(GetHwnd(), EM_EXGETSEL
, 0, (LPARAM
) &range
);
474 DWORD Pos
= (DWORD
)SendMessage(GetHwnd(), EM_GETSEL
, 0, 0L);
478 long wxTextCtrl::GetLastPosition() const
480 HWND hWnd
= GetHwnd();
482 // Will always return a number > 0 (according to docs)
483 int noLines
= (int)SendMessage(hWnd
, EM_GETLINECOUNT
, (WPARAM
)0, (LPARAM
)0L);
485 // This gets the char index for the _beginning_ of the last line
486 int charIndex
= (int)SendMessage(hWnd
, EM_LINEINDEX
, (WPARAM
)(noLines
-1), (LPARAM
)0L);
488 // Get number of characters in the last line. We'll add this to the character
489 // index for the last line, 1st position.
490 int lineLength
= (int)SendMessage(hWnd
, EM_LINELENGTH
, (WPARAM
)charIndex
, (LPARAM
)0L);
492 return (long)(charIndex
+ lineLength
);
495 // If the return values from and to are the same, there is no
497 void wxTextCtrl::GetSelection(long* from
, long* to
) const
503 ::SendMessage(GetHwnd(), EM_EXGETSEL
, 0, (LPARAM
) (CHARRANGE
*) & charRange
);
505 *from
= charRange
.cpMin
;
506 *to
= charRange
.cpMax
;
511 DWORD dwStart
, dwEnd
;
512 WPARAM wParam
= (WPARAM
) (DWORD
*) & dwStart
; // receives starting position
513 LPARAM lParam
= (LPARAM
) (DWORD
*) & dwEnd
; // receives ending position
515 ::SendMessage(GetHwnd(), EM_GETSEL
, wParam
, lParam
);
521 bool wxTextCtrl::IsEditable() const
523 long style
= ::GetWindowLong(GetHwnd(), GWL_STYLE
);
525 return ((style
& ES_READONLY
) == 0);
528 // ----------------------------------------------------------------------------
530 // ----------------------------------------------------------------------------
532 void wxTextCtrl::Replace(long from
, long to
, const wxString
& value
)
535 HWND hWnd
= GetHwnd();
536 long fromChar
= from
;
539 // Set selection and remove it
541 SendMessage(hWnd
, EM_SETSEL
, fromChar
, toChar
);
543 SendMessage(hWnd
, EM_SETSEL
, (WPARAM
)0, (LPARAM
)MAKELONG(fromChar
, toChar
));
545 SendMessage(hWnd
, WM_CUT
, (WPARAM
)0, (LPARAM
)0);
547 // Now replace with 'value', by pasting.
548 wxSetClipboardData(wxDF_TEXT
, (wxObject
*) (const wxChar
*)value
, 0, 0);
550 // Paste into edit control
551 SendMessage(hWnd
, WM_PASTE
, (WPARAM
)0, (LPARAM
)0L);
553 wxFAIL_MSG("wxTextCtrl::Replace not implemented if wxUSE_CLIPBOARD is 0.");
557 void wxTextCtrl::Remove(long from
, long to
)
559 HWND hWnd
= GetHwnd();
560 long fromChar
= from
;
563 // Cut all selected text
565 SendMessage(hWnd
, EM_SETSEL
, fromChar
, toChar
);
567 SendMessage(hWnd
, EM_SETSEL
, (WPARAM
)0, (LPARAM
)MAKELONG(fromChar
, toChar
));
569 SendMessage(hWnd
, WM_CUT
, (WPARAM
)0, (LPARAM
)0);
572 void wxTextCtrl::SetSelection(long from
, long to
)
574 HWND hWnd
= GetHwnd();
575 long fromChar
= from
;
578 // if from and to are both -1, it means (in wxWindows) that all text should
579 // be selected. Translate into Windows convention
580 if ((from
== -1) && (to
== -1))
587 SendMessage(hWnd
, EM_SETSEL
, (WPARAM
)fromChar
, (LPARAM
)toChar
);
588 SendMessage(hWnd
, EM_SCROLLCARET
, (WPARAM
)0, (LPARAM
)0);
590 // WPARAM is 0: selection is scrolled into view
591 SendMessage(hWnd
, EM_SETSEL
, (WPARAM
)0, (LPARAM
)MAKELONG(fromChar
, toChar
));
595 bool wxTextCtrl::LoadFile(const wxString
& file
)
597 if ( wxTextCtrlBase::LoadFile(file
) )
599 // update the size limit if needed
608 bool wxTextCtrl::IsModified() const
610 return (SendMessage(GetHwnd(), EM_GETMODIFY
, 0, 0) != 0);
613 // Makes 'unmodified'
614 void wxTextCtrl::DiscardEdits()
616 SendMessage(GetHwnd(), EM_SETMODIFY
, FALSE
, 0L);
619 int wxTextCtrl::GetNumberOfLines() const
621 return (int)SendMessage(GetHwnd(), EM_GETLINECOUNT
, (WPARAM
)0, (LPARAM
)0);
624 long wxTextCtrl::XYToPosition(long x
, long y
) const
626 HWND hWnd
= GetHwnd();
628 // This gets the char index for the _beginning_ of this line
629 int charIndex
= (int)SendMessage(hWnd
, EM_LINEINDEX
, (WPARAM
)y
, (LPARAM
)0);
630 return (long)(x
+ charIndex
);
633 bool wxTextCtrl::PositionToXY(long pos
, long *x
, long *y
) const
635 HWND hWnd
= GetHwnd();
637 // This gets the line number containing the character
642 lineNo
= (int)SendMessage(hWnd
, EM_EXLINEFROMCHAR
, 0, (LPARAM
)pos
);
645 #endif // wxUSE_RICHEDIT
646 lineNo
= (int)SendMessage(hWnd
, EM_LINEFROMCHAR
, (WPARAM
)pos
, 0);
654 // This gets the char index for the _beginning_ of this line
655 int charIndex
= (int)SendMessage(hWnd
, EM_LINEINDEX
, (WPARAM
)lineNo
, (LPARAM
)0);
656 if ( charIndex
== -1 )
661 // The X position must therefore be the different between pos and charIndex
663 *x
= (long)(pos
- charIndex
);
670 void wxTextCtrl::ShowPosition(long pos
)
672 HWND hWnd
= GetHwnd();
674 // To scroll to a position, we pass the number of lines and characters
675 // to scroll *by*. This means that we need to:
676 // (1) Find the line position of the current line.
677 // (2) Find the line position of pos.
678 // (3) Scroll by (pos - current).
679 // For now, ignore the horizontal scrolling.
681 // Is this where scrolling is relative to - the line containing the caret?
682 // Or is the first visible line??? Try first visible line.
683 // int currentLineLineNo1 = (int)SendMessage(hWnd, EM_LINEFROMCHAR, (WPARAM)-1, (LPARAM)0L);
685 int currentLineLineNo
= (int)SendMessage(hWnd
, EM_GETFIRSTVISIBLELINE
, (WPARAM
)0, (LPARAM
)0L);
687 int specifiedLineLineNo
= (int)SendMessage(hWnd
, EM_LINEFROMCHAR
, (WPARAM
)pos
, (LPARAM
)0L);
689 int linesToScroll
= specifiedLineLineNo
- currentLineLineNo
;
691 if (linesToScroll
!= 0)
692 (void)SendMessage(hWnd
, EM_LINESCROLL
, (WPARAM
)0, (LPARAM
)linesToScroll
);
695 int wxTextCtrl::GetLineLength(long lineNo
) const
697 long charIndex
= XYToPosition(0, lineNo
);
698 int len
= (int)SendMessage(GetHwnd(), EM_LINELENGTH
, charIndex
, 0);
702 wxString
wxTextCtrl::GetLineText(long lineNo
) const
704 size_t len
= (size_t)GetLineLength(lineNo
) + 1;
705 char *buf
= (char *)malloc(len
);
707 int noChars
= (int)SendMessage(GetHwnd(), EM_GETLINE
, lineNo
, (LPARAM
)buf
);
717 // ----------------------------------------------------------------------------
719 // ----------------------------------------------------------------------------
721 void wxTextCtrl::Undo()
725 ::SendMessage(GetHwnd(), EM_UNDO
, 0, 0);
729 void wxTextCtrl::Redo()
733 // Same as Undo, since Undo undoes the undo, i.e. a redo.
734 ::SendMessage(GetHwnd(), EM_UNDO
, 0, 0);
738 bool wxTextCtrl::CanUndo() const
740 return (::SendMessage(GetHwnd(), EM_CANUNDO
, 0, 0) != 0);
743 bool wxTextCtrl::CanRedo() const
745 return (::SendMessage(GetHwnd(), EM_CANUNDO
, 0, 0) != 0);
748 // ----------------------------------------------------------------------------
749 // implemenation details
750 // ----------------------------------------------------------------------------
752 void wxTextCtrl::Command(wxCommandEvent
& event
)
754 SetValue(event
.GetString());
755 ProcessCommand (event
);
758 void wxTextCtrl::OnDropFiles(wxDropFilesEvent
& event
)
760 // By default, load the first file into the text window.
761 if (event
.GetNumberOfFiles() > 0)
763 LoadFile(event
.GetFiles()[0]);
767 void wxTextCtrl::OnChar(wxKeyEvent
& event
)
769 switch ( event
.KeyCode() )
772 if ( !(m_windowStyle
& wxTE_MULTILINE
) )
774 wxCommandEvent
event(wxEVT_COMMAND_TEXT_ENTER
, m_windowId
);
775 event
.SetEventObject( this );
776 if ( GetEventHandler()->ProcessEvent(event
) )
779 //else: multiline controls need Enter for themselves
784 // always produce navigation event - even if we process TAB
785 // ourselves the fact that we got here means that the user code
786 // decided to skip processing of this TAB - probably to let it
787 // do its default job.
789 // NB: Notice that Ctrl-Tab is handled elsewhere and Alt-Tab is
790 // handled by Windows
792 wxNavigationKeyEvent eventNav
;
793 eventNav
.SetDirection(!event
.ShiftDown());
794 eventNav
.SetWindowChange(FALSE
);
795 eventNav
.SetEventObject(this);
797 if ( GetEventHandler()->ProcessEvent(eventNav
) )
807 // don't just call event.Skip() because this will cause TABs and ENTERs
808 // be passed upwards and we don't always want this - instead process it
815 bool wxTextCtrl::MSWCommand(WXUINT param
, WXWORD
WXUNUSED(id
))
822 wxFocusEvent
event(param
== EN_KILLFOCUS
? wxEVT_KILL_FOCUS
825 event
.SetEventObject( this );
826 GetEventHandler()->ProcessEvent(event
);
832 wxCommandEvent
event(wxEVT_COMMAND_TEXT_UPDATED
, m_windowId
);
833 wxString
val(GetValue());
835 event
.m_commandString
= WXSTRINGCAST val
;
836 event
.SetEventObject( this );
837 ProcessCommand(event
);
842 // the text size limit has been hit - increase it
846 // the other notification messages are not processed
859 void wxTextCtrl::AdjustSpaceLimit()
862 unsigned int len
= ::GetWindowTextLength(GetHwnd()),
863 limit
= ::SendMessage(GetHwnd(), EM_GETLIMITTEXT
, 0, 0);
866 limit
= len
+ 0x8000; // 32Kb
869 if ( m_isRich
|| limit
> 0xffff )
871 if ( limit
> 0xffff )
873 ::SendMessage(GetHwnd(), EM_LIMITTEXT
, 0, limit
);
875 ::SendMessage(GetHwnd(), EM_LIMITTEXT
, limit
, 0);
880 bool wxTextCtrl::AcceptsFocus() const
882 // we don't want focus if we can't be edited
883 return IsEditable() && wxControl::AcceptsFocus();
886 wxSize
wxTextCtrl::DoGetBestSize() const
889 wxGetCharSize(GetHWND(), &cx
, &cy
, &GetFont());
891 int wText
= DEFAULT_ITEM_WIDTH
;
893 int hText
= EDIT_HEIGHT_FROM_CHAR_HEIGHT(cy
);
894 if ( m_windowStyle
& wxTE_MULTILINE
)
896 hText
*= wxMin(GetNumberOfLines(), 5);
898 //else: for single line control everything is ok
900 return wxSize(wText
, hText
);
903 // ----------------------------------------------------------------------------
904 // standard handlers for standard edit menu events
905 // ----------------------------------------------------------------------------
907 void wxTextCtrl::OnCut(wxCommandEvent
& event
)
912 void wxTextCtrl::OnCopy(wxCommandEvent
& event
)
917 void wxTextCtrl::OnPaste(wxCommandEvent
& event
)
922 void wxTextCtrl::OnUndo(wxCommandEvent
& event
)
927 void wxTextCtrl::OnRedo(wxCommandEvent
& event
)
932 void wxTextCtrl::OnUpdateCut(wxUpdateUIEvent
& event
)
934 event
.Enable( CanCut() );
937 void wxTextCtrl::OnUpdateCopy(wxUpdateUIEvent
& event
)
939 event
.Enable( CanCopy() );
942 void wxTextCtrl::OnUpdatePaste(wxUpdateUIEvent
& event
)
944 event
.Enable( CanPaste() );
947 void wxTextCtrl::OnUpdateUndo(wxUpdateUIEvent
& event
)
949 event
.Enable( CanUndo() );
952 void wxTextCtrl::OnUpdateRedo(wxUpdateUIEvent
& event
)
954 event
.Enable( CanRedo() );