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
30 #include <sys/types.h>
34 #include "wx/textctrl.h"
35 #include "wx/settings.h"
36 #include "wx/filefn.h"
40 #pragma message disable nosimpint
44 #pragma message enable nosimpint
47 #include "wx/motif/private.h"
49 // ----------------------------------------------------------------------------
51 // ----------------------------------------------------------------------------
53 // helper: inserts the new text in the value of the text ctrl and returns the
55 static void MergeChangesIntoString(wxString
& value
,
56 XmTextVerifyCallbackStruct
*textStruct
);
59 static void wxTextWindowChangedProc(Widget w
, XtPointer clientData
, XtPointer ptr
);
60 static void wxTextWindowModifyProc(Widget w
, XtPointer clientData
, XmTextVerifyCallbackStruct
*cbs
);
61 static void wxTextWindowGainFocusProc(Widget w
, XtPointer clientData
, XmAnyCallbackStruct
*cbs
);
62 static void wxTextWindowLoseFocusProc(Widget w
, XtPointer clientData
, XmAnyCallbackStruct
*cbs
);
63 static void wxTextWindowActivateProc(Widget w
, XtPointer clientData
, XmAnyCallbackStruct
*ptr
);
65 IMPLEMENT_DYNAMIC_CLASS(wxTextCtrl
, wxControl
)
67 BEGIN_EVENT_TABLE(wxTextCtrl
, wxControl
)
68 EVT_DROP_FILES(wxTextCtrl::OnDropFiles
)
69 EVT_CHAR(wxTextCtrl::OnChar
)
71 EVT_MENU(wxID_CUT
, wxTextCtrl::OnCut
)
72 EVT_MENU(wxID_COPY
, wxTextCtrl::OnCopy
)
73 EVT_MENU(wxID_PASTE
, wxTextCtrl::OnPaste
)
74 EVT_MENU(wxID_UNDO
, wxTextCtrl::OnUndo
)
75 EVT_MENU(wxID_REDO
, wxTextCtrl::OnRedo
)
77 EVT_UPDATE_UI(wxID_CUT
, wxTextCtrl::OnUpdateCut
)
78 EVT_UPDATE_UI(wxID_COPY
, wxTextCtrl::OnUpdateCopy
)
79 EVT_UPDATE_UI(wxID_PASTE
, wxTextCtrl::OnUpdatePaste
)
80 EVT_UPDATE_UI(wxID_UNDO
, wxTextCtrl::OnUpdateUndo
)
81 EVT_UPDATE_UI(wxID_REDO
, wxTextCtrl::OnUpdateRedo
)
85 // ============================================================================
87 // ============================================================================
89 // ----------------------------------------------------------------------------
91 // ----------------------------------------------------------------------------
94 wxTextCtrl::wxTextCtrl()
96 m_tempCallbackStruct
= (void*) NULL
;
98 m_processedDefault
= FALSE
;
101 bool wxTextCtrl::Create(wxWindow
*parent
,
103 const wxString
& value
,
107 const wxValidator
& validator
,
108 const wxString
& name
)
110 m_tempCallbackStruct
= (void*) NULL
;
112 m_processedDefault
= FALSE
;
113 // m_backgroundColour = parent->GetBackgroundColour();
114 m_backgroundColour
= * wxWHITE
;
115 m_foregroundColour
= parent
->GetForegroundColour();
118 SetValidator(validator
);
120 parent
->AddChild(this);
122 m_windowStyle
= style
;
125 m_windowId
= (int)NewControlId();
129 Widget parentWidget
= (Widget
) parent
->GetClientWidget();
131 bool wantHorizScrolling
= ((m_windowStyle
& wxHSCROLL
) != 0);
133 // If we don't have horizontal scrollbars, we want word wrap.
134 bool wantWordWrap
= !wantHorizScrolling
;
136 if (m_windowStyle
& wxTE_MULTILINE
)
139 XtSetArg (args
[0], XmNscrollHorizontal
, wantHorizScrolling
? True
: False
);
140 XtSetArg (args
[1], XmNwordWrap
, wantWordWrap
? True
: False
);
142 m_mainWidget
= (WXWidget
) XmCreateScrolledText(parentWidget
,
146 XtVaSetValues ((Widget
) m_mainWidget
,
147 XmNeditable
, ((style
& wxTE_READONLY
) ? False
: True
),
148 XmNeditMode
, XmMULTI_LINE_EDIT
,
150 XtManageChild ((Widget
) m_mainWidget
);
154 m_mainWidget
= (WXWidget
)XtVaCreateManagedWidget
162 XtVaSetValues ((Widget
) m_mainWidget
,
163 XmNeditable
, ((style
& wxTE_READONLY
) ? False
: True
),
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
,
175 // remove border if asked for
176 if ( style
& wxNO_BORDER
)
178 XtVaSetValues((Widget
)m_mainWidget
,
179 XmNshadowThickness
, 0,
186 // don't do this because it is just linking the text to a source
187 // string which is unsafe. MB
189 XmTextSetString ((Widget
) m_mainWidget
, (char*)value
.c_str());
191 // do this instead... MB
193 XtVaSetValues( (Widget
) m_mainWidget
,
194 XmNvalue
, (char *)value
.c_str(),
200 XtAddCallback((Widget
) m_mainWidget
, XmNvalueChangedCallback
, (XtCallbackProc
)wxTextWindowChangedProc
, (XtPointer
)this);
202 XtAddCallback((Widget
) m_mainWidget
, XmNmodifyVerifyCallback
, (XtCallbackProc
)wxTextWindowModifyProc
, (XtPointer
)this);
204 XtAddCallback((Widget
) m_mainWidget
, XmNactivateCallback
, (XtCallbackProc
)wxTextWindowActivateProc
, (XtPointer
)this);
206 XtAddCallback((Widget
) m_mainWidget
, XmNfocusCallback
, (XtCallbackProc
)wxTextWindowGainFocusProc
, (XtPointer
)this);
208 XtAddCallback((Widget
) m_mainWidget
, XmNlosingFocusCallback
, (XtCallbackProc
)wxTextWindowLoseFocusProc
, (XtPointer
)this);
211 m_font
= parent
->GetFont();
214 SetCanAddEventHandler(TRUE
);
215 AttachWidget (parent
, m_mainWidget
, (WXWidget
) NULL
, pos
.x
, pos
.y
, size
.x
, size
.y
);
217 ChangeBackgroundColour();
222 WXWidget
wxTextCtrl::GetTopWidget() const
224 return ((m_windowStyle
& wxTE_MULTILINE
) ? (WXWidget
) XtParent((Widget
) m_mainWidget
) : m_mainWidget
);
227 wxString
wxTextCtrl::GetValue() const
229 wxString str
; // result
231 if (m_windowStyle
& wxTE_PASSWORD
)
233 // the value is stored always in m_value because it can't be retrieved
234 // from the text control
239 // just get the string from Motif
240 char *s
= XmTextGetString ((Widget
) m_mainWidget
);
246 //else: return empty string
248 if ( m_tempCallbackStruct
)
250 // the string in the control isn't yet updated, can't use it as is
251 MergeChangesIntoString(str
, (XmTextVerifyCallbackStruct
*)
252 m_tempCallbackStruct
);
259 void wxTextCtrl::SetValue(const wxString
& value
)
264 // don't do this because it is just linking the text to a source
265 // string which is unsafe. MB
267 XmTextSetString ((Widget
) m_mainWidget
, (char*)value
.c_str());
269 // do this instead... MB
271 XtVaSetValues( (Widget
) m_mainWidget
,
272 XmNvalue
, (char *)value
.c_str(),
276 m_inSetValue
= FALSE
;
279 // Clipboard operations
280 void wxTextCtrl::Copy()
282 XmTextCopy((Widget
) m_mainWidget
, CurrentTime
);
285 void wxTextCtrl::Cut()
287 XmTextCut((Widget
) m_mainWidget
, CurrentTime
);
290 void wxTextCtrl::Paste()
292 XmTextPaste((Widget
) m_mainWidget
);
295 bool wxTextCtrl::CanCopy() const
297 // Can copy if there's a selection
299 GetSelection(& from
, & to
);
300 return (from
!= to
) ;
303 bool wxTextCtrl::CanCut() const
305 // Can cut if there's a selection
307 GetSelection(& from
, & to
);
308 return (from
!= to
) && (IsEditable());
311 bool wxTextCtrl::CanPaste() const
313 return IsEditable() ;
317 void wxTextCtrl::Undo()
319 // Not possible in Motif
322 void wxTextCtrl::Redo()
324 // Not possible in Motif
327 bool wxTextCtrl::CanUndo() const
333 bool wxTextCtrl::CanRedo() const
339 // If the return values from and to are the same, there is no
341 void wxTextCtrl::GetSelection(long* from
, long* to
) const
343 XmTextPosition left
, right
;
345 XmTextGetSelectionPosition((Widget
) m_mainWidget
, & left
, & right
);
351 bool wxTextCtrl::IsEditable() const
353 return (XmTextGetEditable((Widget
) m_mainWidget
) != 0);
356 void wxTextCtrl::SetEditable(bool editable
)
358 XmTextSetEditable((Widget
) m_mainWidget
, (Boolean
) editable
);
361 void wxTextCtrl::SetInsertionPoint(long pos
)
363 XmTextSetInsertionPosition ((Widget
) m_mainWidget
, (XmTextPosition
) pos
);
366 void wxTextCtrl::SetInsertionPointEnd()
368 long pos
= GetLastPosition();
369 SetInsertionPoint(pos
);
372 long wxTextCtrl::GetInsertionPoint() const
374 return (long) XmTextGetInsertionPosition ((Widget
) m_mainWidget
);
377 long wxTextCtrl::GetLastPosition() const
379 return (long) XmTextGetLastPosition ((Widget
) m_mainWidget
);
382 void wxTextCtrl::Replace(long from
, long to
, const wxString
& value
)
384 XmTextReplace ((Widget
) m_mainWidget
, (XmTextPosition
) from
, (XmTextPosition
) to
,
385 (char*) (const char*) value
);
388 void wxTextCtrl::Remove(long from
, long to
)
390 XmTextSetSelection ((Widget
) m_mainWidget
, (XmTextPosition
) from
, (XmTextPosition
) to
,
392 XmTextRemove ((Widget
) m_mainWidget
);
395 void wxTextCtrl::SetSelection(long from
, long to
)
398 to
= GetLastPosition();
400 XmTextSetSelection ((Widget
) m_mainWidget
, (XmTextPosition
) from
, (XmTextPosition
) to
,
404 bool wxTextCtrl::LoadFile(const wxString
& file
)
406 if (!wxFileExists(file
))
413 Widget textWidget
= (Widget
) m_mainWidget
;
417 if ((stat ((char*) (const char*) file
, &statb
) == -1) || (statb
.st_mode
& S_IFMT
) != S_IFREG
||
418 !(fp
= fopen ((char*) (const char*) file
, "r")))
424 long len
= statb
.st_size
;
426 if (!(text
= XtMalloc ((unsigned) (len
+ 1))))
431 if (fread (text
, sizeof (char), len
, fp
) != (size_t) len
)
437 XmTextSetString (textWidget
, text
);
438 // m_textPosition = len;
445 // If file is null, try saved file name first
446 // Returns TRUE if succeeds.
447 bool wxTextCtrl::SaveFile(const wxString
& file
)
449 wxString
theFile(file
);
451 theFile
= m_fileName
;
454 m_fileName
= theFile
;
456 Widget textWidget
= (Widget
) m_mainWidget
;
459 if (!(fp
= fopen ((char*) (const char*) theFile
, "w")))
465 char *text
= XmTextGetString (textWidget
);
466 long len
= XmTextGetLastPosition (textWidget
);
468 if (fwrite (text
, sizeof (char), len
, fp
) != (size_t) len
)
470 // Did not write whole file
472 // Make sure newline terminates the file
473 if (text
[len
- 1] != '\n')
483 void wxTextCtrl::WriteText(const wxString
& text
)
485 long textPosition
= GetInsertionPoint() + strlen (text
);
486 XmTextInsert ((Widget
) m_mainWidget
, GetInsertionPoint(), (char*) (const char*) text
);
487 XtVaSetValues ((Widget
) m_mainWidget
, XmNcursorPosition
, textPosition
, NULL
);
488 SetInsertionPoint(textPosition
);
489 XmTextShowPosition ((Widget
) m_mainWidget
, textPosition
);
493 void wxTextCtrl::AppendText(const wxString
& text
)
495 long textPosition
= GetLastPosition() + strlen(text
);
496 XmTextInsert ((Widget
) m_mainWidget
, GetLastPosition(), (char*) (const char*) text
);
497 XtVaSetValues ((Widget
) m_mainWidget
, XmNcursorPosition
, textPosition
, NULL
);
498 SetInsertionPoint(textPosition
);
499 XmTextShowPosition ((Widget
) m_mainWidget
, textPosition
);
503 void wxTextCtrl::Clear()
505 XmTextSetString ((Widget
) m_mainWidget
, "");
509 bool wxTextCtrl::IsModified() const
514 // Makes 'unmodified'
515 void wxTextCtrl::DiscardEdits()
520 int wxTextCtrl::GetNumberOfLines() const
522 // HIDEOUSLY inefficient, but we have no choice.
523 char *s
= XmTextGetString ((Widget
) m_mainWidget
);
528 bool finished
= FALSE
;
551 long wxTextCtrl::XYToPosition(long x
, long y
) const
553 /* It seems, that there is a bug in some versions of the Motif library,
554 so the original wxWin-Code doesn't work. */
556 Widget textWidget = (Widget) handle;
557 return (long) XmTextXYToPos (textWidget, (Position) x, (Position) y);
559 /* Now a little workaround: */
561 for (int i
=0; i
<y
; i
++) r
+=(GetLineLength(i
)+1);
565 bool wxTextCtrl::PositionToXY(long pos
, long *x
, long *y
) const
568 XmTextPosToXY((Widget
) m_mainWidget
, pos
, &xx
, &yy
);
577 void wxTextCtrl::ShowPosition(long pos
)
579 XmTextShowPosition ((Widget
) m_mainWidget
, (XmTextPosition
) pos
);
582 int wxTextCtrl::GetLineLength(long lineNo
) const
584 wxString str
= GetLineText (lineNo
);
585 return (int) str
.Length();
588 wxString
wxTextCtrl::GetLineText(long lineNo
) const
590 // HIDEOUSLY inefficient, but we have no choice.
591 char *s
= XmTextGetString ((Widget
) m_mainWidget
);
598 for (i
= 0; currentLine
!= lineNo
&& s
[i
]; i
++ )
603 for (j
= 0; s
[i
] && s
[i
] != '\n'; i
++, j
++ )
610 return wxEmptyString
;
617 void wxTextCtrl::Command(wxCommandEvent
& event
)
619 SetValue (event
.GetString());
620 ProcessCommand (event
);
623 void wxTextCtrl::OnDropFiles(wxDropFilesEvent
& event
)
625 // By default, load the first file into the text window.
626 if (event
.GetNumberOfFiles() > 0)
628 LoadFile(event
.GetFiles()[0]);
632 void wxTextCtrl::OnChar(wxKeyEvent
& event
)
634 // Indicates that we should generate a normal command, because
635 // we're letting default behaviour happen (otherwise it's vetoed
636 // by virtue of overriding OnChar)
637 m_processedDefault
= TRUE
;
639 if (m_tempCallbackStruct
)
641 XmTextVerifyCallbackStruct
*textStruct
=
642 (XmTextVerifyCallbackStruct
*) m_tempCallbackStruct
;
643 textStruct
->doit
= True
;
644 if (isascii(event
.m_keyCode
) && (textStruct
->text
->length
== 1))
646 textStruct
->text
->ptr
[0] = ((event
.m_keyCode
== WXK_RETURN
) ? 10 : event
.m_keyCode
);
651 void wxTextCtrl::ChangeFont(bool keepOriginalSize
)
653 wxWindow::ChangeFont(keepOriginalSize
);
656 void wxTextCtrl::ChangeBackgroundColour()
658 wxWindow::ChangeBackgroundColour();
660 /* TODO: should scrollbars be affected? Should probably have separate
661 * function to change them (by default, taken from wxSystemSettings)
663 if (m_windowStyle
& wxTE_MULTILINE
)
665 Widget parent
= XtParent ((Widget
) m_mainWidget
);
668 XtVaGetValues (parent
,
669 XmNhorizontalScrollBar
, &hsb
,
670 XmNverticalScrollBar
, &vsb
,
672 wxColour backgroundColour
= wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE
);
674 DoChangeBackgroundColour((WXWidget
) hsb
, backgroundColour
, TRUE
);
676 DoChangeBackgroundColour((WXWidget
) vsb
, backgroundColour
, TRUE
);
678 DoChangeBackgroundColour((WXWidget
) parent
, m_backgroundColour
, TRUE
);
682 void wxTextCtrl::ChangeForegroundColour()
684 wxWindow::ChangeForegroundColour();
686 if (m_windowStyle
& wxTE_MULTILINE
)
688 Widget parent
= XtParent ((Widget
) m_mainWidget
);
691 XtVaGetValues (parent
,
692 XmNhorizontalScrollBar
, &hsb
,
693 XmNverticalScrollBar
, &vsb
,
696 /* TODO: should scrollbars be affected? Should probably have separate
697 * function to change them (by default, taken from wxSystemSettings)
699 DoChangeForegroundColour((WXWidget) hsb, m_foregroundColour);
701 DoChangeForegroundColour((WXWidget) vsb, m_foregroundColour);
703 DoChangeForegroundColour((WXWidget
) parent
, m_foregroundColour
);
707 void wxTextCtrl::DoSendEvents(void *wxcbs
, long keycode
)
709 // we're in process of updating the text control
710 m_tempCallbackStruct
= wxcbs
;
712 XmTextVerifyCallbackStruct
*cbs
= (XmTextVerifyCallbackStruct
*)wxcbs
;
714 wxKeyEvent
event (wxEVT_CHAR
);
715 event
.SetId(GetId());
716 event
.m_keyCode
= keycode
;
717 event
.SetEventObject(this);
719 // Only if wxTextCtrl::OnChar is called will this be set to True (and
720 // the character passed through)
723 GetEventHandler()->ProcessEvent(event
);
725 if ( !InSetValue() && m_processedDefault
)
727 // Can generate a command
728 wxCommandEvent
commandEvent(wxEVT_COMMAND_TEXT_UPDATED
, GetId());
729 commandEvent
.SetEventObject(this);
730 ProcessCommand(commandEvent
);
733 // do it after the (user) event handlers processed the events because
734 // otherwise GetValue() would return incorrect (not yet updated value)
735 m_tempCallbackStruct
= NULL
;
738 // ----------------------------------------------------------------------------
739 // helpers and Motif callbacks
740 // ----------------------------------------------------------------------------
742 static void MergeChangesIntoString(wxString
& value
,
743 XmTextVerifyCallbackStruct
*cbs
)
746 * At least on my system (SunOS 4.1.3 + Motif 1.2), you need to think of
747 * every event as a replace event. cbs->text->ptr gives the replacement
748 * text, cbs->startPos gives the index of the first char affected by the
749 * replace, and cbs->endPos gives the index one more than the last char
750 * affected by the replace (startPos == endPos implies an empty range).
751 * Hence, a deletion is represented by replacing all input text with a
752 * blank string ("", *not* NULL!). A simple insertion that does not
753 * overwrite any text has startPos == endPos.
758 // easy case: the ol value was empty
759 value
= cbs
->text
->ptr
;
763 // merge the changes into the value
764 const char * const passwd
= value
;
765 int len
= value
.length();
767 len
+= ( cbs
->text
->ptr
?
768 strlen(cbs
->text
->ptr
) :
769 0 ) + 1; // + new text (if any) + NUL
770 len
-= cbs
->endPos
- cbs
->startPos
; // - text from affected region.
772 char * newS
= new char [len
];
774 * insert
= cbs
->text
->ptr
;
776 // Copy (old) text from passwd, up to the start posn of the change.
778 const char * p
= passwd
;
779 for (i
= 0; i
< cbs
->startPos
; ++i
)
782 // Copy the text to be inserted).
787 // Finally, copy into newS any remaining text from passwd[endPos] on.
788 for (p
= passwd
+ cbs
->endPos
; *p
; )
799 wxTextWindowChangedProc (Widget w
, XtPointer clientData
, XtPointer
WXUNUSED(ptr
))
801 if (!wxGetWindowFromTable(w
))
802 // Widget has been deleted!
805 wxTextCtrl
*tw
= (wxTextCtrl
*) clientData
;
806 tw
->SetModified(TRUE
);
810 wxTextWindowModifyProc (Widget
WXUNUSED(w
), XtPointer clientData
, XmTextVerifyCallbackStruct
*cbs
)
812 wxTextCtrl
*tw
= (wxTextCtrl
*) clientData
;
813 tw
->m_processedDefault
= FALSE
;
815 // First, do some stuff if it's a password control: in this case, we need
816 // to store the string inside the class because GetValue() can't retrieve
817 // it from the text ctrl. We do *not* do it in other circumstances because
818 // it would double the amount of memory needed.
820 if ( tw
->GetWindowStyleFlag() & wxTE_PASSWORD
)
822 MergeChangesIntoString(tw
->m_value
, cbs
);
824 if ( cbs
->text
->length
> 0 )
827 for (i
= 0; i
< cbs
->text
->length
; ++i
)
828 cbs
->text
->ptr
[i
] = '*';
829 cbs
->text
->ptr
[i
] = '\0';
833 // If we're already within an OnChar, return: probably a programmatic
835 if (tw
->m_tempCallbackStruct
)
838 // Check for a backspace
839 if (cbs
->startPos
== (cbs
->currInsert
- 1))
841 tw
->DoSendEvents((void *)cbs
, WXK_DELETE
);
846 // Pasting operation: let it through without calling OnChar
847 if (cbs
->text
->length
> 1)
850 // Something other than text
851 if (cbs
->text
->ptr
== NULL
)
855 char ch
= cbs
->text
->ptr
[0];
856 tw
->DoSendEvents((void *)cbs
, ch
== '\n' ? '\r' : ch
);
860 wxTextWindowGainFocusProc (Widget w
, XtPointer clientData
, XmAnyCallbackStruct
*WXUNUSED(cbs
))
862 if (!wxGetWindowFromTable(w
))
865 wxTextCtrl
*tw
= (wxTextCtrl
*) clientData
;
866 wxFocusEvent
event(wxEVT_SET_FOCUS
, tw
->GetId());
867 event
.SetEventObject(tw
);
868 tw
->GetEventHandler()->ProcessEvent(event
);
872 wxTextWindowLoseFocusProc (Widget w
, XtPointer clientData
, XmAnyCallbackStruct
*WXUNUSED(cbs
))
874 if (!wxGetWindowFromTable(w
))
877 wxTextCtrl
*tw
= (wxTextCtrl
*) clientData
;
878 wxFocusEvent
event(wxEVT_KILL_FOCUS
, tw
->GetId());
879 event
.SetEventObject(tw
);
880 tw
->GetEventHandler()->ProcessEvent(event
);
883 static void wxTextWindowActivateProc(Widget w
, XtPointer clientData
,
884 XmAnyCallbackStruct
*WXUNUSED(ptr
))
886 if (!wxGetWindowFromTable(w
))
889 wxTextCtrl
*tw
= (wxTextCtrl
*) clientData
;
891 if (tw
->InSetValue())
894 wxCommandEvent
event(wxEVT_COMMAND_TEXT_ENTER
);
895 event
.SetId(tw
->GetId());
896 event
.SetEventObject(tw
);
897 tw
->ProcessCommand(event
);
900 void wxTextCtrl::OnCut(wxCommandEvent
& WXUNUSED(event
))
905 void wxTextCtrl::OnCopy(wxCommandEvent
& WXUNUSED(event
))
910 void wxTextCtrl::OnPaste(wxCommandEvent
& WXUNUSED(event
))
915 void wxTextCtrl::OnUndo(wxCommandEvent
& WXUNUSED(event
))
920 void wxTextCtrl::OnRedo(wxCommandEvent
& WXUNUSED(event
))
925 void wxTextCtrl::OnUpdateCut(wxUpdateUIEvent
& event
)
927 event
.Enable( CanCut() );
930 void wxTextCtrl::OnUpdateCopy(wxUpdateUIEvent
& event
)
932 event
.Enable( CanCopy() );
935 void wxTextCtrl::OnUpdatePaste(wxUpdateUIEvent
& event
)
937 event
.Enable( CanPaste() );
940 void wxTextCtrl::OnUpdateUndo(wxUpdateUIEvent
& event
)
942 event
.Enable( CanUndo() );
945 void wxTextCtrl::OnUpdateRedo(wxUpdateUIEvent
& event
)
947 event
.Enable( CanRedo() );