1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/motif/textctrl.cpp
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 // ============================================================================
14 // ============================================================================
16 // ----------------------------------------------------------------------------
18 // ----------------------------------------------------------------------------
20 // For compilers that support precompilation, includes "wx.h".
21 #include "wx/wxprec.h"
24 #define XtParent XTPARENT
27 #include <sys/types.h>
31 #include "wx/textctrl.h"
35 #include "wx/settings.h"
38 #include "wx/filefn.h"
41 #pragma message disable nosimpint
45 #pragma message enable nosimpint
48 #include "wx/motif/private.h"
50 // ----------------------------------------------------------------------------
52 // ----------------------------------------------------------------------------
54 // helper: inserts the new text in the value of the text ctrl and returns the
56 static void MergeChangesIntoString(wxString
& value
,
57 XmTextVerifyCallbackStruct
*textStruct
);
60 static void wxTextWindowChangedProc(Widget w
, XtPointer clientData
, XtPointer ptr
);
61 static void wxTextWindowModifyProc(Widget w
, XtPointer clientData
, XmTextVerifyCallbackStruct
*cbs
);
62 static void wxTextWindowGainFocusProc(Widget w
, XtPointer clientData
, XmAnyCallbackStruct
*cbs
);
63 static void wxTextWindowLoseFocusProc(Widget w
, XtPointer clientData
, XmAnyCallbackStruct
*cbs
);
64 static void wxTextWindowActivateProc(Widget w
, XtPointer clientData
, XmAnyCallbackStruct
*ptr
);
66 IMPLEMENT_DYNAMIC_CLASS(wxTextCtrl
, wxTextCtrlBase
)
68 BEGIN_EVENT_TABLE(wxTextCtrl
, wxTextCtrlBase
)
69 EVT_DROP_FILES(wxTextCtrl::OnDropFiles
)
70 EVT_CHAR(wxTextCtrl::OnChar
)
72 EVT_MENU(wxID_CUT
, wxTextCtrl::OnCut
)
73 EVT_MENU(wxID_COPY
, wxTextCtrl::OnCopy
)
74 EVT_MENU(wxID_PASTE
, wxTextCtrl::OnPaste
)
75 EVT_MENU(wxID_UNDO
, wxTextCtrl::OnUndo
)
76 EVT_MENU(wxID_REDO
, wxTextCtrl::OnRedo
)
78 EVT_UPDATE_UI(wxID_CUT
, wxTextCtrl::OnUpdateCut
)
79 EVT_UPDATE_UI(wxID_COPY
, wxTextCtrl::OnUpdateCopy
)
80 EVT_UPDATE_UI(wxID_PASTE
, wxTextCtrl::OnUpdatePaste
)
81 EVT_UPDATE_UI(wxID_UNDO
, wxTextCtrl::OnUpdateUndo
)
82 EVT_UPDATE_UI(wxID_REDO
, wxTextCtrl::OnUpdateRedo
)
86 // ============================================================================
88 // ============================================================================
90 // ----------------------------------------------------------------------------
92 // ----------------------------------------------------------------------------
95 wxTextCtrl::wxTextCtrl()
97 m_tempCallbackStruct
= (void*) NULL
;
99 m_processedDefault
= false;
102 bool wxTextCtrl::Create(wxWindow
*parent
,
104 const wxString
& value
,
108 const wxValidator
& validator
,
109 const wxString
& name
)
111 if( !CreateControl( parent
, id
, pos
, size
, style
, validator
, name
) )
114 m_tempCallbackStruct
= (void*) NULL
;
116 m_processedDefault
= false;
118 m_backgroundColour
= *wxWHITE
;
120 Widget parentWidget
= (Widget
) parent
->GetClientWidget();
122 Bool wantHorizScroll
= (m_windowStyle
& wxHSCROLL
) != 0 ? True
: False
;
123 // If we don't have horizontal scrollbars, we want word wrap.
124 // OpenMotif 2.1 crashes if wantWordWrap is True in Japanese
125 // locale (and probably other multibyte locales). The check might be
127 #if wxCHECK_LESSTIF() || wxCHECK_MOTIF_VERSION( 2, 2 )
128 Bool wantWordWrap
= wantHorizScroll
== True
? False
: True
;
130 Bool wantWordWrap
= False
;
133 if (m_windowStyle
& wxTE_MULTILINE
)
137 XtSetArg (args
[count
], XmNscrollHorizontal
, wantHorizScroll
); ++count
;
138 XtSetArg (args
[count
], (String
) wxFont::GetFontTag(),
139 m_font
.GetFontType( XtDisplay(parentWidget
) ) ); ++count
;
140 XtSetArg (args
[count
], XmNwordWrap
, wantWordWrap
); ++count
;
141 XtSetArg (args
[count
], XmNvalue
, value
.mb_str()); ++count
;
142 XtSetArg (args
[count
], XmNeditable
,
143 style
& wxTE_READONLY
? False
: True
); ++count
;
144 XtSetArg (args
[count
], XmNeditMode
, XmMULTI_LINE_EDIT
); ++count
;
147 (WXWidget
) XmCreateScrolledText(parentWidget
,
148 wxConstCast(name
.mb_str(), char),
151 XtManageChild ((Widget
) m_mainWidget
);
155 m_mainWidget
= (WXWidget
)XtVaCreateManagedWidget
157 wxConstCast(name
.mb_str(), char),
160 wxFont::GetFontTag(), m_font
.GetFontType( XtDisplay(parentWidget
) ),
161 XmNvalue
, value
.mb_str(),
162 XmNeditable
, (style
& wxTE_READONLY
) ?
168 // TODO: Is this relevant? What does it do?
170 if (!value
.IsNull() && (value
.length() > (unsigned int) noCols
))
171 noCols
= value
.length();
172 XtVaSetValues((Widget
) m_mainWidget
,
178 // remove border if asked for
179 if ( style
& wxNO_BORDER
)
181 XtVaSetValues((Widget
)m_mainWidget
,
182 XmNshadowThickness
, 0,
187 XtAddCallback((Widget
) m_mainWidget
, XmNvalueChangedCallback
, (XtCallbackProc
)wxTextWindowChangedProc
, (XtPointer
)this);
189 XtAddCallback((Widget
) m_mainWidget
, XmNmodifyVerifyCallback
, (XtCallbackProc
)wxTextWindowModifyProc
, (XtPointer
)this);
191 XtAddCallback((Widget
) m_mainWidget
, XmNactivateCallback
, (XtCallbackProc
)wxTextWindowActivateProc
, (XtPointer
)this);
193 XtAddCallback((Widget
) m_mainWidget
, XmNfocusCallback
, (XtCallbackProc
)wxTextWindowGainFocusProc
, (XtPointer
)this);
195 XtAddCallback((Widget
) m_mainWidget
, XmNlosingFocusCallback
, (XtCallbackProc
)wxTextWindowLoseFocusProc
, (XtPointer
)this);
197 AttachWidget (parent
, m_mainWidget
, (WXWidget
) NULL
,
198 pos
.x
, pos
.y
, size
.x
, size
.y
);
200 ChangeBackgroundColour();
205 WXWidget
wxTextCtrl::GetTopWidget() const
207 return IsMultiLine() ? (WXWidget
)XtParent((Widget
)m_mainWidget
)
211 wxString
wxTextCtrl::GetValue() const
213 wxString str
; // result
215 if (m_windowStyle
& wxTE_PASSWORD
)
217 // the value is stored always in m_value because it can't be retrieved
218 // from the text control
223 // just get the string from Motif
224 char *s
= XmTextGetString ((Widget
) m_mainWidget
);
230 //else: return empty string
232 if ( m_tempCallbackStruct
)
234 // the string in the control isn't yet updated, can't use it as is
235 MergeChangesIntoString(str
, (XmTextVerifyCallbackStruct
*)
236 m_tempCallbackStruct
);
243 void wxTextCtrl::DoSetValue(const wxString
& text
, int flags
)
247 XmTextSetString ((Widget
) m_mainWidget
, wxConstCast(text
.mb_str(), char));
248 XtVaSetValues ((Widget
) m_mainWidget
,
249 XmNcursorPosition
, text
.length(),
252 SetInsertionPoint(text
.length());
253 XmTextShowPosition ((Widget
) m_mainWidget
, text
.length());
256 m_inSetValue
= false;
258 if ( flags
& SetValue_SendEvent
)
259 SendTextUpdatedEvent();
262 // Clipboard operations
263 void wxTextCtrl::Copy()
265 XmTextCopy((Widget
) m_mainWidget
, CurrentTime
);
268 void wxTextCtrl::Cut()
270 XmTextCut((Widget
) m_mainWidget
, CurrentTime
);
273 void wxTextCtrl::Paste()
275 XmTextPaste((Widget
) m_mainWidget
);
278 bool wxTextCtrl::CanCopy() const
280 // Can copy if there's a selection
282 GetSelection(& from
, & to
);
283 return (from
!= to
) ;
286 bool wxTextCtrl::CanCut() const
288 // Can cut if there's a selection
290 GetSelection(& from
, & to
);
291 return (from
!= to
) && (IsEditable());
294 bool wxTextCtrl::CanPaste() const
296 return IsEditable() ;
300 void wxTextCtrl::Undo()
302 // Not possible in Motif
305 void wxTextCtrl::Redo()
307 // Not possible in Motif
310 bool wxTextCtrl::CanUndo() const
316 bool wxTextCtrl::CanRedo() const
322 // If the return values from and to are the same, there is no
324 void wxTextCtrl::GetSelection(long* from
, long* to
) const
326 XmTextPosition left
, right
;
328 XmTextGetSelectionPosition((Widget
) m_mainWidget
, & left
, & right
);
334 bool wxTextCtrl::IsEditable() const
336 return (XmTextGetEditable((Widget
) m_mainWidget
) != 0);
339 void wxTextCtrl::SetEditable(bool editable
)
341 XmTextSetEditable((Widget
) m_mainWidget
, (Boolean
) editable
);
344 void wxTextCtrl::SetInsertionPoint(long pos
)
346 XmTextSetInsertionPosition ((Widget
) m_mainWidget
, (XmTextPosition
) pos
);
349 void wxTextCtrl::SetInsertionPointEnd()
351 wxTextPos pos
= GetLastPosition();
352 SetInsertionPoint(pos
);
355 long wxTextCtrl::GetInsertionPoint() const
357 return (long) XmTextGetInsertionPosition ((Widget
) m_mainWidget
);
360 wxTextPos
wxTextCtrl::GetLastPosition() const
362 return (long) XmTextGetLastPosition ((Widget
) m_mainWidget
);
365 void wxTextCtrl::Replace(long from
, long to
, const wxString
& value
)
367 XmTextReplace ((Widget
) m_mainWidget
, (XmTextPosition
) from
, (XmTextPosition
) to
,
368 wxConstCast(value
.mb_str(), char));
371 void wxTextCtrl::Remove(long from
, long to
)
373 XmTextSetSelection ((Widget
) m_mainWidget
, (XmTextPosition
) from
, (XmTextPosition
) to
,
375 XmTextRemove ((Widget
) m_mainWidget
);
378 void wxTextCtrl::SetSelection(long from
, long to
)
381 to
= GetLastPosition();
383 XmTextSetSelection ((Widget
) m_mainWidget
, (XmTextPosition
) from
, (XmTextPosition
) to
,
387 void wxTextCtrl::WriteText(const wxString
& text
)
389 long textPosition
= GetInsertionPoint() + text
.length();
390 XmTextInsert ((Widget
) m_mainWidget
, GetInsertionPoint(),
391 wxConstCast(text
.mb_str(), char));
392 XtVaSetValues ((Widget
) m_mainWidget
, XmNcursorPosition
, textPosition
, NULL
);
393 SetInsertionPoint(textPosition
);
394 XmTextShowPosition ((Widget
) m_mainWidget
, textPosition
);
398 void wxTextCtrl::AppendText(const wxString
& text
)
400 wxTextPos textPosition
= GetLastPosition() + text
.length();
401 XmTextInsert ((Widget
) m_mainWidget
, GetLastPosition(),
402 wxConstCast(text
.mb_str(), char));
403 XtVaSetValues ((Widget
) m_mainWidget
, XmNcursorPosition
, textPosition
, NULL
);
404 SetInsertionPoint(textPosition
);
405 XmTextShowPosition ((Widget
) m_mainWidget
, textPosition
);
409 void wxTextCtrl::Clear()
411 XmTextSetString ((Widget
) m_mainWidget
, wxMOTIF_STR(""));
415 bool wxTextCtrl::IsModified() const
420 // Makes modified or unmodified
421 void wxTextCtrl::MarkDirty()
426 void wxTextCtrl::DiscardEdits()
431 int wxTextCtrl::GetNumberOfLines() const
433 // HIDEOUSLY inefficient, but we have no choice.
434 char *s
= XmTextGetString ((Widget
) m_mainWidget
);
439 bool finished
= false;
462 long wxTextCtrl::XYToPosition(long x
, long y
) const
464 /* It seems, that there is a bug in some versions of the Motif library,
465 so the original wxWin-Code doesn't work. */
467 Widget textWidget = (Widget) handle;
468 return (long) XmTextXYToPos (textWidget, (Position) x, (Position) y);
470 /* Now a little workaround: */
472 for (int i
=0; i
<y
; i
++) r
+=(GetLineLength(i
)+1);
476 bool wxTextCtrl::PositionToXY(long pos
, long *x
, long *y
) const
479 XmTextPosToXY((Widget
) m_mainWidget
, pos
, &xx
, &yy
);
488 void wxTextCtrl::ShowPosition(long pos
)
490 XmTextShowPosition ((Widget
) m_mainWidget
, (XmTextPosition
) pos
);
493 int wxTextCtrl::GetLineLength(long lineNo
) const
495 wxString str
= GetLineText (lineNo
);
496 return (int) str
.length();
499 wxString
wxTextCtrl::GetLineText(long lineNo
) const
501 // HIDEOUSLY inefficient, but we have no choice.
502 char *s
= XmTextGetString ((Widget
) m_mainWidget
);
509 for (i
= 0; currentLine
!= lineNo
&& s
[i
]; i
++ )
514 for (j
= 0; s
[i
] && s
[i
] != '\n'; i
++, j
++ )
521 return wxEmptyString
;
528 void wxTextCtrl::Command(wxCommandEvent
& event
)
530 SetValue (event
.GetString());
531 ProcessCommand (event
);
534 void wxTextCtrl::OnDropFiles(wxDropFilesEvent
& event
)
536 // By default, load the first file into the text window.
537 if (event
.GetNumberOfFiles() > 0)
539 LoadFile(event
.GetFiles()[0]);
543 void wxTextCtrl::OnChar(wxKeyEvent
& event
)
545 // Indicates that we should generate a normal command, because
546 // we're letting default behaviour happen (otherwise it's vetoed
547 // by virtue of overriding OnChar)
548 m_processedDefault
= true;
550 if (m_tempCallbackStruct
)
552 XmTextVerifyCallbackStruct
*textStruct
=
553 (XmTextVerifyCallbackStruct
*) m_tempCallbackStruct
;
554 textStruct
->doit
= True
;
555 if (isascii(event
.m_keyCode
) && (textStruct
->text
->length
== 1))
557 textStruct
->text
->ptr
[0] = (char)((event
.m_keyCode
== WXK_RETURN
) ? 10 : event
.m_keyCode
);
562 void wxTextCtrl::ChangeFont(bool keepOriginalSize
)
564 wxWindow::ChangeFont(keepOriginalSize
);
567 void wxTextCtrl::ChangeBackgroundColour()
569 wxWindow::ChangeBackgroundColour();
571 /* TODO: should scrollbars be affected? Should probably have separate
572 * function to change them (by default, taken from wxSystemSettings)
574 if (m_windowStyle
& wxTE_MULTILINE
)
576 Widget parent
= XtParent ((Widget
) m_mainWidget
);
579 XtVaGetValues (parent
,
580 XmNhorizontalScrollBar
, &hsb
,
581 XmNverticalScrollBar
, &vsb
,
583 wxColour backgroundColour
= wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE
);
585 wxDoChangeBackgroundColour((WXWidget
) hsb
, backgroundColour
, true);
587 wxDoChangeBackgroundColour((WXWidget
) vsb
, backgroundColour
, true);
589 // MBN: why change parent background?
590 // DoChangeBackgroundColour((WXWidget) parent, m_backgroundColour, true);
594 void wxTextCtrl::ChangeForegroundColour()
596 wxWindow::ChangeForegroundColour();
598 if (m_windowStyle
& wxTE_MULTILINE
)
600 Widget parent
= XtParent ((Widget
) m_mainWidget
);
603 XtVaGetValues (parent
,
604 XmNhorizontalScrollBar
, &hsb
,
605 XmNverticalScrollBar
, &vsb
,
608 /* TODO: should scrollbars be affected? Should probably have separate
609 * function to change them (by default, taken from wxSystemSettings)
611 DoChangeForegroundColour((WXWidget) hsb, m_foregroundColour);
613 DoChangeForegroundColour((WXWidget) vsb, m_foregroundColour);
615 wxDoChangeForegroundColour((WXWidget
) parent
, m_foregroundColour
);
619 void wxTextCtrl::DoSendEvents(void *wxcbs
, long keycode
)
621 // we're in process of updating the text control
622 m_tempCallbackStruct
= wxcbs
;
624 XmTextVerifyCallbackStruct
*cbs
= (XmTextVerifyCallbackStruct
*)wxcbs
;
626 wxKeyEvent
event (wxEVT_CHAR
);
627 event
.SetId(GetId());
628 event
.m_keyCode
= keycode
;
629 event
.SetEventObject(this);
631 // Only if wxTextCtrl::OnChar is called will this be set to True (and
632 // the character passed through)
635 GetEventHandler()->ProcessEvent(event
);
637 if ( !InSetValue() && m_processedDefault
)
639 // Can generate a command
640 wxCommandEvent
commandEvent(wxEVT_COMMAND_TEXT_UPDATED
, GetId());
641 commandEvent
.SetEventObject(this);
642 ProcessCommand(commandEvent
);
645 // do it after the (user) event handlers processed the events because
646 // otherwise GetValue() would return incorrect (not yet updated value)
647 m_tempCallbackStruct
= NULL
;
650 wxSize
wxDoGetSingleTextCtrlBestSize( Widget textWidget
,
651 const wxWindow
* window
)
653 Dimension xmargin
, ymargin
, highlight
, shadow
;
656 XtVaGetValues( textWidget
,
657 XmNmarginWidth
, &xmargin
,
658 XmNmarginHeight
, &ymargin
,
660 XmNhighlightThickness
, &highlight
,
661 XmNshadowThickness
, &shadow
,
665 value
= wxMOTIF_STR("|");
668 window
->GetTextExtent( value
, &x
, &y
);
673 return wxSize( x
+ 2 * xmargin
+ 2 * highlight
+ 2 * shadow
,
674 // MBN: +2 necessary: Lesstif bug or mine?
675 y
+ 2 * ymargin
+ 2 * highlight
+ 2 * shadow
+ 2 );
678 wxSize
wxTextCtrl::DoGetBestSize() const
682 wxSize best
= wxControl::DoGetBestSize();
684 if( best
.x
< 110 ) best
.x
= 110;
689 return wxWindow::DoGetBestSize();
692 // ----------------------------------------------------------------------------
693 // helpers and Motif callbacks
694 // ----------------------------------------------------------------------------
696 static void MergeChangesIntoString(wxString
& value
,
697 XmTextVerifyCallbackStruct
*cbs
)
700 * At least on my system (SunOS 4.1.3 + Motif 1.2), you need to think of
701 * every event as a replace event. cbs->text->ptr gives the replacement
702 * text, cbs->startPos gives the index of the first char affected by the
703 * replace, and cbs->endPos gives the index one more than the last char
704 * affected by the replace (startPos == endPos implies an empty range).
705 * Hence, a deletion is represented by replacing all input text with a
706 * blank string ("", *not* NULL!). A simple insertion that does not
707 * overwrite any text has startPos == endPos.
712 // easy case: the ol value was empty
713 value
= cbs
->text
->ptr
;
717 // merge the changes into the value
718 const char * const passwd
= value
;
719 int len
= value
.length();
721 len
+= ( cbs
->text
->ptr
?
722 strlen(cbs
->text
->ptr
) :
723 0 ) + 1; // + new text (if any) + NUL
724 len
-= cbs
->endPos
- cbs
->startPos
; // - text from affected region.
726 char * newS
= new char [len
];
728 * insert
= cbs
->text
->ptr
;
730 // Copy (old) text from passwd, up to the start posn of the change.
732 const char * p
= passwd
;
733 for (i
= 0; i
< cbs
->startPos
; ++i
)
736 // Copy the text to be inserted).
741 // Finally, copy into newS any remaining text from passwd[endPos] on.
742 for (p
= passwd
+ cbs
->endPos
; *p
; )
753 wxTextWindowChangedProc (Widget w
, XtPointer clientData
, XtPointer
WXUNUSED(ptr
))
755 if (!wxGetWindowFromTable(w
))
756 // Widget has been deleted!
759 wxTextCtrl
*tw
= (wxTextCtrl
*) clientData
;
760 tw
->SetModified(true);
764 wxTextWindowModifyProc (Widget
WXUNUSED(w
), XtPointer clientData
, XmTextVerifyCallbackStruct
*cbs
)
766 wxTextCtrl
*tw
= (wxTextCtrl
*) clientData
;
767 tw
->m_processedDefault
= false;
769 // First, do some stuff if it's a password control: in this case, we need
770 // to store the string inside the class because GetValue() can't retrieve
771 // it from the text ctrl. We do *not* do it in other circumstances because
772 // it would double the amount of memory needed.
774 if ( tw
->GetWindowStyleFlag() & wxTE_PASSWORD
)
776 MergeChangesIntoString(tw
->m_value
, cbs
);
778 if ( cbs
->text
->length
> 0 )
781 for (i
= 0; i
< cbs
->text
->length
; ++i
)
782 cbs
->text
->ptr
[i
] = '*';
783 cbs
->text
->ptr
[i
] = '\0';
790 // If we're already within an OnChar, return: probably a programmatic
792 if (tw
->m_tempCallbackStruct
)
795 // Check for a backspace
796 if (cbs
->startPos
== (cbs
->currInsert
- 1))
798 tw
->DoSendEvents((void *)cbs
, WXK_DELETE
);
803 // Pasting operation: let it through without calling OnChar
804 if (cbs
->text
->length
> 1)
807 // Something other than text
808 if (cbs
->text
->ptr
== NULL
)
812 char ch
= cbs
->text
->ptr
[0];
813 tw
->DoSendEvents((void *)cbs
, ch
== '\n' ? '\r' : ch
);
817 wxTextWindowGainFocusProc (Widget w
, XtPointer clientData
, XmAnyCallbackStruct
*WXUNUSED(cbs
))
819 if (!wxGetWindowFromTable(w
))
822 wxTextCtrl
*tw
= (wxTextCtrl
*) clientData
;
823 wxFocusEvent
event(wxEVT_SET_FOCUS
, tw
->GetId());
824 event
.SetEventObject(tw
);
825 tw
->GetEventHandler()->ProcessEvent(event
);
829 wxTextWindowLoseFocusProc (Widget w
, XtPointer clientData
, XmAnyCallbackStruct
*WXUNUSED(cbs
))
831 if (!wxGetWindowFromTable(w
))
834 wxTextCtrl
*tw
= (wxTextCtrl
*) clientData
;
835 wxFocusEvent
event(wxEVT_KILL_FOCUS
, tw
->GetId());
836 event
.SetEventObject(tw
);
837 tw
->GetEventHandler()->ProcessEvent(event
);
840 static void wxTextWindowActivateProc(Widget w
, XtPointer clientData
,
841 XmAnyCallbackStruct
*WXUNUSED(ptr
))
843 if (!wxGetWindowFromTable(w
))
846 wxTextCtrl
*tw
= (wxTextCtrl
*) clientData
;
848 if (tw
->InSetValue())
851 wxCommandEvent
event(wxEVT_COMMAND_TEXT_ENTER
);
852 event
.SetId(tw
->GetId());
853 event
.SetEventObject(tw
);
854 tw
->ProcessCommand(event
);
857 void wxTextCtrl::OnCut(wxCommandEvent
& WXUNUSED(event
))
862 void wxTextCtrl::OnCopy(wxCommandEvent
& WXUNUSED(event
))
867 void wxTextCtrl::OnPaste(wxCommandEvent
& WXUNUSED(event
))
872 void wxTextCtrl::OnUndo(wxCommandEvent
& WXUNUSED(event
))
877 void wxTextCtrl::OnRedo(wxCommandEvent
& WXUNUSED(event
))
882 void wxTextCtrl::OnUpdateCut(wxUpdateUIEvent
& event
)
884 event
.Enable( CanCut() );
887 void wxTextCtrl::OnUpdateCopy(wxUpdateUIEvent
& event
)
889 event
.Enable( CanCopy() );
892 void wxTextCtrl::OnUpdatePaste(wxUpdateUIEvent
& event
)
894 event
.Enable( CanPaste() );
897 void wxTextCtrl::OnUpdateUndo(wxUpdateUIEvent
& event
)
899 event
.Enable( CanUndo() );
902 void wxTextCtrl::OnUpdateRedo(wxUpdateUIEvent
& event
)
904 event
.Enable( CanRedo() );