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"
42 #include "wx/clipbrd.h"
45 #include "wx/textfile.h"
49 #include "wx/msw/private.h"
53 #include <sys/types.h>
65 #if !USE_SHARED_LIBRARY
67 // ----------------------------------------------------------------------------
68 // event tables and other macros
69 // ----------------------------------------------------------------------------
71 IMPLEMENT_DYNAMIC_CLASS(wxTextCtrl
, wxControl
)
73 BEGIN_EVENT_TABLE(wxTextCtrl
, wxControl
)
74 EVT_CHAR(wxTextCtrl::OnChar
)
75 EVT_DROP_FILES(wxTextCtrl::OnDropFiles
)
77 EVT_MENU(wxID_CUT
, wxTextCtrl::OnCut
)
78 EVT_MENU(wxID_COPY
, wxTextCtrl::OnCopy
)
79 EVT_MENU(wxID_PASTE
, wxTextCtrl::OnPaste
)
80 EVT_MENU(wxID_UNDO
, wxTextCtrl::OnUndo
)
81 EVT_MENU(wxID_REDO
, wxTextCtrl::OnRedo
)
83 EVT_UPDATE_UI(wxID_CUT
, wxTextCtrl::OnUpdateCut
)
84 EVT_UPDATE_UI(wxID_COPY
, wxTextCtrl::OnUpdateCopy
)
85 EVT_UPDATE_UI(wxID_PASTE
, wxTextCtrl::OnUpdatePaste
)
86 EVT_UPDATE_UI(wxID_UNDO
, wxTextCtrl::OnUpdateUndo
)
87 EVT_UPDATE_UI(wxID_REDO
, wxTextCtrl::OnUpdateRedo
)
90 #endif // USE_SHARED_LIBRARY
92 // ============================================================================
94 // ============================================================================
96 // ----------------------------------------------------------------------------
98 // ----------------------------------------------------------------------------
100 wxTextCtrl::wxTextCtrl()
107 bool wxTextCtrl::Create(wxWindow
*parent
, wxWindowID id
,
108 const wxString
& value
,
112 const wxValidator
& validator
,
113 const wxString
& name
)
115 // base initialization
116 if ( !CreateBase(parent
, id
, pos
, size
, style
, validator
, name
) )
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 wxT("wxTE_PROCESS_ENTER style is ignored for multiline "
132 "text controls (they always process it)") );
134 msStyle
|= ES_MULTILINE
| ES_WANTRETURN
;
135 if ((m_windowStyle
& wxTE_NO_VSCROLL
) == 0)
136 msStyle
|= WS_VSCROLL
;
137 m_windowStyle
|= wxTE_PROCESS_ENTER
;
140 msStyle
|= ES_AUTOHSCROLL
;
142 if (m_windowStyle
& wxHSCROLL
)
143 msStyle
|= (WS_HSCROLL
| ES_AUTOHSCROLL
);
145 if (m_windowStyle
& wxTE_READONLY
)
146 msStyle
|= ES_READONLY
;
148 if (m_windowStyle
& wxHSCROLL
)
149 msStyle
|= (WS_HSCROLL
| ES_AUTOHSCROLL
);
150 if (m_windowStyle
& wxTE_PASSWORD
) // hidden input
151 msStyle
|= ES_PASSWORD
;
153 // we always want the characters and the arrows
154 m_lDlgCode
= DLGC_WANTCHARS
| DLGC_WANTARROWS
;
156 // we may have several different cases:
157 // 1. normal case: both TAB and ENTER are used for dialog navigation
158 // 2. ctrl which wants TAB for itself: ENTER is used to pass to the next
159 // control in the dialog
160 // 3. ctrl which wants ENTER for itself: TAB is used for dialog navigation
161 // 4. ctrl which wants both TAB and ENTER: Ctrl-ENTER is used to pass to
163 if ( m_windowStyle
& wxTE_PROCESS_ENTER
)
164 m_lDlgCode
|= DLGC_WANTMESSAGE
;
165 if ( m_windowStyle
& wxTE_PROCESS_TAB
)
166 m_lDlgCode
|= DLGC_WANTTAB
;
168 // do create the control - either an EDIT or RICHEDIT
169 const wxChar
*windowClass
= wxT("EDIT");
172 if ( m_windowStyle
& wxTE_RICH
)
174 static bool s_errorGiven
= FALSE
; // MT-FIXME
176 // only give the error msg once if the DLL can't be loaded
179 // first try to load the RichEdit DLL (will do nothing if already
181 if ( !wxTheApp
->InitRichEdit() )
183 wxLogError(_("Impossible to create a rich edit control, "
184 "using simple text control instead."));
196 msStyle
|= ES_AUTOVSCROLL
;
198 windowClass
= wxT("RICHEDIT");
206 WXDWORD exStyle
= Determine3DEffects(WS_EX_CLIENTEDGE
, &want3D
);
208 // Even with extended styles, need to combine with WS_BORDER for them to
210 if ( want3D
|| wxStyleHasBorder(m_windowStyle
) )
211 msStyle
|= WS_BORDER
;
213 // NB: don't use pos and size as CreateWindowEx arguments because they
214 // might be -1 in which case we should use the default values (and
215 // SetSize called below takes care of it)
216 m_hWnd
= (WXHWND
)::CreateWindowEx(exStyle
,
226 wxCHECK_MSG( m_hWnd
, FALSE
, wxT("Failed to create text ctrl") );
231 Ctl3dSubclassCtl(GetHwnd());
239 // Have to enable events
240 ::SendMessage(GetHwnd(), EM_SETEVENTMASK
, 0,
241 ENM_CHANGE
| ENM_DROPFILES
| ENM_SELCHANGE
| ENM_UPDATE
);
245 SubclassWin(GetHWND());
247 // set font, position, size and initial value
248 wxFont
& fontParent
= parent
->GetFont();
249 if ( fontParent
.Ok() )
255 SetFont(wxSystemSettings::GetSystemFont(wxSYS_SYSTEM_FONT
));
258 // Causes a crash for Symantec C++ and WIN32 for some reason
259 #if !(defined(__SC__) && defined(__WIN32__))
260 if ( !value
.IsEmpty() )
266 SetSize(pos
.x
, pos
.y
, size
.x
, size
.y
);
271 // Make sure the window style (etc.) reflects the HWND style (roughly)
272 void wxTextCtrl::AdoptAttributesFromHWND()
274 wxWindow::AdoptAttributesFromHWND();
276 HWND hWnd
= GetHwnd();
277 long style
= GetWindowLong(hWnd
, GWL_STYLE
);
279 // retrieve the style to see whether this is an edit or richedit ctrl
283 GetClassName(hWnd
, buf
, WXSIZEOF(buf
));
285 if ( wxStricmp(buf
, wxT("EDIT")) == 0 )
289 #endif // wxUSE_RICHEDIT
291 if (style
& ES_MULTILINE
)
292 m_windowStyle
|= wxTE_MULTILINE
;
293 if (style
& ES_PASSWORD
)
294 m_windowStyle
|= wxTE_PASSWORD
;
295 if (style
& ES_READONLY
)
296 m_windowStyle
|= wxTE_READONLY
;
297 if (style
& ES_WANTRETURN
)
298 m_windowStyle
|= wxTE_PROCESS_ENTER
;
301 void wxTextCtrl::SetupColours()
303 // FIXME why is bg colour not inherited from parent?
304 SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_WINDOW
));
305 SetForegroundColour(GetParent()->GetForegroundColour());
308 // ----------------------------------------------------------------------------
309 // set/get the controls text
310 // ----------------------------------------------------------------------------
312 wxString
wxTextCtrl::GetValue() const
314 return wxGetWindowText(GetHWND());
317 void wxTextCtrl::SetValue(const wxString
& value
)
319 wxString valueDos
= wxTextFile::Translate(value
, wxTextFileType_Dos
);
321 if ( valueDos
!= GetValue() )
323 SetWindowText(GetHwnd(), valueDos
);
329 void wxTextCtrl::WriteText(const wxString
& value
)
331 wxString valueDos
= wxTextFile::Translate(value
, wxTextFileType_Dos
);
333 SendMessage(GetHwnd(), EM_REPLACESEL
, 0, (LPARAM
)valueDos
.c_str());
338 void wxTextCtrl::AppendText(const wxString
& text
)
340 SetInsertionPointEnd();
344 void wxTextCtrl::Clear()
346 SetWindowText(GetHwnd(), wxT(""));
349 // ----------------------------------------------------------------------------
350 // Clipboard operations
351 // ----------------------------------------------------------------------------
353 void wxTextCtrl::Copy()
357 HWND hWnd
= GetHwnd();
358 SendMessage(hWnd
, WM_COPY
, 0, 0L);
362 void wxTextCtrl::Cut()
366 HWND hWnd
= GetHwnd();
367 SendMessage(hWnd
, WM_CUT
, 0, 0L);
371 void wxTextCtrl::Paste()
375 HWND hWnd
= GetHwnd();
376 SendMessage(hWnd
, WM_PASTE
, 0, 0L);
380 bool wxTextCtrl::CanCopy() const
382 // Can copy if there's a selection
384 GetSelection(& from
, & to
);
388 bool wxTextCtrl::CanCut() const
390 // Can cut if there's a selection
392 GetSelection(& from
, & to
);
396 bool wxTextCtrl::CanPaste() const
401 int dataFormat
= 0; // 0 == any format
402 return (::SendMessage( GetHwnd(), EM_CANPASTE
, (WPARAM
) (UINT
) dataFormat
, 0) != 0);
408 // Standard edit control: check for straight text on clipboard
409 bool isTextAvailable
= FALSE
;
410 if ( ::OpenClipboard(GetHwndOf(wxTheApp
->GetTopWindow())) )
412 isTextAvailable
= (::IsClipboardFormatAvailable(CF_TEXT
) != 0);
416 return isTextAvailable
;
419 // ----------------------------------------------------------------------------
421 // ----------------------------------------------------------------------------
423 void wxTextCtrl::SetEditable(bool editable
)
425 HWND hWnd
= GetHwnd();
426 SendMessage(hWnd
, EM_SETREADONLY
, (WPARAM
)!editable
, (LPARAM
)0L);
429 void wxTextCtrl::SetInsertionPoint(long pos
)
431 HWND hWnd
= GetHwnd();
439 SendMessage(hWnd
, EM_EXSETSEL
, 0, (LPARAM
) &range
);
440 SendMessage(hWnd
, EM_SCROLLCARET
, (WPARAM
)0, (LPARAM
)0);
443 #endif // wxUSE_RICHEDIT
445 SendMessage(hWnd
, EM_SETSEL
, pos
, pos
);
446 SendMessage(hWnd
, EM_SCROLLCARET
, (WPARAM
)0, (LPARAM
)0);
449 SendMessage(hWnd
, EM_SETSEL
, 0, MAKELPARAM(pos
, pos
));
452 static const char *nothing
= "";
453 SendMessage(hWnd
, EM_REPLACESEL
, 0, (LPARAM
)nothing
);
456 void wxTextCtrl::SetInsertionPointEnd()
458 long pos
= GetLastPosition();
459 SetInsertionPoint(pos
);
462 long wxTextCtrl::GetInsertionPoint() const
470 SendMessage(GetHwnd(), EM_EXGETSEL
, 0, (LPARAM
) &range
);
475 DWORD Pos
= (DWORD
)SendMessage(GetHwnd(), EM_GETSEL
, 0, 0L);
479 long wxTextCtrl::GetLastPosition() const
481 HWND hWnd
= GetHwnd();
483 // Will always return a number > 0 (according to docs)
484 int noLines
= (int)SendMessage(hWnd
, EM_GETLINECOUNT
, (WPARAM
)0, (LPARAM
)0L);
486 // This gets the char index for the _beginning_ of the last line
487 int charIndex
= (int)SendMessage(hWnd
, EM_LINEINDEX
, (WPARAM
)(noLines
-1), (LPARAM
)0L);
489 // Get number of characters in the last line. We'll add this to the character
490 // index for the last line, 1st position.
491 int lineLength
= (int)SendMessage(hWnd
, EM_LINELENGTH
, (WPARAM
)charIndex
, (LPARAM
)0L);
493 return (long)(charIndex
+ lineLength
);
496 // If the return values from and to are the same, there is no
498 void wxTextCtrl::GetSelection(long* from
, long* to
) const
504 ::SendMessage(GetHwnd(), EM_EXGETSEL
, 0, (LPARAM
) (CHARRANGE
*) & charRange
);
506 *from
= charRange
.cpMin
;
507 *to
= charRange
.cpMax
;
512 DWORD dwStart
, dwEnd
;
513 WPARAM wParam
= (WPARAM
) (DWORD
*) & dwStart
; // receives starting position
514 LPARAM lParam
= (LPARAM
) (DWORD
*) & dwEnd
; // receives ending position
516 ::SendMessage(GetHwnd(), EM_GETSEL
, wParam
, lParam
);
522 bool wxTextCtrl::IsEditable() const
524 long style
= ::GetWindowLong(GetHwnd(), GWL_STYLE
);
526 return ((style
& ES_READONLY
) == 0);
529 // ----------------------------------------------------------------------------
531 // ----------------------------------------------------------------------------
533 void wxTextCtrl::Replace(long from
, long to
, const wxString
& value
)
536 HWND hWnd
= GetHwnd();
537 long fromChar
= from
;
540 // Set selection and remove it
542 SendMessage(hWnd
, EM_SETSEL
, fromChar
, toChar
);
544 SendMessage(hWnd
, EM_SETSEL
, (WPARAM
)0, (LPARAM
)MAKELONG(fromChar
, toChar
));
546 SendMessage(hWnd
, WM_CUT
, (WPARAM
)0, (LPARAM
)0);
548 // Now replace with 'value', by pasting.
549 wxSetClipboardData(wxDF_TEXT
, (wxObject
*) (const wxChar
*)value
, 0, 0);
551 // Paste into edit control
552 SendMessage(hWnd
, WM_PASTE
, (WPARAM
)0, (LPARAM
)0L);
554 wxFAIL_MSG("wxTextCtrl::Replace not implemented if wxUSE_CLIPBOARD is 0.");
558 void wxTextCtrl::Remove(long from
, long to
)
560 HWND hWnd
= GetHwnd();
561 long fromChar
= from
;
564 // Cut all selected text
566 SendMessage(hWnd
, EM_SETSEL
, fromChar
, toChar
);
568 SendMessage(hWnd
, EM_SETSEL
, (WPARAM
)0, (LPARAM
)MAKELONG(fromChar
, toChar
));
570 SendMessage(hWnd
, WM_CUT
, (WPARAM
)0, (LPARAM
)0);
573 void wxTextCtrl::SetSelection(long from
, long to
)
575 HWND hWnd
= GetHwnd();
576 long fromChar
= from
;
579 // if from and to are both -1, it means (in wxWindows) that all text should
580 // be selected. Translate into Windows convention
581 if ((from
== -1) && (to
== -1))
588 SendMessage(hWnd
, EM_SETSEL
, (WPARAM
)fromChar
, (LPARAM
)toChar
);
589 SendMessage(hWnd
, EM_SCROLLCARET
, (WPARAM
)0, (LPARAM
)0);
591 // WPARAM is 0: selection is scrolled into view
592 SendMessage(hWnd
, EM_SETSEL
, (WPARAM
)0, (LPARAM
)MAKELONG(fromChar
, toChar
));
596 bool wxTextCtrl::LoadFile(const wxString
& file
)
598 if ( wxTextCtrlBase::LoadFile(file
) )
600 // update the size limit if needed
609 bool wxTextCtrl::IsModified() const
611 return (SendMessage(GetHwnd(), EM_GETMODIFY
, 0, 0) != 0);
614 // Makes 'unmodified'
615 void wxTextCtrl::DiscardEdits()
617 SendMessage(GetHwnd(), EM_SETMODIFY
, FALSE
, 0L);
620 int wxTextCtrl::GetNumberOfLines() const
622 return (int)SendMessage(GetHwnd(), EM_GETLINECOUNT
, (WPARAM
)0, (LPARAM
)0);
625 long wxTextCtrl::XYToPosition(long x
, long y
) const
627 HWND hWnd
= GetHwnd();
629 // This gets the char index for the _beginning_ of this line
630 int charIndex
= (int)SendMessage(hWnd
, EM_LINEINDEX
, (WPARAM
)y
, (LPARAM
)0);
631 return (long)(x
+ charIndex
);
634 bool wxTextCtrl::PositionToXY(long pos
, long *x
, long *y
) const
636 HWND hWnd
= GetHwnd();
638 // This gets the line number containing the character
643 lineNo
= (int)SendMessage(hWnd
, EM_EXLINEFROMCHAR
, 0, (LPARAM
)pos
);
646 #endif // wxUSE_RICHEDIT
647 lineNo
= (int)SendMessage(hWnd
, EM_LINEFROMCHAR
, (WPARAM
)pos
, 0);
655 // This gets the char index for the _beginning_ of this line
656 int charIndex
= (int)SendMessage(hWnd
, EM_LINEINDEX
, (WPARAM
)lineNo
, (LPARAM
)0);
657 if ( charIndex
== -1 )
662 // The X position must therefore be the different between pos and charIndex
664 *x
= (long)(pos
- charIndex
);
671 void wxTextCtrl::ShowPosition(long pos
)
673 HWND hWnd
= GetHwnd();
675 // To scroll to a position, we pass the number of lines and characters
676 // to scroll *by*. This means that we need to:
677 // (1) Find the line position of the current line.
678 // (2) Find the line position of pos.
679 // (3) Scroll by (pos - current).
680 // For now, ignore the horizontal scrolling.
682 // Is this where scrolling is relative to - the line containing the caret?
683 // Or is the first visible line??? Try first visible line.
684 // int currentLineLineNo1 = (int)SendMessage(hWnd, EM_LINEFROMCHAR, (WPARAM)-1, (LPARAM)0L);
686 int currentLineLineNo
= (int)SendMessage(hWnd
, EM_GETFIRSTVISIBLELINE
, (WPARAM
)0, (LPARAM
)0L);
688 int specifiedLineLineNo
= (int)SendMessage(hWnd
, EM_LINEFROMCHAR
, (WPARAM
)pos
, (LPARAM
)0L);
690 int linesToScroll
= specifiedLineLineNo
- currentLineLineNo
;
692 if (linesToScroll
!= 0)
693 (void)SendMessage(hWnd
, EM_LINESCROLL
, (WPARAM
)0, (LPARAM
)linesToScroll
);
696 int wxTextCtrl::GetLineLength(long lineNo
) const
698 long charIndex
= XYToPosition(0, lineNo
);
699 int len
= (int)SendMessage(GetHwnd(), EM_LINELENGTH
, charIndex
, 0);
703 wxString
wxTextCtrl::GetLineText(long lineNo
) const
705 size_t len
= (size_t)GetLineLength(lineNo
) + 1;
706 char *buf
= (char *)malloc(len
);
708 int noChars
= (int)SendMessage(GetHwnd(), EM_GETLINE
, lineNo
, (LPARAM
)buf
);
718 // ----------------------------------------------------------------------------
720 // ----------------------------------------------------------------------------
722 void wxTextCtrl::Undo()
726 ::SendMessage(GetHwnd(), EM_UNDO
, 0, 0);
730 void wxTextCtrl::Redo()
734 // Same as Undo, since Undo undoes the undo, i.e. a redo.
735 ::SendMessage(GetHwnd(), EM_UNDO
, 0, 0);
739 bool wxTextCtrl::CanUndo() const
741 return (::SendMessage(GetHwnd(), EM_CANUNDO
, 0, 0) != 0);
744 bool wxTextCtrl::CanRedo() const
746 return (::SendMessage(GetHwnd(), EM_CANUNDO
, 0, 0) != 0);
749 // ----------------------------------------------------------------------------
750 // implemenation details
751 // ----------------------------------------------------------------------------
753 void wxTextCtrl::Command(wxCommandEvent
& event
)
755 SetValue(event
.GetString());
756 ProcessCommand (event
);
759 void wxTextCtrl::OnDropFiles(wxDropFilesEvent
& event
)
761 // By default, load the first file into the text window.
762 if (event
.GetNumberOfFiles() > 0)
764 LoadFile(event
.GetFiles()[0]);
768 void wxTextCtrl::OnChar(wxKeyEvent
& event
)
770 switch ( event
.KeyCode() )
773 if ( !(m_windowStyle
& wxTE_MULTILINE
) )
775 wxCommandEvent
event(wxEVT_COMMAND_TEXT_ENTER
, m_windowId
);
776 event
.SetEventObject( this );
777 if ( GetEventHandler()->ProcessEvent(event
) )
780 //else: multiline controls need Enter for themselves
785 // always produce navigation event - even if we process TAB
786 // ourselves the fact that we got here means that the user code
787 // decided to skip processing of this TAB - probably to let it
788 // do its default job.
790 // NB: Notice that Ctrl-Tab is handled elsewhere and Alt-Tab is
791 // handled by Windows
793 wxNavigationKeyEvent eventNav
;
794 eventNav
.SetDirection(!event
.ShiftDown());
795 eventNav
.SetWindowChange(FALSE
);
796 eventNav
.SetEventObject(this);
798 if ( GetEventHandler()->ProcessEvent(eventNav
) )
808 // don't just call event.Skip() because this will cause TABs and ENTERs
809 // be passed upwards and we don't always want this - instead process it
816 bool wxTextCtrl::MSWCommand(WXUINT param
, WXWORD
WXUNUSED(id
))
823 wxFocusEvent
event(param
== EN_KILLFOCUS
? wxEVT_KILL_FOCUS
826 event
.SetEventObject( this );
827 GetEventHandler()->ProcessEvent(event
);
833 wxCommandEvent
event(wxEVT_COMMAND_TEXT_UPDATED
, m_windowId
);
834 wxString
val(GetValue());
836 event
.m_commandString
= WXSTRINGCAST val
;
837 event
.SetEventObject( this );
838 ProcessCommand(event
);
843 // the text size limit has been hit - increase it
847 // the other notification messages are not processed
860 void wxTextCtrl::AdjustSpaceLimit()
863 unsigned int len
= ::GetWindowTextLength(GetHwnd()),
864 limit
= ::SendMessage(GetHwnd(), EM_GETLIMITTEXT
, 0, 0);
867 limit
= len
+ 0x8000; // 32Kb
870 if ( m_isRich
|| limit
> 0xffff )
872 if ( limit
> 0xffff )
874 ::SendMessage(GetHwnd(), EM_LIMITTEXT
, 0, limit
);
876 ::SendMessage(GetHwnd(), EM_LIMITTEXT
, limit
, 0);
881 bool wxTextCtrl::AcceptsFocus() const
883 // we don't want focus if we can't be edited
884 return IsEditable() && wxControl::AcceptsFocus();
887 wxSize
wxTextCtrl::DoGetBestSize() const
890 wxGetCharSize(GetHWND(), &cx
, &cy
, &GetFont());
892 int wText
= DEFAULT_ITEM_WIDTH
;
894 int hText
= EDIT_HEIGHT_FROM_CHAR_HEIGHT(cy
);
895 if ( m_windowStyle
& wxTE_MULTILINE
)
897 hText
*= wxMin(GetNumberOfLines(), 5);
899 //else: for single line control everything is ok
901 return wxSize(wText
, hText
);
904 // ----------------------------------------------------------------------------
905 // standard handlers for standard edit menu events
906 // ----------------------------------------------------------------------------
908 void wxTextCtrl::OnCut(wxCommandEvent
& event
)
913 void wxTextCtrl::OnCopy(wxCommandEvent
& event
)
918 void wxTextCtrl::OnPaste(wxCommandEvent
& event
)
923 void wxTextCtrl::OnUndo(wxCommandEvent
& event
)
928 void wxTextCtrl::OnRedo(wxCommandEvent
& event
)
933 void wxTextCtrl::OnUpdateCut(wxUpdateUIEvent
& event
)
935 event
.Enable( CanCut() );
938 void wxTextCtrl::OnUpdateCopy(wxUpdateUIEvent
& event
)
940 event
.Enable( CanCopy() );
943 void wxTextCtrl::OnUpdatePaste(wxUpdateUIEvent
& event
)
945 event
.Enable( CanPaste() );
948 void wxTextCtrl::OnUpdateUndo(wxUpdateUIEvent
& event
)
950 event
.Enable( CanUndo() );
953 void wxTextCtrl::OnUpdateRedo(wxUpdateUIEvent
& event
)
955 event
.Enable( CanRedo() );