1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 // ============================================================================
14 // ============================================================================
16 // ----------------------------------------------------------------------------
18 // ----------------------------------------------------------------------------
21 #pragma implementation "textctrl.h"
25 #define XtParent XTPARENT
28 #include <sys/types.h>
33 #include "wx/textctrl.h"
34 #include "wx/settings.h"
35 #include "wx/filefn.h"
39 #pragma message disable nosimpint
43 #pragma message enable nosimpint
46 #include "wx/motif/private.h"
48 // ----------------------------------------------------------------------------
50 // ----------------------------------------------------------------------------
52 // helper: inserts the new text in the value of the text ctrl and returns the
54 static void MergeChangesIntoString(wxString
& value
,
55 XmTextVerifyCallbackStruct
*textStruct
);
58 static void wxTextWindowChangedProc(Widget w
, XtPointer clientData
, XtPointer ptr
);
59 static void wxTextWindowModifyProc(Widget w
, XtPointer clientData
, XmTextVerifyCallbackStruct
*cbs
);
60 static void wxTextWindowGainFocusProc(Widget w
, XtPointer clientData
, XmAnyCallbackStruct
*cbs
);
61 static void wxTextWindowLoseFocusProc(Widget w
, XtPointer clientData
, XmAnyCallbackStruct
*cbs
);
62 static void wxTextWindowActivateProc(Widget w
, XtPointer clientData
, XmAnyCallbackStruct
*ptr
);
64 IMPLEMENT_DYNAMIC_CLASS(wxTextCtrl
, wxControl
)
66 BEGIN_EVENT_TABLE(wxTextCtrl
, wxControl
)
67 EVT_DROP_FILES(wxTextCtrl::OnDropFiles
)
68 EVT_CHAR(wxTextCtrl::OnChar
)
70 EVT_MENU(wxID_CUT
, wxTextCtrl::OnCut
)
71 EVT_MENU(wxID_COPY
, wxTextCtrl::OnCopy
)
72 EVT_MENU(wxID_PASTE
, wxTextCtrl::OnPaste
)
73 EVT_MENU(wxID_UNDO
, wxTextCtrl::OnUndo
)
74 EVT_MENU(wxID_REDO
, wxTextCtrl::OnRedo
)
76 EVT_UPDATE_UI(wxID_CUT
, wxTextCtrl::OnUpdateCut
)
77 EVT_UPDATE_UI(wxID_COPY
, wxTextCtrl::OnUpdateCopy
)
78 EVT_UPDATE_UI(wxID_PASTE
, wxTextCtrl::OnUpdatePaste
)
79 EVT_UPDATE_UI(wxID_UNDO
, wxTextCtrl::OnUpdateUndo
)
80 EVT_UPDATE_UI(wxID_REDO
, wxTextCtrl::OnUpdateRedo
)
84 // ============================================================================
86 // ============================================================================
88 // ----------------------------------------------------------------------------
90 // ----------------------------------------------------------------------------
93 wxTextCtrl::wxTextCtrl()
95 m_tempCallbackStruct
= (void*) NULL
;
97 m_processedDefault
= FALSE
;
100 bool wxTextCtrl::Create(wxWindow
*parent
,
102 const wxString
& value
,
106 const wxValidator
& validator
,
107 const wxString
& name
)
109 m_tempCallbackStruct
= (void*) NULL
;
111 m_processedDefault
= FALSE
;
112 // m_backgroundColour = parent->GetBackgroundColour();
113 m_backgroundColour
= * wxWHITE
;
114 m_foregroundColour
= parent
->GetForegroundColour();
117 SetValidator(validator
);
119 parent
->AddChild(this);
121 m_windowStyle
= style
;
124 m_windowId
= (int)NewControlId();
128 Widget parentWidget
= (Widget
) parent
->GetClientWidget();
130 bool wantHorizScrolling
= ((m_windowStyle
& wxHSCROLL
) != 0);
132 // If we don't have horizontal scrollbars, we want word wrap.
133 bool wantWordWrap
= !wantHorizScrolling
;
135 if (m_windowStyle
& wxTE_MULTILINE
)
138 XtSetArg (args
[0], XmNscrollHorizontal
, wantHorizScrolling
? True
: False
);
139 XtSetArg (args
[1], XmNwordWrap
, wantWordWrap
? True
: False
);
141 m_mainWidget
= (WXWidget
) XmCreateScrolledText(parentWidget
,
145 XtVaSetValues ((Widget
) m_mainWidget
,
146 XmNeditable
, ((style
& wxTE_READONLY
) ? False
: True
),
147 XmNeditMode
, XmMULTI_LINE_EDIT
,
149 XtManageChild ((Widget
) m_mainWidget
);
153 m_mainWidget
= (WXWidget
)XtVaCreateManagedWidget
161 XtVaSetValues ((Widget
) m_mainWidget
,
162 XmNeditable
, ((style
& wxTE_READONLY
) ? False
: True
),
165 // TODO: Is this relevant? What does it do?
167 if (!value
.IsNull() && (value
.Length() > (unsigned int) noCols
))
168 noCols
= value
.Length();
169 XtVaSetValues((Widget
) m_mainWidget
,
174 // remove border if asked for
175 if ( style
& wxNO_BORDER
)
177 XtVaSetValues((Widget
)m_mainWidget
,
178 XmNshadowThickness
, 0,
185 // don't do this because it is just linking the text to a source
186 // string which is unsafe. MB
188 XmTextSetString ((Widget
) m_mainWidget
, (char*)value
.c_str());
190 // do this instead... MB
192 XtVaSetValues( (Widget
) m_mainWidget
,
193 XmNvalue
, (char *)value
.c_str(),
199 XtAddCallback((Widget
) m_mainWidget
, XmNvalueChangedCallback
, (XtCallbackProc
)wxTextWindowChangedProc
, (XtPointer
)this);
201 XtAddCallback((Widget
) m_mainWidget
, XmNmodifyVerifyCallback
, (XtCallbackProc
)wxTextWindowModifyProc
, (XtPointer
)this);
203 XtAddCallback((Widget
) m_mainWidget
, XmNactivateCallback
, (XtCallbackProc
)wxTextWindowActivateProc
, (XtPointer
)this);
205 XtAddCallback((Widget
) m_mainWidget
, XmNfocusCallback
, (XtCallbackProc
)wxTextWindowGainFocusProc
, (XtPointer
)this);
207 XtAddCallback((Widget
) m_mainWidget
, XmNlosingFocusCallback
, (XtCallbackProc
)wxTextWindowLoseFocusProc
, (XtPointer
)this);
210 m_font
= parent
->GetFont();
213 SetCanAddEventHandler(TRUE
);
214 AttachWidget (parent
, m_mainWidget
, (WXWidget
) NULL
, pos
.x
, pos
.y
, size
.x
, size
.y
);
216 ChangeBackgroundColour();
221 WXWidget
wxTextCtrl::GetTopWidget() const
223 return ((m_windowStyle
& wxTE_MULTILINE
) ? (WXWidget
) XtParent((Widget
) m_mainWidget
) : m_mainWidget
);
226 wxString
wxTextCtrl::GetValue() const
228 wxString str
; // result
230 if (m_windowStyle
& wxTE_PASSWORD
)
232 // the value is stored always in m_value because it can't be retrieved
233 // from the text control
238 // just get the string from Motif
239 char *s
= XmTextGetString ((Widget
) m_mainWidget
);
245 //else: return empty string
247 if ( m_tempCallbackStruct
)
249 // the string in the control isn't yet updated, can't use it as is
250 MergeChangesIntoString(str
, (XmTextVerifyCallbackStruct
*)
251 m_tempCallbackStruct
);
258 void wxTextCtrl::SetValue(const wxString
& value
)
263 // don't do this because it is just linking the text to a source
264 // string which is unsafe. MB
266 XmTextSetString ((Widget
) m_mainWidget
, (char*)value
.c_str());
268 // do this instead... MB
270 XtVaSetValues( (Widget
) m_mainWidget
,
271 XmNvalue
, (char *)value
.c_str(),
275 m_inSetValue
= FALSE
;
278 // Clipboard operations
279 void wxTextCtrl::Copy()
281 XmTextCopy((Widget
) m_mainWidget
, CurrentTime
);
284 void wxTextCtrl::Cut()
286 XmTextCut((Widget
) m_mainWidget
, CurrentTime
);
289 void wxTextCtrl::Paste()
291 XmTextPaste((Widget
) m_mainWidget
);
294 bool wxTextCtrl::CanCopy() const
296 // Can copy if there's a selection
298 GetSelection(& from
, & to
);
299 return (from
!= to
) ;
302 bool wxTextCtrl::CanCut() const
304 // Can cut if there's a selection
306 GetSelection(& from
, & to
);
307 return (from
!= to
) && (IsEditable());
310 bool wxTextCtrl::CanPaste() const
312 return IsEditable() ;
316 void wxTextCtrl::Undo()
318 // Not possible in Motif
321 void wxTextCtrl::Redo()
323 // Not possible in Motif
326 bool wxTextCtrl::CanUndo() const
332 bool wxTextCtrl::CanRedo() const
338 // If the return values from and to are the same, there is no
340 void wxTextCtrl::GetSelection(long* from
, long* to
) const
342 XmTextPosition left
, right
;
344 XmTextGetSelectionPosition((Widget
) m_mainWidget
, & left
, & right
);
350 bool wxTextCtrl::IsEditable() const
352 return (XmTextGetEditable((Widget
) m_mainWidget
) != 0);
355 void wxTextCtrl::SetEditable(bool editable
)
357 XmTextSetEditable((Widget
) m_mainWidget
, (Boolean
) editable
);
360 void wxTextCtrl::SetInsertionPoint(long pos
)
362 XmTextSetInsertionPosition ((Widget
) m_mainWidget
, (XmTextPosition
) pos
);
365 void wxTextCtrl::SetInsertionPointEnd()
367 long pos
= GetLastPosition();
368 SetInsertionPoint(pos
);
371 long wxTextCtrl::GetInsertionPoint() const
373 return (long) XmTextGetInsertionPosition ((Widget
) m_mainWidget
);
376 long wxTextCtrl::GetLastPosition() const
378 return (long) XmTextGetLastPosition ((Widget
) m_mainWidget
);
381 void wxTextCtrl::Replace(long from
, long to
, const wxString
& value
)
383 XmTextReplace ((Widget
) m_mainWidget
, (XmTextPosition
) from
, (XmTextPosition
) to
,
384 (char*) (const char*) value
);
387 void wxTextCtrl::Remove(long from
, long to
)
389 XmTextSetSelection ((Widget
) m_mainWidget
, (XmTextPosition
) from
, (XmTextPosition
) to
,
391 XmTextRemove ((Widget
) m_mainWidget
);
394 void wxTextCtrl::SetSelection(long from
, long to
)
396 XmTextSetSelection ((Widget
) m_mainWidget
, (XmTextPosition
) from
, (XmTextPosition
) to
,
400 bool wxTextCtrl::LoadFile(const wxString
& file
)
402 if (!wxFileExists(file
))
409 Widget textWidget
= (Widget
) m_mainWidget
;
413 if ((stat ((char*) (const char*) file
, &statb
) == -1) || (statb
.st_mode
& S_IFMT
) != S_IFREG
||
414 !(fp
= fopen ((char*) (const char*) file
, "r")))
420 long len
= statb
.st_size
;
422 if (!(text
= XtMalloc ((unsigned) (len
+ 1))))
427 if (fread (text
, sizeof (char), len
, fp
) != (size_t) len
)
433 XmTextSetString (textWidget
, text
);
434 // m_textPosition = len;
441 // If file is null, try saved file name first
442 // Returns TRUE if succeeds.
443 bool wxTextCtrl::SaveFile(const wxString
& file
)
445 wxString
theFile(file
);
447 theFile
= m_fileName
;
450 m_fileName
= theFile
;
452 Widget textWidget
= (Widget
) m_mainWidget
;
455 if (!(fp
= fopen ((char*) (const char*) theFile
, "w")))
461 char *text
= XmTextGetString (textWidget
);
462 long len
= XmTextGetLastPosition (textWidget
);
464 if (fwrite (text
, sizeof (char), len
, fp
) != (size_t) len
)
466 // Did not write whole file
468 // Make sure newline terminates the file
469 if (text
[len
- 1] != '\n')
479 void wxTextCtrl::WriteText(const wxString
& text
)
481 long textPosition
= GetInsertionPoint() + strlen (text
);
482 XmTextInsert ((Widget
) m_mainWidget
, GetInsertionPoint(), (char*) (const char*) text
);
483 XtVaSetValues ((Widget
) m_mainWidget
, XmNcursorPosition
, textPosition
, NULL
);
484 SetInsertionPoint(textPosition
);
485 XmTextShowPosition ((Widget
) m_mainWidget
, textPosition
);
489 void wxTextCtrl::AppendText(const wxString
& text
)
491 long textPosition
= GetLastPosition() + strlen(text
);
492 XmTextInsert ((Widget
) m_mainWidget
, GetLastPosition(), (char*) (const char*) text
);
493 XtVaSetValues ((Widget
) m_mainWidget
, XmNcursorPosition
, textPosition
, NULL
);
494 SetInsertionPoint(textPosition
);
495 XmTextShowPosition ((Widget
) m_mainWidget
, textPosition
);
499 void wxTextCtrl::Clear()
501 XmTextSetString ((Widget
) m_mainWidget
, "");
505 bool wxTextCtrl::IsModified() const
510 // Makes 'unmodified'
511 void wxTextCtrl::DiscardEdits()
516 int wxTextCtrl::GetNumberOfLines() const
518 // HIDEOUSLY inefficient, but we have no choice.
519 char *s
= XmTextGetString ((Widget
) m_mainWidget
);
524 bool finished
= FALSE
;
547 long wxTextCtrl::XYToPosition(long x
, long y
) const
549 /* It seems, that there is a bug in some versions of the Motif library,
550 so the original wxWin-Code doesn't work. */
552 Widget textWidget = (Widget) handle;
553 return (long) XmTextXYToPos (textWidget, (Position) x, (Position) y);
555 /* Now a little workaround: */
557 for (int i
=0; i
<y
; i
++) r
+=(GetLineLength(i
)+1);
561 bool wxTextCtrl::PositionToXY(long pos
, long *x
, long *y
) const
564 XmTextPosToXY((Widget
) m_mainWidget
, pos
, &xx
, &yy
);
573 void wxTextCtrl::ShowPosition(long pos
)
575 XmTextShowPosition ((Widget
) m_mainWidget
, (XmTextPosition
) pos
);
578 int wxTextCtrl::GetLineLength(long lineNo
) const
580 wxString str
= GetLineText (lineNo
);
581 return (int) str
.Length();
584 wxString
wxTextCtrl::GetLineText(long lineNo
) const
586 // HIDEOUSLY inefficient, but we have no choice.
587 char *s
= XmTextGetString ((Widget
) m_mainWidget
);
594 for (i
= 0; currentLine
!= lineNo
&& s
[i
]; i
++ )
599 for (j
= 0; s
[i
] && s
[i
] != '\n'; i
++, j
++ )
606 return wxEmptyString
;
613 void wxTextCtrl::Command(wxCommandEvent
& event
)
615 SetValue (event
.GetString());
616 ProcessCommand (event
);
619 void wxTextCtrl::OnDropFiles(wxDropFilesEvent
& event
)
621 // By default, load the first file into the text window.
622 if (event
.GetNumberOfFiles() > 0)
624 LoadFile(event
.GetFiles()[0]);
628 void wxTextCtrl::OnChar(wxKeyEvent
& event
)
630 // Indicates that we should generate a normal command, because
631 // we're letting default behaviour happen (otherwise it's vetoed
632 // by virtue of overriding OnChar)
633 m_processedDefault
= TRUE
;
635 if (m_tempCallbackStruct
)
637 XmTextVerifyCallbackStruct
*textStruct
=
638 (XmTextVerifyCallbackStruct
*) m_tempCallbackStruct
;
639 textStruct
->doit
= True
;
640 if (isascii(event
.m_keyCode
) && (textStruct
->text
->length
== 1))
642 textStruct
->text
->ptr
[0] = ((event
.m_keyCode
== WXK_RETURN
) ? 10 : event
.m_keyCode
);
647 void wxTextCtrl::ChangeFont(bool keepOriginalSize
)
649 wxWindow::ChangeFont(keepOriginalSize
);
652 void wxTextCtrl::ChangeBackgroundColour()
654 wxWindow::ChangeBackgroundColour();
656 /* TODO: should scrollbars be affected? Should probably have separate
657 * function to change them (by default, taken from wxSystemSettings)
659 if (m_windowStyle
& wxTE_MULTILINE
)
661 Widget parent
= XtParent ((Widget
) m_mainWidget
);
664 XtVaGetValues (parent
,
665 XmNhorizontalScrollBar
, &hsb
,
666 XmNverticalScrollBar
, &vsb
,
668 wxColour backgroundColour
= wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE
);
670 DoChangeBackgroundColour((WXWidget
) hsb
, backgroundColour
, TRUE
);
672 DoChangeBackgroundColour((WXWidget
) vsb
, backgroundColour
, TRUE
);
674 DoChangeBackgroundColour((WXWidget
) parent
, m_backgroundColour
, TRUE
);
678 void wxTextCtrl::ChangeForegroundColour()
680 wxWindow::ChangeForegroundColour();
682 if (m_windowStyle
& wxTE_MULTILINE
)
684 Widget parent
= XtParent ((Widget
) m_mainWidget
);
687 XtVaGetValues (parent
,
688 XmNhorizontalScrollBar
, &hsb
,
689 XmNverticalScrollBar
, &vsb
,
692 /* TODO: should scrollbars be affected? Should probably have separate
693 * function to change them (by default, taken from wxSystemSettings)
695 DoChangeForegroundColour((WXWidget) hsb, m_foregroundColour);
697 DoChangeForegroundColour((WXWidget) vsb, m_foregroundColour);
699 DoChangeForegroundColour((WXWidget
) parent
, m_foregroundColour
);
703 void wxTextCtrl::DoSendEvents(void *wxcbs
, long keycode
)
705 // we're in process of updating the text control
706 m_tempCallbackStruct
= wxcbs
;
708 XmTextVerifyCallbackStruct
*cbs
= (XmTextVerifyCallbackStruct
*)wxcbs
;
710 wxKeyEvent
event (wxEVT_CHAR
);
711 event
.SetId(GetId());
712 event
.m_keyCode
= keycode
;
713 event
.SetEventObject(this);
715 // Only if wxTextCtrl::OnChar is called will this be set to True (and
716 // the character passed through)
719 GetEventHandler()->ProcessEvent(event
);
721 if ( !InSetValue() && m_processedDefault
)
723 // Can generate a command
724 wxCommandEvent
commandEvent(wxEVT_COMMAND_TEXT_UPDATED
, GetId());
725 commandEvent
.SetEventObject(this);
726 ProcessCommand(commandEvent
);
729 // do it after the (user) event handlers processed the events because
730 // otherwise GetValue() would return incorrect (not yet updated value)
731 m_tempCallbackStruct
= NULL
;
734 // ----------------------------------------------------------------------------
735 // helpers and Motif callbacks
736 // ----------------------------------------------------------------------------
738 static void MergeChangesIntoString(wxString
& value
,
739 XmTextVerifyCallbackStruct
*cbs
)
742 * At least on my system (SunOS 4.1.3 + Motif 1.2), you need to think of
743 * every event as a replace event. cbs->text->ptr gives the replacement
744 * text, cbs->startPos gives the index of the first char affected by the
745 * replace, and cbs->endPos gives the index one more than the last char
746 * affected by the replace (startPos == endPos implies an empty range).
747 * Hence, a deletion is represented by replacing all input text with a
748 * blank string ("", *not* NULL!). A simple insertion that does not
749 * overwrite any text has startPos == endPos.
754 // easy case: the ol value was empty
755 value
= cbs
->text
->ptr
;
759 // merge the changes into the value
760 const char * const passwd
= value
;
761 int len
= value
.length();
763 len
+= strlen(cbs
->text
->ptr
) + 1; // + new text (if any) + NUL
764 len
-= cbs
->endPos
- cbs
->startPos
; // - text from affected region.
766 char * newS
= new char [len
];
768 * insert
= cbs
->text
->ptr
;
770 // Copy (old) text from passwd, up to the start posn of the change.
772 const char * p
= passwd
;
773 for (i
= 0; i
< cbs
->startPos
; ++i
)
776 // Copy the text to be inserted).
780 // Finally, copy into newS any remaining text from passwd[endPos] on.
781 for (p
= passwd
+ cbs
->endPos
; *p
; )
792 wxTextWindowChangedProc (Widget w
, XtPointer clientData
, XtPointer
WXUNUSED(ptr
))
794 if (!wxGetWindowFromTable(w
))
795 // Widget has been deleted!
798 wxTextCtrl
*tw
= (wxTextCtrl
*) clientData
;
799 tw
->SetModified(TRUE
);
803 wxTextWindowModifyProc (Widget
WXUNUSED(w
), XtPointer clientData
, XmTextVerifyCallbackStruct
*cbs
)
805 wxTextCtrl
*tw
= (wxTextCtrl
*) clientData
;
806 tw
->m_processedDefault
= FALSE
;
808 // First, do some stuff if it's a password control: in this case, we need
809 // to store the string inside the class because GetValue() can't retrieve
810 // it from the text ctrl. We do *not* do it in other circumstances because
811 // it would double the amount of memory needed.
813 if ( tw
->GetWindowStyleFlag() & wxTE_PASSWORD
)
815 MergeChangesIntoString(tw
->m_value
, cbs
);
817 if ( cbs
->text
->length
> 0 )
820 for (i
= 0; i
< cbs
->text
->length
; ++i
)
821 cbs
->text
->ptr
[i
] = '*';
822 cbs
->text
->ptr
[i
] = '\0';
826 // If we're already within an OnChar, return: probably a programmatic
828 if (tw
->m_tempCallbackStruct
)
831 // Check for a backspace
832 if (cbs
->startPos
== (cbs
->currInsert
- 1))
834 tw
->DoSendEvents((void *)cbs
, WXK_DELETE
);
839 // Pasting operation: let it through without calling OnChar
840 if (cbs
->text
->length
> 1)
843 // Something other than text
844 if (cbs
->text
->ptr
== NULL
)
848 char ch
= cbs
->text
->ptr
[0];
849 tw
->DoSendEvents((void *)cbs
, ch
== '\n' ? '\r' : ch
);
853 wxTextWindowGainFocusProc (Widget w
, XtPointer clientData
, XmAnyCallbackStruct
*WXUNUSED(cbs
))
855 if (!wxGetWindowFromTable(w
))
858 wxTextCtrl
*tw
= (wxTextCtrl
*) clientData
;
859 wxFocusEvent
event(wxEVT_SET_FOCUS
, tw
->GetId());
860 event
.SetEventObject(tw
);
861 tw
->GetEventHandler()->ProcessEvent(event
);
865 wxTextWindowLoseFocusProc (Widget w
, XtPointer clientData
, XmAnyCallbackStruct
*WXUNUSED(cbs
))
867 if (!wxGetWindowFromTable(w
))
870 wxTextCtrl
*tw
= (wxTextCtrl
*) clientData
;
871 wxFocusEvent
event(wxEVT_KILL_FOCUS
, tw
->GetId());
872 event
.SetEventObject(tw
);
873 tw
->GetEventHandler()->ProcessEvent(event
);
876 static void wxTextWindowActivateProc(Widget w
, XtPointer clientData
,
877 XmAnyCallbackStruct
*WXUNUSED(ptr
))
879 if (!wxGetWindowFromTable(w
))
882 wxTextCtrl
*tw
= (wxTextCtrl
*) clientData
;
884 if (tw
->InSetValue())
887 wxCommandEvent
event(wxEVT_COMMAND_TEXT_ENTER
);
888 event
.SetId(tw
->GetId());
889 event
.SetEventObject(tw
);
890 tw
->ProcessCommand(event
);
893 void wxTextCtrl::OnCut(wxCommandEvent
& WXUNUSED(event
))
898 void wxTextCtrl::OnCopy(wxCommandEvent
& WXUNUSED(event
))
903 void wxTextCtrl::OnPaste(wxCommandEvent
& WXUNUSED(event
))
908 void wxTextCtrl::OnUndo(wxCommandEvent
& WXUNUSED(event
))
913 void wxTextCtrl::OnRedo(wxCommandEvent
& WXUNUSED(event
))
918 void wxTextCtrl::OnUpdateCut(wxUpdateUIEvent
& event
)
920 event
.Enable( CanCut() );
923 void wxTextCtrl::OnUpdateCopy(wxUpdateUIEvent
& event
)
925 event
.Enable( CanCopy() );
928 void wxTextCtrl::OnUpdatePaste(wxUpdateUIEvent
& event
)
930 event
.Enable( CanPaste() );
933 void wxTextCtrl::OnUpdateUndo(wxUpdateUIEvent
& event
)
935 event
.Enable( CanUndo() );
938 void wxTextCtrl::OnUpdateRedo(wxUpdateUIEvent
& event
)
940 event
.Enable( CanRedo() );