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>
35 #include "wx/textctrl.h"
36 #include "wx/settings.h"
37 #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
, wxControl
)
68 BEGIN_EVENT_TABLE(wxTextCtrl
, wxControl
)
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 m_tempCallbackStruct
= (void*) NULL
;
113 m_processedDefault
= FALSE
;
114 // m_backgroundColour = parent->GetBackgroundColour();
115 m_backgroundColour
= * wxWHITE
;
116 m_foregroundColour
= parent
->GetForegroundColour();
119 SetValidator(validator
);
121 parent
->AddChild(this);
123 m_windowStyle
= style
;
126 m_windowId
= (int)NewControlId();
130 Widget parentWidget
= (Widget
) parent
->GetClientWidget();
132 bool wantHorizScrolling
= ((m_windowStyle
& wxHSCROLL
) != 0);
134 // If we don't have horizontal scrollbars, we want word wrap.
135 bool wantWordWrap
= !wantHorizScrolling
;
137 if (m_windowStyle
& wxTE_MULTILINE
)
140 XtSetArg (args
[0], XmNscrollHorizontal
, wantHorizScrolling
? True
: False
);
141 XtSetArg (args
[1], XmNwordWrap
, wantWordWrap
? True
: False
);
143 m_mainWidget
= (WXWidget
) XmCreateScrolledText(parentWidget
,
147 XtVaSetValues ((Widget
) m_mainWidget
,
148 XmNeditable
, ((style
& wxTE_READONLY
) ? False
: True
),
149 XmNeditMode
, XmMULTI_LINE_EDIT
,
151 XtManageChild ((Widget
) m_mainWidget
);
155 m_mainWidget
= (WXWidget
)XtVaCreateManagedWidget
163 XtVaSetValues ((Widget
) m_mainWidget
,
164 XmNeditable
, ((style
& wxTE_READONLY
) ? False
: True
),
167 // TODO: Is this relevant? What does it do?
169 if (!value
.IsNull() && (value
.Length() > (unsigned int) noCols
))
170 noCols
= value
.Length();
171 XtVaSetValues((Widget
) m_mainWidget
,
176 // remove border if asked for
177 if ( style
& wxNO_BORDER
)
179 XtVaSetValues((Widget
)m_mainWidget
,
180 XmNshadowThickness
, 0,
187 // don't do this because it is just linking the text to a source
188 // string which is unsafe. MB
190 XmTextSetString ((Widget
) m_mainWidget
, (char*)value
.c_str());
192 // do this instead... MB
194 XtVaSetValues( (Widget
) m_mainWidget
,
195 XmNvalue
, (char *)value
.c_str(),
201 XtAddCallback((Widget
) m_mainWidget
, XmNvalueChangedCallback
, (XtCallbackProc
)wxTextWindowChangedProc
, (XtPointer
)this);
203 XtAddCallback((Widget
) m_mainWidget
, XmNmodifyVerifyCallback
, (XtCallbackProc
)wxTextWindowModifyProc
, (XtPointer
)this);
205 XtAddCallback((Widget
) m_mainWidget
, XmNactivateCallback
, (XtCallbackProc
)wxTextWindowActivateProc
, (XtPointer
)this);
207 XtAddCallback((Widget
) m_mainWidget
, XmNfocusCallback
, (XtCallbackProc
)wxTextWindowGainFocusProc
, (XtPointer
)this);
209 XtAddCallback((Widget
) m_mainWidget
, XmNlosingFocusCallback
, (XtCallbackProc
)wxTextWindowLoseFocusProc
, (XtPointer
)this);
212 m_font
= parent
->GetFont();
215 SetCanAddEventHandler(TRUE
);
216 AttachWidget (parent
, m_mainWidget
, (WXWidget
) NULL
, pos
.x
, pos
.y
, size
.x
, size
.y
);
218 ChangeBackgroundColour();
223 WXWidget
wxTextCtrl::GetTopWidget() const
225 return ((m_windowStyle
& wxTE_MULTILINE
) ? (WXWidget
) XtParent((Widget
) m_mainWidget
) : m_mainWidget
);
228 wxString
wxTextCtrl::GetValue() const
230 wxString str
; // result
232 if (m_windowStyle
& wxTE_PASSWORD
)
234 // the value is stored always in m_value because it can't be retrieved
235 // from the text control
240 // just get the string from Motif
241 char *s
= XmTextGetString ((Widget
) m_mainWidget
);
247 //else: return empty string
249 if ( m_tempCallbackStruct
)
251 // the string in the control isn't yet updated, can't use it as is
252 MergeChangesIntoString(str
, (XmTextVerifyCallbackStruct
*)
253 m_tempCallbackStruct
);
260 void wxTextCtrl::SetValue(const wxString
& value
)
265 // don't do this because it is just linking the text to a source
266 // string which is unsafe. MB
268 XmTextSetString ((Widget
) m_mainWidget
, (char*)value
.c_str());
270 // do this instead... MB
272 XtVaSetValues( (Widget
) m_mainWidget
,
273 XmNvalue
, (char *)value
.c_str(),
277 m_inSetValue
= FALSE
;
280 // Clipboard operations
281 void wxTextCtrl::Copy()
283 XmTextCopy((Widget
) m_mainWidget
, CurrentTime
);
286 void wxTextCtrl::Cut()
288 XmTextCut((Widget
) m_mainWidget
, CurrentTime
);
291 void wxTextCtrl::Paste()
293 XmTextPaste((Widget
) m_mainWidget
);
296 bool wxTextCtrl::CanCopy() const
298 // Can copy if there's a selection
300 GetSelection(& from
, & to
);
301 return (from
!= to
) ;
304 bool wxTextCtrl::CanCut() const
306 // Can cut if there's a selection
308 GetSelection(& from
, & to
);
309 return (from
!= to
) && (IsEditable());
312 bool wxTextCtrl::CanPaste() const
314 return IsEditable() ;
318 void wxTextCtrl::Undo()
320 // Not possible in Motif
323 void wxTextCtrl::Redo()
325 // Not possible in Motif
328 bool wxTextCtrl::CanUndo() const
334 bool wxTextCtrl::CanRedo() const
340 // If the return values from and to are the same, there is no
342 void wxTextCtrl::GetSelection(long* from
, long* to
) const
344 XmTextPosition left
, right
;
346 XmTextGetSelectionPosition((Widget
) m_mainWidget
, & left
, & right
);
352 bool wxTextCtrl::IsEditable() const
354 return (XmTextGetEditable((Widget
) m_mainWidget
) != 0);
357 void wxTextCtrl::SetEditable(bool editable
)
359 XmTextSetEditable((Widget
) m_mainWidget
, (Boolean
) editable
);
362 void wxTextCtrl::SetInsertionPoint(long pos
)
364 XmTextSetInsertionPosition ((Widget
) m_mainWidget
, (XmTextPosition
) pos
);
367 void wxTextCtrl::SetInsertionPointEnd()
369 long pos
= GetLastPosition();
370 SetInsertionPoint(pos
);
373 long wxTextCtrl::GetInsertionPoint() const
375 return (long) XmTextGetInsertionPosition ((Widget
) m_mainWidget
);
378 long wxTextCtrl::GetLastPosition() const
380 return (long) XmTextGetLastPosition ((Widget
) m_mainWidget
);
383 void wxTextCtrl::Replace(long from
, long to
, const wxString
& value
)
385 XmTextReplace ((Widget
) m_mainWidget
, (XmTextPosition
) from
, (XmTextPosition
) to
,
386 (char*) (const char*) value
);
389 void wxTextCtrl::Remove(long from
, long to
)
391 XmTextSetSelection ((Widget
) m_mainWidget
, (XmTextPosition
) from
, (XmTextPosition
) to
,
393 XmTextRemove ((Widget
) m_mainWidget
);
396 void wxTextCtrl::SetSelection(long from
, long to
)
399 to
= GetLastPosition();
401 XmTextSetSelection ((Widget
) m_mainWidget
, (XmTextPosition
) from
, (XmTextPosition
) to
,
405 bool wxTextCtrl::LoadFile(const wxString
& file
)
407 if (!wxFileExists(file
))
414 Widget textWidget
= (Widget
) m_mainWidget
;
418 if ((stat ((char*) (const char*) file
, &statb
) == -1) || (statb
.st_mode
& S_IFMT
) != S_IFREG
||
419 !(fp
= fopen ((char*) (const char*) file
, "r")))
425 long len
= statb
.st_size
;
427 if (!(text
= XtMalloc ((unsigned) (len
+ 1))))
432 if (fread (text
, sizeof (char), len
, fp
) != (size_t) len
)
438 XmTextSetString (textWidget
, text
);
439 // m_textPosition = len;
446 // If file is null, try saved file name first
447 // Returns TRUE if succeeds.
448 bool wxTextCtrl::SaveFile(const wxString
& file
)
450 wxString
theFile(file
);
452 theFile
= m_fileName
;
455 m_fileName
= theFile
;
457 Widget textWidget
= (Widget
) m_mainWidget
;
460 if (!(fp
= fopen ((char*) (const char*) theFile
, "w")))
466 char *text
= XmTextGetString (textWidget
);
467 long len
= XmTextGetLastPosition (textWidget
);
469 if (fwrite (text
, sizeof (char), len
, fp
) != (size_t) len
)
471 // Did not write whole file
473 // Make sure newline terminates the file
474 if (text
[len
- 1] != '\n')
484 void wxTextCtrl::WriteText(const wxString
& text
)
486 long textPosition
= GetInsertionPoint() + strlen (text
);
487 XmTextInsert ((Widget
) m_mainWidget
, GetInsertionPoint(), (char*) (const char*) text
);
488 XtVaSetValues ((Widget
) m_mainWidget
, XmNcursorPosition
, textPosition
, NULL
);
489 SetInsertionPoint(textPosition
);
490 XmTextShowPosition ((Widget
) m_mainWidget
, textPosition
);
494 void wxTextCtrl::AppendText(const wxString
& text
)
496 long textPosition
= GetLastPosition() + strlen(text
);
497 XmTextInsert ((Widget
) m_mainWidget
, GetLastPosition(), (char*) (const char*) text
);
498 XtVaSetValues ((Widget
) m_mainWidget
, XmNcursorPosition
, textPosition
, NULL
);
499 SetInsertionPoint(textPosition
);
500 XmTextShowPosition ((Widget
) m_mainWidget
, textPosition
);
504 void wxTextCtrl::Clear()
506 XmTextSetString ((Widget
) m_mainWidget
, "");
510 bool wxTextCtrl::IsModified() const
515 // Makes 'unmodified'
516 void wxTextCtrl::DiscardEdits()
521 int wxTextCtrl::GetNumberOfLines() const
523 // HIDEOUSLY inefficient, but we have no choice.
524 char *s
= XmTextGetString ((Widget
) m_mainWidget
);
529 bool finished
= FALSE
;
552 long wxTextCtrl::XYToPosition(long x
, long y
) const
554 /* It seems, that there is a bug in some versions of the Motif library,
555 so the original wxWin-Code doesn't work. */
557 Widget textWidget = (Widget) handle;
558 return (long) XmTextXYToPos (textWidget, (Position) x, (Position) y);
560 /* Now a little workaround: */
562 for (int i
=0; i
<y
; i
++) r
+=(GetLineLength(i
)+1);
566 bool wxTextCtrl::PositionToXY(long pos
, long *x
, long *y
) const
569 XmTextPosToXY((Widget
) m_mainWidget
, pos
, &xx
, &yy
);
578 void wxTextCtrl::ShowPosition(long pos
)
580 XmTextShowPosition ((Widget
) m_mainWidget
, (XmTextPosition
) pos
);
583 int wxTextCtrl::GetLineLength(long lineNo
) const
585 wxString str
= GetLineText (lineNo
);
586 return (int) str
.Length();
589 wxString
wxTextCtrl::GetLineText(long lineNo
) const
591 // HIDEOUSLY inefficient, but we have no choice.
592 char *s
= XmTextGetString ((Widget
) m_mainWidget
);
599 for (i
= 0; currentLine
!= lineNo
&& s
[i
]; i
++ )
604 for (j
= 0; s
[i
] && s
[i
] != '\n'; i
++, j
++ )
611 return wxEmptyString
;
618 void wxTextCtrl::Command(wxCommandEvent
& event
)
620 SetValue (event
.GetString());
621 ProcessCommand (event
);
624 void wxTextCtrl::OnDropFiles(wxDropFilesEvent
& event
)
626 // By default, load the first file into the text window.
627 if (event
.GetNumberOfFiles() > 0)
629 LoadFile(event
.GetFiles()[0]);
633 void wxTextCtrl::OnChar(wxKeyEvent
& event
)
635 // Indicates that we should generate a normal command, because
636 // we're letting default behaviour happen (otherwise it's vetoed
637 // by virtue of overriding OnChar)
638 m_processedDefault
= TRUE
;
640 if (m_tempCallbackStruct
)
642 XmTextVerifyCallbackStruct
*textStruct
=
643 (XmTextVerifyCallbackStruct
*) m_tempCallbackStruct
;
644 textStruct
->doit
= True
;
645 if (isascii(event
.m_keyCode
) && (textStruct
->text
->length
== 1))
647 textStruct
->text
->ptr
[0] = ((event
.m_keyCode
== WXK_RETURN
) ? 10 : event
.m_keyCode
);
652 void wxTextCtrl::ChangeFont(bool keepOriginalSize
)
654 wxWindow::ChangeFont(keepOriginalSize
);
657 void wxTextCtrl::ChangeBackgroundColour()
659 wxWindow::ChangeBackgroundColour();
661 /* TODO: should scrollbars be affected? Should probably have separate
662 * function to change them (by default, taken from wxSystemSettings)
664 if (m_windowStyle
& wxTE_MULTILINE
)
666 Widget parent
= XtParent ((Widget
) m_mainWidget
);
669 XtVaGetValues (parent
,
670 XmNhorizontalScrollBar
, &hsb
,
671 XmNverticalScrollBar
, &vsb
,
673 wxColour backgroundColour
= wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE
);
675 DoChangeBackgroundColour((WXWidget
) hsb
, backgroundColour
, TRUE
);
677 DoChangeBackgroundColour((WXWidget
) vsb
, backgroundColour
, TRUE
);
679 DoChangeBackgroundColour((WXWidget
) parent
, m_backgroundColour
, TRUE
);
683 void wxTextCtrl::ChangeForegroundColour()
685 wxWindow::ChangeForegroundColour();
687 if (m_windowStyle
& wxTE_MULTILINE
)
689 Widget parent
= XtParent ((Widget
) m_mainWidget
);
692 XtVaGetValues (parent
,
693 XmNhorizontalScrollBar
, &hsb
,
694 XmNverticalScrollBar
, &vsb
,
697 /* TODO: should scrollbars be affected? Should probably have separate
698 * function to change them (by default, taken from wxSystemSettings)
700 DoChangeForegroundColour((WXWidget) hsb, m_foregroundColour);
702 DoChangeForegroundColour((WXWidget) vsb, m_foregroundColour);
704 DoChangeForegroundColour((WXWidget
) parent
, m_foregroundColour
);
708 void wxTextCtrl::DoSendEvents(void *wxcbs
, long keycode
)
710 // we're in process of updating the text control
711 m_tempCallbackStruct
= wxcbs
;
713 XmTextVerifyCallbackStruct
*cbs
= (XmTextVerifyCallbackStruct
*)wxcbs
;
715 wxKeyEvent
event (wxEVT_CHAR
);
716 event
.SetId(GetId());
717 event
.m_keyCode
= keycode
;
718 event
.SetEventObject(this);
720 // Only if wxTextCtrl::OnChar is called will this be set to True (and
721 // the character passed through)
724 GetEventHandler()->ProcessEvent(event
);
726 if ( !InSetValue() && m_processedDefault
)
728 // Can generate a command
729 wxCommandEvent
commandEvent(wxEVT_COMMAND_TEXT_UPDATED
, GetId());
730 commandEvent
.SetEventObject(this);
731 ProcessCommand(commandEvent
);
734 // do it after the (user) event handlers processed the events because
735 // otherwise GetValue() would return incorrect (not yet updated value)
736 m_tempCallbackStruct
= NULL
;
739 // ----------------------------------------------------------------------------
740 // helpers and Motif callbacks
741 // ----------------------------------------------------------------------------
743 static void MergeChangesIntoString(wxString
& value
,
744 XmTextVerifyCallbackStruct
*cbs
)
747 * At least on my system (SunOS 4.1.3 + Motif 1.2), you need to think of
748 * every event as a replace event. cbs->text->ptr gives the replacement
749 * text, cbs->startPos gives the index of the first char affected by the
750 * replace, and cbs->endPos gives the index one more than the last char
751 * affected by the replace (startPos == endPos implies an empty range).
752 * Hence, a deletion is represented by replacing all input text with a
753 * blank string ("", *not* NULL!). A simple insertion that does not
754 * overwrite any text has startPos == endPos.
759 // easy case: the ol value was empty
760 value
= cbs
->text
->ptr
;
764 // merge the changes into the value
765 const char * const passwd
= value
;
766 int len
= value
.length();
768 len
+= ( cbs
->text
->ptr
?
769 strlen(cbs
->text
->ptr
) :
770 0 ) + 1; // + new text (if any) + NUL
771 len
-= cbs
->endPos
- cbs
->startPos
; // - text from affected region.
773 char * newS
= new char [len
];
775 * insert
= cbs
->text
->ptr
;
777 // Copy (old) text from passwd, up to the start posn of the change.
779 const char * p
= passwd
;
780 for (i
= 0; i
< cbs
->startPos
; ++i
)
783 // Copy the text to be inserted).
788 // Finally, copy into newS any remaining text from passwd[endPos] on.
789 for (p
= passwd
+ cbs
->endPos
; *p
; )
800 wxTextWindowChangedProc (Widget w
, XtPointer clientData
, XtPointer
WXUNUSED(ptr
))
802 if (!wxGetWindowFromTable(w
))
803 // Widget has been deleted!
806 wxTextCtrl
*tw
= (wxTextCtrl
*) clientData
;
807 tw
->SetModified(TRUE
);
811 wxTextWindowModifyProc (Widget
WXUNUSED(w
), XtPointer clientData
, XmTextVerifyCallbackStruct
*cbs
)
813 wxTextCtrl
*tw
= (wxTextCtrl
*) clientData
;
814 tw
->m_processedDefault
= FALSE
;
816 // First, do some stuff if it's a password control: in this case, we need
817 // to store the string inside the class because GetValue() can't retrieve
818 // it from the text ctrl. We do *not* do it in other circumstances because
819 // it would double the amount of memory needed.
821 if ( tw
->GetWindowStyleFlag() & wxTE_PASSWORD
)
823 MergeChangesIntoString(tw
->m_value
, cbs
);
825 if ( cbs
->text
->length
> 0 )
828 for (i
= 0; i
< cbs
->text
->length
; ++i
)
829 cbs
->text
->ptr
[i
] = '*';
830 cbs
->text
->ptr
[i
] = '\0';
834 // If we're already within an OnChar, return: probably a programmatic
836 if (tw
->m_tempCallbackStruct
)
839 // Check for a backspace
840 if (cbs
->startPos
== (cbs
->currInsert
- 1))
842 tw
->DoSendEvents((void *)cbs
, WXK_DELETE
);
847 // Pasting operation: let it through without calling OnChar
848 if (cbs
->text
->length
> 1)
851 // Something other than text
852 if (cbs
->text
->ptr
== NULL
)
856 char ch
= cbs
->text
->ptr
[0];
857 tw
->DoSendEvents((void *)cbs
, ch
== '\n' ? '\r' : ch
);
861 wxTextWindowGainFocusProc (Widget w
, XtPointer clientData
, XmAnyCallbackStruct
*WXUNUSED(cbs
))
863 if (!wxGetWindowFromTable(w
))
866 wxTextCtrl
*tw
= (wxTextCtrl
*) clientData
;
867 wxFocusEvent
event(wxEVT_SET_FOCUS
, tw
->GetId());
868 event
.SetEventObject(tw
);
869 tw
->GetEventHandler()->ProcessEvent(event
);
873 wxTextWindowLoseFocusProc (Widget w
, XtPointer clientData
, XmAnyCallbackStruct
*WXUNUSED(cbs
))
875 if (!wxGetWindowFromTable(w
))
878 wxTextCtrl
*tw
= (wxTextCtrl
*) clientData
;
879 wxFocusEvent
event(wxEVT_KILL_FOCUS
, tw
->GetId());
880 event
.SetEventObject(tw
);
881 tw
->GetEventHandler()->ProcessEvent(event
);
884 static void wxTextWindowActivateProc(Widget w
, XtPointer clientData
,
885 XmAnyCallbackStruct
*WXUNUSED(ptr
))
887 if (!wxGetWindowFromTable(w
))
890 wxTextCtrl
*tw
= (wxTextCtrl
*) clientData
;
892 if (tw
->InSetValue())
895 wxCommandEvent
event(wxEVT_COMMAND_TEXT_ENTER
);
896 event
.SetId(tw
->GetId());
897 event
.SetEventObject(tw
);
898 tw
->ProcessCommand(event
);
901 void wxTextCtrl::OnCut(wxCommandEvent
& WXUNUSED(event
))
906 void wxTextCtrl::OnCopy(wxCommandEvent
& WXUNUSED(event
))
911 void wxTextCtrl::OnPaste(wxCommandEvent
& WXUNUSED(event
))
916 void wxTextCtrl::OnUndo(wxCommandEvent
& WXUNUSED(event
))
921 void wxTextCtrl::OnRedo(wxCommandEvent
& WXUNUSED(event
))
926 void wxTextCtrl::OnUpdateCut(wxUpdateUIEvent
& event
)
928 event
.Enable( CanCut() );
931 void wxTextCtrl::OnUpdateCopy(wxUpdateUIEvent
& event
)
933 event
.Enable( CanCopy() );
936 void wxTextCtrl::OnUpdatePaste(wxUpdateUIEvent
& event
)
938 event
.Enable( CanPaste() );
941 void wxTextCtrl::OnUpdateUndo(wxUpdateUIEvent
& event
)
943 event
.Enable( CanUndo() );
946 void wxTextCtrl::OnUpdateRedo(wxUpdateUIEvent
& event
)
948 event
.Enable( CanRedo() );