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 #if !USE_SHARED_LIBRARY
61 IMPLEMENT_DYNAMIC_CLASS(wxTextCtrl
, wxControl
)
63 BEGIN_EVENT_TABLE(wxTextCtrl
, wxControl
)
64 EVT_DROP_FILES(wxTextCtrl::OnDropFiles
)
65 EVT_CHAR(wxTextCtrl::OnChar
)
67 EVT_MENU(wxID_CUT
, wxTextCtrl::OnCut
)
68 EVT_MENU(wxID_COPY
, wxTextCtrl::OnCopy
)
69 EVT_MENU(wxID_PASTE
, wxTextCtrl::OnPaste
)
70 EVT_MENU(wxID_UNDO
, wxTextCtrl::OnUndo
)
71 EVT_MENU(wxID_REDO
, wxTextCtrl::OnRedo
)
73 EVT_UPDATE_UI(wxID_CUT
, wxTextCtrl::OnUpdateCut
)
74 EVT_UPDATE_UI(wxID_COPY
, wxTextCtrl::OnUpdateCopy
)
75 EVT_UPDATE_UI(wxID_PASTE
, wxTextCtrl::OnUpdatePaste
)
76 EVT_UPDATE_UI(wxID_UNDO
, wxTextCtrl::OnUpdateUndo
)
77 EVT_UPDATE_UI(wxID_REDO
, wxTextCtrl::OnUpdateRedo
)
82 // ============================================================================
84 // ============================================================================
86 // ----------------------------------------------------------------------------
88 // ----------------------------------------------------------------------------
91 wxTextCtrl::wxTextCtrl()
93 m_tempCallbackStruct
= (void*) NULL
;
95 m_processedDefault
= FALSE
;
98 bool wxTextCtrl::Create(wxWindow
*parent
,
100 const wxString
& value
,
104 const wxValidator
& validator
,
105 const wxString
& name
)
107 m_tempCallbackStruct
= (void*) NULL
;
109 m_processedDefault
= FALSE
;
110 // m_backgroundColour = parent->GetBackgroundColour();
111 m_backgroundColour
= * wxWHITE
;
112 m_foregroundColour
= parent
->GetForegroundColour();
115 SetValidator(validator
);
117 parent
->AddChild(this);
119 m_windowStyle
= style
;
122 m_windowId
= (int)NewControlId();
126 Widget parentWidget
= (Widget
) parent
->GetClientWidget();
128 bool wantHorizScrolling
= ((m_windowStyle
& wxHSCROLL
) != 0);
130 // If we don't have horizontal scrollbars, we want word wrap.
131 bool wantWordWrap
= !wantHorizScrolling
;
133 if (m_windowStyle
& wxTE_MULTILINE
)
136 XtSetArg (args
[0], XmNscrollHorizontal
, wantHorizScrolling
? True
: False
);
137 XtSetArg (args
[1], XmNwordWrap
, wantWordWrap
? True
: False
);
139 m_mainWidget
= (WXWidget
) XmCreateScrolledText(parentWidget
,
143 XtVaSetValues ((Widget
) m_mainWidget
,
144 XmNeditable
, ((style
& wxTE_READONLY
) ? False
: True
),
145 XmNeditMode
, XmMULTI_LINE_EDIT
,
147 XtManageChild ((Widget
) m_mainWidget
);
151 m_mainWidget
= (WXWidget
)XtVaCreateManagedWidget
159 XtVaSetValues ((Widget
) m_mainWidget
,
160 XmNeditable
, ((style
& wxTE_READONLY
) ? False
: True
),
163 // TODO: Is this relevant? What does it do?
165 if (!value
.IsNull() && (value
.Length() > (unsigned int) noCols
))
166 noCols
= value
.Length();
167 XtVaSetValues((Widget
) m_mainWidget
,
172 // remove border if asked for
173 if ( style
& wxNO_BORDER
)
175 XtVaSetValues((Widget
)m_mainWidget
,
176 XmNshadowThickness
, 0,
183 // don't do this because it is just linking the text to a source
184 // string which is unsafe. MB
186 XmTextSetString ((Widget
) m_mainWidget
, (char*)value
.c_str());
188 // do this instead... MB
190 XtVaSetValues( (Widget
) m_mainWidget
,
191 XmNvalue
, (char *)value
.c_str(),
197 XtAddCallback((Widget
) m_mainWidget
, XmNvalueChangedCallback
, (XtCallbackProc
)wxTextWindowChangedProc
, (XtPointer
)this);
199 XtAddCallback((Widget
) m_mainWidget
, XmNmodifyVerifyCallback
, (XtCallbackProc
)wxTextWindowModifyProc
, (XtPointer
)this);
201 XtAddCallback((Widget
) m_mainWidget
, XmNactivateCallback
, (XtCallbackProc
)wxTextWindowActivateProc
, (XtPointer
)this);
203 XtAddCallback((Widget
) m_mainWidget
, XmNfocusCallback
, (XtCallbackProc
)wxTextWindowGainFocusProc
, (XtPointer
)this);
205 XtAddCallback((Widget
) m_mainWidget
, XmNlosingFocusCallback
, (XtCallbackProc
)wxTextWindowLoseFocusProc
, (XtPointer
)this);
208 m_font
= parent
->GetFont();
211 SetCanAddEventHandler(TRUE
);
212 AttachWidget (parent
, m_mainWidget
, (WXWidget
) NULL
, pos
.x
, pos
.y
, size
.x
, size
.y
);
214 ChangeBackgroundColour();
219 WXWidget
wxTextCtrl::GetTopWidget() const
221 return ((m_windowStyle
& wxTE_MULTILINE
) ? (WXWidget
) XtParent((Widget
) m_mainWidget
) : m_mainWidget
);
224 wxString
wxTextCtrl::GetValue() const
226 wxString str
; // result
228 if (m_windowStyle
& wxTE_PASSWORD
)
230 // the value is stored always in m_value because it can't be retrieved
231 // from the text control
236 // just get the string from Motif
237 char *s
= XmTextGetString ((Widget
) m_mainWidget
);
243 //else: return empty string
245 if ( m_tempCallbackStruct
)
247 // the string in the control isn't yet updated, can't use it as is
248 MergeChangesIntoString(str
, (XmTextVerifyCallbackStruct
*)
249 m_tempCallbackStruct
);
256 void wxTextCtrl::SetValue(const wxString
& value
)
261 // don't do this because it is just linking the text to a source
262 // string which is unsafe. MB
264 XmTextSetString ((Widget
) m_mainWidget
, (char*)value
.c_str());
266 // do this instead... MB
268 XtVaSetValues( (Widget
) m_mainWidget
,
269 XmNvalue
, (char *)value
.c_str(),
273 m_inSetValue
= FALSE
;
276 // Clipboard operations
277 void wxTextCtrl::Copy()
279 XmTextCopy((Widget
) m_mainWidget
, CurrentTime
);
282 void wxTextCtrl::Cut()
284 XmTextCut((Widget
) m_mainWidget
, CurrentTime
);
287 void wxTextCtrl::Paste()
289 XmTextPaste((Widget
) m_mainWidget
);
292 bool wxTextCtrl::CanCopy() const
294 // Can copy if there's a selection
296 GetSelection(& from
, & to
);
297 return (from
!= to
) ;
300 bool wxTextCtrl::CanCut() const
302 // Can cut if there's a selection
304 GetSelection(& from
, & to
);
305 return (from
!= to
) ;
308 bool wxTextCtrl::CanPaste() const
310 return IsEditable() ;
314 void wxTextCtrl::Undo()
316 // Not possible in Motif
319 void wxTextCtrl::Redo()
321 // Not possible in Motif
324 bool wxTextCtrl::CanUndo() const
330 bool wxTextCtrl::CanRedo() const
336 // If the return values from and to are the same, there is no
338 void wxTextCtrl::GetSelection(long* from
, long* to
) const
340 XmTextPosition left
, right
;
342 XmTextGetSelectionPosition((Widget
) m_mainWidget
, & left
, & right
);
348 bool wxTextCtrl::IsEditable() const
350 return (XmTextGetEditable((Widget
) m_mainWidget
) != 0);
353 void wxTextCtrl::SetEditable(bool editable
)
355 XmTextSetEditable((Widget
) m_mainWidget
, (Boolean
) editable
);
358 void wxTextCtrl::SetInsertionPoint(long pos
)
360 XmTextSetInsertionPosition ((Widget
) m_mainWidget
, (XmTextPosition
) pos
);
363 void wxTextCtrl::SetInsertionPointEnd()
365 long pos
= GetLastPosition();
366 SetInsertionPoint(pos
);
369 long wxTextCtrl::GetInsertionPoint() const
371 return (long) XmTextGetInsertionPosition ((Widget
) m_mainWidget
);
374 long wxTextCtrl::GetLastPosition() const
376 return (long) XmTextGetLastPosition ((Widget
) m_mainWidget
);
379 void wxTextCtrl::Replace(long from
, long to
, const wxString
& value
)
381 XmTextReplace ((Widget
) m_mainWidget
, (XmTextPosition
) from
, (XmTextPosition
) to
,
382 (char*) (const char*) value
);
385 void wxTextCtrl::Remove(long from
, long to
)
387 XmTextSetSelection ((Widget
) m_mainWidget
, (XmTextPosition
) from
, (XmTextPosition
) to
,
389 XmTextRemove ((Widget
) m_mainWidget
);
392 void wxTextCtrl::SetSelection(long from
, long to
)
394 XmTextSetSelection ((Widget
) m_mainWidget
, (XmTextPosition
) from
, (XmTextPosition
) to
,
398 bool wxTextCtrl::LoadFile(const wxString
& file
)
400 if (!wxFileExists(file
))
407 Widget textWidget
= (Widget
) m_mainWidget
;
411 if ((stat ((char*) (const char*) file
, &statb
) == -1) || (statb
.st_mode
& S_IFMT
) != S_IFREG
||
412 !(fp
= fopen ((char*) (const char*) file
, "r")))
418 long len
= statb
.st_size
;
420 if (!(text
= XtMalloc ((unsigned) (len
+ 1))))
425 if (fread (text
, sizeof (char), len
, fp
) != (size_t) len
)
431 XmTextSetString (textWidget
, text
);
432 // m_textPosition = len;
439 // If file is null, try saved file name first
440 // Returns TRUE if succeeds.
441 bool wxTextCtrl::SaveFile(const wxString
& file
)
443 wxString
theFile(file
);
445 theFile
= m_fileName
;
448 m_fileName
= theFile
;
450 Widget textWidget
= (Widget
) m_mainWidget
;
453 if (!(fp
= fopen ((char*) (const char*) theFile
, "w")))
459 char *text
= XmTextGetString (textWidget
);
460 long len
= XmTextGetLastPosition (textWidget
);
462 if (fwrite (text
, sizeof (char), len
, fp
) != (size_t) len
)
464 // Did not write whole file
466 // Make sure newline terminates the file
467 if (text
[len
- 1] != '\n')
477 void wxTextCtrl::WriteText(const wxString
& text
)
479 long textPosition
= GetInsertionPoint() + strlen (text
);
480 XmTextInsert ((Widget
) m_mainWidget
, GetInsertionPoint(), (char*) (const char*) text
);
481 XtVaSetValues ((Widget
) m_mainWidget
, XmNcursorPosition
, textPosition
, NULL
);
482 SetInsertionPoint(textPosition
);
483 XmTextShowPosition ((Widget
) m_mainWidget
, textPosition
);
487 void wxTextCtrl::AppendText(const wxString
& text
)
489 long textPosition
= GetLastPosition() + strlen(text
);
490 XmTextInsert ((Widget
) m_mainWidget
, GetLastPosition(), (char*) (const char*) text
);
491 XtVaSetValues ((Widget
) m_mainWidget
, XmNcursorPosition
, textPosition
, NULL
);
492 SetInsertionPoint(textPosition
);
493 XmTextShowPosition ((Widget
) m_mainWidget
, textPosition
);
497 void wxTextCtrl::Clear()
499 XmTextSetString ((Widget
) m_mainWidget
, "");
503 bool wxTextCtrl::IsModified() const
508 // Makes 'unmodified'
509 void wxTextCtrl::DiscardEdits()
514 int wxTextCtrl::GetNumberOfLines() const
516 // HIDEOUSLY inefficient, but we have no choice.
517 char *s
= XmTextGetString ((Widget
) m_mainWidget
);
522 bool finished
= FALSE
;
545 long wxTextCtrl::XYToPosition(long x
, long y
) const
547 /* It seems, that there is a bug in some versions of the Motif library,
548 so the original wxWin-Code doesn't work. */
550 Widget textWidget = (Widget) handle;
551 return (long) XmTextXYToPos (textWidget, (Position) x, (Position) y);
553 /* Now a little workaround: */
555 for (int i
=0; i
<y
; i
++) r
+=(GetLineLength(i
)+1);
559 bool wxTextCtrl::PositionToXY(long pos
, long *x
, long *y
) const
562 XmTextPosToXY((Widget
) m_mainWidget
, pos
, &xx
, &yy
);
571 void wxTextCtrl::ShowPosition(long pos
)
573 XmTextShowPosition ((Widget
) m_mainWidget
, (XmTextPosition
) pos
);
576 int wxTextCtrl::GetLineLength(long lineNo
) const
578 wxString str
= GetLineText (lineNo
);
579 return (int) str
.Length();
582 wxString
wxTextCtrl::GetLineText(long lineNo
) const
584 // HIDEOUSLY inefficient, but we have no choice.
585 char *s
= XmTextGetString ((Widget
) m_mainWidget
);
592 for (i
= 0; currentLine
!= lineNo
&& s
[i
]; i
++ )
597 for (j
= 0; s
[i
] && s
[i
] != '\n'; i
++, j
++ )
604 return wxEmptyString
;
611 void wxTextCtrl::Command(wxCommandEvent
& event
)
613 SetValue (event
.GetString());
614 ProcessCommand (event
);
617 void wxTextCtrl::OnDropFiles(wxDropFilesEvent
& event
)
619 // By default, load the first file into the text window.
620 if (event
.GetNumberOfFiles() > 0)
622 LoadFile(event
.GetFiles()[0]);
626 void wxTextCtrl::OnChar(wxKeyEvent
& event
)
628 // Indicates that we should generate a normal command, because
629 // we're letting default behaviour happen (otherwise it's vetoed
630 // by virtue of overriding OnChar)
631 m_processedDefault
= TRUE
;
633 if (m_tempCallbackStruct
)
635 XmTextVerifyCallbackStruct
*textStruct
=
636 (XmTextVerifyCallbackStruct
*) m_tempCallbackStruct
;
637 textStruct
->doit
= True
;
638 if (isascii(event
.m_keyCode
) && (textStruct
->text
->length
== 1))
640 textStruct
->text
->ptr
[0] = ((event
.m_keyCode
== WXK_RETURN
) ? 10 : event
.m_keyCode
);
645 void wxTextCtrl::ChangeFont(bool keepOriginalSize
)
647 wxWindow::ChangeFont(keepOriginalSize
);
650 void wxTextCtrl::ChangeBackgroundColour()
652 wxWindow::ChangeBackgroundColour();
654 /* TODO: should scrollbars be affected? Should probably have separate
655 * function to change them (by default, taken from wxSystemSettings)
657 if (m_windowStyle
& wxTE_MULTILINE
)
659 Widget parent
= XtParent ((Widget
) m_mainWidget
);
662 XtVaGetValues (parent
,
663 XmNhorizontalScrollBar
, &hsb
,
664 XmNverticalScrollBar
, &vsb
,
666 wxColour backgroundColour
= wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE
);
668 DoChangeBackgroundColour((WXWidget
) hsb
, backgroundColour
, TRUE
);
670 DoChangeBackgroundColour((WXWidget
) vsb
, backgroundColour
, TRUE
);
672 DoChangeBackgroundColour((WXWidget
) parent
, m_backgroundColour
, TRUE
);
676 void wxTextCtrl::ChangeForegroundColour()
678 wxWindow::ChangeForegroundColour();
680 if (m_windowStyle
& wxTE_MULTILINE
)
682 Widget parent
= XtParent ((Widget
) m_mainWidget
);
685 XtVaGetValues (parent
,
686 XmNhorizontalScrollBar
, &hsb
,
687 XmNverticalScrollBar
, &vsb
,
690 /* TODO: should scrollbars be affected? Should probably have separate
691 * function to change them (by default, taken from wxSystemSettings)
693 DoChangeForegroundColour((WXWidget) hsb, m_foregroundColour);
695 DoChangeForegroundColour((WXWidget) vsb, m_foregroundColour);
697 DoChangeForegroundColour((WXWidget
) parent
, m_foregroundColour
);
701 void wxTextCtrl::DoSendEvents(void *wxcbs
, long keycode
)
703 // we're in process of updating the text control
704 m_tempCallbackStruct
= wxcbs
;
706 XmTextVerifyCallbackStruct
*cbs
= (XmTextVerifyCallbackStruct
*)wxcbs
;
708 wxKeyEvent
event (wxEVT_CHAR
);
709 event
.SetId(GetId());
710 event
.m_keyCode
= keycode
;
711 event
.SetEventObject(this);
713 // Only if wxTextCtrl::OnChar is called will this be set to True (and
714 // the character passed through)
717 GetEventHandler()->ProcessEvent(event
);
719 if ( !InSetValue() && m_processedDefault
)
721 // Can generate a command
722 wxCommandEvent
commandEvent(wxEVT_COMMAND_TEXT_UPDATED
, GetId());
723 commandEvent
.SetEventObject(this);
724 ProcessCommand(commandEvent
);
727 // do it after the (user) event handlers processed the events because
728 // otherwise GetValue() would return incorrect (not yet updated value)
729 m_tempCallbackStruct
= NULL
;
732 // ----------------------------------------------------------------------------
733 // helpers and Motif callbacks
734 // ----------------------------------------------------------------------------
736 static void MergeChangesIntoString(wxString
& value
,
737 XmTextVerifyCallbackStruct
*cbs
)
740 * At least on my system (SunOS 4.1.3 + Motif 1.2), you need to think of
741 * every event as a replace event. cbs->text->ptr gives the replacement
742 * text, cbs->startPos gives the index of the first char affected by the
743 * replace, and cbs->endPos gives the index one more than the last char
744 * affected by the replace (startPos == endPos implies an empty range).
745 * Hence, a deletion is represented by replacing all input text with a
746 * blank string ("", *not* NULL!). A simple insertion that does not
747 * overwrite any text has startPos == endPos.
752 // easy case: the ol value was empty
753 value
= cbs
->text
->ptr
;
757 // merge the changes into the value
758 const char * const passwd
= value
;
759 int len
= value
.length();
761 len
+= strlen(cbs
->text
->ptr
) + 1; // + new text (if any) + NUL
762 len
-= cbs
->endPos
- cbs
->startPos
; // - text from affected region.
764 char * newS
= new char [len
];
766 * insert
= cbs
->text
->ptr
;
768 // Copy (old) text from passwd, up to the start posn of the change.
770 const char * p
= passwd
;
771 for (i
= 0; i
< cbs
->startPos
; ++i
)
774 // Copy the text to be inserted).
778 // Finally, copy into newS any remaining text from passwd[endPos] on.
779 for (p
= passwd
+ cbs
->endPos
; *p
; )
790 wxTextWindowChangedProc (Widget w
, XtPointer clientData
, XtPointer
WXUNUSED(ptr
))
792 if (!wxGetWindowFromTable(w
))
793 // Widget has been deleted!
796 wxTextCtrl
*tw
= (wxTextCtrl
*) clientData
;
797 tw
->SetModified(TRUE
);
801 wxTextWindowModifyProc (Widget
WXUNUSED(w
), XtPointer clientData
, XmTextVerifyCallbackStruct
*cbs
)
803 wxTextCtrl
*tw
= (wxTextCtrl
*) clientData
;
804 tw
->m_processedDefault
= FALSE
;
806 // First, do some stuff if it's a password control: in this case, we need
807 // to store the string inside the class because GetValue() can't retrieve
808 // it from the text ctrl. We do *not* do it in other circumstances because
809 // it would double the amount of memory needed.
811 if ( tw
->GetWindowStyleFlag() & wxTE_PASSWORD
)
813 MergeChangesIntoString(tw
->m_value
, cbs
);
815 if ( cbs
->text
->length
> 0 )
818 for (i
= 0; i
< cbs
->text
->length
; ++i
)
819 cbs
->text
->ptr
[i
] = '*';
820 cbs
->text
->ptr
[i
] = '\0';
824 // If we're already within an OnChar, return: probably a programmatic
826 if (tw
->m_tempCallbackStruct
)
829 // Check for a backspace
830 if (cbs
->startPos
== (cbs
->currInsert
- 1))
832 tw
->DoSendEvents((void *)cbs
, WXK_DELETE
);
837 // Pasting operation: let it through without calling OnChar
838 if (cbs
->text
->length
> 1)
841 // Something other than text
842 if (cbs
->text
->ptr
== NULL
)
846 char ch
= cbs
->text
->ptr
[0];
847 tw
->DoSendEvents((void *)cbs
, ch
== '\n' ? '\r' : ch
);
851 wxTextWindowGainFocusProc (Widget w
, XtPointer clientData
, XmAnyCallbackStruct
*WXUNUSED(cbs
))
853 if (!wxGetWindowFromTable(w
))
856 wxTextCtrl
*tw
= (wxTextCtrl
*) clientData
;
857 wxFocusEvent
event(wxEVT_SET_FOCUS
, tw
->GetId());
858 event
.SetEventObject(tw
);
859 tw
->GetEventHandler()->ProcessEvent(event
);
863 wxTextWindowLoseFocusProc (Widget w
, XtPointer clientData
, XmAnyCallbackStruct
*WXUNUSED(cbs
))
865 if (!wxGetWindowFromTable(w
))
868 wxTextCtrl
*tw
= (wxTextCtrl
*) clientData
;
869 wxFocusEvent
event(wxEVT_KILL_FOCUS
, tw
->GetId());
870 event
.SetEventObject(tw
);
871 tw
->GetEventHandler()->ProcessEvent(event
);
874 static void wxTextWindowActivateProc(Widget w
, XtPointer clientData
,
875 XmAnyCallbackStruct
*WXUNUSED(ptr
))
877 if (!wxGetWindowFromTable(w
))
880 wxTextCtrl
*tw
= (wxTextCtrl
*) clientData
;
882 if (tw
->InSetValue())
885 wxCommandEvent
event(wxEVT_COMMAND_TEXT_ENTER
);
886 event
.SetId(tw
->GetId());
887 event
.SetEventObject(tw
);
888 tw
->ProcessCommand(event
);
891 void wxTextCtrl::OnCut(wxCommandEvent
& WXUNUSED(event
))
896 void wxTextCtrl::OnCopy(wxCommandEvent
& WXUNUSED(event
))
901 void wxTextCtrl::OnPaste(wxCommandEvent
& WXUNUSED(event
))
906 void wxTextCtrl::OnUndo(wxCommandEvent
& WXUNUSED(event
))
911 void wxTextCtrl::OnRedo(wxCommandEvent
& WXUNUSED(event
))
916 void wxTextCtrl::OnUpdateCut(wxUpdateUIEvent
& event
)
918 event
.Enable( CanCut() );
921 void wxTextCtrl::OnUpdateCopy(wxUpdateUIEvent
& event
)
923 event
.Enable( CanCopy() );
926 void wxTextCtrl::OnUpdatePaste(wxUpdateUIEvent
& event
)
928 event
.Enable( CanPaste() );
931 void wxTextCtrl::OnUpdateUndo(wxUpdateUIEvent
& event
)
933 event
.Enable( CanUndo() );
936 void wxTextCtrl::OnUpdateRedo(wxUpdateUIEvent
& event
)
938 event
.Enable( CanRedo() );