1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 // ============================================================================
14 // ============================================================================
16 // ----------------------------------------------------------------------------
18 // ----------------------------------------------------------------------------
21 #pragma implementation "textctrl.h"
24 #include <sys/types.h>
29 #include "wx/textctrl.h"
30 #include "wx/settings.h"
31 #include "wx/filefn.h"
36 #include "wx/motif/private.h"
38 // ----------------------------------------------------------------------------
40 // ----------------------------------------------------------------------------
42 // helper: inserts the new text in the value of the text ctrl and returns the
44 static void MergeChangesIntoString(wxString
& value
,
45 XmTextVerifyCallbackStruct
*textStruct
);
48 static void wxTextWindowChangedProc(Widget w
, XtPointer clientData
, XtPointer ptr
);
49 static void wxTextWindowModifyProc(Widget w
, XtPointer clientData
, XmTextVerifyCallbackStruct
*cbs
);
50 static void wxTextWindowGainFocusProc(Widget w
, XtPointer clientData
, XmAnyCallbackStruct
*cbs
);
51 static void wxTextWindowLoseFocusProc(Widget w
, XtPointer clientData
, XmAnyCallbackStruct
*cbs
);
52 static void wxTextWindowActivateProc(Widget w
, XtPointer clientData
, XmAnyCallbackStruct
*ptr
);
54 #if !USE_SHARED_LIBRARY
55 IMPLEMENT_DYNAMIC_CLASS(wxTextCtrl
, wxControl
)
57 BEGIN_EVENT_TABLE(wxTextCtrl
, wxControl
)
58 EVT_DROP_FILES(wxTextCtrl::OnDropFiles
)
59 EVT_CHAR(wxTextCtrl::OnChar
)
61 EVT_MENU(wxID_CUT
, wxTextCtrl::OnCut
)
62 EVT_MENU(wxID_COPY
, wxTextCtrl::OnCopy
)
63 EVT_MENU(wxID_PASTE
, wxTextCtrl::OnPaste
)
64 EVT_MENU(wxID_UNDO
, wxTextCtrl::OnUndo
)
65 EVT_MENU(wxID_REDO
, wxTextCtrl::OnRedo
)
67 EVT_UPDATE_UI(wxID_CUT
, wxTextCtrl::OnUpdateCut
)
68 EVT_UPDATE_UI(wxID_COPY
, wxTextCtrl::OnUpdateCopy
)
69 EVT_UPDATE_UI(wxID_PASTE
, wxTextCtrl::OnUpdatePaste
)
70 EVT_UPDATE_UI(wxID_UNDO
, wxTextCtrl::OnUpdateUndo
)
71 EVT_UPDATE_UI(wxID_REDO
, wxTextCtrl::OnUpdateRedo
)
76 // ============================================================================
78 // ============================================================================
80 // ----------------------------------------------------------------------------
82 // ----------------------------------------------------------------------------
85 wxTextCtrl::wxTextCtrl()
87 m_tempCallbackStruct
= (void*) NULL
;
89 m_processedDefault
= FALSE
;
92 bool wxTextCtrl::Create(wxWindow
*parent
,
94 const wxString
& value
,
98 const wxValidator
& validator
,
101 m_tempCallbackStruct
= (void*) NULL
;
103 m_processedDefault
= FALSE
;
104 // m_backgroundColour = parent->GetBackgroundColour();
105 m_backgroundColour
= * wxWHITE
;
106 m_foregroundColour
= parent
->GetForegroundColour();
109 SetValidator(validator
);
111 parent
->AddChild(this);
113 m_windowStyle
= style
;
116 m_windowId
= (int)NewControlId();
120 Widget parentWidget
= (Widget
) parent
->GetClientWidget();
122 bool wantHorizScrolling
= ((m_windowStyle
& wxHSCROLL
) != 0);
124 // If we don't have horizontal scrollbars, we want word wrap.
125 bool wantWordWrap
= !wantHorizScrolling
;
127 if (m_windowStyle
& wxTE_MULTILINE
)
130 XtSetArg (args
[0], XmNscrollHorizontal
, wantHorizScrolling
? True
: False
);
131 XtSetArg (args
[1], XmNwordWrap
, wantWordWrap
? True
: False
);
133 m_mainWidget
= (WXWidget
) XmCreateScrolledText(parentWidget
,
137 XtVaSetValues ((Widget
) m_mainWidget
,
138 XmNeditable
, ((style
& wxTE_READONLY
) ? False
: True
),
139 XmNeditMode
, XmMULTI_LINE_EDIT
,
141 XtManageChild ((Widget
) m_mainWidget
);
145 m_mainWidget
= (WXWidget
)XtVaCreateManagedWidget
153 // TODO: Is this relevant? What does it do?
155 if (!value
.IsNull() && (value
.Length() > (unsigned int) noCols
))
156 noCols
= value
.Length();
157 XtVaSetValues((Widget
) m_mainWidget
,
162 // remove border if asked for
163 if ( style
& wxNO_BORDER
)
165 XtVaSetValues((Widget
)m_mainWidget
,
166 XmNshadowThickness
, 0,
173 // don't do this because it is just linking the text to a source
174 // string which is unsafe. MB
176 XmTextSetString ((Widget
) m_mainWidget
, (char*)value
.c_str());
178 // do this instead... MB
180 XtVaSetValues( (Widget
) m_mainWidget
,
181 XmNvalue
, (char *)value
.c_str(),
187 XtAddCallback((Widget
) m_mainWidget
, XmNvalueChangedCallback
, (XtCallbackProc
)wxTextWindowChangedProc
, (XtPointer
)this);
189 XtAddCallback((Widget
) m_mainWidget
, XmNmodifyVerifyCallback
, (XtCallbackProc
)wxTextWindowModifyProc
, (XtPointer
)this);
191 XtAddCallback((Widget
) m_mainWidget
, XmNactivateCallback
, (XtCallbackProc
)wxTextWindowActivateProc
, (XtPointer
)this);
193 XtAddCallback((Widget
) m_mainWidget
, XmNfocusCallback
, (XtCallbackProc
)wxTextWindowGainFocusProc
, (XtPointer
)this);
195 XtAddCallback((Widget
) m_mainWidget
, XmNlosingFocusCallback
, (XtCallbackProc
)wxTextWindowLoseFocusProc
, (XtPointer
)this);
198 m_font
= parent
->GetFont();
201 SetCanAddEventHandler(TRUE
);
202 AttachWidget (parent
, m_mainWidget
, (WXWidget
) NULL
, pos
.x
, pos
.y
, size
.x
, size
.y
);
204 ChangeBackgroundColour();
209 WXWidget
wxTextCtrl::GetTopWidget() const
211 return ((m_windowStyle
& wxTE_MULTILINE
) ? (WXWidget
) XtParent((Widget
) m_mainWidget
) : 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
)
251 // don't do this because it is just linking the text to a source
252 // string which is unsafe. MB
254 XmTextSetString ((Widget
) m_mainWidget
, (char*)value
.c_str());
256 // do this instead... MB
258 XtVaSetValues( (Widget
) m_mainWidget
,
259 XmNvalue
, (char *)value
.c_str(),
263 m_inSetValue
= FALSE
;
266 // Clipboard operations
267 void wxTextCtrl::Copy()
269 XmTextCopy((Widget
) m_mainWidget
, CurrentTime
);
272 void wxTextCtrl::Cut()
274 XmTextCut((Widget
) m_mainWidget
, CurrentTime
);
277 void wxTextCtrl::Paste()
279 XmTextPaste((Widget
) m_mainWidget
);
282 bool wxTextCtrl::CanCopy() const
284 // Can copy if there's a selection
286 GetSelection(& from
, & to
);
287 return (from
!= to
) ;
290 bool wxTextCtrl::CanCut() const
292 // Can cut if there's a selection
294 GetSelection(& from
, & to
);
295 return (from
!= to
) ;
298 bool wxTextCtrl::CanPaste() const
300 return IsEditable() ;
304 void wxTextCtrl::Undo()
306 // Not possible in Motif
309 void wxTextCtrl::Redo()
311 // Not possible in Motif
314 bool wxTextCtrl::CanUndo() const
320 bool wxTextCtrl::CanRedo() const
326 // If the return values from and to are the same, there is no
328 void wxTextCtrl::GetSelection(long* from
, long* to
) const
330 XmTextPosition left
, right
;
332 XmTextGetSelectionPosition((Widget
) m_mainWidget
, & left
, & right
);
338 bool wxTextCtrl::IsEditable() const
340 return (XmTextGetEditable((Widget
) m_mainWidget
) != 0);
343 void wxTextCtrl::SetEditable(bool editable
)
345 XmTextSetEditable((Widget
) m_mainWidget
, (Boolean
) editable
);
348 void wxTextCtrl::SetInsertionPoint(long pos
)
350 XmTextSetInsertionPosition ((Widget
) m_mainWidget
, (XmTextPosition
) pos
);
353 void wxTextCtrl::SetInsertionPointEnd()
355 long pos
= GetLastPosition();
356 SetInsertionPoint(pos
);
359 long wxTextCtrl::GetInsertionPoint() const
361 return (long) XmTextGetInsertionPosition ((Widget
) m_mainWidget
);
364 long wxTextCtrl::GetLastPosition() const
366 return (long) XmTextGetLastPosition ((Widget
) m_mainWidget
);
369 void wxTextCtrl::Replace(long from
, long to
, const wxString
& value
)
371 XmTextReplace ((Widget
) m_mainWidget
, (XmTextPosition
) from
, (XmTextPosition
) to
,
372 (char*) (const char*) value
);
375 void wxTextCtrl::Remove(long from
, long to
)
377 XmTextSetSelection ((Widget
) m_mainWidget
, (XmTextPosition
) from
, (XmTextPosition
) to
,
379 XmTextRemove ((Widget
) m_mainWidget
);
382 void wxTextCtrl::SetSelection(long from
, long to
)
384 XmTextSetSelection ((Widget
) m_mainWidget
, (XmTextPosition
) from
, (XmTextPosition
) to
,
388 bool wxTextCtrl::LoadFile(const wxString
& file
)
390 if (!wxFileExists(file
))
397 Widget textWidget
= (Widget
) m_mainWidget
;
401 if ((stat ((char*) (const char*) file
, &statb
) == -1) || (statb
.st_mode
& S_IFMT
) != S_IFREG
||
402 !(fp
= fopen ((char*) (const char*) file
, "r")))
408 long len
= statb
.st_size
;
410 if (!(text
= XtMalloc ((unsigned) (len
+ 1))))
415 if (fread (text
, sizeof (char), len
, fp
) != (size_t) len
)
421 XmTextSetString (textWidget
, text
);
422 // m_textPosition = len;
429 // If file is null, try saved file name first
430 // Returns TRUE if succeeds.
431 bool wxTextCtrl::SaveFile(const wxString
& file
)
433 wxString
theFile(file
);
435 theFile
= m_fileName
;
438 m_fileName
= theFile
;
440 Widget textWidget
= (Widget
) m_mainWidget
;
443 if (!(fp
= fopen ((char*) (const char*) theFile
, "w")))
449 char *text
= XmTextGetString (textWidget
);
450 long len
= XmTextGetLastPosition (textWidget
);
452 if (fwrite (text
, sizeof (char), len
, fp
) != (size_t) len
)
454 // Did not write whole file
456 // Make sure newline terminates the file
457 if (text
[len
- 1] != '\n')
467 void wxTextCtrl::WriteText(const wxString
& text
)
469 long textPosition
= GetInsertionPoint() + strlen (text
);
470 XmTextInsert ((Widget
) m_mainWidget
, GetInsertionPoint(), (char*) (const char*) text
);
471 XtVaSetValues ((Widget
) m_mainWidget
, XmNcursorPosition
, textPosition
, NULL
);
472 SetInsertionPoint(textPosition
);
473 XmTextShowPosition ((Widget
) m_mainWidget
, textPosition
);
477 void wxTextCtrl::AppendText(const wxString
& text
)
479 long textPosition
= GetLastPosition() + strlen(text
);
480 XmTextInsert ((Widget
) m_mainWidget
, GetLastPosition(), (char*) (const char*) text
);
481 XtVaSetValues ((Widget
) m_mainWidget
, XmNcursorPosition
, textPosition
, NULL
);
482 SetInsertionPoint(textPosition
);
483 XmTextShowPosition ((Widget
) m_mainWidget
, textPosition
);
487 void wxTextCtrl::Clear()
489 XmTextSetString ((Widget
) m_mainWidget
, "");
493 bool wxTextCtrl::IsModified() const
498 // Makes 'unmodified'
499 void wxTextCtrl::DiscardEdits()
504 int wxTextCtrl::GetNumberOfLines() const
506 // HIDEOUSLY inefficient, but we have no choice.
507 char *s
= XmTextGetString ((Widget
) m_mainWidget
);
512 bool finished
= FALSE
;
535 long wxTextCtrl::XYToPosition(long x
, long y
) const
537 /* It seems, that there is a bug in some versions of the Motif library,
538 so the original wxWin-Code doesn't work. */
540 Widget textWidget = (Widget) handle;
541 return (long) XmTextXYToPos (textWidget, (Position) x, (Position) y);
543 /* Now a little workaround: */
545 for (int i
=0; i
<y
; i
++) r
+=(GetLineLength(i
)+1);
549 bool wxTextCtrl::PositionToXY(long pos
, long *x
, long *y
) const
552 XmTextPosToXY((Widget
) m_mainWidget
, pos
, &xx
, &yy
);
561 void wxTextCtrl::ShowPosition(long pos
)
563 XmTextShowPosition ((Widget
) m_mainWidget
, (XmTextPosition
) pos
);
566 int wxTextCtrl::GetLineLength(long lineNo
) const
568 wxString str
= GetLineText (lineNo
);
569 return (int) str
.Length();
572 wxString
wxTextCtrl::GetLineText(long lineNo
) const
574 // HIDEOUSLY inefficient, but we have no choice.
575 char *s
= XmTextGetString ((Widget
) m_mainWidget
);
582 for (i
= 0; currentLine
!= lineNo
&& s
[i
]; i
++ )
587 for (j
= 0; s
[i
] && s
[i
] != '\n'; i
++, j
++ )
594 return wxEmptyString
;
601 void wxTextCtrl::Command(wxCommandEvent
& event
)
603 SetValue (event
.GetString());
604 ProcessCommand (event
);
607 void wxTextCtrl::OnDropFiles(wxDropFilesEvent
& event
)
609 // By default, load the first file into the text window.
610 if (event
.GetNumberOfFiles() > 0)
612 LoadFile(event
.GetFiles()[0]);
616 void wxTextCtrl::OnChar(wxKeyEvent
& event
)
618 // Indicates that we should generate a normal command, because
619 // we're letting default behaviour happen (otherwise it's vetoed
620 // by virtue of overriding OnChar)
621 m_processedDefault
= TRUE
;
623 if (m_tempCallbackStruct
)
625 XmTextVerifyCallbackStruct
*textStruct
=
626 (XmTextVerifyCallbackStruct
*) m_tempCallbackStruct
;
627 textStruct
->doit
= True
;
628 if (isascii(event
.m_keyCode
) && (textStruct
->text
->length
== 1))
630 textStruct
->text
->ptr
[0] = ((event
.m_keyCode
== WXK_RETURN
) ? 10 : event
.m_keyCode
);
635 void wxTextCtrl::ChangeFont(bool keepOriginalSize
)
637 wxWindow::ChangeFont(keepOriginalSize
);
640 void wxTextCtrl::ChangeBackgroundColour()
642 wxWindow::ChangeBackgroundColour();
644 /* TODO: should scrollbars be affected? Should probably have separate
645 * function to change them (by default, taken from wxSystemSettings)
647 if (m_windowStyle
& wxTE_MULTILINE
)
649 Widget parent
= XtParent ((Widget
) m_mainWidget
);
652 XtVaGetValues (parent
,
653 XmNhorizontalScrollBar
, &hsb
,
654 XmNverticalScrollBar
, &vsb
,
656 wxColour backgroundColour
= wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE
);
658 DoChangeBackgroundColour((WXWidget
) hsb
, backgroundColour
, TRUE
);
660 DoChangeBackgroundColour((WXWidget
) vsb
, backgroundColour
, TRUE
);
662 DoChangeBackgroundColour((WXWidget
) parent
, m_backgroundColour
, TRUE
);
666 void wxTextCtrl::ChangeForegroundColour()
668 wxWindow::ChangeForegroundColour();
670 if (m_windowStyle
& wxTE_MULTILINE
)
672 Widget parent
= XtParent ((Widget
) m_mainWidget
);
675 XtVaGetValues (parent
,
676 XmNhorizontalScrollBar
, &hsb
,
677 XmNverticalScrollBar
, &vsb
,
680 /* TODO: should scrollbars be affected? Should probably have separate
681 * function to change them (by default, taken from wxSystemSettings)
683 DoChangeForegroundColour((WXWidget) hsb, m_foregroundColour);
685 DoChangeForegroundColour((WXWidget) vsb, m_foregroundColour);
687 DoChangeForegroundColour((WXWidget
) parent
, m_foregroundColour
);
691 void wxTextCtrl::DoSendEvents(void *wxcbs
, long keycode
)
693 // we're in process of updating the text control
694 m_tempCallbackStruct
= wxcbs
;
696 XmTextVerifyCallbackStruct
*cbs
= (XmTextVerifyCallbackStruct
*)wxcbs
;
698 wxKeyEvent
event (wxEVT_CHAR
);
699 event
.SetId(GetId());
700 event
.m_keyCode
= keycode
;
701 event
.SetEventObject(this);
703 // Only if wxTextCtrl::OnChar is called will this be set to True (and
704 // the character passed through)
707 GetEventHandler()->ProcessEvent(event
);
709 if ( !InSetValue() && m_processedDefault
)
711 // Can generate a command
712 wxCommandEvent
commandEvent(wxEVT_COMMAND_TEXT_UPDATED
, GetId());
713 commandEvent
.SetEventObject(this);
714 ProcessCommand(commandEvent
);
717 // do it after the (user) event handlers processed the events because
718 // otherwise GetValue() would return incorrect (not yet updated value)
719 m_tempCallbackStruct
= NULL
;
722 // ----------------------------------------------------------------------------
723 // helpers and Motif callbacks
724 // ----------------------------------------------------------------------------
726 static void MergeChangesIntoString(wxString
& value
,
727 XmTextVerifyCallbackStruct
*cbs
)
730 * At least on my system (SunOS 4.1.3 + Motif 1.2), you need to think of
731 * every event as a replace event. cbs->text->ptr gives the replacement
732 * text, cbs->startPos gives the index of the first char affected by the
733 * replace, and cbs->endPos gives the index one more than the last char
734 * affected by the replace (startPos == endPos implies an empty range).
735 * Hence, a deletion is represented by replacing all input text with a
736 * blank string ("", *not* NULL!). A simple insertion that does not
737 * overwrite any text has startPos == endPos.
742 // easy case: the ol value was empty
743 value
= cbs
->text
->ptr
;
747 // merge the changes into the value
748 const char * const passwd
= value
;
749 int len
= value
.length();
751 len
+= strlen(cbs
->text
->ptr
) + 1; // + new text (if any) + NUL
752 len
-= cbs
->endPos
- cbs
->startPos
; // - text from affected region.
754 char * newS
= new char [len
];
756 * insert
= cbs
->text
->ptr
;
758 // Copy (old) text from passwd, up to the start posn of the change.
760 const char * p
= passwd
;
761 for (i
= 0; i
< cbs
->startPos
; ++i
)
764 // Copy the text to be inserted).
768 // Finally, copy into newS any remaining text from passwd[endPos] on.
769 for (p
= passwd
+ cbs
->endPos
; *p
; )
780 wxTextWindowChangedProc (Widget w
, XtPointer clientData
, XtPointer ptr
)
782 if (!wxGetWindowFromTable(w
))
783 // Widget has been deleted!
786 wxTextCtrl
*tw
= (wxTextCtrl
*) clientData
;
787 tw
->SetModified(TRUE
);
791 wxTextWindowModifyProc (Widget w
, XtPointer clientData
, XmTextVerifyCallbackStruct
*cbs
)
793 wxTextCtrl
*tw
= (wxTextCtrl
*) clientData
;
794 tw
->m_processedDefault
= FALSE
;
796 // First, do some stuff if it's a password control: in this case, we need
797 // to store the string inside the class because GetValue() can't retrieve
798 // it from the text ctrl. We do *not* do it in other circumstances because
799 // it would double the amount of memory needed.
801 if ( tw
->GetWindowStyleFlag() & wxTE_PASSWORD
)
803 MergeChangesIntoString(tw
->m_value
, cbs
);
805 if ( cbs
->text
->length
> 0 )
808 for (i
= 0; i
< cbs
->text
->length
; ++i
)
809 cbs
->text
->ptr
[i
] = '*';
810 cbs
->text
->ptr
[i
] = '\0';
814 // If we're already within an OnChar, return: probably a programmatic
816 if (tw
->m_tempCallbackStruct
)
819 // Check for a backspace
820 if (cbs
->startPos
== (cbs
->currInsert
- 1))
822 tw
->DoSendEvents((void *)cbs
, WXK_DELETE
);
827 // Pasting operation: let it through without calling OnChar
828 if (cbs
->text
->length
> 1)
831 // Something other than text
832 if (cbs
->text
->ptr
== NULL
)
836 char ch
= cbs
->text
->ptr
[0];
837 tw
->DoSendEvents((void *)cbs
, ch
== '\n' ? '\r' : ch
);
841 wxTextWindowGainFocusProc (Widget w
, XtPointer clientData
, XmAnyCallbackStruct
*cbs
)
843 if (!wxGetWindowFromTable(w
))
846 wxTextCtrl
*tw
= (wxTextCtrl
*) clientData
;
847 wxFocusEvent
event(wxEVT_SET_FOCUS
, tw
->GetId());
848 event
.SetEventObject(tw
);
849 tw
->GetEventHandler()->ProcessEvent(event
);
853 wxTextWindowLoseFocusProc (Widget w
, XtPointer clientData
, XmAnyCallbackStruct
*cbs
)
855 if (!wxGetWindowFromTable(w
))
858 wxTextCtrl
*tw
= (wxTextCtrl
*) clientData
;
859 wxFocusEvent
event(wxEVT_KILL_FOCUS
, tw
->GetId());
860 event
.SetEventObject(tw
);
861 tw
->GetEventHandler()->ProcessEvent(event
);
864 static void wxTextWindowActivateProc(Widget w
, XtPointer clientData
,
865 XmAnyCallbackStruct
*ptr
)
867 if (!wxGetWindowFromTable(w
))
870 wxTextCtrl
*tw
= (wxTextCtrl
*) clientData
;
872 if (tw
->InSetValue())
875 wxCommandEvent
event(wxEVT_COMMAND_TEXT_ENTER
);
876 event
.SetId(tw
->GetId());
877 event
.SetEventObject(tw
);
878 tw
->ProcessCommand(event
);
881 void wxTextCtrl::OnCut(wxCommandEvent
& WXUNUSED(event
))
886 void wxTextCtrl::OnCopy(wxCommandEvent
& WXUNUSED(event
))
891 void wxTextCtrl::OnPaste(wxCommandEvent
& WXUNUSED(event
))
896 void wxTextCtrl::OnUndo(wxCommandEvent
& WXUNUSED(event
))
901 void wxTextCtrl::OnRedo(wxCommandEvent
& WXUNUSED(event
))
906 void wxTextCtrl::OnUpdateCut(wxUpdateUIEvent
& event
)
908 event
.Enable( CanCut() );
911 void wxTextCtrl::OnUpdateCopy(wxUpdateUIEvent
& event
)
913 event
.Enable( CanCopy() );
916 void wxTextCtrl::OnUpdatePaste(wxUpdateUIEvent
& event
)
918 event
.Enable( CanPaste() );
921 void wxTextCtrl::OnUpdateUndo(wxUpdateUIEvent
& event
)
923 event
.Enable( CanUndo() );
926 void wxTextCtrl::OnUpdateRedo(wxUpdateUIEvent
& event
)
928 event
.Enable( CanRedo() );