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 XtVaSetValues ((Widget
) m_mainWidget
,
154 XmNeditable
, ((style
& wxTE_READONLY
) ? False
: True
),
157 // TODO: Is this relevant? What does it do?
159 if (!value
.IsNull() && (value
.Length() > (unsigned int) noCols
))
160 noCols
= value
.Length();
161 XtVaSetValues((Widget
) m_mainWidget
,
166 // remove border if asked for
167 if ( style
& wxNO_BORDER
)
169 XtVaSetValues((Widget
)m_mainWidget
,
170 XmNshadowThickness
, 0,
177 // don't do this because it is just linking the text to a source
178 // string which is unsafe. MB
180 XmTextSetString ((Widget
) m_mainWidget
, (char*)value
.c_str());
182 // do this instead... MB
184 XtVaSetValues( (Widget
) m_mainWidget
,
185 XmNvalue
, (char *)value
.c_str(),
191 XtAddCallback((Widget
) m_mainWidget
, XmNvalueChangedCallback
, (XtCallbackProc
)wxTextWindowChangedProc
, (XtPointer
)this);
193 XtAddCallback((Widget
) m_mainWidget
, XmNmodifyVerifyCallback
, (XtCallbackProc
)wxTextWindowModifyProc
, (XtPointer
)this);
195 XtAddCallback((Widget
) m_mainWidget
, XmNactivateCallback
, (XtCallbackProc
)wxTextWindowActivateProc
, (XtPointer
)this);
197 XtAddCallback((Widget
) m_mainWidget
, XmNfocusCallback
, (XtCallbackProc
)wxTextWindowGainFocusProc
, (XtPointer
)this);
199 XtAddCallback((Widget
) m_mainWidget
, XmNlosingFocusCallback
, (XtCallbackProc
)wxTextWindowLoseFocusProc
, (XtPointer
)this);
202 m_font
= parent
->GetFont();
205 SetCanAddEventHandler(TRUE
);
206 AttachWidget (parent
, m_mainWidget
, (WXWidget
) NULL
, pos
.x
, pos
.y
, size
.x
, size
.y
);
208 ChangeBackgroundColour();
213 WXWidget
wxTextCtrl::GetTopWidget() const
215 return ((m_windowStyle
& wxTE_MULTILINE
) ? (WXWidget
) XtParent((Widget
) m_mainWidget
) : m_mainWidget
);
218 wxString
wxTextCtrl::GetValue() const
220 wxString str
; // result
222 if (m_windowStyle
& wxTE_PASSWORD
)
224 // the value is stored always in m_value because it can't be retrieved
225 // from the text control
230 // just get the string from Motif
231 char *s
= XmTextGetString ((Widget
) m_mainWidget
);
237 //else: return empty string
239 if ( m_tempCallbackStruct
)
241 // the string in the control isn't yet updated, can't use it as is
242 MergeChangesIntoString(str
, (XmTextVerifyCallbackStruct
*)
243 m_tempCallbackStruct
);
250 void wxTextCtrl::SetValue(const wxString
& value
)
255 // don't do this because it is just linking the text to a source
256 // string which is unsafe. MB
258 XmTextSetString ((Widget
) m_mainWidget
, (char*)value
.c_str());
260 // do this instead... MB
262 XtVaSetValues( (Widget
) m_mainWidget
,
263 XmNvalue
, (char *)value
.c_str(),
267 m_inSetValue
= FALSE
;
270 // Clipboard operations
271 void wxTextCtrl::Copy()
273 XmTextCopy((Widget
) m_mainWidget
, CurrentTime
);
276 void wxTextCtrl::Cut()
278 XmTextCut((Widget
) m_mainWidget
, CurrentTime
);
281 void wxTextCtrl::Paste()
283 XmTextPaste((Widget
) m_mainWidget
);
286 bool wxTextCtrl::CanCopy() const
288 // Can copy if there's a selection
290 GetSelection(& from
, & to
);
291 return (from
!= to
) ;
294 bool wxTextCtrl::CanCut() const
296 // Can cut if there's a selection
298 GetSelection(& from
, & to
);
299 return (from
!= to
) ;
302 bool wxTextCtrl::CanPaste() const
304 return IsEditable() ;
308 void wxTextCtrl::Undo()
310 // Not possible in Motif
313 void wxTextCtrl::Redo()
315 // Not possible in Motif
318 bool wxTextCtrl::CanUndo() const
324 bool wxTextCtrl::CanRedo() const
330 // If the return values from and to are the same, there is no
332 void wxTextCtrl::GetSelection(long* from
, long* to
) const
334 XmTextPosition left
, right
;
336 XmTextGetSelectionPosition((Widget
) m_mainWidget
, & left
, & right
);
342 bool wxTextCtrl::IsEditable() const
344 return (XmTextGetEditable((Widget
) m_mainWidget
) != 0);
347 void wxTextCtrl::SetEditable(bool editable
)
349 XmTextSetEditable((Widget
) m_mainWidget
, (Boolean
) editable
);
352 void wxTextCtrl::SetInsertionPoint(long pos
)
354 XmTextSetInsertionPosition ((Widget
) m_mainWidget
, (XmTextPosition
) pos
);
357 void wxTextCtrl::SetInsertionPointEnd()
359 long pos
= GetLastPosition();
360 SetInsertionPoint(pos
);
363 long wxTextCtrl::GetInsertionPoint() const
365 return (long) XmTextGetInsertionPosition ((Widget
) m_mainWidget
);
368 long wxTextCtrl::GetLastPosition() const
370 return (long) XmTextGetLastPosition ((Widget
) m_mainWidget
);
373 void wxTextCtrl::Replace(long from
, long to
, const wxString
& value
)
375 XmTextReplace ((Widget
) m_mainWidget
, (XmTextPosition
) from
, (XmTextPosition
) to
,
376 (char*) (const char*) value
);
379 void wxTextCtrl::Remove(long from
, long to
)
381 XmTextSetSelection ((Widget
) m_mainWidget
, (XmTextPosition
) from
, (XmTextPosition
) to
,
383 XmTextRemove ((Widget
) m_mainWidget
);
386 void wxTextCtrl::SetSelection(long from
, long to
)
388 XmTextSetSelection ((Widget
) m_mainWidget
, (XmTextPosition
) from
, (XmTextPosition
) to
,
392 bool wxTextCtrl::LoadFile(const wxString
& file
)
394 if (!wxFileExists(file
))
401 Widget textWidget
= (Widget
) m_mainWidget
;
405 if ((stat ((char*) (const char*) file
, &statb
) == -1) || (statb
.st_mode
& S_IFMT
) != S_IFREG
||
406 !(fp
= fopen ((char*) (const char*) file
, "r")))
412 long len
= statb
.st_size
;
414 if (!(text
= XtMalloc ((unsigned) (len
+ 1))))
419 if (fread (text
, sizeof (char), len
, fp
) != (size_t) len
)
425 XmTextSetString (textWidget
, text
);
426 // m_textPosition = len;
433 // If file is null, try saved file name first
434 // Returns TRUE if succeeds.
435 bool wxTextCtrl::SaveFile(const wxString
& file
)
437 wxString
theFile(file
);
439 theFile
= m_fileName
;
442 m_fileName
= theFile
;
444 Widget textWidget
= (Widget
) m_mainWidget
;
447 if (!(fp
= fopen ((char*) (const char*) theFile
, "w")))
453 char *text
= XmTextGetString (textWidget
);
454 long len
= XmTextGetLastPosition (textWidget
);
456 if (fwrite (text
, sizeof (char), len
, fp
) != (size_t) len
)
458 // Did not write whole file
460 // Make sure newline terminates the file
461 if (text
[len
- 1] != '\n')
471 void wxTextCtrl::WriteText(const wxString
& text
)
473 long textPosition
= GetInsertionPoint() + strlen (text
);
474 XmTextInsert ((Widget
) m_mainWidget
, GetInsertionPoint(), (char*) (const char*) text
);
475 XtVaSetValues ((Widget
) m_mainWidget
, XmNcursorPosition
, textPosition
, NULL
);
476 SetInsertionPoint(textPosition
);
477 XmTextShowPosition ((Widget
) m_mainWidget
, textPosition
);
481 void wxTextCtrl::AppendText(const wxString
& text
)
483 long textPosition
= GetLastPosition() + strlen(text
);
484 XmTextInsert ((Widget
) m_mainWidget
, GetLastPosition(), (char*) (const char*) text
);
485 XtVaSetValues ((Widget
) m_mainWidget
, XmNcursorPosition
, textPosition
, NULL
);
486 SetInsertionPoint(textPosition
);
487 XmTextShowPosition ((Widget
) m_mainWidget
, textPosition
);
491 void wxTextCtrl::Clear()
493 XmTextSetString ((Widget
) m_mainWidget
, "");
497 bool wxTextCtrl::IsModified() const
502 // Makes 'unmodified'
503 void wxTextCtrl::DiscardEdits()
508 int wxTextCtrl::GetNumberOfLines() const
510 // HIDEOUSLY inefficient, but we have no choice.
511 char *s
= XmTextGetString ((Widget
) m_mainWidget
);
516 bool finished
= FALSE
;
539 long wxTextCtrl::XYToPosition(long x
, long y
) const
541 /* It seems, that there is a bug in some versions of the Motif library,
542 so the original wxWin-Code doesn't work. */
544 Widget textWidget = (Widget) handle;
545 return (long) XmTextXYToPos (textWidget, (Position) x, (Position) y);
547 /* Now a little workaround: */
549 for (int i
=0; i
<y
; i
++) r
+=(GetLineLength(i
)+1);
553 bool wxTextCtrl::PositionToXY(long pos
, long *x
, long *y
) const
556 XmTextPosToXY((Widget
) m_mainWidget
, pos
, &xx
, &yy
);
565 void wxTextCtrl::ShowPosition(long pos
)
567 XmTextShowPosition ((Widget
) m_mainWidget
, (XmTextPosition
) pos
);
570 int wxTextCtrl::GetLineLength(long lineNo
) const
572 wxString str
= GetLineText (lineNo
);
573 return (int) str
.Length();
576 wxString
wxTextCtrl::GetLineText(long lineNo
) const
578 // HIDEOUSLY inefficient, but we have no choice.
579 char *s
= XmTextGetString ((Widget
) m_mainWidget
);
586 for (i
= 0; currentLine
!= lineNo
&& s
[i
]; i
++ )
591 for (j
= 0; s
[i
] && s
[i
] != '\n'; i
++, j
++ )
598 return wxEmptyString
;
605 void wxTextCtrl::Command(wxCommandEvent
& event
)
607 SetValue (event
.GetString());
608 ProcessCommand (event
);
611 void wxTextCtrl::OnDropFiles(wxDropFilesEvent
& event
)
613 // By default, load the first file into the text window.
614 if (event
.GetNumberOfFiles() > 0)
616 LoadFile(event
.GetFiles()[0]);
620 void wxTextCtrl::OnChar(wxKeyEvent
& event
)
622 // Indicates that we should generate a normal command, because
623 // we're letting default behaviour happen (otherwise it's vetoed
624 // by virtue of overriding OnChar)
625 m_processedDefault
= TRUE
;
627 if (m_tempCallbackStruct
)
629 XmTextVerifyCallbackStruct
*textStruct
=
630 (XmTextVerifyCallbackStruct
*) m_tempCallbackStruct
;
631 textStruct
->doit
= True
;
632 if (isascii(event
.m_keyCode
) && (textStruct
->text
->length
== 1))
634 textStruct
->text
->ptr
[0] = ((event
.m_keyCode
== WXK_RETURN
) ? 10 : event
.m_keyCode
);
639 void wxTextCtrl::ChangeFont(bool keepOriginalSize
)
641 wxWindow::ChangeFont(keepOriginalSize
);
644 void wxTextCtrl::ChangeBackgroundColour()
646 wxWindow::ChangeBackgroundColour();
648 /* TODO: should scrollbars be affected? Should probably have separate
649 * function to change them (by default, taken from wxSystemSettings)
651 if (m_windowStyle
& wxTE_MULTILINE
)
653 Widget parent
= XtParent ((Widget
) m_mainWidget
);
656 XtVaGetValues (parent
,
657 XmNhorizontalScrollBar
, &hsb
,
658 XmNverticalScrollBar
, &vsb
,
660 wxColour backgroundColour
= wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE
);
662 DoChangeBackgroundColour((WXWidget
) hsb
, backgroundColour
, TRUE
);
664 DoChangeBackgroundColour((WXWidget
) vsb
, backgroundColour
, TRUE
);
666 DoChangeBackgroundColour((WXWidget
) parent
, m_backgroundColour
, TRUE
);
670 void wxTextCtrl::ChangeForegroundColour()
672 wxWindow::ChangeForegroundColour();
674 if (m_windowStyle
& wxTE_MULTILINE
)
676 Widget parent
= XtParent ((Widget
) m_mainWidget
);
679 XtVaGetValues (parent
,
680 XmNhorizontalScrollBar
, &hsb
,
681 XmNverticalScrollBar
, &vsb
,
684 /* TODO: should scrollbars be affected? Should probably have separate
685 * function to change them (by default, taken from wxSystemSettings)
687 DoChangeForegroundColour((WXWidget) hsb, m_foregroundColour);
689 DoChangeForegroundColour((WXWidget) vsb, m_foregroundColour);
691 DoChangeForegroundColour((WXWidget
) parent
, m_foregroundColour
);
695 void wxTextCtrl::DoSendEvents(void *wxcbs
, long keycode
)
697 // we're in process of updating the text control
698 m_tempCallbackStruct
= wxcbs
;
700 XmTextVerifyCallbackStruct
*cbs
= (XmTextVerifyCallbackStruct
*)wxcbs
;
702 wxKeyEvent
event (wxEVT_CHAR
);
703 event
.SetId(GetId());
704 event
.m_keyCode
= keycode
;
705 event
.SetEventObject(this);
707 // Only if wxTextCtrl::OnChar is called will this be set to True (and
708 // the character passed through)
711 GetEventHandler()->ProcessEvent(event
);
713 if ( !InSetValue() && m_processedDefault
)
715 // Can generate a command
716 wxCommandEvent
commandEvent(wxEVT_COMMAND_TEXT_UPDATED
, GetId());
717 commandEvent
.SetEventObject(this);
718 ProcessCommand(commandEvent
);
721 // do it after the (user) event handlers processed the events because
722 // otherwise GetValue() would return incorrect (not yet updated value)
723 m_tempCallbackStruct
= NULL
;
726 // ----------------------------------------------------------------------------
727 // helpers and Motif callbacks
728 // ----------------------------------------------------------------------------
730 static void MergeChangesIntoString(wxString
& value
,
731 XmTextVerifyCallbackStruct
*cbs
)
734 * At least on my system (SunOS 4.1.3 + Motif 1.2), you need to think of
735 * every event as a replace event. cbs->text->ptr gives the replacement
736 * text, cbs->startPos gives the index of the first char affected by the
737 * replace, and cbs->endPos gives the index one more than the last char
738 * affected by the replace (startPos == endPos implies an empty range).
739 * Hence, a deletion is represented by replacing all input text with a
740 * blank string ("", *not* NULL!). A simple insertion that does not
741 * overwrite any text has startPos == endPos.
746 // easy case: the ol value was empty
747 value
= cbs
->text
->ptr
;
751 // merge the changes into the value
752 const char * const passwd
= value
;
753 int len
= value
.length();
755 len
+= strlen(cbs
->text
->ptr
) + 1; // + new text (if any) + NUL
756 len
-= cbs
->endPos
- cbs
->startPos
; // - text from affected region.
758 char * newS
= new char [len
];
760 * insert
= cbs
->text
->ptr
;
762 // Copy (old) text from passwd, up to the start posn of the change.
764 const char * p
= passwd
;
765 for (i
= 0; i
< cbs
->startPos
; ++i
)
768 // Copy the text to be inserted).
772 // Finally, copy into newS any remaining text from passwd[endPos] on.
773 for (p
= passwd
+ cbs
->endPos
; *p
; )
784 wxTextWindowChangedProc (Widget w
, XtPointer clientData
, XtPointer
WXUNUSED(ptr
))
786 if (!wxGetWindowFromTable(w
))
787 // Widget has been deleted!
790 wxTextCtrl
*tw
= (wxTextCtrl
*) clientData
;
791 tw
->SetModified(TRUE
);
795 wxTextWindowModifyProc (Widget
WXUNUSED(w
), XtPointer clientData
, XmTextVerifyCallbackStruct
*cbs
)
797 wxTextCtrl
*tw
= (wxTextCtrl
*) clientData
;
798 tw
->m_processedDefault
= FALSE
;
800 // First, do some stuff if it's a password control: in this case, we need
801 // to store the string inside the class because GetValue() can't retrieve
802 // it from the text ctrl. We do *not* do it in other circumstances because
803 // it would double the amount of memory needed.
805 if ( tw
->GetWindowStyleFlag() & wxTE_PASSWORD
)
807 MergeChangesIntoString(tw
->m_value
, cbs
);
809 if ( cbs
->text
->length
> 0 )
812 for (i
= 0; i
< cbs
->text
->length
; ++i
)
813 cbs
->text
->ptr
[i
] = '*';
814 cbs
->text
->ptr
[i
] = '\0';
818 // If we're already within an OnChar, return: probably a programmatic
820 if (tw
->m_tempCallbackStruct
)
823 // Check for a backspace
824 if (cbs
->startPos
== (cbs
->currInsert
- 1))
826 tw
->DoSendEvents((void *)cbs
, WXK_DELETE
);
831 // Pasting operation: let it through without calling OnChar
832 if (cbs
->text
->length
> 1)
835 // Something other than text
836 if (cbs
->text
->ptr
== NULL
)
840 char ch
= cbs
->text
->ptr
[0];
841 tw
->DoSendEvents((void *)cbs
, ch
== '\n' ? '\r' : ch
);
845 wxTextWindowGainFocusProc (Widget w
, XtPointer clientData
, XmAnyCallbackStruct
*WXUNUSED(cbs
))
847 if (!wxGetWindowFromTable(w
))
850 wxTextCtrl
*tw
= (wxTextCtrl
*) clientData
;
851 wxFocusEvent
event(wxEVT_SET_FOCUS
, tw
->GetId());
852 event
.SetEventObject(tw
);
853 tw
->GetEventHandler()->ProcessEvent(event
);
857 wxTextWindowLoseFocusProc (Widget w
, XtPointer clientData
, XmAnyCallbackStruct
*WXUNUSED(cbs
))
859 if (!wxGetWindowFromTable(w
))
862 wxTextCtrl
*tw
= (wxTextCtrl
*) clientData
;
863 wxFocusEvent
event(wxEVT_KILL_FOCUS
, tw
->GetId());
864 event
.SetEventObject(tw
);
865 tw
->GetEventHandler()->ProcessEvent(event
);
868 static void wxTextWindowActivateProc(Widget w
, XtPointer clientData
,
869 XmAnyCallbackStruct
*WXUNUSED(ptr
))
871 if (!wxGetWindowFromTable(w
))
874 wxTextCtrl
*tw
= (wxTextCtrl
*) clientData
;
876 if (tw
->InSetValue())
879 wxCommandEvent
event(wxEVT_COMMAND_TEXT_ENTER
);
880 event
.SetId(tw
->GetId());
881 event
.SetEventObject(tw
);
882 tw
->ProcessCommand(event
);
885 void wxTextCtrl::OnCut(wxCommandEvent
& WXUNUSED(event
))
890 void wxTextCtrl::OnCopy(wxCommandEvent
& WXUNUSED(event
))
895 void wxTextCtrl::OnPaste(wxCommandEvent
& WXUNUSED(event
))
900 void wxTextCtrl::OnUndo(wxCommandEvent
& WXUNUSED(event
))
905 void wxTextCtrl::OnRedo(wxCommandEvent
& WXUNUSED(event
))
910 void wxTextCtrl::OnUpdateCut(wxUpdateUIEvent
& event
)
912 event
.Enable( CanCut() );
915 void wxTextCtrl::OnUpdateCopy(wxUpdateUIEvent
& event
)
917 event
.Enable( CanCopy() );
920 void wxTextCtrl::OnUpdatePaste(wxUpdateUIEvent
& event
)
922 event
.Enable( CanPaste() );
925 void wxTextCtrl::OnUpdateUndo(wxUpdateUIEvent
& event
)
927 event
.Enable( CanUndo() );
930 void wxTextCtrl::OnUpdateRedo(wxUpdateUIEvent
& event
)
932 event
.Enable( CanRedo() );