1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 // ============================================================================
14 // ============================================================================
16 // ----------------------------------------------------------------------------
18 // ----------------------------------------------------------------------------
20 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
21 #pragma implementation "textctrl.h"
25 #define XtParent XTPARENT
30 #include <sys/types.h>
34 #include "wx/textctrl.h"
35 #include "wx/settings.h"
36 #include "wx/filefn.h"
40 #pragma message disable nosimpint
44 #pragma message enable nosimpint
47 #include "wx/motif/private.h"
49 // ----------------------------------------------------------------------------
51 // ----------------------------------------------------------------------------
53 // helper: inserts the new text in the value of the text ctrl and returns the
55 static void MergeChangesIntoString(wxString
& value
,
56 XmTextVerifyCallbackStruct
*textStruct
);
59 static void wxTextWindowChangedProc(Widget w
, XtPointer clientData
, XtPointer ptr
);
60 static void wxTextWindowModifyProc(Widget w
, XtPointer clientData
, XmTextVerifyCallbackStruct
*cbs
);
61 static void wxTextWindowGainFocusProc(Widget w
, XtPointer clientData
, XmAnyCallbackStruct
*cbs
);
62 static void wxTextWindowLoseFocusProc(Widget w
, XtPointer clientData
, XmAnyCallbackStruct
*cbs
);
63 static void wxTextWindowActivateProc(Widget w
, XtPointer clientData
, XmAnyCallbackStruct
*ptr
);
65 IMPLEMENT_DYNAMIC_CLASS(wxTextCtrl
, wxControl
)
67 BEGIN_EVENT_TABLE(wxTextCtrl
, wxControl
)
68 EVT_DROP_FILES(wxTextCtrl::OnDropFiles
)
69 EVT_CHAR(wxTextCtrl::OnChar
)
71 EVT_MENU(wxID_CUT
, wxTextCtrl::OnCut
)
72 EVT_MENU(wxID_COPY
, wxTextCtrl::OnCopy
)
73 EVT_MENU(wxID_PASTE
, wxTextCtrl::OnPaste
)
74 EVT_MENU(wxID_UNDO
, wxTextCtrl::OnUndo
)
75 EVT_MENU(wxID_REDO
, wxTextCtrl::OnRedo
)
77 EVT_UPDATE_UI(wxID_CUT
, wxTextCtrl::OnUpdateCut
)
78 EVT_UPDATE_UI(wxID_COPY
, wxTextCtrl::OnUpdateCopy
)
79 EVT_UPDATE_UI(wxID_PASTE
, wxTextCtrl::OnUpdatePaste
)
80 EVT_UPDATE_UI(wxID_UNDO
, wxTextCtrl::OnUpdateUndo
)
81 EVT_UPDATE_UI(wxID_REDO
, wxTextCtrl::OnUpdateRedo
)
85 // ============================================================================
87 // ============================================================================
89 // ----------------------------------------------------------------------------
91 // ----------------------------------------------------------------------------
94 wxTextCtrl::wxTextCtrl()
96 m_tempCallbackStruct
= (void*) NULL
;
98 m_processedDefault
= FALSE
;
101 bool wxTextCtrl::Create(wxWindow
*parent
,
103 const wxString
& value
,
107 const wxValidator
& validator
,
108 const wxString
& name
)
110 if( !CreateControl( parent
, id
, pos
, size
, style
, validator
, name
) )
113 m_tempCallbackStruct
= (void*) NULL
;
115 m_processedDefault
= FALSE
;
117 m_backgroundColour
= *wxWHITE
;
119 Widget parentWidget
= (Widget
) parent
->GetClientWidget();
121 bool wantHorizScrolling
= ((m_windowStyle
& wxHSCROLL
) != 0);
123 // If we don't have horizontal scrollbars, we want word wrap.
124 bool wantWordWrap
= !wantHorizScrolling
;
126 if (m_windowStyle
& wxTE_MULTILINE
)
129 XtSetArg (args
[0], XmNscrollHorizontal
, wantHorizScrolling
? True
: False
);
130 XtSetArg (args
[1], XmNwordWrap
, wantWordWrap
? True
: False
);
132 m_mainWidget
= (WXWidget
) XmCreateScrolledText(parentWidget
,
133 wxConstCast(name
.c_str(), char),
136 XtVaSetValues ((Widget
) m_mainWidget
,
137 XmNeditable
, ((style
& wxTE_READONLY
) ? False
: True
),
138 XmNeditMode
, XmMULTI_LINE_EDIT
,
140 XtManageChild ((Widget
) m_mainWidget
);
144 m_mainWidget
= (WXWidget
)XtVaCreateManagedWidget
146 wxConstCast(name
.c_str(), char),
152 XtVaSetValues ((Widget
) m_mainWidget
,
153 XmNeditable
, ((style
& wxTE_READONLY
) ? False
: True
),
156 // TODO: Is this relevant? What does it do?
158 if (!value
.IsNull() && (value
.Length() > (unsigned int) noCols
))
159 noCols
= value
.Length();
160 XtVaSetValues((Widget
) m_mainWidget
,
165 // remove border if asked for
166 if ( style
& wxNO_BORDER
)
168 XtVaSetValues((Widget
)m_mainWidget
,
169 XmNshadowThickness
, 0,
173 if ( !value
.empty() )
175 // do this instead... MB
177 XtVaSetValues( (Widget
) m_mainWidget
,
178 XmNvalue
, wxConstCast(value
.c_str(), char),
183 XtAddCallback((Widget
) m_mainWidget
, XmNvalueChangedCallback
, (XtCallbackProc
)wxTextWindowChangedProc
, (XtPointer
)this);
185 XtAddCallback((Widget
) m_mainWidget
, XmNmodifyVerifyCallback
, (XtCallbackProc
)wxTextWindowModifyProc
, (XtPointer
)this);
187 XtAddCallback((Widget
) m_mainWidget
, XmNactivateCallback
, (XtCallbackProc
)wxTextWindowActivateProc
, (XtPointer
)this);
189 XtAddCallback((Widget
) m_mainWidget
, XmNfocusCallback
, (XtCallbackProc
)wxTextWindowGainFocusProc
, (XtPointer
)this);
191 XtAddCallback((Widget
) m_mainWidget
, XmNlosingFocusCallback
, (XtCallbackProc
)wxTextWindowLoseFocusProc
, (XtPointer
)this);
196 wxSize best
= GetBestSize();
197 if( size
.x
!= -1 ) best
.x
= size
.x
;
198 if( size
.y
!= -1 ) best
.y
= size
.y
;
200 AttachWidget (parent
, m_mainWidget
, (WXWidget
) NULL
,
201 pos
.x
, pos
.y
, best
.x
, best
.y
);
203 ChangeBackgroundColour();
208 WXWidget
wxTextCtrl::GetTopWidget() const
210 return IsMultiLine() ? (WXWidget
)XtParent((Widget
)m_mainWidget
)
214 wxString
wxTextCtrl::GetValue() const
216 wxString str
; // result
218 if (m_windowStyle
& wxTE_PASSWORD
)
220 // the value is stored always in m_value because it can't be retrieved
221 // from the text control
226 // just get the string from Motif
227 char *s
= XmTextGetString ((Widget
) m_mainWidget
);
233 //else: return empty string
235 if ( m_tempCallbackStruct
)
237 // the string in the control isn't yet updated, can't use it as is
238 MergeChangesIntoString(str
, (XmTextVerifyCallbackStruct
*)
239 m_tempCallbackStruct
);
246 void wxTextCtrl::SetValue(const wxString
& value
)
250 // do this instead... MB
252 // with (at least) OpenMotif 2.1 this causes a lot of flicker
254 XtVaSetValues( (Widget
) m_mainWidget
,
255 XmNvalue
, wxConstCast(value
.c_str(), char),
262 m_inSetValue
= FALSE
;
265 // Clipboard operations
266 void wxTextCtrl::Copy()
268 XmTextCopy((Widget
) m_mainWidget
, CurrentTime
);
271 void wxTextCtrl::Cut()
273 XmTextCut((Widget
) m_mainWidget
, CurrentTime
);
276 void wxTextCtrl::Paste()
278 XmTextPaste((Widget
) m_mainWidget
);
281 bool wxTextCtrl::CanCopy() const
283 // Can copy if there's a selection
285 GetSelection(& from
, & to
);
286 return (from
!= to
) ;
289 bool wxTextCtrl::CanCut() const
291 // Can cut if there's a selection
293 GetSelection(& from
, & to
);
294 return (from
!= to
) && (IsEditable());
297 bool wxTextCtrl::CanPaste() const
299 return IsEditable() ;
303 void wxTextCtrl::Undo()
305 // Not possible in Motif
308 void wxTextCtrl::Redo()
310 // Not possible in Motif
313 bool wxTextCtrl::CanUndo() const
319 bool wxTextCtrl::CanRedo() const
325 // If the return values from and to are the same, there is no
327 void wxTextCtrl::GetSelection(long* from
, long* to
) const
329 XmTextPosition left
, right
;
331 XmTextGetSelectionPosition((Widget
) m_mainWidget
, & left
, & right
);
337 bool wxTextCtrl::IsEditable() const
339 return (XmTextGetEditable((Widget
) m_mainWidget
) != 0);
342 void wxTextCtrl::SetEditable(bool editable
)
344 XmTextSetEditable((Widget
) m_mainWidget
, (Boolean
) editable
);
347 void wxTextCtrl::SetInsertionPoint(long pos
)
349 XmTextSetInsertionPosition ((Widget
) m_mainWidget
, (XmTextPosition
) pos
);
352 void wxTextCtrl::SetInsertionPointEnd()
354 long pos
= GetLastPosition();
355 SetInsertionPoint(pos
);
358 long wxTextCtrl::GetInsertionPoint() const
360 return (long) XmTextGetInsertionPosition ((Widget
) m_mainWidget
);
363 long wxTextCtrl::GetLastPosition() const
365 return (long) XmTextGetLastPosition ((Widget
) m_mainWidget
);
368 void wxTextCtrl::Replace(long from
, long to
, const wxString
& value
)
370 XmTextReplace ((Widget
) m_mainWidget
, (XmTextPosition
) from
, (XmTextPosition
) to
,
371 wxConstCast(value
.c_str(), char));
374 void wxTextCtrl::Remove(long from
, long to
)
376 XmTextSetSelection ((Widget
) m_mainWidget
, (XmTextPosition
) from
, (XmTextPosition
) to
,
378 XmTextRemove ((Widget
) m_mainWidget
);
381 void wxTextCtrl::SetSelection(long from
, long to
)
384 to
= GetLastPosition();
386 XmTextSetSelection ((Widget
) m_mainWidget
, (XmTextPosition
) from
, (XmTextPosition
) to
,
390 void wxTextCtrl::WriteText(const wxString
& text
)
392 long textPosition
= GetInsertionPoint() + strlen (text
);
393 XmTextInsert ((Widget
) m_mainWidget
, GetInsertionPoint(),
394 wxConstCast(text
.c_str(), char));
395 XtVaSetValues ((Widget
) m_mainWidget
, XmNcursorPosition
, textPosition
, NULL
);
396 SetInsertionPoint(textPosition
);
397 XmTextShowPosition ((Widget
) m_mainWidget
, textPosition
);
401 void wxTextCtrl::AppendText(const wxString
& text
)
403 long textPosition
= GetLastPosition() + text
.length();
404 XmTextInsert ((Widget
) m_mainWidget
, GetLastPosition(),
405 wxConstCast(text
.c_str(), char));
406 XtVaSetValues ((Widget
) m_mainWidget
, XmNcursorPosition
, textPosition
, NULL
);
407 SetInsertionPoint(textPosition
);
408 XmTextShowPosition ((Widget
) m_mainWidget
, textPosition
);
412 void wxTextCtrl::Clear()
414 XmTextSetString ((Widget
) m_mainWidget
, "");
418 bool wxTextCtrl::IsModified() const
423 // Makes modified or unmodified
424 void wxTextCtrl::MarkDirty()
429 void wxTextCtrl::DiscardEdits()
434 int wxTextCtrl::GetNumberOfLines() const
436 // HIDEOUSLY inefficient, but we have no choice.
437 char *s
= XmTextGetString ((Widget
) m_mainWidget
);
442 bool finished
= FALSE
;
465 long wxTextCtrl::XYToPosition(long x
, long y
) const
467 /* It seems, that there is a bug in some versions of the Motif library,
468 so the original wxWin-Code doesn't work. */
470 Widget textWidget = (Widget) handle;
471 return (long) XmTextXYToPos (textWidget, (Position) x, (Position) y);
473 /* Now a little workaround: */
475 for (int i
=0; i
<y
; i
++) r
+=(GetLineLength(i
)+1);
479 bool wxTextCtrl::PositionToXY(long pos
, long *x
, long *y
) const
482 XmTextPosToXY((Widget
) m_mainWidget
, pos
, &xx
, &yy
);
491 void wxTextCtrl::ShowPosition(long pos
)
493 XmTextShowPosition ((Widget
) m_mainWidget
, (XmTextPosition
) pos
);
496 int wxTextCtrl::GetLineLength(long lineNo
) const
498 wxString str
= GetLineText (lineNo
);
499 return (int) str
.Length();
502 wxString
wxTextCtrl::GetLineText(long lineNo
) const
504 // HIDEOUSLY inefficient, but we have no choice.
505 char *s
= XmTextGetString ((Widget
) m_mainWidget
);
512 for (i
= 0; currentLine
!= lineNo
&& s
[i
]; i
++ )
517 for (j
= 0; s
[i
] && s
[i
] != '\n'; i
++, j
++ )
524 return wxEmptyString
;
531 void wxTextCtrl::Command(wxCommandEvent
& event
)
533 SetValue (event
.GetString());
534 ProcessCommand (event
);
537 void wxTextCtrl::OnDropFiles(wxDropFilesEvent
& event
)
539 // By default, load the first file into the text window.
540 if (event
.GetNumberOfFiles() > 0)
542 LoadFile(event
.GetFiles()[0]);
546 void wxTextCtrl::OnChar(wxKeyEvent
& event
)
548 // Indicates that we should generate a normal command, because
549 // we're letting default behaviour happen (otherwise it's vetoed
550 // by virtue of overriding OnChar)
551 m_processedDefault
= TRUE
;
553 if (m_tempCallbackStruct
)
555 XmTextVerifyCallbackStruct
*textStruct
=
556 (XmTextVerifyCallbackStruct
*) m_tempCallbackStruct
;
557 textStruct
->doit
= True
;
558 if (isascii(event
.m_keyCode
) && (textStruct
->text
->length
== 1))
560 textStruct
->text
->ptr
[0] = ((event
.m_keyCode
== WXK_RETURN
) ? 10 : event
.m_keyCode
);
565 void wxTextCtrl::ChangeFont(bool keepOriginalSize
)
567 wxWindow::ChangeFont(keepOriginalSize
);
570 void wxTextCtrl::ChangeBackgroundColour()
572 wxWindow::ChangeBackgroundColour();
574 /* TODO: should scrollbars be affected? Should probably have separate
575 * function to change them (by default, taken from wxSystemSettings)
577 if (m_windowStyle
& wxTE_MULTILINE
)
579 Widget parent
= XtParent ((Widget
) m_mainWidget
);
582 XtVaGetValues (parent
,
583 XmNhorizontalScrollBar
, &hsb
,
584 XmNverticalScrollBar
, &vsb
,
586 wxColour backgroundColour
= wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE
);
588 wxDoChangeBackgroundColour((WXWidget
) hsb
, backgroundColour
, TRUE
);
590 wxDoChangeBackgroundColour((WXWidget
) vsb
, backgroundColour
, TRUE
);
592 // MBN: why change parent background?
593 // DoChangeBackgroundColour((WXWidget) parent, m_backgroundColour, TRUE);
597 void wxTextCtrl::ChangeForegroundColour()
599 wxWindow::ChangeForegroundColour();
601 if (m_windowStyle
& wxTE_MULTILINE
)
603 Widget parent
= XtParent ((Widget
) m_mainWidget
);
606 XtVaGetValues (parent
,
607 XmNhorizontalScrollBar
, &hsb
,
608 XmNverticalScrollBar
, &vsb
,
611 /* TODO: should scrollbars be affected? Should probably have separate
612 * function to change them (by default, taken from wxSystemSettings)
614 DoChangeForegroundColour((WXWidget) hsb, m_foregroundColour);
616 DoChangeForegroundColour((WXWidget) vsb, m_foregroundColour);
618 wxDoChangeForegroundColour((WXWidget
) parent
, m_foregroundColour
);
622 void wxTextCtrl::DoSendEvents(void *wxcbs
, long keycode
)
624 // we're in process of updating the text control
625 m_tempCallbackStruct
= wxcbs
;
627 XmTextVerifyCallbackStruct
*cbs
= (XmTextVerifyCallbackStruct
*)wxcbs
;
629 wxKeyEvent
event (wxEVT_CHAR
);
630 event
.SetId(GetId());
631 event
.m_keyCode
= keycode
;
632 event
.SetEventObject(this);
634 // Only if wxTextCtrl::OnChar is called will this be set to True (and
635 // the character passed through)
638 GetEventHandler()->ProcessEvent(event
);
640 if ( !InSetValue() && m_processedDefault
)
642 // Can generate a command
643 wxCommandEvent
commandEvent(wxEVT_COMMAND_TEXT_UPDATED
, GetId());
644 commandEvent
.SetEventObject(this);
645 ProcessCommand(commandEvent
);
648 // do it after the (user) event handlers processed the events because
649 // otherwise GetValue() would return incorrect (not yet updated value)
650 m_tempCallbackStruct
= NULL
;
653 wxSize
wxDoGetSingleTextCtrlBestSize( Widget textWidget
,
654 const wxWindow
* window
)
656 Dimension xmargin
, ymargin
, highlight
, shadow
;
659 XtVaGetValues( textWidget
,
660 XmNmarginWidth
, &xmargin
,
661 XmNmarginHeight
, &ymargin
,
663 XmNhighlightThickness
, &highlight
,
664 XmNshadowThickness
, &shadow
,
671 window
->GetTextExtent( value
, &x
, &y
);
673 if( x
< 100 ) x
= 100;
675 return wxSize( x
+ 2 * xmargin
+ 2 * highlight
+ 2 * shadow
,
676 // MBN: +2 necessary: Lesstif bug or mine?
677 y
+ 2 * ymargin
+ 2 * highlight
+ 2 * shadow
+ 2 );
680 wxSize
wxTextCtrl::DoGetBestSize() const
683 return wxDoGetSingleTextCtrlBestSize( (Widget
)m_mainWidget
, this );
685 return wxWindow::DoGetBestSize();
688 // ----------------------------------------------------------------------------
689 // helpers and Motif callbacks
690 // ----------------------------------------------------------------------------
692 static void MergeChangesIntoString(wxString
& value
,
693 XmTextVerifyCallbackStruct
*cbs
)
696 * At least on my system (SunOS 4.1.3 + Motif 1.2), you need to think of
697 * every event as a replace event. cbs->text->ptr gives the replacement
698 * text, cbs->startPos gives the index of the first char affected by the
699 * replace, and cbs->endPos gives the index one more than the last char
700 * affected by the replace (startPos == endPos implies an empty range).
701 * Hence, a deletion is represented by replacing all input text with a
702 * blank string ("", *not* NULL!). A simple insertion that does not
703 * overwrite any text has startPos == endPos.
708 // easy case: the ol value was empty
709 value
= cbs
->text
->ptr
;
713 // merge the changes into the value
714 const char * const passwd
= value
;
715 int len
= value
.length();
717 len
+= ( cbs
->text
->ptr
?
718 strlen(cbs
->text
->ptr
) :
719 0 ) + 1; // + new text (if any) + NUL
720 len
-= cbs
->endPos
- cbs
->startPos
; // - text from affected region.
722 char * newS
= new char [len
];
724 * insert
= cbs
->text
->ptr
;
726 // Copy (old) text from passwd, up to the start posn of the change.
728 const char * p
= passwd
;
729 for (i
= 0; i
< cbs
->startPos
; ++i
)
732 // Copy the text to be inserted).
737 // Finally, copy into newS any remaining text from passwd[endPos] on.
738 for (p
= passwd
+ cbs
->endPos
; *p
; )
749 wxTextWindowChangedProc (Widget w
, XtPointer clientData
, XtPointer
WXUNUSED(ptr
))
751 if (!wxGetWindowFromTable(w
))
752 // Widget has been deleted!
755 wxTextCtrl
*tw
= (wxTextCtrl
*) clientData
;
756 tw
->SetModified(TRUE
);
760 wxTextWindowModifyProc (Widget
WXUNUSED(w
), XtPointer clientData
, XmTextVerifyCallbackStruct
*cbs
)
762 wxTextCtrl
*tw
= (wxTextCtrl
*) clientData
;
763 tw
->m_processedDefault
= FALSE
;
765 // First, do some stuff if it's a password control: in this case, we need
766 // to store the string inside the class because GetValue() can't retrieve
767 // it from the text ctrl. We do *not* do it in other circumstances because
768 // it would double the amount of memory needed.
770 if ( tw
->GetWindowStyleFlag() & wxTE_PASSWORD
)
772 MergeChangesIntoString(tw
->m_value
, cbs
);
774 if ( cbs
->text
->length
> 0 )
777 for (i
= 0; i
< cbs
->text
->length
; ++i
)
778 cbs
->text
->ptr
[i
] = '*';
779 cbs
->text
->ptr
[i
] = '\0';
786 // If we're already within an OnChar, return: probably a programmatic
788 if (tw
->m_tempCallbackStruct
)
791 // Check for a backspace
792 if (cbs
->startPos
== (cbs
->currInsert
- 1))
794 tw
->DoSendEvents((void *)cbs
, WXK_DELETE
);
799 // Pasting operation: let it through without calling OnChar
800 if (cbs
->text
->length
> 1)
803 // Something other than text
804 if (cbs
->text
->ptr
== NULL
)
808 char ch
= cbs
->text
->ptr
[0];
809 tw
->DoSendEvents((void *)cbs
, ch
== '\n' ? '\r' : ch
);
813 wxTextWindowGainFocusProc (Widget w
, XtPointer clientData
, XmAnyCallbackStruct
*WXUNUSED(cbs
))
815 if (!wxGetWindowFromTable(w
))
818 wxTextCtrl
*tw
= (wxTextCtrl
*) clientData
;
819 wxFocusEvent
event(wxEVT_SET_FOCUS
, tw
->GetId());
820 event
.SetEventObject(tw
);
821 tw
->GetEventHandler()->ProcessEvent(event
);
825 wxTextWindowLoseFocusProc (Widget w
, XtPointer clientData
, XmAnyCallbackStruct
*WXUNUSED(cbs
))
827 if (!wxGetWindowFromTable(w
))
830 wxTextCtrl
*tw
= (wxTextCtrl
*) clientData
;
831 wxFocusEvent
event(wxEVT_KILL_FOCUS
, tw
->GetId());
832 event
.SetEventObject(tw
);
833 tw
->GetEventHandler()->ProcessEvent(event
);
836 static void wxTextWindowActivateProc(Widget w
, XtPointer clientData
,
837 XmAnyCallbackStruct
*WXUNUSED(ptr
))
839 if (!wxGetWindowFromTable(w
))
842 wxTextCtrl
*tw
= (wxTextCtrl
*) clientData
;
844 if (tw
->InSetValue())
847 wxCommandEvent
event(wxEVT_COMMAND_TEXT_ENTER
);
848 event
.SetId(tw
->GetId());
849 event
.SetEventObject(tw
);
850 tw
->ProcessCommand(event
);
853 void wxTextCtrl::OnCut(wxCommandEvent
& WXUNUSED(event
))
858 void wxTextCtrl::OnCopy(wxCommandEvent
& WXUNUSED(event
))
863 void wxTextCtrl::OnPaste(wxCommandEvent
& WXUNUSED(event
))
868 void wxTextCtrl::OnUndo(wxCommandEvent
& WXUNUSED(event
))
873 void wxTextCtrl::OnRedo(wxCommandEvent
& WXUNUSED(event
))
878 void wxTextCtrl::OnUpdateCut(wxUpdateUIEvent
& event
)
880 event
.Enable( CanCut() );
883 void wxTextCtrl::OnUpdateCopy(wxUpdateUIEvent
& event
)
885 event
.Enable( CanCopy() );
888 void wxTextCtrl::OnUpdatePaste(wxUpdateUIEvent
& event
)
890 event
.Enable( CanPaste() );
893 void wxTextCtrl::OnUpdateUndo(wxUpdateUIEvent
& event
)
895 event
.Enable( CanUndo() );
898 void wxTextCtrl::OnUpdateRedo(wxUpdateUIEvent
& event
)
900 event
.Enable( CanRedo() );