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"
24 // For compilers that support precompilation, includes "wx.h".
25 #include "wx/wxprec.h"
28 #define XtParent XTPARENT
33 #include <sys/types.h>
37 #include "wx/textctrl.h"
38 #include "wx/settings.h"
39 #include "wx/filefn.h"
43 #pragma message disable nosimpint
47 #pragma message enable nosimpint
50 #include "wx/motif/private.h"
52 // ----------------------------------------------------------------------------
54 // ----------------------------------------------------------------------------
56 // helper: inserts the new text in the value of the text ctrl and returns the
58 static void MergeChangesIntoString(wxString
& value
,
59 XmTextVerifyCallbackStruct
*textStruct
);
62 static void wxTextWindowChangedProc(Widget w
, XtPointer clientData
, XtPointer ptr
);
63 static void wxTextWindowModifyProc(Widget w
, XtPointer clientData
, XmTextVerifyCallbackStruct
*cbs
);
64 static void wxTextWindowGainFocusProc(Widget w
, XtPointer clientData
, XmAnyCallbackStruct
*cbs
);
65 static void wxTextWindowLoseFocusProc(Widget w
, XtPointer clientData
, XmAnyCallbackStruct
*cbs
);
66 static void wxTextWindowActivateProc(Widget w
, XtPointer clientData
, XmAnyCallbackStruct
*ptr
);
68 IMPLEMENT_DYNAMIC_CLASS(wxTextCtrl
, wxControl
)
70 BEGIN_EVENT_TABLE(wxTextCtrl
, wxControl
)
71 EVT_DROP_FILES(wxTextCtrl::OnDropFiles
)
72 EVT_CHAR(wxTextCtrl::OnChar
)
74 EVT_MENU(wxID_CUT
, wxTextCtrl::OnCut
)
75 EVT_MENU(wxID_COPY
, wxTextCtrl::OnCopy
)
76 EVT_MENU(wxID_PASTE
, wxTextCtrl::OnPaste
)
77 EVT_MENU(wxID_UNDO
, wxTextCtrl::OnUndo
)
78 EVT_MENU(wxID_REDO
, wxTextCtrl::OnRedo
)
80 EVT_UPDATE_UI(wxID_CUT
, wxTextCtrl::OnUpdateCut
)
81 EVT_UPDATE_UI(wxID_COPY
, wxTextCtrl::OnUpdateCopy
)
82 EVT_UPDATE_UI(wxID_PASTE
, wxTextCtrl::OnUpdatePaste
)
83 EVT_UPDATE_UI(wxID_UNDO
, wxTextCtrl::OnUpdateUndo
)
84 EVT_UPDATE_UI(wxID_REDO
, wxTextCtrl::OnUpdateRedo
)
88 // ============================================================================
90 // ============================================================================
92 // ----------------------------------------------------------------------------
94 // ----------------------------------------------------------------------------
97 wxTextCtrl::wxTextCtrl()
99 m_tempCallbackStruct
= (void*) NULL
;
101 m_processedDefault
= false;
104 bool wxTextCtrl::Create(wxWindow
*parent
,
106 const wxString
& value
,
110 const wxValidator
& validator
,
111 const wxString
& name
)
113 if( !CreateControl( parent
, id
, pos
, size
, style
, validator
, name
) )
116 m_tempCallbackStruct
= (void*) NULL
;
118 m_processedDefault
= false;
120 m_backgroundColour
= *wxWHITE
;
122 Widget parentWidget
= (Widget
) parent
->GetClientWidget();
124 bool wantHorizScrolling
= ((m_windowStyle
& wxHSCROLL
) != 0);
126 // If we don't have horizontal scrollbars, we want word wrap.
127 bool wantWordWrap
= !wantHorizScrolling
;
129 if (m_windowStyle
& wxTE_MULTILINE
)
132 XtSetArg (args
[0], XmNscrollHorizontal
, wantHorizScrolling
? True
: False
);
133 XtSetArg (args
[1], XmNwordWrap
, wantWordWrap
? True
: False
);
135 m_mainWidget
= (WXWidget
) XmCreateScrolledText(parentWidget
,
136 wxConstCast(name
.c_str(), char),
139 XtVaSetValues ((Widget
) m_mainWidget
,
140 XmNeditable
, ((style
& wxTE_READONLY
) ? False
: True
),
141 XmNeditMode
, XmMULTI_LINE_EDIT
,
143 XtManageChild ((Widget
) m_mainWidget
);
147 m_mainWidget
= (WXWidget
)XtVaCreateManagedWidget
149 wxConstCast(name
.c_str(), char),
155 XtVaSetValues ((Widget
) m_mainWidget
,
156 XmNeditable
, ((style
& wxTE_READONLY
) ? False
: True
),
159 // TODO: Is this relevant? What does it do?
161 if (!value
.IsNull() && (value
.Length() > (unsigned int) noCols
))
162 noCols
= value
.Length();
163 XtVaSetValues((Widget
) m_mainWidget
,
168 // remove border if asked for
169 if ( style
& wxNO_BORDER
)
171 XtVaSetValues((Widget
)m_mainWidget
,
172 XmNshadowThickness
, 0,
176 if ( !value
.empty() )
178 // do this instead... MB
180 XtVaSetValues( (Widget
) m_mainWidget
,
181 XmNvalue
, wxConstCast(value
.c_str(), char),
186 XtAddCallback((Widget
) m_mainWidget
, XmNvalueChangedCallback
, (XtCallbackProc
)wxTextWindowChangedProc
, (XtPointer
)this);
188 XtAddCallback((Widget
) m_mainWidget
, XmNmodifyVerifyCallback
, (XtCallbackProc
)wxTextWindowModifyProc
, (XtPointer
)this);
190 XtAddCallback((Widget
) m_mainWidget
, XmNactivateCallback
, (XtCallbackProc
)wxTextWindowActivateProc
, (XtPointer
)this);
192 XtAddCallback((Widget
) m_mainWidget
, XmNfocusCallback
, (XtCallbackProc
)wxTextWindowGainFocusProc
, (XtPointer
)this);
194 XtAddCallback((Widget
) m_mainWidget
, XmNlosingFocusCallback
, (XtCallbackProc
)wxTextWindowLoseFocusProc
, (XtPointer
)this);
199 wxSize best
= GetBestSize();
200 if( size
.x
!= -1 ) best
.x
= size
.x
;
201 if( size
.y
!= -1 ) best
.y
= size
.y
;
203 AttachWidget (parent
, m_mainWidget
, (WXWidget
) NULL
,
204 pos
.x
, pos
.y
, best
.x
, best
.y
);
206 ChangeBackgroundColour();
211 WXWidget
wxTextCtrl::GetTopWidget() const
213 return IsMultiLine() ? (WXWidget
)XtParent((Widget
)m_mainWidget
)
217 wxString
wxTextCtrl::GetValue() const
219 wxString str
; // result
221 if (m_windowStyle
& wxTE_PASSWORD
)
223 // the value is stored always in m_value because it can't be retrieved
224 // from the text control
229 // just get the string from Motif
230 char *s
= XmTextGetString ((Widget
) m_mainWidget
);
236 //else: return empty string
238 if ( m_tempCallbackStruct
)
240 // the string in the control isn't yet updated, can't use it as is
241 MergeChangesIntoString(str
, (XmTextVerifyCallbackStruct
*)
242 m_tempCallbackStruct
);
249 void wxTextCtrl::SetValue(const wxString
& value
)
253 // do this instead... MB
255 // with (at least) OpenMotif 2.1 this causes a lot of flicker
257 XtVaSetValues( (Widget
) m_mainWidget
,
258 XmNvalue
, wxConstCast(value
.c_str(), char),
265 m_inSetValue
= false;
268 // Clipboard operations
269 void wxTextCtrl::Copy()
271 XmTextCopy((Widget
) m_mainWidget
, CurrentTime
);
274 void wxTextCtrl::Cut()
276 XmTextCut((Widget
) m_mainWidget
, CurrentTime
);
279 void wxTextCtrl::Paste()
281 XmTextPaste((Widget
) m_mainWidget
);
284 bool wxTextCtrl::CanCopy() const
286 // Can copy if there's a selection
288 GetSelection(& from
, & to
);
289 return (from
!= to
) ;
292 bool wxTextCtrl::CanCut() const
294 // Can cut if there's a selection
296 GetSelection(& from
, & to
);
297 return (from
!= to
) && (IsEditable());
300 bool wxTextCtrl::CanPaste() const
302 return IsEditable() ;
306 void wxTextCtrl::Undo()
308 // Not possible in Motif
311 void wxTextCtrl::Redo()
313 // Not possible in Motif
316 bool wxTextCtrl::CanUndo() const
322 bool wxTextCtrl::CanRedo() const
328 // If the return values from and to are the same, there is no
330 void wxTextCtrl::GetSelection(long* from
, long* to
) const
332 XmTextPosition left
, right
;
334 XmTextGetSelectionPosition((Widget
) m_mainWidget
, & left
, & right
);
340 bool wxTextCtrl::IsEditable() const
342 return (XmTextGetEditable((Widget
) m_mainWidget
) != 0);
345 void wxTextCtrl::SetEditable(bool editable
)
347 XmTextSetEditable((Widget
) m_mainWidget
, (Boolean
) editable
);
350 void wxTextCtrl::SetInsertionPoint(long pos
)
352 XmTextSetInsertionPosition ((Widget
) m_mainWidget
, (XmTextPosition
) pos
);
355 void wxTextCtrl::SetInsertionPointEnd()
357 wxTextPos pos
= GetLastPosition();
358 SetInsertionPoint(pos
);
361 long wxTextCtrl::GetInsertionPoint() const
363 return (long) XmTextGetInsertionPosition ((Widget
) m_mainWidget
);
366 wxTextPos
wxTextCtrl::GetLastPosition() const
368 return (long) XmTextGetLastPosition ((Widget
) m_mainWidget
);
371 void wxTextCtrl::Replace(long from
, long to
, const wxString
& value
)
373 XmTextReplace ((Widget
) m_mainWidget
, (XmTextPosition
) from
, (XmTextPosition
) to
,
374 wxConstCast(value
.c_str(), char));
377 void wxTextCtrl::Remove(long from
, long to
)
379 XmTextSetSelection ((Widget
) m_mainWidget
, (XmTextPosition
) from
, (XmTextPosition
) to
,
381 XmTextRemove ((Widget
) m_mainWidget
);
384 void wxTextCtrl::SetSelection(long from
, long to
)
387 to
= GetLastPosition();
389 XmTextSetSelection ((Widget
) m_mainWidget
, (XmTextPosition
) from
, (XmTextPosition
) to
,
393 void wxTextCtrl::WriteText(const wxString
& text
)
395 long textPosition
= GetInsertionPoint() + strlen (text
);
396 XmTextInsert ((Widget
) m_mainWidget
, GetInsertionPoint(),
397 wxConstCast(text
.c_str(), char));
398 XtVaSetValues ((Widget
) m_mainWidget
, XmNcursorPosition
, textPosition
, NULL
);
399 SetInsertionPoint(textPosition
);
400 XmTextShowPosition ((Widget
) m_mainWidget
, textPosition
);
404 void wxTextCtrl::AppendText(const wxString
& text
)
406 wxTextPos textPosition
= GetLastPosition() + text
.length();
407 XmTextInsert ((Widget
) m_mainWidget
, GetLastPosition(),
408 wxConstCast(text
.c_str(), char));
409 XtVaSetValues ((Widget
) m_mainWidget
, XmNcursorPosition
, textPosition
, NULL
);
410 SetInsertionPoint(textPosition
);
411 XmTextShowPosition ((Widget
) m_mainWidget
, textPosition
);
415 void wxTextCtrl::Clear()
417 XmTextSetString ((Widget
) m_mainWidget
, "");
421 bool wxTextCtrl::IsModified() const
426 // Makes modified or unmodified
427 void wxTextCtrl::MarkDirty()
432 void wxTextCtrl::DiscardEdits()
437 int wxTextCtrl::GetNumberOfLines() const
439 // HIDEOUSLY inefficient, but we have no choice.
440 char *s
= XmTextGetString ((Widget
) m_mainWidget
);
445 bool finished
= false;
468 long wxTextCtrl::XYToPosition(long x
, long y
) const
470 /* It seems, that there is a bug in some versions of the Motif library,
471 so the original wxWin-Code doesn't work. */
473 Widget textWidget = (Widget) handle;
474 return (long) XmTextXYToPos (textWidget, (Position) x, (Position) y);
476 /* Now a little workaround: */
478 for (int i
=0; i
<y
; i
++) r
+=(GetLineLength(i
)+1);
482 bool wxTextCtrl::PositionToXY(long pos
, long *x
, long *y
) const
485 XmTextPosToXY((Widget
) m_mainWidget
, pos
, &xx
, &yy
);
494 void wxTextCtrl::ShowPosition(long pos
)
496 XmTextShowPosition ((Widget
) m_mainWidget
, (XmTextPosition
) pos
);
499 int wxTextCtrl::GetLineLength(long lineNo
) const
501 wxString str
= GetLineText (lineNo
);
502 return (int) str
.Length();
505 wxString
wxTextCtrl::GetLineText(long lineNo
) const
507 // HIDEOUSLY inefficient, but we have no choice.
508 char *s
= XmTextGetString ((Widget
) m_mainWidget
);
515 for (i
= 0; currentLine
!= lineNo
&& s
[i
]; i
++ )
520 for (j
= 0; s
[i
] && s
[i
] != '\n'; i
++, j
++ )
527 return wxEmptyString
;
534 void wxTextCtrl::Command(wxCommandEvent
& event
)
536 SetValue (event
.GetString());
537 ProcessCommand (event
);
540 void wxTextCtrl::OnDropFiles(wxDropFilesEvent
& event
)
542 // By default, load the first file into the text window.
543 if (event
.GetNumberOfFiles() > 0)
545 LoadFile(event
.GetFiles()[0]);
549 void wxTextCtrl::OnChar(wxKeyEvent
& event
)
551 // Indicates that we should generate a normal command, because
552 // we're letting default behaviour happen (otherwise it's vetoed
553 // by virtue of overriding OnChar)
554 m_processedDefault
= true;
556 if (m_tempCallbackStruct
)
558 XmTextVerifyCallbackStruct
*textStruct
=
559 (XmTextVerifyCallbackStruct
*) m_tempCallbackStruct
;
560 textStruct
->doit
= True
;
561 if (isascii(event
.m_keyCode
) && (textStruct
->text
->length
== 1))
563 textStruct
->text
->ptr
[0] = ((event
.m_keyCode
== WXK_RETURN
) ? 10 : event
.m_keyCode
);
568 void wxTextCtrl::ChangeFont(bool keepOriginalSize
)
570 wxWindow::ChangeFont(keepOriginalSize
);
573 void wxTextCtrl::ChangeBackgroundColour()
575 wxWindow::ChangeBackgroundColour();
577 /* TODO: should scrollbars be affected? Should probably have separate
578 * function to change them (by default, taken from wxSystemSettings)
580 if (m_windowStyle
& wxTE_MULTILINE
)
582 Widget parent
= XtParent ((Widget
) m_mainWidget
);
585 XtVaGetValues (parent
,
586 XmNhorizontalScrollBar
, &hsb
,
587 XmNverticalScrollBar
, &vsb
,
589 wxColour backgroundColour
= wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE
);
591 wxDoChangeBackgroundColour((WXWidget
) hsb
, backgroundColour
, true);
593 wxDoChangeBackgroundColour((WXWidget
) vsb
, backgroundColour
, true);
595 // MBN: why change parent background?
596 // DoChangeBackgroundColour((WXWidget) parent, m_backgroundColour, true);
600 void wxTextCtrl::ChangeForegroundColour()
602 wxWindow::ChangeForegroundColour();
604 if (m_windowStyle
& wxTE_MULTILINE
)
606 Widget parent
= XtParent ((Widget
) m_mainWidget
);
609 XtVaGetValues (parent
,
610 XmNhorizontalScrollBar
, &hsb
,
611 XmNverticalScrollBar
, &vsb
,
614 /* TODO: should scrollbars be affected? Should probably have separate
615 * function to change them (by default, taken from wxSystemSettings)
617 DoChangeForegroundColour((WXWidget) hsb, m_foregroundColour);
619 DoChangeForegroundColour((WXWidget) vsb, m_foregroundColour);
621 wxDoChangeForegroundColour((WXWidget
) parent
, m_foregroundColour
);
625 void wxTextCtrl::DoSendEvents(void *wxcbs
, long keycode
)
627 // we're in process of updating the text control
628 m_tempCallbackStruct
= wxcbs
;
630 XmTextVerifyCallbackStruct
*cbs
= (XmTextVerifyCallbackStruct
*)wxcbs
;
632 wxKeyEvent
event (wxEVT_CHAR
);
633 event
.SetId(GetId());
634 event
.m_keyCode
= keycode
;
635 event
.SetEventObject(this);
637 // Only if wxTextCtrl::OnChar is called will this be set to True (and
638 // the character passed through)
641 GetEventHandler()->ProcessEvent(event
);
643 if ( !InSetValue() && m_processedDefault
)
645 // Can generate a command
646 wxCommandEvent
commandEvent(wxEVT_COMMAND_TEXT_UPDATED
, GetId());
647 commandEvent
.SetEventObject(this);
648 ProcessCommand(commandEvent
);
651 // do it after the (user) event handlers processed the events because
652 // otherwise GetValue() would return incorrect (not yet updated value)
653 m_tempCallbackStruct
= NULL
;
656 wxSize
wxDoGetSingleTextCtrlBestSize( Widget textWidget
,
657 const wxWindow
* window
)
659 Dimension xmargin
, ymargin
, highlight
, shadow
;
662 XtVaGetValues( textWidget
,
663 XmNmarginWidth
, &xmargin
,
664 XmNmarginHeight
, &ymargin
,
666 XmNhighlightThickness
, &highlight
,
667 XmNshadowThickness
, &shadow
,
674 window
->GetTextExtent( value
, &x
, &y
);
676 if( x
< 100 ) x
= 100;
678 return wxSize( x
+ 2 * xmargin
+ 2 * highlight
+ 2 * shadow
,
679 // MBN: +2 necessary: Lesstif bug or mine?
680 y
+ 2 * ymargin
+ 2 * highlight
+ 2 * shadow
+ 2 );
683 wxSize
wxTextCtrl::DoGetBestSize() const
686 return wxDoGetSingleTextCtrlBestSize( (Widget
)m_mainWidget
, this );
688 return wxWindow::DoGetBestSize();
691 // ----------------------------------------------------------------------------
692 // helpers and Motif callbacks
693 // ----------------------------------------------------------------------------
695 static void MergeChangesIntoString(wxString
& value
,
696 XmTextVerifyCallbackStruct
*cbs
)
699 * At least on my system (SunOS 4.1.3 + Motif 1.2), you need to think of
700 * every event as a replace event. cbs->text->ptr gives the replacement
701 * text, cbs->startPos gives the index of the first char affected by the
702 * replace, and cbs->endPos gives the index one more than the last char
703 * affected by the replace (startPos == endPos implies an empty range).
704 * Hence, a deletion is represented by replacing all input text with a
705 * blank string ("", *not* NULL!). A simple insertion that does not
706 * overwrite any text has startPos == endPos.
711 // easy case: the ol value was empty
712 value
= cbs
->text
->ptr
;
716 // merge the changes into the value
717 const char * const passwd
= value
;
718 int len
= value
.length();
720 len
+= ( cbs
->text
->ptr
?
721 strlen(cbs
->text
->ptr
) :
722 0 ) + 1; // + new text (if any) + NUL
723 len
-= cbs
->endPos
- cbs
->startPos
; // - text from affected region.
725 char * newS
= new char [len
];
727 * insert
= cbs
->text
->ptr
;
729 // Copy (old) text from passwd, up to the start posn of the change.
731 const char * p
= passwd
;
732 for (i
= 0; i
< cbs
->startPos
; ++i
)
735 // Copy the text to be inserted).
740 // Finally, copy into newS any remaining text from passwd[endPos] on.
741 for (p
= passwd
+ cbs
->endPos
; *p
; )
752 wxTextWindowChangedProc (Widget w
, XtPointer clientData
, XtPointer
WXUNUSED(ptr
))
754 if (!wxGetWindowFromTable(w
))
755 // Widget has been deleted!
758 wxTextCtrl
*tw
= (wxTextCtrl
*) clientData
;
759 tw
->SetModified(true);
763 wxTextWindowModifyProc (Widget
WXUNUSED(w
), XtPointer clientData
, XmTextVerifyCallbackStruct
*cbs
)
765 wxTextCtrl
*tw
= (wxTextCtrl
*) clientData
;
766 tw
->m_processedDefault
= false;
768 // First, do some stuff if it's a password control: in this case, we need
769 // to store the string inside the class because GetValue() can't retrieve
770 // it from the text ctrl. We do *not* do it in other circumstances because
771 // it would double the amount of memory needed.
773 if ( tw
->GetWindowStyleFlag() & wxTE_PASSWORD
)
775 MergeChangesIntoString(tw
->m_value
, cbs
);
777 if ( cbs
->text
->length
> 0 )
780 for (i
= 0; i
< cbs
->text
->length
; ++i
)
781 cbs
->text
->ptr
[i
] = '*';
782 cbs
->text
->ptr
[i
] = '\0';
789 // If we're already within an OnChar, return: probably a programmatic
791 if (tw
->m_tempCallbackStruct
)
794 // Check for a backspace
795 if (cbs
->startPos
== (cbs
->currInsert
- 1))
797 tw
->DoSendEvents((void *)cbs
, WXK_DELETE
);
802 // Pasting operation: let it through without calling OnChar
803 if (cbs
->text
->length
> 1)
806 // Something other than text
807 if (cbs
->text
->ptr
== NULL
)
811 char ch
= cbs
->text
->ptr
[0];
812 tw
->DoSendEvents((void *)cbs
, ch
== '\n' ? '\r' : ch
);
816 wxTextWindowGainFocusProc (Widget w
, XtPointer clientData
, XmAnyCallbackStruct
*WXUNUSED(cbs
))
818 if (!wxGetWindowFromTable(w
))
821 wxTextCtrl
*tw
= (wxTextCtrl
*) clientData
;
822 wxFocusEvent
event(wxEVT_SET_FOCUS
, tw
->GetId());
823 event
.SetEventObject(tw
);
824 tw
->GetEventHandler()->ProcessEvent(event
);
828 wxTextWindowLoseFocusProc (Widget w
, XtPointer clientData
, XmAnyCallbackStruct
*WXUNUSED(cbs
))
830 if (!wxGetWindowFromTable(w
))
833 wxTextCtrl
*tw
= (wxTextCtrl
*) clientData
;
834 wxFocusEvent
event(wxEVT_KILL_FOCUS
, tw
->GetId());
835 event
.SetEventObject(tw
);
836 tw
->GetEventHandler()->ProcessEvent(event
);
839 static void wxTextWindowActivateProc(Widget w
, XtPointer clientData
,
840 XmAnyCallbackStruct
*WXUNUSED(ptr
))
842 if (!wxGetWindowFromTable(w
))
845 wxTextCtrl
*tw
= (wxTextCtrl
*) clientData
;
847 if (tw
->InSetValue())
850 wxCommandEvent
event(wxEVT_COMMAND_TEXT_ENTER
);
851 event
.SetId(tw
->GetId());
852 event
.SetEventObject(tw
);
853 tw
->ProcessCommand(event
);
856 void wxTextCtrl::OnCut(wxCommandEvent
& WXUNUSED(event
))
861 void wxTextCtrl::OnCopy(wxCommandEvent
& WXUNUSED(event
))
866 void wxTextCtrl::OnPaste(wxCommandEvent
& WXUNUSED(event
))
871 void wxTextCtrl::OnUndo(wxCommandEvent
& WXUNUSED(event
))
876 void wxTextCtrl::OnRedo(wxCommandEvent
& WXUNUSED(event
))
881 void wxTextCtrl::OnUpdateCut(wxUpdateUIEvent
& event
)
883 event
.Enable( CanCut() );
886 void wxTextCtrl::OnUpdateCopy(wxUpdateUIEvent
& event
)
888 event
.Enable( CanCopy() );
891 void wxTextCtrl::OnUpdatePaste(wxUpdateUIEvent
& event
)
893 event
.Enable( CanPaste() );
896 void wxTextCtrl::OnUpdateUndo(wxUpdateUIEvent
& event
)
898 event
.Enable( CanUndo() );
901 void wxTextCtrl::OnUpdateRedo(wxUpdateUIEvent
& event
)
903 event
.Enable( CanRedo() );