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"
35 #pragma message disable nosimpint
39 #pragma message enable nosimpint
42 #include "wx/motif/private.h"
44 // ----------------------------------------------------------------------------
46 // ----------------------------------------------------------------------------
48 // helper: inserts the new text in the value of the text ctrl and returns the
50 static void MergeChangesIntoString(wxString
& value
,
51 XmTextVerifyCallbackStruct
*textStruct
);
54 static void wxTextWindowChangedProc(Widget w
, XtPointer clientData
, XtPointer ptr
);
55 static void wxTextWindowModifyProc(Widget w
, XtPointer clientData
, XmTextVerifyCallbackStruct
*cbs
);
56 static void wxTextWindowGainFocusProc(Widget w
, XtPointer clientData
, XmAnyCallbackStruct
*cbs
);
57 static void wxTextWindowLoseFocusProc(Widget w
, XtPointer clientData
, XmAnyCallbackStruct
*cbs
);
58 static void wxTextWindowActivateProc(Widget w
, XtPointer clientData
, XmAnyCallbackStruct
*ptr
);
60 IMPLEMENT_DYNAMIC_CLASS(wxTextCtrl
, wxControl
)
62 BEGIN_EVENT_TABLE(wxTextCtrl
, wxControl
)
63 EVT_DROP_FILES(wxTextCtrl::OnDropFiles
)
64 EVT_CHAR(wxTextCtrl::OnChar
)
66 EVT_MENU(wxID_CUT
, wxTextCtrl::OnCut
)
67 EVT_MENU(wxID_COPY
, wxTextCtrl::OnCopy
)
68 EVT_MENU(wxID_PASTE
, wxTextCtrl::OnPaste
)
69 EVT_MENU(wxID_UNDO
, wxTextCtrl::OnUndo
)
70 EVT_MENU(wxID_REDO
, wxTextCtrl::OnRedo
)
72 EVT_UPDATE_UI(wxID_CUT
, wxTextCtrl::OnUpdateCut
)
73 EVT_UPDATE_UI(wxID_COPY
, wxTextCtrl::OnUpdateCopy
)
74 EVT_UPDATE_UI(wxID_PASTE
, wxTextCtrl::OnUpdatePaste
)
75 EVT_UPDATE_UI(wxID_UNDO
, wxTextCtrl::OnUpdateUndo
)
76 EVT_UPDATE_UI(wxID_REDO
, wxTextCtrl::OnUpdateRedo
)
80 // ============================================================================
82 // ============================================================================
84 // ----------------------------------------------------------------------------
86 // ----------------------------------------------------------------------------
89 wxTextCtrl::wxTextCtrl()
91 m_tempCallbackStruct
= (void*) NULL
;
93 m_processedDefault
= FALSE
;
96 bool wxTextCtrl::Create(wxWindow
*parent
,
98 const wxString
& value
,
102 const wxValidator
& validator
,
103 const wxString
& name
)
105 m_tempCallbackStruct
= (void*) NULL
;
107 m_processedDefault
= FALSE
;
108 // m_backgroundColour = parent->GetBackgroundColour();
109 m_backgroundColour
= * wxWHITE
;
110 m_foregroundColour
= parent
->GetForegroundColour();
113 SetValidator(validator
);
115 parent
->AddChild(this);
117 m_windowStyle
= style
;
120 m_windowId
= (int)NewControlId();
124 Widget parentWidget
= (Widget
) parent
->GetClientWidget();
126 bool wantHorizScrolling
= ((m_windowStyle
& wxHSCROLL
) != 0);
128 // If we don't have horizontal scrollbars, we want word wrap.
129 bool wantWordWrap
= !wantHorizScrolling
;
131 if (m_windowStyle
& wxTE_MULTILINE
)
134 XtSetArg (args
[0], XmNscrollHorizontal
, wantHorizScrolling
? True
: False
);
135 XtSetArg (args
[1], XmNwordWrap
, wantWordWrap
? True
: False
);
137 m_mainWidget
= (WXWidget
) XmCreateScrolledText(parentWidget
,
141 XtVaSetValues ((Widget
) m_mainWidget
,
142 XmNeditable
, ((style
& wxTE_READONLY
) ? False
: True
),
143 XmNeditMode
, XmMULTI_LINE_EDIT
,
145 XtManageChild ((Widget
) m_mainWidget
);
149 m_mainWidget
= (WXWidget
)XtVaCreateManagedWidget
157 XtVaSetValues ((Widget
) m_mainWidget
,
158 XmNeditable
, ((style
& wxTE_READONLY
) ? False
: True
),
161 // TODO: Is this relevant? What does it do?
163 if (!value
.IsNull() && (value
.Length() > (unsigned int) noCols
))
164 noCols
= value
.Length();
165 XtVaSetValues((Widget
) m_mainWidget
,
170 // remove border if asked for
171 if ( style
& wxNO_BORDER
)
173 XtVaSetValues((Widget
)m_mainWidget
,
174 XmNshadowThickness
, 0,
181 // don't do this because it is just linking the text to a source
182 // string which is unsafe. MB
184 XmTextSetString ((Widget
) m_mainWidget
, (char*)value
.c_str());
186 // do this instead... MB
188 XtVaSetValues( (Widget
) m_mainWidget
,
189 XmNvalue
, (char *)value
.c_str(),
195 XtAddCallback((Widget
) m_mainWidget
, XmNvalueChangedCallback
, (XtCallbackProc
)wxTextWindowChangedProc
, (XtPointer
)this);
197 XtAddCallback((Widget
) m_mainWidget
, XmNmodifyVerifyCallback
, (XtCallbackProc
)wxTextWindowModifyProc
, (XtPointer
)this);
199 XtAddCallback((Widget
) m_mainWidget
, XmNactivateCallback
, (XtCallbackProc
)wxTextWindowActivateProc
, (XtPointer
)this);
201 XtAddCallback((Widget
) m_mainWidget
, XmNfocusCallback
, (XtCallbackProc
)wxTextWindowGainFocusProc
, (XtPointer
)this);
203 XtAddCallback((Widget
) m_mainWidget
, XmNlosingFocusCallback
, (XtCallbackProc
)wxTextWindowLoseFocusProc
, (XtPointer
)this);
206 m_font
= parent
->GetFont();
209 SetCanAddEventHandler(TRUE
);
210 AttachWidget (parent
, m_mainWidget
, (WXWidget
) NULL
, pos
.x
, pos
.y
, size
.x
, size
.y
);
212 ChangeBackgroundColour();
217 WXWidget
wxTextCtrl::GetTopWidget() const
219 return ((m_windowStyle
& wxTE_MULTILINE
) ? (WXWidget
) XtParent((Widget
) m_mainWidget
) : m_mainWidget
);
222 wxString
wxTextCtrl::GetValue() const
224 wxString str
; // result
226 if (m_windowStyle
& wxTE_PASSWORD
)
228 // the value is stored always in m_value because it can't be retrieved
229 // from the text control
234 // just get the string from Motif
235 char *s
= XmTextGetString ((Widget
) m_mainWidget
);
241 //else: return empty string
243 if ( m_tempCallbackStruct
)
245 // the string in the control isn't yet updated, can't use it as is
246 MergeChangesIntoString(str
, (XmTextVerifyCallbackStruct
*)
247 m_tempCallbackStruct
);
254 void wxTextCtrl::SetValue(const wxString
& value
)
259 // don't do this because it is just linking the text to a source
260 // string which is unsafe. MB
262 XmTextSetString ((Widget
) m_mainWidget
, (char*)value
.c_str());
264 // do this instead... MB
266 XtVaSetValues( (Widget
) m_mainWidget
,
267 XmNvalue
, (char *)value
.c_str(),
271 m_inSetValue
= FALSE
;
274 // Clipboard operations
275 void wxTextCtrl::Copy()
277 XmTextCopy((Widget
) m_mainWidget
, CurrentTime
);
280 void wxTextCtrl::Cut()
282 XmTextCut((Widget
) m_mainWidget
, CurrentTime
);
285 void wxTextCtrl::Paste()
287 XmTextPaste((Widget
) m_mainWidget
);
290 bool wxTextCtrl::CanCopy() const
292 // Can copy if there's a selection
294 GetSelection(& from
, & to
);
295 return (from
!= to
) ;
298 bool wxTextCtrl::CanCut() const
300 // Can cut if there's a selection
302 GetSelection(& from
, & to
);
303 return (from
!= to
) ;
306 bool wxTextCtrl::CanPaste() const
308 return IsEditable() ;
312 void wxTextCtrl::Undo()
314 // Not possible in Motif
317 void wxTextCtrl::Redo()
319 // Not possible in Motif
322 bool wxTextCtrl::CanUndo() const
328 bool wxTextCtrl::CanRedo() const
334 // If the return values from and to are the same, there is no
336 void wxTextCtrl::GetSelection(long* from
, long* to
) const
338 XmTextPosition left
, right
;
340 XmTextGetSelectionPosition((Widget
) m_mainWidget
, & left
, & right
);
346 bool wxTextCtrl::IsEditable() const
348 return (XmTextGetEditable((Widget
) m_mainWidget
) != 0);
351 void wxTextCtrl::SetEditable(bool editable
)
353 XmTextSetEditable((Widget
) m_mainWidget
, (Boolean
) editable
);
356 void wxTextCtrl::SetInsertionPoint(long pos
)
358 XmTextSetInsertionPosition ((Widget
) m_mainWidget
, (XmTextPosition
) pos
);
361 void wxTextCtrl::SetInsertionPointEnd()
363 long pos
= GetLastPosition();
364 SetInsertionPoint(pos
);
367 long wxTextCtrl::GetInsertionPoint() const
369 return (long) XmTextGetInsertionPosition ((Widget
) m_mainWidget
);
372 long wxTextCtrl::GetLastPosition() const
374 return (long) XmTextGetLastPosition ((Widget
) m_mainWidget
);
377 void wxTextCtrl::Replace(long from
, long to
, const wxString
& value
)
379 XmTextReplace ((Widget
) m_mainWidget
, (XmTextPosition
) from
, (XmTextPosition
) to
,
380 (char*) (const char*) value
);
383 void wxTextCtrl::Remove(long from
, long to
)
385 XmTextSetSelection ((Widget
) m_mainWidget
, (XmTextPosition
) from
, (XmTextPosition
) to
,
387 XmTextRemove ((Widget
) m_mainWidget
);
390 void wxTextCtrl::SetSelection(long from
, long to
)
392 XmTextSetSelection ((Widget
) m_mainWidget
, (XmTextPosition
) from
, (XmTextPosition
) to
,
396 bool wxTextCtrl::LoadFile(const wxString
& file
)
398 if (!wxFileExists(file
))
405 Widget textWidget
= (Widget
) m_mainWidget
;
409 if ((stat ((char*) (const char*) file
, &statb
) == -1) || (statb
.st_mode
& S_IFMT
) != S_IFREG
||
410 !(fp
= fopen ((char*) (const char*) file
, "r")))
416 long len
= statb
.st_size
;
418 if (!(text
= XtMalloc ((unsigned) (len
+ 1))))
423 if (fread (text
, sizeof (char), len
, fp
) != (size_t) len
)
429 XmTextSetString (textWidget
, text
);
430 // m_textPosition = len;
437 // If file is null, try saved file name first
438 // Returns TRUE if succeeds.
439 bool wxTextCtrl::SaveFile(const wxString
& file
)
441 wxString
theFile(file
);
443 theFile
= m_fileName
;
446 m_fileName
= theFile
;
448 Widget textWidget
= (Widget
) m_mainWidget
;
451 if (!(fp
= fopen ((char*) (const char*) theFile
, "w")))
457 char *text
= XmTextGetString (textWidget
);
458 long len
= XmTextGetLastPosition (textWidget
);
460 if (fwrite (text
, sizeof (char), len
, fp
) != (size_t) len
)
462 // Did not write whole file
464 // Make sure newline terminates the file
465 if (text
[len
- 1] != '\n')
475 void wxTextCtrl::WriteText(const wxString
& text
)
477 long textPosition
= GetInsertionPoint() + strlen (text
);
478 XmTextInsert ((Widget
) m_mainWidget
, GetInsertionPoint(), (char*) (const char*) text
);
479 XtVaSetValues ((Widget
) m_mainWidget
, XmNcursorPosition
, textPosition
, NULL
);
480 SetInsertionPoint(textPosition
);
481 XmTextShowPosition ((Widget
) m_mainWidget
, textPosition
);
485 void wxTextCtrl::AppendText(const wxString
& text
)
487 long textPosition
= GetLastPosition() + strlen(text
);
488 XmTextInsert ((Widget
) m_mainWidget
, GetLastPosition(), (char*) (const char*) text
);
489 XtVaSetValues ((Widget
) m_mainWidget
, XmNcursorPosition
, textPosition
, NULL
);
490 SetInsertionPoint(textPosition
);
491 XmTextShowPosition ((Widget
) m_mainWidget
, textPosition
);
495 void wxTextCtrl::Clear()
497 XmTextSetString ((Widget
) m_mainWidget
, "");
501 bool wxTextCtrl::IsModified() const
506 // Makes 'unmodified'
507 void wxTextCtrl::DiscardEdits()
512 int wxTextCtrl::GetNumberOfLines() const
514 // HIDEOUSLY inefficient, but we have no choice.
515 char *s
= XmTextGetString ((Widget
) m_mainWidget
);
520 bool finished
= FALSE
;
543 long wxTextCtrl::XYToPosition(long x
, long y
) const
545 /* It seems, that there is a bug in some versions of the Motif library,
546 so the original wxWin-Code doesn't work. */
548 Widget textWidget = (Widget) handle;
549 return (long) XmTextXYToPos (textWidget, (Position) x, (Position) y);
551 /* Now a little workaround: */
553 for (int i
=0; i
<y
; i
++) r
+=(GetLineLength(i
)+1);
557 bool wxTextCtrl::PositionToXY(long pos
, long *x
, long *y
) const
560 XmTextPosToXY((Widget
) m_mainWidget
, pos
, &xx
, &yy
);
569 void wxTextCtrl::ShowPosition(long pos
)
571 XmTextShowPosition ((Widget
) m_mainWidget
, (XmTextPosition
) pos
);
574 int wxTextCtrl::GetLineLength(long lineNo
) const
576 wxString str
= GetLineText (lineNo
);
577 return (int) str
.Length();
580 wxString
wxTextCtrl::GetLineText(long lineNo
) const
582 // HIDEOUSLY inefficient, but we have no choice.
583 char *s
= XmTextGetString ((Widget
) m_mainWidget
);
590 for (i
= 0; currentLine
!= lineNo
&& s
[i
]; i
++ )
595 for (j
= 0; s
[i
] && s
[i
] != '\n'; i
++, j
++ )
602 return wxEmptyString
;
609 void wxTextCtrl::Command(wxCommandEvent
& event
)
611 SetValue (event
.GetString());
612 ProcessCommand (event
);
615 void wxTextCtrl::OnDropFiles(wxDropFilesEvent
& event
)
617 // By default, load the first file into the text window.
618 if (event
.GetNumberOfFiles() > 0)
620 LoadFile(event
.GetFiles()[0]);
624 void wxTextCtrl::OnChar(wxKeyEvent
& event
)
626 // Indicates that we should generate a normal command, because
627 // we're letting default behaviour happen (otherwise it's vetoed
628 // by virtue of overriding OnChar)
629 m_processedDefault
= TRUE
;
631 if (m_tempCallbackStruct
)
633 XmTextVerifyCallbackStruct
*textStruct
=
634 (XmTextVerifyCallbackStruct
*) m_tempCallbackStruct
;
635 textStruct
->doit
= True
;
636 if (isascii(event
.m_keyCode
) && (textStruct
->text
->length
== 1))
638 textStruct
->text
->ptr
[0] = ((event
.m_keyCode
== WXK_RETURN
) ? 10 : event
.m_keyCode
);
643 void wxTextCtrl::ChangeFont(bool keepOriginalSize
)
645 wxWindow::ChangeFont(keepOriginalSize
);
648 void wxTextCtrl::ChangeBackgroundColour()
650 wxWindow::ChangeBackgroundColour();
652 /* TODO: should scrollbars be affected? Should probably have separate
653 * function to change them (by default, taken from wxSystemSettings)
655 if (m_windowStyle
& wxTE_MULTILINE
)
657 Widget parent
= XtParent ((Widget
) m_mainWidget
);
660 XtVaGetValues (parent
,
661 XmNhorizontalScrollBar
, &hsb
,
662 XmNverticalScrollBar
, &vsb
,
664 wxColour backgroundColour
= wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE
);
666 DoChangeBackgroundColour((WXWidget
) hsb
, backgroundColour
, TRUE
);
668 DoChangeBackgroundColour((WXWidget
) vsb
, backgroundColour
, TRUE
);
670 DoChangeBackgroundColour((WXWidget
) parent
, m_backgroundColour
, TRUE
);
674 void wxTextCtrl::ChangeForegroundColour()
676 wxWindow::ChangeForegroundColour();
678 if (m_windowStyle
& wxTE_MULTILINE
)
680 Widget parent
= XtParent ((Widget
) m_mainWidget
);
683 XtVaGetValues (parent
,
684 XmNhorizontalScrollBar
, &hsb
,
685 XmNverticalScrollBar
, &vsb
,
688 /* TODO: should scrollbars be affected? Should probably have separate
689 * function to change them (by default, taken from wxSystemSettings)
691 DoChangeForegroundColour((WXWidget) hsb, m_foregroundColour);
693 DoChangeForegroundColour((WXWidget) vsb, m_foregroundColour);
695 DoChangeForegroundColour((WXWidget
) parent
, m_foregroundColour
);
699 void wxTextCtrl::DoSendEvents(void *wxcbs
, long keycode
)
701 // we're in process of updating the text control
702 m_tempCallbackStruct
= wxcbs
;
704 XmTextVerifyCallbackStruct
*cbs
= (XmTextVerifyCallbackStruct
*)wxcbs
;
706 wxKeyEvent
event (wxEVT_CHAR
);
707 event
.SetId(GetId());
708 event
.m_keyCode
= keycode
;
709 event
.SetEventObject(this);
711 // Only if wxTextCtrl::OnChar is called will this be set to True (and
712 // the character passed through)
715 GetEventHandler()->ProcessEvent(event
);
717 if ( !InSetValue() && m_processedDefault
)
719 // Can generate a command
720 wxCommandEvent
commandEvent(wxEVT_COMMAND_TEXT_UPDATED
, GetId());
721 commandEvent
.SetEventObject(this);
722 ProcessCommand(commandEvent
);
725 // do it after the (user) event handlers processed the events because
726 // otherwise GetValue() would return incorrect (not yet updated value)
727 m_tempCallbackStruct
= NULL
;
730 // ----------------------------------------------------------------------------
731 // helpers and Motif callbacks
732 // ----------------------------------------------------------------------------
734 static void MergeChangesIntoString(wxString
& value
,
735 XmTextVerifyCallbackStruct
*cbs
)
738 * At least on my system (SunOS 4.1.3 + Motif 1.2), you need to think of
739 * every event as a replace event. cbs->text->ptr gives the replacement
740 * text, cbs->startPos gives the index of the first char affected by the
741 * replace, and cbs->endPos gives the index one more than the last char
742 * affected by the replace (startPos == endPos implies an empty range).
743 * Hence, a deletion is represented by replacing all input text with a
744 * blank string ("", *not* NULL!). A simple insertion that does not
745 * overwrite any text has startPos == endPos.
750 // easy case: the ol value was empty
751 value
= cbs
->text
->ptr
;
755 // merge the changes into the value
756 const char * const passwd
= value
;
757 int len
= value
.length();
759 len
+= strlen(cbs
->text
->ptr
) + 1; // + new text (if any) + NUL
760 len
-= cbs
->endPos
- cbs
->startPos
; // - text from affected region.
762 char * newS
= new char [len
];
764 * insert
= cbs
->text
->ptr
;
766 // Copy (old) text from passwd, up to the start posn of the change.
768 const char * p
= passwd
;
769 for (i
= 0; i
< cbs
->startPos
; ++i
)
772 // Copy the text to be inserted).
776 // Finally, copy into newS any remaining text from passwd[endPos] on.
777 for (p
= passwd
+ cbs
->endPos
; *p
; )
788 wxTextWindowChangedProc (Widget w
, XtPointer clientData
, XtPointer
WXUNUSED(ptr
))
790 if (!wxGetWindowFromTable(w
))
791 // Widget has been deleted!
794 wxTextCtrl
*tw
= (wxTextCtrl
*) clientData
;
795 tw
->SetModified(TRUE
);
799 wxTextWindowModifyProc (Widget
WXUNUSED(w
), XtPointer clientData
, XmTextVerifyCallbackStruct
*cbs
)
801 wxTextCtrl
*tw
= (wxTextCtrl
*) clientData
;
802 tw
->m_processedDefault
= FALSE
;
804 // First, do some stuff if it's a password control: in this case, we need
805 // to store the string inside the class because GetValue() can't retrieve
806 // it from the text ctrl. We do *not* do it in other circumstances because
807 // it would double the amount of memory needed.
809 if ( tw
->GetWindowStyleFlag() & wxTE_PASSWORD
)
811 MergeChangesIntoString(tw
->m_value
, cbs
);
813 if ( cbs
->text
->length
> 0 )
816 for (i
= 0; i
< cbs
->text
->length
; ++i
)
817 cbs
->text
->ptr
[i
] = '*';
818 cbs
->text
->ptr
[i
] = '\0';
822 // If we're already within an OnChar, return: probably a programmatic
824 if (tw
->m_tempCallbackStruct
)
827 // Check for a backspace
828 if (cbs
->startPos
== (cbs
->currInsert
- 1))
830 tw
->DoSendEvents((void *)cbs
, WXK_DELETE
);
835 // Pasting operation: let it through without calling OnChar
836 if (cbs
->text
->length
> 1)
839 // Something other than text
840 if (cbs
->text
->ptr
== NULL
)
844 char ch
= cbs
->text
->ptr
[0];
845 tw
->DoSendEvents((void *)cbs
, ch
== '\n' ? '\r' : ch
);
849 wxTextWindowGainFocusProc (Widget w
, XtPointer clientData
, XmAnyCallbackStruct
*WXUNUSED(cbs
))
851 if (!wxGetWindowFromTable(w
))
854 wxTextCtrl
*tw
= (wxTextCtrl
*) clientData
;
855 wxFocusEvent
event(wxEVT_SET_FOCUS
, tw
->GetId());
856 event
.SetEventObject(tw
);
857 tw
->GetEventHandler()->ProcessEvent(event
);
861 wxTextWindowLoseFocusProc (Widget w
, XtPointer clientData
, XmAnyCallbackStruct
*WXUNUSED(cbs
))
863 if (!wxGetWindowFromTable(w
))
866 wxTextCtrl
*tw
= (wxTextCtrl
*) clientData
;
867 wxFocusEvent
event(wxEVT_KILL_FOCUS
, tw
->GetId());
868 event
.SetEventObject(tw
);
869 tw
->GetEventHandler()->ProcessEvent(event
);
872 static void wxTextWindowActivateProc(Widget w
, XtPointer clientData
,
873 XmAnyCallbackStruct
*WXUNUSED(ptr
))
875 if (!wxGetWindowFromTable(w
))
878 wxTextCtrl
*tw
= (wxTextCtrl
*) clientData
;
880 if (tw
->InSetValue())
883 wxCommandEvent
event(wxEVT_COMMAND_TEXT_ENTER
);
884 event
.SetId(tw
->GetId());
885 event
.SetEventObject(tw
);
886 tw
->ProcessCommand(event
);
889 void wxTextCtrl::OnCut(wxCommandEvent
& WXUNUSED(event
))
894 void wxTextCtrl::OnCopy(wxCommandEvent
& WXUNUSED(event
))
899 void wxTextCtrl::OnPaste(wxCommandEvent
& WXUNUSED(event
))
904 void wxTextCtrl::OnUndo(wxCommandEvent
& WXUNUSED(event
))
909 void wxTextCtrl::OnRedo(wxCommandEvent
& WXUNUSED(event
))
914 void wxTextCtrl::OnUpdateCut(wxUpdateUIEvent
& event
)
916 event
.Enable( CanCut() );
919 void wxTextCtrl::OnUpdateCopy(wxUpdateUIEvent
& event
)
921 event
.Enable( CanCopy() );
924 void wxTextCtrl::OnUpdatePaste(wxUpdateUIEvent
& event
)
926 event
.Enable( CanPaste() );
929 void wxTextCtrl::OnUpdateUndo(wxUpdateUIEvent
& event
)
931 event
.Enable( CanUndo() );
934 void wxTextCtrl::OnUpdateRedo(wxUpdateUIEvent
& event
)
936 event
.Enable( CanRedo() );