+ rEvent.Enable(CanPaste());
+} // end of wxTextCtrl::OnUpdatePaste
+
+void wxTextCtrl::OnUpdateUndo( wxUpdateUIEvent& rEvent )
+{
+ rEvent.Enable(CanUndo());
+} // end of wxTextCtrl::OnUpdateUndo
+
+void wxTextCtrl::OnUpdateRedo( wxUpdateUIEvent& rEvent )
+{
+ rEvent.Enable(CanRedo());
+} // end of wxTextCtrl::OnUpdateRedo
+
+void wxTextCtrl::OnUpdateDelete( wxUpdateUIEvent& rEvent )
+{
+ long lFrom, lTo;
+
+ GetSelection( &lFrom, &lTo );
+ rEvent.Enable( lFrom != -1L && lTo != -1L && lFrom != lTo && IsEditable()) ;
+} // end of wxTextCtrl::OnUpdateDelete
+
+void wxTextCtrl::OnUpdateSelectAll( wxUpdateUIEvent& rEvent )
+{
+ rEvent.Enable(GetLastPosition() > 0);
+} // end of wxTextCtrl::OnUpdateSelectAll
+
+bool wxTextCtrl::SetBackgroundColour( const wxColour& rColour )
+{
+ if (m_bIsMLE)
+ ::WinSendMsg(GetHwnd(), MLM_SETBACKCOLOR, (MPARAM)rColour.GetPixel(), MLE_INDEX);
+ return true;
+} // end of wxTextCtrl::SetBackgroundColour
+
+bool wxTextCtrl::SetForegroundColour( const wxColour& rColour )
+{
+ if (m_bIsMLE)
+ ::WinSendMsg(GetHwnd(), MLM_SETTEXTCOLOR, (MPARAM)rColour.GetPixel(), MLE_INDEX);
+ return true;
+} // end of wxTextCtrl::SetForegroundColour
+
+bool wxTextCtrl::SetStyle( long lStart,
+ long lEnd,
+ const wxTextAttr& WXUNUSED(rStyle) )
+{
+ HWND hWnd = GetHwnd();
+
+ if (lStart > lEnd)
+ {
+ long lTmp = lStart;
+
+ lStart = lEnd;
+ lEnd = lTmp;
+ }
+
+ //
+ // We can only change the format of the selection, so select the range we
+ // want and restore the old selection later
+ //
+ long lStartOld, lEndOld;
+
+ GetSelection( &lStartOld, &lEndOld );
+
+ //
+ // But do we really have to change the selection?
+ //
+ bool bChangeSel = lStart != lStartOld ||
+ lEnd != lEndOld;
+
+ if (bChangeSel)
+ {
+ if (m_bIsMLE)
+ ::WinSendMsg(hWnd, MLM_SETSEL, MPFROM2SHORT((USHORT)lStart, (USHORT)lEnd), 0);
+ else
+ ::WinSendMsg(hWnd, EM_SETSEL, MPFROM2SHORT((USHORT)lStart, (USHORT)lEnd), 0);
+ }