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>
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
)
90 // ============================================================================
92 // ============================================================================
94 // ----------------------------------------------------------------------------
96 // ----------------------------------------------------------------------------
98 wxTextCtrl::wxTextCtrl()
105 bool wxTextCtrl::Create(wxWindow
*parent
, wxWindowID id
,
106 const wxString
& value
,
110 const wxValidator
& validator
,
111 const wxString
& name
)
113 // base initialization
114 if ( !CreateBase(parent
, id
, pos
, size
, style
, validator
, name
) )
118 parent
->AddChild(this);
123 // translate wxWin style flags to MSW ones, checking for consistency while
125 long msStyle
= ES_LEFT
| WS_VISIBLE
| WS_CHILD
| WS_TABSTOP
;
126 if ( m_windowStyle
& wxTE_MULTILINE
)
128 wxASSERT_MSG( !(m_windowStyle
& wxTE_PROCESS_ENTER
),
129 wxT("wxTE_PROCESS_ENTER style is ignored for multiline "
130 "text controls (they always process it)") );
132 msStyle
|= ES_MULTILINE
| ES_WANTRETURN
;
133 if ((m_windowStyle
& wxTE_NO_VSCROLL
) == 0)
134 msStyle
|= WS_VSCROLL
;
135 m_windowStyle
|= wxTE_PROCESS_ENTER
;
138 msStyle
|= ES_AUTOHSCROLL
;
140 if (m_windowStyle
& wxHSCROLL
)
141 msStyle
|= (WS_HSCROLL
| ES_AUTOHSCROLL
);
143 if (m_windowStyle
& wxTE_READONLY
)
144 msStyle
|= ES_READONLY
;
146 if (m_windowStyle
& wxHSCROLL
)
147 msStyle
|= (WS_HSCROLL
| ES_AUTOHSCROLL
);
148 if (m_windowStyle
& wxTE_PASSWORD
) // hidden input
149 msStyle
|= ES_PASSWORD
;
151 // we always want the characters and the arrows
152 m_lDlgCode
= DLGC_WANTCHARS
| DLGC_WANTARROWS
;
154 // we may have several different cases:
155 // 1. normal case: both TAB and ENTER are used for dialog navigation
156 // 2. ctrl which wants TAB for itself: ENTER is used to pass to the next
157 // control in the dialog
158 // 3. ctrl which wants ENTER for itself: TAB is used for dialog navigation
159 // 4. ctrl which wants both TAB and ENTER: Ctrl-ENTER is used to pass to
161 if ( m_windowStyle
& wxTE_PROCESS_ENTER
)
162 m_lDlgCode
|= DLGC_WANTMESSAGE
;
163 if ( m_windowStyle
& wxTE_PROCESS_TAB
)
164 m_lDlgCode
|= DLGC_WANTTAB
;
166 // do create the control - either an EDIT or RICHEDIT
167 const wxChar
*windowClass
= wxT("EDIT");
170 if ( m_windowStyle
& wxTE_RICH
)
172 static bool s_errorGiven
= FALSE
; // MT-FIXME
174 // only give the error msg once if the DLL can't be loaded
177 // first try to load the RichEdit DLL (will do nothing if already
179 if ( !wxTheApp
->InitRichEdit() )
181 wxLogError(_("Impossible to create a rich edit control, "
182 "using simple text control instead."));
194 msStyle
|= ES_AUTOVSCROLL
;
196 windowClass
= wxT("RICHEDIT");
204 WXDWORD exStyle
= Determine3DEffects(WS_EX_CLIENTEDGE
, &want3D
);
206 // Even with extended styles, need to combine with WS_BORDER for them to
208 if ( want3D
|| wxStyleHasBorder(m_windowStyle
) )
209 msStyle
|= WS_BORDER
;
211 // NB: don't use pos and size as CreateWindowEx arguments because they
212 // might be -1 in which case we should use the default values (and
213 // SetSize called below takes care of it)
214 m_hWnd
= (WXHWND
)::CreateWindowEx(exStyle
,
224 wxCHECK_MSG( m_hWnd
, FALSE
, wxT("Failed to create text ctrl") );
229 Ctl3dSubclassCtl(GetHwnd());
237 // Have to enable events
238 ::SendMessage(GetHwnd(), EM_SETEVENTMASK
, 0,
239 ENM_CHANGE
| ENM_DROPFILES
| ENM_SELCHANGE
| ENM_UPDATE
);
243 SubclassWin(GetHWND());
245 // set font, position, size and initial value
246 wxFont
& fontParent
= parent
->GetFont();
247 if ( fontParent
.Ok() )
253 SetFont(wxSystemSettings::GetSystemFont(wxSYS_SYSTEM_FONT
));
256 // Causes a crash for Symantec C++ and WIN32 for some reason
257 #if !(defined(__SC__) && defined(__WIN32__))
258 if ( !value
.IsEmpty() )
264 SetSize(pos
.x
, pos
.y
, size
.x
, size
.y
);
269 // Make sure the window style (etc.) reflects the HWND style (roughly)
270 void wxTextCtrl::AdoptAttributesFromHWND()
272 wxWindow::AdoptAttributesFromHWND();
274 HWND hWnd
= GetHwnd();
275 long style
= GetWindowLong(hWnd
, GWL_STYLE
);
277 // retrieve the style to see whether this is an edit or richedit ctrl
281 GetClassName(hWnd
, buf
, WXSIZEOF(buf
));
283 if ( wxStricmp(buf
, wxT("EDIT")) == 0 )
287 #endif // wxUSE_RICHEDIT
289 if (style
& ES_MULTILINE
)
290 m_windowStyle
|= wxTE_MULTILINE
;
291 if (style
& ES_PASSWORD
)
292 m_windowStyle
|= wxTE_PASSWORD
;
293 if (style
& ES_READONLY
)
294 m_windowStyle
|= wxTE_READONLY
;
295 if (style
& ES_WANTRETURN
)
296 m_windowStyle
|= wxTE_PROCESS_ENTER
;
299 void wxTextCtrl::SetupColours()
301 // FIXME why is bg colour not inherited from parent?
302 SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_WINDOW
));
303 SetForegroundColour(GetParent()->GetForegroundColour());
306 // ----------------------------------------------------------------------------
307 // set/get the controls text
308 // ----------------------------------------------------------------------------
310 wxString
wxTextCtrl::GetValue() const
312 return wxGetWindowText(GetHWND());
315 void wxTextCtrl::SetValue(const wxString
& value
)
317 wxString valueDos
= wxTextFile::Translate(value
, wxTextFileType_Dos
);
319 if ( valueDos
!= GetValue() )
321 SetWindowText(GetHwnd(), valueDos
);
327 void wxTextCtrl::WriteText(const wxString
& value
)
329 wxString valueDos
= wxTextFile::Translate(value
, wxTextFileType_Dos
);
331 SendMessage(GetHwnd(), EM_REPLACESEL
, 0, (LPARAM
)valueDos
.c_str());
336 void wxTextCtrl::AppendText(const wxString
& text
)
338 SetInsertionPointEnd();
342 void wxTextCtrl::Clear()
344 SetWindowText(GetHwnd(), wxT(""));
347 // ----------------------------------------------------------------------------
348 // Clipboard operations
349 // ----------------------------------------------------------------------------
351 void wxTextCtrl::Copy()
355 HWND hWnd
= GetHwnd();
356 SendMessage(hWnd
, WM_COPY
, 0, 0L);
360 void wxTextCtrl::Cut()
364 HWND hWnd
= GetHwnd();
365 SendMessage(hWnd
, WM_CUT
, 0, 0L);
369 void wxTextCtrl::Paste()
373 HWND hWnd
= GetHwnd();
374 SendMessage(hWnd
, WM_PASTE
, 0, 0L);
378 bool wxTextCtrl::CanCopy() const
380 // Can copy if there's a selection
382 GetSelection(& from
, & to
);
386 bool wxTextCtrl::CanCut() const
388 // Can cut if there's a selection
390 GetSelection(& from
, & to
);
394 bool wxTextCtrl::CanPaste() const
399 int dataFormat
= 0; // 0 == any format
400 return (::SendMessage( GetHwnd(), EM_CANPASTE
, (WPARAM
) (UINT
) dataFormat
, 0) != 0);
406 // Standard edit control: check for straight text on clipboard
407 bool isTextAvailable
= FALSE
;
408 if ( ::OpenClipboard(GetHwndOf(wxTheApp
->GetTopWindow())) )
410 isTextAvailable
= (::IsClipboardFormatAvailable(CF_TEXT
) != 0);
414 return isTextAvailable
;
417 // ----------------------------------------------------------------------------
419 // ----------------------------------------------------------------------------
421 void wxTextCtrl::SetEditable(bool editable
)
423 HWND hWnd
= GetHwnd();
424 SendMessage(hWnd
, EM_SETREADONLY
, (WPARAM
)!editable
, (LPARAM
)0L);
427 void wxTextCtrl::SetInsertionPoint(long pos
)
429 HWND hWnd
= GetHwnd();
437 SendMessage(hWnd
, EM_EXSETSEL
, 0, (LPARAM
) &range
);
438 SendMessage(hWnd
, EM_SCROLLCARET
, (WPARAM
)0, (LPARAM
)0);
441 #endif // wxUSE_RICHEDIT
443 SendMessage(hWnd
, EM_SETSEL
, pos
, pos
);
444 SendMessage(hWnd
, EM_SCROLLCARET
, (WPARAM
)0, (LPARAM
)0);
447 SendMessage(hWnd
, EM_SETSEL
, 0, MAKELPARAM(pos
, pos
));
450 static const char *nothing
= "";
451 SendMessage(hWnd
, EM_REPLACESEL
, 0, (LPARAM
)nothing
);
454 void wxTextCtrl::SetInsertionPointEnd()
456 long pos
= GetLastPosition();
457 SetInsertionPoint(pos
);
460 long wxTextCtrl::GetInsertionPoint() const
468 SendMessage(GetHwnd(), EM_EXGETSEL
, 0, (LPARAM
) &range
);
473 DWORD Pos
= (DWORD
)SendMessage(GetHwnd(), EM_GETSEL
, 0, 0L);
477 long wxTextCtrl::GetLastPosition() const
479 HWND hWnd
= GetHwnd();
481 // Will always return a number > 0 (according to docs)
482 int noLines
= (int)SendMessage(hWnd
, EM_GETLINECOUNT
, (WPARAM
)0, (LPARAM
)0L);
484 // This gets the char index for the _beginning_ of the last line
485 int charIndex
= (int)SendMessage(hWnd
, EM_LINEINDEX
, (WPARAM
)(noLines
-1), (LPARAM
)0L);
487 // Get number of characters in the last line. We'll add this to the character
488 // index for the last line, 1st position.
489 int lineLength
= (int)SendMessage(hWnd
, EM_LINELENGTH
, (WPARAM
)charIndex
, (LPARAM
)0L);
491 return (long)(charIndex
+ lineLength
);
494 // If the return values from and to are the same, there is no
496 void wxTextCtrl::GetSelection(long* from
, long* to
) const
502 ::SendMessage(GetHwnd(), EM_EXGETSEL
, 0, (LPARAM
) (CHARRANGE
*) & charRange
);
504 *from
= charRange
.cpMin
;
505 *to
= charRange
.cpMax
;
510 DWORD dwStart
, dwEnd
;
511 WPARAM wParam
= (WPARAM
) (DWORD
*) & dwStart
; // receives starting position
512 LPARAM lParam
= (LPARAM
) (DWORD
*) & dwEnd
; // receives ending position
514 ::SendMessage(GetHwnd(), EM_GETSEL
, wParam
, lParam
);
520 bool wxTextCtrl::IsEditable() const
522 long style
= ::GetWindowLong(GetHwnd(), GWL_STYLE
);
524 return ((style
& ES_READONLY
) == 0);
527 // ----------------------------------------------------------------------------
529 // ----------------------------------------------------------------------------
531 void wxTextCtrl::Replace(long from
, long to
, const wxString
& value
)
534 HWND hWnd
= GetHwnd();
535 long fromChar
= from
;
538 // Set selection and remove it
540 SendMessage(hWnd
, EM_SETSEL
, fromChar
, toChar
);
542 SendMessage(hWnd
, EM_SETSEL
, (WPARAM
)0, (LPARAM
)MAKELONG(fromChar
, toChar
));
544 SendMessage(hWnd
, WM_CUT
, (WPARAM
)0, (LPARAM
)0);
546 // Now replace with 'value', by pasting.
547 wxSetClipboardData(wxDF_TEXT
, (wxObject
*) (const wxChar
*)value
, 0, 0);
549 // Paste into edit control
550 SendMessage(hWnd
, WM_PASTE
, (WPARAM
)0, (LPARAM
)0L);
552 wxFAIL_MSG("wxTextCtrl::Replace not implemented if wxUSE_CLIPBOARD is 0.");
556 void wxTextCtrl::Remove(long from
, long to
)
558 HWND hWnd
= GetHwnd();
559 long fromChar
= from
;
562 // Cut all selected text
564 SendMessage(hWnd
, EM_SETSEL
, fromChar
, toChar
);
566 SendMessage(hWnd
, EM_SETSEL
, (WPARAM
)0, (LPARAM
)MAKELONG(fromChar
, toChar
));
568 SendMessage(hWnd
, WM_CUT
, (WPARAM
)0, (LPARAM
)0);
571 void wxTextCtrl::SetSelection(long from
, long to
)
573 HWND hWnd
= GetHwnd();
574 long fromChar
= from
;
577 // if from and to are both -1, it means (in wxWindows) that all text should
578 // be selected. Translate into Windows convention
579 if ((from
== -1) && (to
== -1))
586 SendMessage(hWnd
, EM_SETSEL
, (WPARAM
)fromChar
, (LPARAM
)toChar
);
587 SendMessage(hWnd
, EM_SCROLLCARET
, (WPARAM
)0, (LPARAM
)0);
589 // WPARAM is 0: selection is scrolled into view
590 SendMessage(hWnd
, EM_SETSEL
, (WPARAM
)0, (LPARAM
)MAKELONG(fromChar
, toChar
));
594 bool wxTextCtrl::LoadFile(const wxString
& file
)
596 if ( wxTextCtrlBase::LoadFile(file
) )
598 // update the size limit if needed
607 bool wxTextCtrl::IsModified() const
609 return (SendMessage(GetHwnd(), EM_GETMODIFY
, 0, 0) != 0);
612 // Makes 'unmodified'
613 void wxTextCtrl::DiscardEdits()
615 SendMessage(GetHwnd(), EM_SETMODIFY
, FALSE
, 0L);
618 int wxTextCtrl::GetNumberOfLines() const
620 return (int)SendMessage(GetHwnd(), EM_GETLINECOUNT
, (WPARAM
)0, (LPARAM
)0);
623 long wxTextCtrl::XYToPosition(long x
, long y
) const
625 HWND hWnd
= GetHwnd();
627 // This gets the char index for the _beginning_ of this line
628 int charIndex
= (int)SendMessage(hWnd
, EM_LINEINDEX
, (WPARAM
)y
, (LPARAM
)0);
629 return (long)(x
+ charIndex
);
632 bool wxTextCtrl::PositionToXY(long pos
, long *x
, long *y
) const
634 HWND hWnd
= GetHwnd();
636 // This gets the line number containing the character
641 lineNo
= (int)SendMessage(hWnd
, EM_EXLINEFROMCHAR
, 0, (LPARAM
)pos
);
644 #endif // wxUSE_RICHEDIT
645 lineNo
= (int)SendMessage(hWnd
, EM_LINEFROMCHAR
, (WPARAM
)pos
, 0);
653 // This gets the char index for the _beginning_ of this line
654 int charIndex
= (int)SendMessage(hWnd
, EM_LINEINDEX
, (WPARAM
)lineNo
, (LPARAM
)0);
655 if ( charIndex
== -1 )
660 // The X position must therefore be the different between pos and charIndex
662 *x
= (long)(pos
- charIndex
);
669 void wxTextCtrl::ShowPosition(long pos
)
671 HWND hWnd
= GetHwnd();
673 // To scroll to a position, we pass the number of lines and characters
674 // to scroll *by*. This means that we need to:
675 // (1) Find the line position of the current line.
676 // (2) Find the line position of pos.
677 // (3) Scroll by (pos - current).
678 // For now, ignore the horizontal scrolling.
680 // Is this where scrolling is relative to - the line containing the caret?
681 // Or is the first visible line??? Try first visible line.
682 // int currentLineLineNo1 = (int)SendMessage(hWnd, EM_LINEFROMCHAR, (WPARAM)-1, (LPARAM)0L);
684 int currentLineLineNo
= (int)SendMessage(hWnd
, EM_GETFIRSTVISIBLELINE
, (WPARAM
)0, (LPARAM
)0L);
686 int specifiedLineLineNo
= (int)SendMessage(hWnd
, EM_LINEFROMCHAR
, (WPARAM
)pos
, (LPARAM
)0L);
688 int linesToScroll
= specifiedLineLineNo
- currentLineLineNo
;
690 if (linesToScroll
!= 0)
691 (void)SendMessage(hWnd
, EM_LINESCROLL
, (WPARAM
)0, (LPARAM
)linesToScroll
);
694 int wxTextCtrl::GetLineLength(long lineNo
) const
696 long charIndex
= XYToPosition(0, lineNo
);
697 int len
= (int)SendMessage(GetHwnd(), EM_LINELENGTH
, charIndex
, 0);
701 wxString
wxTextCtrl::GetLineText(long lineNo
) const
703 size_t len
= (size_t)GetLineLength(lineNo
) + 1;
704 char *buf
= (char *)malloc(len
);
706 int noChars
= (int)SendMessage(GetHwnd(), EM_GETLINE
, lineNo
, (LPARAM
)buf
);
716 // ----------------------------------------------------------------------------
718 // ----------------------------------------------------------------------------
720 void wxTextCtrl::Undo()
724 ::SendMessage(GetHwnd(), EM_UNDO
, 0, 0);
728 void wxTextCtrl::Redo()
732 // Same as Undo, since Undo undoes the undo, i.e. a redo.
733 ::SendMessage(GetHwnd(), EM_UNDO
, 0, 0);
737 bool wxTextCtrl::CanUndo() const
739 return (::SendMessage(GetHwnd(), EM_CANUNDO
, 0, 0) != 0);
742 bool wxTextCtrl::CanRedo() const
744 return (::SendMessage(GetHwnd(), EM_CANUNDO
, 0, 0) != 0);
747 // ----------------------------------------------------------------------------
748 // implemenation details
749 // ----------------------------------------------------------------------------
751 void wxTextCtrl::Command(wxCommandEvent
& event
)
753 SetValue(event
.GetString());
754 ProcessCommand (event
);
757 void wxTextCtrl::OnDropFiles(wxDropFilesEvent
& event
)
759 // By default, load the first file into the text window.
760 if (event
.GetNumberOfFiles() > 0)
762 LoadFile(event
.GetFiles()[0]);
766 void wxTextCtrl::OnChar(wxKeyEvent
& event
)
768 switch ( event
.KeyCode() )
771 if ( !(m_windowStyle
& wxTE_MULTILINE
) )
773 wxCommandEvent
event(wxEVT_COMMAND_TEXT_ENTER
, m_windowId
);
774 event
.SetEventObject( this );
775 if ( GetEventHandler()->ProcessEvent(event
) )
778 //else: multiline controls need Enter for themselves
783 // always produce navigation event - even if we process TAB
784 // ourselves the fact that we got here means that the user code
785 // decided to skip processing of this TAB - probably to let it
786 // do its default job.
788 // NB: Notice that Ctrl-Tab is handled elsewhere and Alt-Tab is
789 // handled by Windows
791 wxNavigationKeyEvent eventNav
;
792 eventNav
.SetDirection(!event
.ShiftDown());
793 eventNav
.SetWindowChange(FALSE
);
794 eventNav
.SetEventObject(this);
796 if ( GetEventHandler()->ProcessEvent(eventNav
) )
806 // don't just call event.Skip() because this will cause TABs and ENTERs
807 // be passed upwards and we don't always want this - instead process it
814 bool wxTextCtrl::MSWCommand(WXUINT param
, WXWORD
WXUNUSED(id
))
821 wxFocusEvent
event(param
== EN_KILLFOCUS
? wxEVT_KILL_FOCUS
824 event
.SetEventObject( this );
825 GetEventHandler()->ProcessEvent(event
);
831 wxCommandEvent
event(wxEVT_COMMAND_TEXT_UPDATED
, m_windowId
);
832 wxString
val(GetValue());
834 event
.m_commandString
= WXSTRINGCAST val
;
835 event
.SetEventObject( this );
836 ProcessCommand(event
);
841 // the text size limit has been hit - increase it
845 // the other notification messages are not processed
858 void wxTextCtrl::AdjustSpaceLimit()
861 unsigned int len
= ::GetWindowTextLength(GetHwnd()),
862 limit
= ::SendMessage(GetHwnd(), EM_GETLIMITTEXT
, 0, 0);
865 limit
= len
+ 0x8000; // 32Kb
868 if ( m_isRich
|| limit
> 0xffff )
870 if ( limit
> 0xffff )
872 ::SendMessage(GetHwnd(), EM_LIMITTEXT
, 0, limit
);
874 ::SendMessage(GetHwnd(), EM_LIMITTEXT
, limit
, 0);
879 bool wxTextCtrl::AcceptsFocus() const
881 // we don't want focus if we can't be edited
882 return IsEditable() && wxControl::AcceptsFocus();
885 wxSize
wxTextCtrl::DoGetBestSize() const
888 wxGetCharSize(GetHWND(), &cx
, &cy
, &GetFont());
890 int wText
= DEFAULT_ITEM_WIDTH
;
892 int hText
= EDIT_HEIGHT_FROM_CHAR_HEIGHT(cy
);
893 if ( m_windowStyle
& wxTE_MULTILINE
)
895 hText
*= wxMin(GetNumberOfLines(), 5);
897 //else: for single line control everything is ok
899 return wxSize(wText
, hText
);
902 // ----------------------------------------------------------------------------
903 // standard handlers for standard edit menu events
904 // ----------------------------------------------------------------------------
906 void wxTextCtrl::OnCut(wxCommandEvent
& event
)
911 void wxTextCtrl::OnCopy(wxCommandEvent
& event
)
916 void wxTextCtrl::OnPaste(wxCommandEvent
& event
)
921 void wxTextCtrl::OnUndo(wxCommandEvent
& event
)
926 void wxTextCtrl::OnRedo(wxCommandEvent
& event
)
931 void wxTextCtrl::OnUpdateCut(wxUpdateUIEvent
& event
)
933 event
.Enable( CanCut() );
936 void wxTextCtrl::OnUpdateCopy(wxUpdateUIEvent
& event
)
938 event
.Enable( CanCopy() );
941 void wxTextCtrl::OnUpdatePaste(wxUpdateUIEvent
& event
)
943 event
.Enable( CanPaste() );
946 void wxTextCtrl::OnUpdateUndo(wxUpdateUIEvent
& event
)
948 event
.Enable( CanUndo() );
951 void wxTextCtrl::OnUpdateRedo(wxUpdateUIEvent
& event
)
953 event
.Enable( CanRedo() );