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"
32 #include "wx/settings.h"
33 #include "wx/filefn.h"
37 #pragma message disable nosimpint
41 #pragma message enable nosimpint
44 #include "wx/motif/private.h"
46 // ----------------------------------------------------------------------------
48 // ----------------------------------------------------------------------------
50 // helper: inserts the new text in the value of the text ctrl and returns the
52 static void MergeChangesIntoString(wxString
& value
,
53 XmTextVerifyCallbackStruct
*textStruct
);
56 static void wxTextWindowChangedProc(Widget w
, XtPointer clientData
, XtPointer ptr
);
57 static void wxTextWindowModifyProc(Widget w
, XtPointer clientData
, XmTextVerifyCallbackStruct
*cbs
);
58 static void wxTextWindowGainFocusProc(Widget w
, XtPointer clientData
, XmAnyCallbackStruct
*cbs
);
59 static void wxTextWindowLoseFocusProc(Widget w
, XtPointer clientData
, XmAnyCallbackStruct
*cbs
);
60 static void wxTextWindowActivateProc(Widget w
, XtPointer clientData
, XmAnyCallbackStruct
*ptr
);
62 IMPLEMENT_DYNAMIC_CLASS(wxTextCtrl
, wxControl
)
64 BEGIN_EVENT_TABLE(wxTextCtrl
, wxControl
)
65 EVT_DROP_FILES(wxTextCtrl::OnDropFiles
)
66 EVT_CHAR(wxTextCtrl::OnChar
)
68 EVT_MENU(wxID_CUT
, wxTextCtrl::OnCut
)
69 EVT_MENU(wxID_COPY
, wxTextCtrl::OnCopy
)
70 EVT_MENU(wxID_PASTE
, wxTextCtrl::OnPaste
)
71 EVT_MENU(wxID_UNDO
, wxTextCtrl::OnUndo
)
72 EVT_MENU(wxID_REDO
, wxTextCtrl::OnRedo
)
74 EVT_UPDATE_UI(wxID_CUT
, wxTextCtrl::OnUpdateCut
)
75 EVT_UPDATE_UI(wxID_COPY
, wxTextCtrl::OnUpdateCopy
)
76 EVT_UPDATE_UI(wxID_PASTE
, wxTextCtrl::OnUpdatePaste
)
77 EVT_UPDATE_UI(wxID_UNDO
, wxTextCtrl::OnUpdateUndo
)
78 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 if( !CreateControl( parent
, id
, pos
, size
, style
, validator
, name
) )
110 m_tempCallbackStruct
= (void*) NULL
;
112 m_processedDefault
= false;
114 m_backgroundColour
= *wxWHITE
;
116 Widget parentWidget
= (Widget
) parent
->GetClientWidget();
118 Bool wantHorizScroll
= (m_windowStyle
& wxHSCROLL
) != 0 ? True
: False
;
119 // If we don't have horizontal scrollbars, we want word wrap.
120 // OpenMotif 2.1 crashes if wantWordWrap is True in Japanese
121 // locale (and probably other multibyte locales). The check might be
123 #if wxCHECK_LESSTIF() || wxCHECK_MOTIF_VERSION( 2, 2 )
124 Bool wantWordWrap
= wantHorizScroll
== True
? False
: True
;
126 Bool wantWordWrap
= False
;
129 if (m_windowStyle
& wxTE_MULTILINE
)
133 XtSetArg (args
[count
], XmNscrollHorizontal
, wantHorizScroll
); ++count
;
134 XtSetArg (args
[count
], (String
) wxFont::GetFontTag(),
135 m_font
.GetFontType( XtDisplay(parentWidget
) ) ); ++count
;
136 XtSetArg (args
[count
], XmNwordWrap
, wantWordWrap
); ++count
;
137 XtSetArg (args
[count
], XmNvalue
, value
.c_str()); ++count
;
138 XtSetArg (args
[count
], XmNeditable
,
139 style
& wxTE_READONLY
? False
: True
); ++count
;
140 XtSetArg (args
[count
], XmNeditMode
, XmMULTI_LINE_EDIT
); ++count
;
143 (WXWidget
) XmCreateScrolledText(parentWidget
,
144 wxConstCast(name
.c_str(), char),
147 XtManageChild ((Widget
) m_mainWidget
);
151 m_mainWidget
= (WXWidget
)XtVaCreateManagedWidget
153 wxConstCast(name
.c_str(), char),
156 wxFont::GetFontTag(), m_font
.GetFontType( XtDisplay(parentWidget
) ),
157 XmNvalue
, value
.c_str(),
158 XmNeditable
, (style
& wxTE_READONLY
) ?
164 // TODO: Is this relevant? What does it do?
166 if (!value
.IsNull() && (value
.Length() > (unsigned int) noCols
))
167 noCols
= value
.Length();
168 XtVaSetValues((Widget
) m_mainWidget
,
174 // remove border if asked for
175 if ( style
& wxNO_BORDER
)
177 XtVaSetValues((Widget
)m_mainWidget
,
178 XmNshadowThickness
, 0,
183 XtAddCallback((Widget
) m_mainWidget
, XmNvalueChangedCallback
, (XtCallbackProc
)wxTextWindowChangedProc
, (XtPointer
)this);
185 XtAddCallback((Widget
) m_mainWidget
, XmNmodifyVerifyCallback
, (XtCallbackProc
)wxTextWindowModifyProc
, (XtPointer
)this);
187 XtAddCallback((Widget
) m_mainWidget
, XmNactivateCallback
, (XtCallbackProc
)wxTextWindowActivateProc
, (XtPointer
)this);
189 XtAddCallback((Widget
) m_mainWidget
, XmNfocusCallback
, (XtCallbackProc
)wxTextWindowGainFocusProc
, (XtPointer
)this);
191 XtAddCallback((Widget
) m_mainWidget
, XmNlosingFocusCallback
, (XtCallbackProc
)wxTextWindowLoseFocusProc
, (XtPointer
)this);
193 AttachWidget (parent
, m_mainWidget
, (WXWidget
) NULL
,
194 pos
.x
, pos
.y
, size
.x
, size
.y
);
196 ChangeBackgroundColour();
201 WXWidget
wxTextCtrl::GetTopWidget() const
203 return IsMultiLine() ? (WXWidget
)XtParent((Widget
)m_mainWidget
)
207 wxString
wxTextCtrl::GetValue() const
209 wxString str
; // result
211 if (m_windowStyle
& wxTE_PASSWORD
)
213 // the value is stored always in m_value because it can't be retrieved
214 // from the text control
219 // just get the string from Motif
220 char *s
= XmTextGetString ((Widget
) m_mainWidget
);
226 //else: return empty string
228 if ( m_tempCallbackStruct
)
230 // the string in the control isn't yet updated, can't use it as is
231 MergeChangesIntoString(str
, (XmTextVerifyCallbackStruct
*)
232 m_tempCallbackStruct
);
239 void wxTextCtrl::SetValue(const wxString
& text
)
243 XmTextSetString ((Widget
) m_mainWidget
, wxConstCast(text
.c_str(), char));
244 XtVaSetValues ((Widget
) m_mainWidget
,
245 XmNcursorPosition
, text
.length(),
248 SetInsertionPoint(text
.length());
249 XmTextShowPosition ((Widget
) m_mainWidget
, text
.length());
252 m_inSetValue
= false;
255 // Clipboard operations
256 void wxTextCtrl::Copy()
258 XmTextCopy((Widget
) m_mainWidget
, CurrentTime
);
261 void wxTextCtrl::Cut()
263 XmTextCut((Widget
) m_mainWidget
, CurrentTime
);
266 void wxTextCtrl::Paste()
268 XmTextPaste((Widget
) m_mainWidget
);
271 bool wxTextCtrl::CanCopy() const
273 // Can copy if there's a selection
275 GetSelection(& from
, & to
);
276 return (from
!= to
) ;
279 bool wxTextCtrl::CanCut() const
281 // Can cut if there's a selection
283 GetSelection(& from
, & to
);
284 return (from
!= to
) && (IsEditable());
287 bool wxTextCtrl::CanPaste() const
289 return IsEditable() ;
293 void wxTextCtrl::Undo()
295 // Not possible in Motif
298 void wxTextCtrl::Redo()
300 // Not possible in Motif
303 bool wxTextCtrl::CanUndo() const
309 bool wxTextCtrl::CanRedo() const
315 // If the return values from and to are the same, there is no
317 void wxTextCtrl::GetSelection(long* from
, long* to
) const
319 XmTextPosition left
, right
;
321 XmTextGetSelectionPosition((Widget
) m_mainWidget
, & left
, & right
);
327 bool wxTextCtrl::IsEditable() const
329 return (XmTextGetEditable((Widget
) m_mainWidget
) != 0);
332 void wxTextCtrl::SetEditable(bool editable
)
334 XmTextSetEditable((Widget
) m_mainWidget
, (Boolean
) editable
);
337 void wxTextCtrl::SetInsertionPoint(long pos
)
339 XmTextSetInsertionPosition ((Widget
) m_mainWidget
, (XmTextPosition
) pos
);
342 void wxTextCtrl::SetInsertionPointEnd()
344 wxTextPos pos
= GetLastPosition();
345 SetInsertionPoint(pos
);
348 long wxTextCtrl::GetInsertionPoint() const
350 return (long) XmTextGetInsertionPosition ((Widget
) m_mainWidget
);
353 wxTextPos
wxTextCtrl::GetLastPosition() const
355 return (long) XmTextGetLastPosition ((Widget
) m_mainWidget
);
358 void wxTextCtrl::Replace(long from
, long to
, const wxString
& value
)
360 XmTextReplace ((Widget
) m_mainWidget
, (XmTextPosition
) from
, (XmTextPosition
) to
,
361 wxConstCast(value
.c_str(), char));
364 void wxTextCtrl::Remove(long from
, long to
)
366 XmTextSetSelection ((Widget
) m_mainWidget
, (XmTextPosition
) from
, (XmTextPosition
) to
,
368 XmTextRemove ((Widget
) m_mainWidget
);
371 void wxTextCtrl::SetSelection(long from
, long to
)
374 to
= GetLastPosition();
376 XmTextSetSelection ((Widget
) m_mainWidget
, (XmTextPosition
) from
, (XmTextPosition
) to
,
380 void wxTextCtrl::WriteText(const wxString
& text
)
382 long textPosition
= GetInsertionPoint() + text
.length();
383 XmTextInsert ((Widget
) m_mainWidget
, GetInsertionPoint(),
384 wxConstCast(text
.c_str(), char));
385 XtVaSetValues ((Widget
) m_mainWidget
, XmNcursorPosition
, textPosition
, NULL
);
386 SetInsertionPoint(textPosition
);
387 XmTextShowPosition ((Widget
) m_mainWidget
, textPosition
);
391 void wxTextCtrl::AppendText(const wxString
& text
)
393 wxTextPos textPosition
= GetLastPosition() + text
.length();
394 XmTextInsert ((Widget
) m_mainWidget
, GetLastPosition(),
395 wxConstCast(text
.c_str(), char));
396 XtVaSetValues ((Widget
) m_mainWidget
, XmNcursorPosition
, textPosition
, NULL
);
397 SetInsertionPoint(textPosition
);
398 XmTextShowPosition ((Widget
) m_mainWidget
, textPosition
);
402 void wxTextCtrl::Clear()
404 XmTextSetString ((Widget
) m_mainWidget
, wxMOTIF_STR(""));
408 bool wxTextCtrl::IsModified() const
413 // Makes modified or unmodified
414 void wxTextCtrl::MarkDirty()
419 void wxTextCtrl::DiscardEdits()
424 int wxTextCtrl::GetNumberOfLines() const
426 // HIDEOUSLY inefficient, but we have no choice.
427 char *s
= XmTextGetString ((Widget
) m_mainWidget
);
432 bool finished
= false;
455 long wxTextCtrl::XYToPosition(long x
, long y
) const
457 /* It seems, that there is a bug in some versions of the Motif library,
458 so the original wxWin-Code doesn't work. */
460 Widget textWidget = (Widget) handle;
461 return (long) XmTextXYToPos (textWidget, (Position) x, (Position) y);
463 /* Now a little workaround: */
465 for (int i
=0; i
<y
; i
++) r
+=(GetLineLength(i
)+1);
469 bool wxTextCtrl::PositionToXY(long pos
, long *x
, long *y
) const
472 XmTextPosToXY((Widget
) m_mainWidget
, pos
, &xx
, &yy
);
481 void wxTextCtrl::ShowPosition(long pos
)
483 XmTextShowPosition ((Widget
) m_mainWidget
, (XmTextPosition
) pos
);
486 int wxTextCtrl::GetLineLength(long lineNo
) const
488 wxString str
= GetLineText (lineNo
);
489 return (int) str
.length();
492 wxString
wxTextCtrl::GetLineText(long lineNo
) const
494 // HIDEOUSLY inefficient, but we have no choice.
495 char *s
= XmTextGetString ((Widget
) m_mainWidget
);
502 for (i
= 0; currentLine
!= lineNo
&& s
[i
]; i
++ )
507 for (j
= 0; s
[i
] && s
[i
] != '\n'; i
++, j
++ )
514 return wxEmptyString
;
521 void wxTextCtrl::Command(wxCommandEvent
& event
)
523 SetValue (event
.GetString());
524 ProcessCommand (event
);
527 void wxTextCtrl::OnDropFiles(wxDropFilesEvent
& event
)
529 // By default, load the first file into the text window.
530 if (event
.GetNumberOfFiles() > 0)
532 LoadFile(event
.GetFiles()[0]);
536 void wxTextCtrl::OnChar(wxKeyEvent
& event
)
538 // Indicates that we should generate a normal command, because
539 // we're letting default behaviour happen (otherwise it's vetoed
540 // by virtue of overriding OnChar)
541 m_processedDefault
= true;
543 if (m_tempCallbackStruct
)
545 XmTextVerifyCallbackStruct
*textStruct
=
546 (XmTextVerifyCallbackStruct
*) m_tempCallbackStruct
;
547 textStruct
->doit
= True
;
548 if (isascii(event
.m_keyCode
) && (textStruct
->text
->length
== 1))
550 textStruct
->text
->ptr
[0] = (char)((event
.m_keyCode
== WXK_RETURN
) ? 10 : event
.m_keyCode
);
555 void wxTextCtrl::ChangeFont(bool keepOriginalSize
)
557 wxWindow::ChangeFont(keepOriginalSize
);
560 void wxTextCtrl::ChangeBackgroundColour()
562 wxWindow::ChangeBackgroundColour();
564 /* TODO: should scrollbars be affected? Should probably have separate
565 * function to change them (by default, taken from wxSystemSettings)
567 if (m_windowStyle
& wxTE_MULTILINE
)
569 Widget parent
= XtParent ((Widget
) m_mainWidget
);
572 XtVaGetValues (parent
,
573 XmNhorizontalScrollBar
, &hsb
,
574 XmNverticalScrollBar
, &vsb
,
576 wxColour backgroundColour
= wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE
);
578 wxDoChangeBackgroundColour((WXWidget
) hsb
, backgroundColour
, true);
580 wxDoChangeBackgroundColour((WXWidget
) vsb
, backgroundColour
, true);
582 // MBN: why change parent background?
583 // DoChangeBackgroundColour((WXWidget) parent, m_backgroundColour, true);
587 void wxTextCtrl::ChangeForegroundColour()
589 wxWindow::ChangeForegroundColour();
591 if (m_windowStyle
& wxTE_MULTILINE
)
593 Widget parent
= XtParent ((Widget
) m_mainWidget
);
596 XtVaGetValues (parent
,
597 XmNhorizontalScrollBar
, &hsb
,
598 XmNverticalScrollBar
, &vsb
,
601 /* TODO: should scrollbars be affected? Should probably have separate
602 * function to change them (by default, taken from wxSystemSettings)
604 DoChangeForegroundColour((WXWidget) hsb, m_foregroundColour);
606 DoChangeForegroundColour((WXWidget) vsb, m_foregroundColour);
608 wxDoChangeForegroundColour((WXWidget
) parent
, m_foregroundColour
);
612 void wxTextCtrl::DoSendEvents(void *wxcbs
, long keycode
)
614 // we're in process of updating the text control
615 m_tempCallbackStruct
= wxcbs
;
617 XmTextVerifyCallbackStruct
*cbs
= (XmTextVerifyCallbackStruct
*)wxcbs
;
619 wxKeyEvent
event (wxEVT_CHAR
);
620 event
.SetId(GetId());
621 event
.m_keyCode
= keycode
;
622 event
.SetEventObject(this);
624 // Only if wxTextCtrl::OnChar is called will this be set to True (and
625 // the character passed through)
628 GetEventHandler()->ProcessEvent(event
);
630 if ( !InSetValue() && m_processedDefault
)
632 // Can generate a command
633 wxCommandEvent
commandEvent(wxEVT_COMMAND_TEXT_UPDATED
, GetId());
634 commandEvent
.SetEventObject(this);
635 ProcessCommand(commandEvent
);
638 // do it after the (user) event handlers processed the events because
639 // otherwise GetValue() would return incorrect (not yet updated value)
640 m_tempCallbackStruct
= NULL
;
643 wxSize
wxDoGetSingleTextCtrlBestSize( Widget textWidget
,
644 const wxWindow
* window
)
646 Dimension xmargin
, ymargin
, highlight
, shadow
;
649 XtVaGetValues( textWidget
,
650 XmNmarginWidth
, &xmargin
,
651 XmNmarginHeight
, &ymargin
,
653 XmNhighlightThickness
, &highlight
,
654 XmNshadowThickness
, &shadow
,
658 value
= wxMOTIF_STR("|");
661 window
->GetTextExtent( value
, &x
, &y
);
666 return wxSize( x
+ 2 * xmargin
+ 2 * highlight
+ 2 * shadow
,
667 // MBN: +2 necessary: Lesstif bug or mine?
668 y
+ 2 * ymargin
+ 2 * highlight
+ 2 * shadow
+ 2 );
671 wxSize
wxTextCtrl::DoGetBestSize() const
675 wxSize best
= wxControl::DoGetBestSize();
677 if( best
.x
< 110 ) best
.x
= 110;
682 return wxWindow::DoGetBestSize();
685 // ----------------------------------------------------------------------------
686 // helpers and Motif callbacks
687 // ----------------------------------------------------------------------------
689 static void MergeChangesIntoString(wxString
& value
,
690 XmTextVerifyCallbackStruct
*cbs
)
693 * At least on my system (SunOS 4.1.3 + Motif 1.2), you need to think of
694 * every event as a replace event. cbs->text->ptr gives the replacement
695 * text, cbs->startPos gives the index of the first char affected by the
696 * replace, and cbs->endPos gives the index one more than the last char
697 * affected by the replace (startPos == endPos implies an empty range).
698 * Hence, a deletion is represented by replacing all input text with a
699 * blank string ("", *not* NULL!). A simple insertion that does not
700 * overwrite any text has startPos == endPos.
705 // easy case: the ol value was empty
706 value
= cbs
->text
->ptr
;
710 // merge the changes into the value
711 const char * const passwd
= value
;
712 int len
= value
.length();
714 len
+= ( cbs
->text
->ptr
?
715 strlen(cbs
->text
->ptr
) :
716 0 ) + 1; // + new text (if any) + NUL
717 len
-= cbs
->endPos
- cbs
->startPos
; // - text from affected region.
719 char * newS
= new char [len
];
721 * insert
= cbs
->text
->ptr
;
723 // Copy (old) text from passwd, up to the start posn of the change.
725 const char * p
= passwd
;
726 for (i
= 0; i
< cbs
->startPos
; ++i
)
729 // Copy the text to be inserted).
734 // Finally, copy into newS any remaining text from passwd[endPos] on.
735 for (p
= passwd
+ cbs
->endPos
; *p
; )
746 wxTextWindowChangedProc (Widget w
, XtPointer clientData
, XtPointer
WXUNUSED(ptr
))
748 if (!wxGetWindowFromTable(w
))
749 // Widget has been deleted!
752 wxTextCtrl
*tw
= (wxTextCtrl
*) clientData
;
753 tw
->SetModified(true);
757 wxTextWindowModifyProc (Widget
WXUNUSED(w
), XtPointer clientData
, XmTextVerifyCallbackStruct
*cbs
)
759 wxTextCtrl
*tw
= (wxTextCtrl
*) clientData
;
760 tw
->m_processedDefault
= false;
762 // First, do some stuff if it's a password control: in this case, we need
763 // to store the string inside the class because GetValue() can't retrieve
764 // it from the text ctrl. We do *not* do it in other circumstances because
765 // it would double the amount of memory needed.
767 if ( tw
->GetWindowStyleFlag() & wxTE_PASSWORD
)
769 MergeChangesIntoString(tw
->m_value
, cbs
);
771 if ( cbs
->text
->length
> 0 )
774 for (i
= 0; i
< cbs
->text
->length
; ++i
)
775 cbs
->text
->ptr
[i
] = '*';
776 cbs
->text
->ptr
[i
] = '\0';
783 // If we're already within an OnChar, return: probably a programmatic
785 if (tw
->m_tempCallbackStruct
)
788 // Check for a backspace
789 if (cbs
->startPos
== (cbs
->currInsert
- 1))
791 tw
->DoSendEvents((void *)cbs
, WXK_DELETE
);
796 // Pasting operation: let it through without calling OnChar
797 if (cbs
->text
->length
> 1)
800 // Something other than text
801 if (cbs
->text
->ptr
== NULL
)
805 char ch
= cbs
->text
->ptr
[0];
806 tw
->DoSendEvents((void *)cbs
, ch
== '\n' ? '\r' : ch
);
810 wxTextWindowGainFocusProc (Widget w
, XtPointer clientData
, XmAnyCallbackStruct
*WXUNUSED(cbs
))
812 if (!wxGetWindowFromTable(w
))
815 wxTextCtrl
*tw
= (wxTextCtrl
*) clientData
;
816 wxFocusEvent
event(wxEVT_SET_FOCUS
, tw
->GetId());
817 event
.SetEventObject(tw
);
818 tw
->GetEventHandler()->ProcessEvent(event
);
822 wxTextWindowLoseFocusProc (Widget w
, XtPointer clientData
, XmAnyCallbackStruct
*WXUNUSED(cbs
))
824 if (!wxGetWindowFromTable(w
))
827 wxTextCtrl
*tw
= (wxTextCtrl
*) clientData
;
828 wxFocusEvent
event(wxEVT_KILL_FOCUS
, tw
->GetId());
829 event
.SetEventObject(tw
);
830 tw
->GetEventHandler()->ProcessEvent(event
);
833 static void wxTextWindowActivateProc(Widget w
, XtPointer clientData
,
834 XmAnyCallbackStruct
*WXUNUSED(ptr
))
836 if (!wxGetWindowFromTable(w
))
839 wxTextCtrl
*tw
= (wxTextCtrl
*) clientData
;
841 if (tw
->InSetValue())
844 wxCommandEvent
event(wxEVT_COMMAND_TEXT_ENTER
);
845 event
.SetId(tw
->GetId());
846 event
.SetEventObject(tw
);
847 tw
->ProcessCommand(event
);
850 void wxTextCtrl::OnCut(wxCommandEvent
& WXUNUSED(event
))
855 void wxTextCtrl::OnCopy(wxCommandEvent
& WXUNUSED(event
))
860 void wxTextCtrl::OnPaste(wxCommandEvent
& WXUNUSED(event
))
865 void wxTextCtrl::OnUndo(wxCommandEvent
& WXUNUSED(event
))
870 void wxTextCtrl::OnRedo(wxCommandEvent
& WXUNUSED(event
))
875 void wxTextCtrl::OnUpdateCut(wxUpdateUIEvent
& event
)
877 event
.Enable( CanCut() );
880 void wxTextCtrl::OnUpdateCopy(wxUpdateUIEvent
& event
)
882 event
.Enable( CanCopy() );
885 void wxTextCtrl::OnUpdatePaste(wxUpdateUIEvent
& event
)
887 event
.Enable( CanPaste() );
890 void wxTextCtrl::OnUpdateUndo(wxUpdateUIEvent
& event
)
892 event
.Enable( CanUndo() );
895 void wxTextCtrl::OnUpdateRedo(wxUpdateUIEvent
& event
)
897 event
.Enable( CanRedo() );