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
29 #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 if( !CreateControl( parent
, id
, pos
, size
, style
, validator
, name
) )
112 m_tempCallbackStruct
= (void*) NULL
;
114 m_processedDefault
= false;
116 m_backgroundColour
= *wxWHITE
;
118 Widget parentWidget
= (Widget
) parent
->GetClientWidget();
120 Bool wantHorizScroll
= (m_windowStyle
& wxHSCROLL
) != 0 ? True
: False
;
121 // If we don't have horizontal scrollbars, we want word wrap.
122 // OpenMotif 2.1 crashes if wantWordWrap is True in Japanese
123 // locale (and probably other multibyte locales). The check might be
125 #if wxCHECK_LESSTIF() || wxCHECK_MOTIF_VERSION( 2, 2 )
126 Bool wantWordWrap
= wantHorizScroll
== True
? False
: True
;
128 Bool wantWordWrap
= False
;
131 if (m_windowStyle
& wxTE_MULTILINE
)
135 XtSetArg (args
[count
], XmNscrollHorizontal
, wantHorizScroll
); ++count
;
136 XtSetArg (args
[count
], (String
) wxFont::GetFontTag(),
137 m_font
.GetFontType( XtDisplay(parentWidget
) ) ); ++count
;
138 XtSetArg (args
[count
], XmNwordWrap
, wantWordWrap
); ++count
;
139 XtSetArg (args
[count
], XmNvalue
, value
.c_str()); ++count
;
140 XtSetArg (args
[count
], XmNeditable
,
141 style
& wxTE_READONLY
? False
: True
); ++count
;
142 XtSetArg (args
[count
], XmNeditMode
, XmMULTI_LINE_EDIT
); ++count
;
145 (WXWidget
) XmCreateScrolledText(parentWidget
,
146 wxConstCast(name
.c_str(), char),
149 XtManageChild ((Widget
) m_mainWidget
);
153 m_mainWidget
= (WXWidget
)XtVaCreateManagedWidget
155 wxConstCast(name
.c_str(), char),
158 wxFont::GetFontTag(), m_font
.GetFontType( XtDisplay(parentWidget
) ),
159 XmNvalue
, value
.c_str(),
160 XmNeditable
, (style
& wxTE_READONLY
) ?
166 // TODO: Is this relevant? What does it do?
168 if (!value
.IsNull() && (value
.Length() > (unsigned int) noCols
))
169 noCols
= value
.Length();
170 XtVaSetValues((Widget
) m_mainWidget
,
176 // remove border if asked for
177 if ( style
& wxNO_BORDER
)
179 XtVaSetValues((Widget
)m_mainWidget
,
180 XmNshadowThickness
, 0,
185 XtAddCallback((Widget
) m_mainWidget
, XmNvalueChangedCallback
, (XtCallbackProc
)wxTextWindowChangedProc
, (XtPointer
)this);
187 XtAddCallback((Widget
) m_mainWidget
, XmNmodifyVerifyCallback
, (XtCallbackProc
)wxTextWindowModifyProc
, (XtPointer
)this);
189 XtAddCallback((Widget
) m_mainWidget
, XmNactivateCallback
, (XtCallbackProc
)wxTextWindowActivateProc
, (XtPointer
)this);
191 XtAddCallback((Widget
) m_mainWidget
, XmNfocusCallback
, (XtCallbackProc
)wxTextWindowGainFocusProc
, (XtPointer
)this);
193 XtAddCallback((Widget
) m_mainWidget
, XmNlosingFocusCallback
, (XtCallbackProc
)wxTextWindowLoseFocusProc
, (XtPointer
)this);
195 AttachWidget (parent
, m_mainWidget
, (WXWidget
) NULL
,
196 pos
.x
, pos
.y
, size
.x
, size
.y
);
198 ChangeBackgroundColour();
203 WXWidget
wxTextCtrl::GetTopWidget() const
205 return IsMultiLine() ? (WXWidget
)XtParent((Widget
)m_mainWidget
)
209 wxString
wxTextCtrl::GetValue() const
211 wxString str
; // result
213 if (m_windowStyle
& wxTE_PASSWORD
)
215 // the value is stored always in m_value because it can't be retrieved
216 // from the text control
221 // just get the string from Motif
222 char *s
= XmTextGetString ((Widget
) m_mainWidget
);
228 //else: return empty string
230 if ( m_tempCallbackStruct
)
232 // the string in the control isn't yet updated, can't use it as is
233 MergeChangesIntoString(str
, (XmTextVerifyCallbackStruct
*)
234 m_tempCallbackStruct
);
241 void wxTextCtrl::SetValue(const wxString
& text
)
245 XmTextSetString ((Widget
) m_mainWidget
, wxConstCast(text
.c_str(), char));
246 XtVaSetValues ((Widget
) m_mainWidget
,
247 XmNcursorPosition
, text
.length(),
250 SetInsertionPoint(text
.length());
251 XmTextShowPosition ((Widget
) m_mainWidget
, text
.length());
254 m_inSetValue
= false;
257 // Clipboard operations
258 void wxTextCtrl::Copy()
260 XmTextCopy((Widget
) m_mainWidget
, CurrentTime
);
263 void wxTextCtrl::Cut()
265 XmTextCut((Widget
) m_mainWidget
, CurrentTime
);
268 void wxTextCtrl::Paste()
270 XmTextPaste((Widget
) m_mainWidget
);
273 bool wxTextCtrl::CanCopy() const
275 // Can copy if there's a selection
277 GetSelection(& from
, & to
);
278 return (from
!= to
) ;
281 bool wxTextCtrl::CanCut() const
283 // Can cut if there's a selection
285 GetSelection(& from
, & to
);
286 return (from
!= to
) && (IsEditable());
289 bool wxTextCtrl::CanPaste() const
291 return IsEditable() ;
295 void wxTextCtrl::Undo()
297 // Not possible in Motif
300 void wxTextCtrl::Redo()
302 // Not possible in Motif
305 bool wxTextCtrl::CanUndo() const
311 bool wxTextCtrl::CanRedo() const
317 // If the return values from and to are the same, there is no
319 void wxTextCtrl::GetSelection(long* from
, long* to
) const
321 XmTextPosition left
, right
;
323 XmTextGetSelectionPosition((Widget
) m_mainWidget
, & left
, & right
);
329 bool wxTextCtrl::IsEditable() const
331 return (XmTextGetEditable((Widget
) m_mainWidget
) != 0);
334 void wxTextCtrl::SetEditable(bool editable
)
336 XmTextSetEditable((Widget
) m_mainWidget
, (Boolean
) editable
);
339 void wxTextCtrl::SetInsertionPoint(long pos
)
341 XmTextSetInsertionPosition ((Widget
) m_mainWidget
, (XmTextPosition
) pos
);
344 void wxTextCtrl::SetInsertionPointEnd()
346 wxTextPos pos
= GetLastPosition();
347 SetInsertionPoint(pos
);
350 long wxTextCtrl::GetInsertionPoint() const
352 return (long) XmTextGetInsertionPosition ((Widget
) m_mainWidget
);
355 wxTextPos
wxTextCtrl::GetLastPosition() const
357 return (long) XmTextGetLastPosition ((Widget
) m_mainWidget
);
360 void wxTextCtrl::Replace(long from
, long to
, const wxString
& value
)
362 XmTextReplace ((Widget
) m_mainWidget
, (XmTextPosition
) from
, (XmTextPosition
) to
,
363 wxConstCast(value
.c_str(), char));
366 void wxTextCtrl::Remove(long from
, long to
)
368 XmTextSetSelection ((Widget
) m_mainWidget
, (XmTextPosition
) from
, (XmTextPosition
) to
,
370 XmTextRemove ((Widget
) m_mainWidget
);
373 void wxTextCtrl::SetSelection(long from
, long to
)
376 to
= GetLastPosition();
378 XmTextSetSelection ((Widget
) m_mainWidget
, (XmTextPosition
) from
, (XmTextPosition
) to
,
382 void wxTextCtrl::WriteText(const wxString
& text
)
384 long textPosition
= GetInsertionPoint() + text
.length();
385 XmTextInsert ((Widget
) m_mainWidget
, GetInsertionPoint(),
386 wxConstCast(text
.c_str(), char));
387 XtVaSetValues ((Widget
) m_mainWidget
, XmNcursorPosition
, textPosition
, NULL
);
388 SetInsertionPoint(textPosition
);
389 XmTextShowPosition ((Widget
) m_mainWidget
, textPosition
);
393 void wxTextCtrl::AppendText(const wxString
& text
)
395 wxTextPos textPosition
= GetLastPosition() + text
.length();
396 XmTextInsert ((Widget
) m_mainWidget
, GetLastPosition(),
397 wxConstCast(text
.c_str(), char));
398 XtVaSetValues ((Widget
) m_mainWidget
, XmNcursorPosition
, textPosition
, NULL
);
399 SetInsertionPoint(textPosition
);
400 XmTextShowPosition ((Widget
) m_mainWidget
, textPosition
);
404 void wxTextCtrl::Clear()
406 XmTextSetString ((Widget
) m_mainWidget
, wxMOTIF_STR(""));
410 bool wxTextCtrl::IsModified() const
415 // Makes modified or unmodified
416 void wxTextCtrl::MarkDirty()
421 void wxTextCtrl::DiscardEdits()
426 int wxTextCtrl::GetNumberOfLines() const
428 // HIDEOUSLY inefficient, but we have no choice.
429 char *s
= XmTextGetString ((Widget
) m_mainWidget
);
434 bool finished
= false;
457 long wxTextCtrl::XYToPosition(long x
, long y
) const
459 /* It seems, that there is a bug in some versions of the Motif library,
460 so the original wxWin-Code doesn't work. */
462 Widget textWidget = (Widget) handle;
463 return (long) XmTextXYToPos (textWidget, (Position) x, (Position) y);
465 /* Now a little workaround: */
467 for (int i
=0; i
<y
; i
++) r
+=(GetLineLength(i
)+1);
471 bool wxTextCtrl::PositionToXY(long pos
, long *x
, long *y
) const
474 XmTextPosToXY((Widget
) m_mainWidget
, pos
, &xx
, &yy
);
483 void wxTextCtrl::ShowPosition(long pos
)
485 XmTextShowPosition ((Widget
) m_mainWidget
, (XmTextPosition
) pos
);
488 int wxTextCtrl::GetLineLength(long lineNo
) const
490 wxString str
= GetLineText (lineNo
);
491 return (int) str
.Length();
494 wxString
wxTextCtrl::GetLineText(long lineNo
) const
496 // HIDEOUSLY inefficient, but we have no choice.
497 char *s
= XmTextGetString ((Widget
) m_mainWidget
);
504 for (i
= 0; currentLine
!= lineNo
&& s
[i
]; i
++ )
509 for (j
= 0; s
[i
] && s
[i
] != '\n'; i
++, j
++ )
516 return wxEmptyString
;
523 void wxTextCtrl::Command(wxCommandEvent
& event
)
525 SetValue (event
.GetString());
526 ProcessCommand (event
);
529 void wxTextCtrl::OnDropFiles(wxDropFilesEvent
& event
)
531 // By default, load the first file into the text window.
532 if (event
.GetNumberOfFiles() > 0)
534 LoadFile(event
.GetFiles()[0]);
538 void wxTextCtrl::OnChar(wxKeyEvent
& event
)
540 // Indicates that we should generate a normal command, because
541 // we're letting default behaviour happen (otherwise it's vetoed
542 // by virtue of overriding OnChar)
543 m_processedDefault
= true;
545 if (m_tempCallbackStruct
)
547 XmTextVerifyCallbackStruct
*textStruct
=
548 (XmTextVerifyCallbackStruct
*) m_tempCallbackStruct
;
549 textStruct
->doit
= True
;
550 if (isascii(event
.m_keyCode
) && (textStruct
->text
->length
== 1))
552 textStruct
->text
->ptr
[0] = (char)((event
.m_keyCode
== WXK_RETURN
) ? 10 : event
.m_keyCode
);
557 void wxTextCtrl::ChangeFont(bool keepOriginalSize
)
559 wxWindow::ChangeFont(keepOriginalSize
);
562 void wxTextCtrl::ChangeBackgroundColour()
564 wxWindow::ChangeBackgroundColour();
566 /* TODO: should scrollbars be affected? Should probably have separate
567 * function to change them (by default, taken from wxSystemSettings)
569 if (m_windowStyle
& wxTE_MULTILINE
)
571 Widget parent
= XtParent ((Widget
) m_mainWidget
);
574 XtVaGetValues (parent
,
575 XmNhorizontalScrollBar
, &hsb
,
576 XmNverticalScrollBar
, &vsb
,
578 wxColour backgroundColour
= wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE
);
580 wxDoChangeBackgroundColour((WXWidget
) hsb
, backgroundColour
, true);
582 wxDoChangeBackgroundColour((WXWidget
) vsb
, backgroundColour
, true);
584 // MBN: why change parent background?
585 // DoChangeBackgroundColour((WXWidget) parent, m_backgroundColour, true);
589 void wxTextCtrl::ChangeForegroundColour()
591 wxWindow::ChangeForegroundColour();
593 if (m_windowStyle
& wxTE_MULTILINE
)
595 Widget parent
= XtParent ((Widget
) m_mainWidget
);
598 XtVaGetValues (parent
,
599 XmNhorizontalScrollBar
, &hsb
,
600 XmNverticalScrollBar
, &vsb
,
603 /* TODO: should scrollbars be affected? Should probably have separate
604 * function to change them (by default, taken from wxSystemSettings)
606 DoChangeForegroundColour((WXWidget) hsb, m_foregroundColour);
608 DoChangeForegroundColour((WXWidget) vsb, m_foregroundColour);
610 wxDoChangeForegroundColour((WXWidget
) parent
, m_foregroundColour
);
614 void wxTextCtrl::DoSendEvents(void *wxcbs
, long keycode
)
616 // we're in process of updating the text control
617 m_tempCallbackStruct
= wxcbs
;
619 XmTextVerifyCallbackStruct
*cbs
= (XmTextVerifyCallbackStruct
*)wxcbs
;
621 wxKeyEvent
event (wxEVT_CHAR
);
622 event
.SetId(GetId());
623 event
.m_keyCode
= keycode
;
624 event
.SetEventObject(this);
626 // Only if wxTextCtrl::OnChar is called will this be set to True (and
627 // the character passed through)
630 GetEventHandler()->ProcessEvent(event
);
632 if ( !InSetValue() && m_processedDefault
)
634 // Can generate a command
635 wxCommandEvent
commandEvent(wxEVT_COMMAND_TEXT_UPDATED
, GetId());
636 commandEvent
.SetEventObject(this);
637 ProcessCommand(commandEvent
);
640 // do it after the (user) event handlers processed the events because
641 // otherwise GetValue() would return incorrect (not yet updated value)
642 m_tempCallbackStruct
= NULL
;
645 wxSize
wxDoGetSingleTextCtrlBestSize( Widget textWidget
,
646 const wxWindow
* window
)
648 Dimension xmargin
, ymargin
, highlight
, shadow
;
651 XtVaGetValues( textWidget
,
652 XmNmarginWidth
, &xmargin
,
653 XmNmarginHeight
, &ymargin
,
655 XmNhighlightThickness
, &highlight
,
656 XmNshadowThickness
, &shadow
,
660 value
= wxMOTIF_STR("|");
663 window
->GetTextExtent( value
, &x
, &y
);
668 return wxSize( x
+ 2 * xmargin
+ 2 * highlight
+ 2 * shadow
,
669 // MBN: +2 necessary: Lesstif bug or mine?
670 y
+ 2 * ymargin
+ 2 * highlight
+ 2 * shadow
+ 2 );
673 wxSize
wxTextCtrl::DoGetBestSize() const
677 wxSize best
= wxControl::DoGetBestSize();
679 if( best
.x
< 110 ) best
.x
= 110;
684 return wxWindow::DoGetBestSize();
687 // ----------------------------------------------------------------------------
688 // helpers and Motif callbacks
689 // ----------------------------------------------------------------------------
691 static void MergeChangesIntoString(wxString
& value
,
692 XmTextVerifyCallbackStruct
*cbs
)
695 * At least on my system (SunOS 4.1.3 + Motif 1.2), you need to think of
696 * every event as a replace event. cbs->text->ptr gives the replacement
697 * text, cbs->startPos gives the index of the first char affected by the
698 * replace, and cbs->endPos gives the index one more than the last char
699 * affected by the replace (startPos == endPos implies an empty range).
700 * Hence, a deletion is represented by replacing all input text with a
701 * blank string ("", *not* NULL!). A simple insertion that does not
702 * overwrite any text has startPos == endPos.
707 // easy case: the ol value was empty
708 value
= cbs
->text
->ptr
;
712 // merge the changes into the value
713 const char * const passwd
= value
;
714 int len
= value
.length();
716 len
+= ( cbs
->text
->ptr
?
717 strlen(cbs
->text
->ptr
) :
718 0 ) + 1; // + new text (if any) + NUL
719 len
-= cbs
->endPos
- cbs
->startPos
; // - text from affected region.
721 char * newS
= new char [len
];
723 * insert
= cbs
->text
->ptr
;
725 // Copy (old) text from passwd, up to the start posn of the change.
727 const char * p
= passwd
;
728 for (i
= 0; i
< cbs
->startPos
; ++i
)
731 // Copy the text to be inserted).
736 // Finally, copy into newS any remaining text from passwd[endPos] on.
737 for (p
= passwd
+ cbs
->endPos
; *p
; )
748 wxTextWindowChangedProc (Widget w
, XtPointer clientData
, XtPointer
WXUNUSED(ptr
))
750 if (!wxGetWindowFromTable(w
))
751 // Widget has been deleted!
754 wxTextCtrl
*tw
= (wxTextCtrl
*) clientData
;
755 tw
->SetModified(true);
759 wxTextWindowModifyProc (Widget
WXUNUSED(w
), XtPointer clientData
, XmTextVerifyCallbackStruct
*cbs
)
761 wxTextCtrl
*tw
= (wxTextCtrl
*) clientData
;
762 tw
->m_processedDefault
= false;
764 // First, do some stuff if it's a password control: in this case, we need
765 // to store the string inside the class because GetValue() can't retrieve
766 // it from the text ctrl. We do *not* do it in other circumstances because
767 // it would double the amount of memory needed.
769 if ( tw
->GetWindowStyleFlag() & wxTE_PASSWORD
)
771 MergeChangesIntoString(tw
->m_value
, cbs
);
773 if ( cbs
->text
->length
> 0 )
776 for (i
= 0; i
< cbs
->text
->length
; ++i
)
777 cbs
->text
->ptr
[i
] = '*';
778 cbs
->text
->ptr
[i
] = '\0';
785 // If we're already within an OnChar, return: probably a programmatic
787 if (tw
->m_tempCallbackStruct
)
790 // Check for a backspace
791 if (cbs
->startPos
== (cbs
->currInsert
- 1))
793 tw
->DoSendEvents((void *)cbs
, WXK_DELETE
);
798 // Pasting operation: let it through without calling OnChar
799 if (cbs
->text
->length
> 1)
802 // Something other than text
803 if (cbs
->text
->ptr
== NULL
)
807 char ch
= cbs
->text
->ptr
[0];
808 tw
->DoSendEvents((void *)cbs
, ch
== '\n' ? '\r' : ch
);
812 wxTextWindowGainFocusProc (Widget w
, XtPointer clientData
, XmAnyCallbackStruct
*WXUNUSED(cbs
))
814 if (!wxGetWindowFromTable(w
))
817 wxTextCtrl
*tw
= (wxTextCtrl
*) clientData
;
818 wxFocusEvent
event(wxEVT_SET_FOCUS
, tw
->GetId());
819 event
.SetEventObject(tw
);
820 tw
->GetEventHandler()->ProcessEvent(event
);
824 wxTextWindowLoseFocusProc (Widget w
, XtPointer clientData
, XmAnyCallbackStruct
*WXUNUSED(cbs
))
826 if (!wxGetWindowFromTable(w
))
829 wxTextCtrl
*tw
= (wxTextCtrl
*) clientData
;
830 wxFocusEvent
event(wxEVT_KILL_FOCUS
, tw
->GetId());
831 event
.SetEventObject(tw
);
832 tw
->GetEventHandler()->ProcessEvent(event
);
835 static void wxTextWindowActivateProc(Widget w
, XtPointer clientData
,
836 XmAnyCallbackStruct
*WXUNUSED(ptr
))
838 if (!wxGetWindowFromTable(w
))
841 wxTextCtrl
*tw
= (wxTextCtrl
*) clientData
;
843 if (tw
->InSetValue())
846 wxCommandEvent
event(wxEVT_COMMAND_TEXT_ENTER
);
847 event
.SetId(tw
->GetId());
848 event
.SetEventObject(tw
);
849 tw
->ProcessCommand(event
);
852 void wxTextCtrl::OnCut(wxCommandEvent
& WXUNUSED(event
))
857 void wxTextCtrl::OnCopy(wxCommandEvent
& WXUNUSED(event
))
862 void wxTextCtrl::OnPaste(wxCommandEvent
& WXUNUSED(event
))
867 void wxTextCtrl::OnUndo(wxCommandEvent
& WXUNUSED(event
))
872 void wxTextCtrl::OnRedo(wxCommandEvent
& WXUNUSED(event
))
877 void wxTextCtrl::OnUpdateCut(wxUpdateUIEvent
& event
)
879 event
.Enable( CanCut() );
882 void wxTextCtrl::OnUpdateCopy(wxUpdateUIEvent
& event
)
884 event
.Enable( CanCopy() );
887 void wxTextCtrl::OnUpdatePaste(wxUpdateUIEvent
& event
)
889 event
.Enable( CanPaste() );
892 void wxTextCtrl::OnUpdateUndo(wxUpdateUIEvent
& event
)
894 event
.Enable( CanUndo() );
897 void wxTextCtrl::OnUpdateRedo(wxUpdateUIEvent
& event
)
899 event
.Enable( CanRedo() );