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 wantHorizScroll
= (m_windowStyle
& wxHSCROLL
) != 0 ? True
: False
;
125 // If we don't have horizontal scrollbars, we want word wrap.
126 // OpenMotif 2.1 crashes if wantWordWrap is True in Japanese
127 // locale (and probably other multibyte locales). The check might be
129 #if wxCHECK_LESSTIF() || wxCHECK_MOTIF_VERSION( 2, 2 )
130 Bool wantWordWrap
= wantHorizScroll
== True
? False
: True
;
132 Bool wantWordWrap
= False
;
135 if (m_windowStyle
& wxTE_MULTILINE
)
139 XtSetArg (args
[count
], XmNscrollHorizontal
, wantHorizScroll
); ++count
;
140 XtSetArg (args
[count
], (String
) wxFont::GetFontTag(),
141 m_font
.GetFontType( XtDisplay(parentWidget
) ) ); ++count
;
142 XtSetArg (args
[count
], XmNwordWrap
, wantWordWrap
); ++count
;
143 XtSetArg (args
[count
], XmNvalue
, value
.c_str()); ++count
;
144 XtSetArg (args
[count
], XmNeditable
,
145 style
& wxTE_READONLY
? False
: True
); ++count
;
146 XtSetArg (args
[count
], XmNeditMode
, XmMULTI_LINE_EDIT
); ++count
;
149 (WXWidget
) XmCreateScrolledText(parentWidget
,
150 wxConstCast(name
.c_str(), char),
153 XtManageChild ((Widget
) m_mainWidget
);
157 m_mainWidget
= (WXWidget
)XtVaCreateManagedWidget
159 wxConstCast(name
.c_str(), char),
162 wxFont::GetFontTag(), m_font
.GetFontType( XtDisplay(parentWidget
) ),
163 XmNvalue
, value
.c_str(),
164 XmNeditable
, (style
& wxTE_READONLY
) ?
170 // TODO: Is this relevant? What does it do?
172 if (!value
.IsNull() && (value
.Length() > (unsigned int) noCols
))
173 noCols
= value
.Length();
174 XtVaSetValues((Widget
) m_mainWidget
,
180 // remove border if asked for
181 if ( style
& wxNO_BORDER
)
183 XtVaSetValues((Widget
)m_mainWidget
,
184 XmNshadowThickness
, 0,
189 XtAddCallback((Widget
) m_mainWidget
, XmNvalueChangedCallback
, (XtCallbackProc
)wxTextWindowChangedProc
, (XtPointer
)this);
191 XtAddCallback((Widget
) m_mainWidget
, XmNmodifyVerifyCallback
, (XtCallbackProc
)wxTextWindowModifyProc
, (XtPointer
)this);
193 XtAddCallback((Widget
) m_mainWidget
, XmNactivateCallback
, (XtCallbackProc
)wxTextWindowActivateProc
, (XtPointer
)this);
195 XtAddCallback((Widget
) m_mainWidget
, XmNfocusCallback
, (XtCallbackProc
)wxTextWindowGainFocusProc
, (XtPointer
)this);
197 XtAddCallback((Widget
) m_mainWidget
, XmNlosingFocusCallback
, (XtCallbackProc
)wxTextWindowLoseFocusProc
, (XtPointer
)this);
199 AttachWidget (parent
, m_mainWidget
, (WXWidget
) NULL
,
200 pos
.x
, pos
.y
, size
.x
, size
.y
);
202 ChangeBackgroundColour();
207 WXWidget
wxTextCtrl::GetTopWidget() const
209 return IsMultiLine() ? (WXWidget
)XtParent((Widget
)m_mainWidget
)
213 wxString
wxTextCtrl::GetValue() const
215 wxString str
; // result
217 if (m_windowStyle
& wxTE_PASSWORD
)
219 // the value is stored always in m_value because it can't be retrieved
220 // from the text control
225 // just get the string from Motif
226 char *s
= XmTextGetString ((Widget
) m_mainWidget
);
232 //else: return empty string
234 if ( m_tempCallbackStruct
)
236 // the string in the control isn't yet updated, can't use it as is
237 MergeChangesIntoString(str
, (XmTextVerifyCallbackStruct
*)
238 m_tempCallbackStruct
);
245 void wxTextCtrl::SetValue(const wxString
& text
)
249 XmTextSetString ((Widget
) m_mainWidget
, wxConstCast(text
.c_str(), char));
250 XtVaSetValues ((Widget
) m_mainWidget
,
251 XmNcursorPosition
, text
.length(),
254 SetInsertionPoint(text
.length());
255 XmTextShowPosition ((Widget
) m_mainWidget
, text
.length());
258 m_inSetValue
= false;
261 // Clipboard operations
262 void wxTextCtrl::Copy()
264 XmTextCopy((Widget
) m_mainWidget
, CurrentTime
);
267 void wxTextCtrl::Cut()
269 XmTextCut((Widget
) m_mainWidget
, CurrentTime
);
272 void wxTextCtrl::Paste()
274 XmTextPaste((Widget
) m_mainWidget
);
277 bool wxTextCtrl::CanCopy() const
279 // Can copy if there's a selection
281 GetSelection(& from
, & to
);
282 return (from
!= to
) ;
285 bool wxTextCtrl::CanCut() const
287 // Can cut if there's a selection
289 GetSelection(& from
, & to
);
290 return (from
!= to
) && (IsEditable());
293 bool wxTextCtrl::CanPaste() const
295 return IsEditable() ;
299 void wxTextCtrl::Undo()
301 // Not possible in Motif
304 void wxTextCtrl::Redo()
306 // Not possible in Motif
309 bool wxTextCtrl::CanUndo() const
315 bool wxTextCtrl::CanRedo() const
321 // If the return values from and to are the same, there is no
323 void wxTextCtrl::GetSelection(long* from
, long* to
) const
325 XmTextPosition left
, right
;
327 XmTextGetSelectionPosition((Widget
) m_mainWidget
, & left
, & right
);
333 bool wxTextCtrl::IsEditable() const
335 return (XmTextGetEditable((Widget
) m_mainWidget
) != 0);
338 void wxTextCtrl::SetEditable(bool editable
)
340 XmTextSetEditable((Widget
) m_mainWidget
, (Boolean
) editable
);
343 void wxTextCtrl::SetInsertionPoint(long pos
)
345 XmTextSetInsertionPosition ((Widget
) m_mainWidget
, (XmTextPosition
) pos
);
348 void wxTextCtrl::SetInsertionPointEnd()
350 wxTextPos pos
= GetLastPosition();
351 SetInsertionPoint(pos
);
354 long wxTextCtrl::GetInsertionPoint() const
356 return (long) XmTextGetInsertionPosition ((Widget
) m_mainWidget
);
359 wxTextPos
wxTextCtrl::GetLastPosition() const
361 return (long) XmTextGetLastPosition ((Widget
) m_mainWidget
);
364 void wxTextCtrl::Replace(long from
, long to
, const wxString
& value
)
366 XmTextReplace ((Widget
) m_mainWidget
, (XmTextPosition
) from
, (XmTextPosition
) to
,
367 wxConstCast(value
.c_str(), char));
370 void wxTextCtrl::Remove(long from
, long to
)
372 XmTextSetSelection ((Widget
) m_mainWidget
, (XmTextPosition
) from
, (XmTextPosition
) to
,
374 XmTextRemove ((Widget
) m_mainWidget
);
377 void wxTextCtrl::SetSelection(long from
, long to
)
380 to
= GetLastPosition();
382 XmTextSetSelection ((Widget
) m_mainWidget
, (XmTextPosition
) from
, (XmTextPosition
) to
,
386 void wxTextCtrl::WriteText(const wxString
& text
)
388 long textPosition
= GetInsertionPoint() + text
.length();
389 XmTextInsert ((Widget
) m_mainWidget
, GetInsertionPoint(),
390 wxConstCast(text
.c_str(), char));
391 XtVaSetValues ((Widget
) m_mainWidget
, XmNcursorPosition
, textPosition
, NULL
);
392 SetInsertionPoint(textPosition
);
393 XmTextShowPosition ((Widget
) m_mainWidget
, textPosition
);
397 void wxTextCtrl::AppendText(const wxString
& text
)
399 wxTextPos textPosition
= GetLastPosition() + text
.length();
400 XmTextInsert ((Widget
) m_mainWidget
, GetLastPosition(),
401 wxConstCast(text
.c_str(), char));
402 XtVaSetValues ((Widget
) m_mainWidget
, XmNcursorPosition
, textPosition
, NULL
);
403 SetInsertionPoint(textPosition
);
404 XmTextShowPosition ((Widget
) m_mainWidget
, textPosition
);
408 void wxTextCtrl::Clear()
410 XmTextSetString ((Widget
) m_mainWidget
, wxMOTIF_STR(""));
414 bool wxTextCtrl::IsModified() const
419 // Makes modified or unmodified
420 void wxTextCtrl::MarkDirty()
425 void wxTextCtrl::DiscardEdits()
430 int wxTextCtrl::GetNumberOfLines() const
432 // HIDEOUSLY inefficient, but we have no choice.
433 char *s
= XmTextGetString ((Widget
) m_mainWidget
);
438 bool finished
= false;
461 long wxTextCtrl::XYToPosition(long x
, long y
) const
463 /* It seems, that there is a bug in some versions of the Motif library,
464 so the original wxWin-Code doesn't work. */
466 Widget textWidget = (Widget) handle;
467 return (long) XmTextXYToPos (textWidget, (Position) x, (Position) y);
469 /* Now a little workaround: */
471 for (int i
=0; i
<y
; i
++) r
+=(GetLineLength(i
)+1);
475 bool wxTextCtrl::PositionToXY(long pos
, long *x
, long *y
) const
478 XmTextPosToXY((Widget
) m_mainWidget
, pos
, &xx
, &yy
);
487 void wxTextCtrl::ShowPosition(long pos
)
489 XmTextShowPosition ((Widget
) m_mainWidget
, (XmTextPosition
) pos
);
492 int wxTextCtrl::GetLineLength(long lineNo
) const
494 wxString str
= GetLineText (lineNo
);
495 return (int) str
.Length();
498 wxString
wxTextCtrl::GetLineText(long lineNo
) const
500 // HIDEOUSLY inefficient, but we have no choice.
501 char *s
= XmTextGetString ((Widget
) m_mainWidget
);
508 for (i
= 0; currentLine
!= lineNo
&& s
[i
]; i
++ )
513 for (j
= 0; s
[i
] && s
[i
] != '\n'; i
++, j
++ )
520 return wxEmptyString
;
527 void wxTextCtrl::Command(wxCommandEvent
& event
)
529 SetValue (event
.GetString());
530 ProcessCommand (event
);
533 void wxTextCtrl::OnDropFiles(wxDropFilesEvent
& event
)
535 // By default, load the first file into the text window.
536 if (event
.GetNumberOfFiles() > 0)
538 LoadFile(event
.GetFiles()[0]);
542 void wxTextCtrl::OnChar(wxKeyEvent
& event
)
544 // Indicates that we should generate a normal command, because
545 // we're letting default behaviour happen (otherwise it's vetoed
546 // by virtue of overriding OnChar)
547 m_processedDefault
= true;
549 if (m_tempCallbackStruct
)
551 XmTextVerifyCallbackStruct
*textStruct
=
552 (XmTextVerifyCallbackStruct
*) m_tempCallbackStruct
;
553 textStruct
->doit
= True
;
554 if (isascii(event
.m_keyCode
) && (textStruct
->text
->length
== 1))
556 textStruct
->text
->ptr
[0] = ((event
.m_keyCode
== WXK_RETURN
) ? 10 : event
.m_keyCode
);
561 void wxTextCtrl::ChangeFont(bool keepOriginalSize
)
563 wxWindow::ChangeFont(keepOriginalSize
);
566 void wxTextCtrl::ChangeBackgroundColour()
568 wxWindow::ChangeBackgroundColour();
570 /* TODO: should scrollbars be affected? Should probably have separate
571 * function to change them (by default, taken from wxSystemSettings)
573 if (m_windowStyle
& wxTE_MULTILINE
)
575 Widget parent
= XtParent ((Widget
) m_mainWidget
);
578 XtVaGetValues (parent
,
579 XmNhorizontalScrollBar
, &hsb
,
580 XmNverticalScrollBar
, &vsb
,
582 wxColour backgroundColour
= wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE
);
584 wxDoChangeBackgroundColour((WXWidget
) hsb
, backgroundColour
, true);
586 wxDoChangeBackgroundColour((WXWidget
) vsb
, backgroundColour
, true);
588 // MBN: why change parent background?
589 // DoChangeBackgroundColour((WXWidget) parent, m_backgroundColour, true);
593 void wxTextCtrl::ChangeForegroundColour()
595 wxWindow::ChangeForegroundColour();
597 if (m_windowStyle
& wxTE_MULTILINE
)
599 Widget parent
= XtParent ((Widget
) m_mainWidget
);
602 XtVaGetValues (parent
,
603 XmNhorizontalScrollBar
, &hsb
,
604 XmNverticalScrollBar
, &vsb
,
607 /* TODO: should scrollbars be affected? Should probably have separate
608 * function to change them (by default, taken from wxSystemSettings)
610 DoChangeForegroundColour((WXWidget) hsb, m_foregroundColour);
612 DoChangeForegroundColour((WXWidget) vsb, m_foregroundColour);
614 wxDoChangeForegroundColour((WXWidget
) parent
, m_foregroundColour
);
618 void wxTextCtrl::DoSendEvents(void *wxcbs
, long keycode
)
620 // we're in process of updating the text control
621 m_tempCallbackStruct
= wxcbs
;
623 XmTextVerifyCallbackStruct
*cbs
= (XmTextVerifyCallbackStruct
*)wxcbs
;
625 wxKeyEvent
event (wxEVT_CHAR
);
626 event
.SetId(GetId());
627 event
.m_keyCode
= keycode
;
628 event
.SetEventObject(this);
630 // Only if wxTextCtrl::OnChar is called will this be set to True (and
631 // the character passed through)
634 GetEventHandler()->ProcessEvent(event
);
636 if ( !InSetValue() && m_processedDefault
)
638 // Can generate a command
639 wxCommandEvent
commandEvent(wxEVT_COMMAND_TEXT_UPDATED
, GetId());
640 commandEvent
.SetEventObject(this);
641 ProcessCommand(commandEvent
);
644 // do it after the (user) event handlers processed the events because
645 // otherwise GetValue() would return incorrect (not yet updated value)
646 m_tempCallbackStruct
= NULL
;
649 wxSize
wxDoGetSingleTextCtrlBestSize( Widget textWidget
,
650 const wxWindow
* window
)
652 Dimension xmargin
, ymargin
, highlight
, shadow
;
655 XtVaGetValues( textWidget
,
656 XmNmarginWidth
, &xmargin
,
657 XmNmarginHeight
, &ymargin
,
659 XmNhighlightThickness
, &highlight
,
660 XmNshadowThickness
, &shadow
,
664 value
= wxMOTIF_STR("|");
667 window
->GetTextExtent( value
, &x
, &y
);
672 return wxSize( x
+ 2 * xmargin
+ 2 * highlight
+ 2 * shadow
,
673 // MBN: +2 necessary: Lesstif bug or mine?
674 y
+ 2 * ymargin
+ 2 * highlight
+ 2 * shadow
+ 2 );
677 wxSize
wxTextCtrl::DoGetBestSize() const
681 wxSize best
= wxControl::DoGetBestSize();
683 if( best
.x
< 110 ) best
.x
= 110;
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() );