m_dirty = false;
m_privateContextMenu = NULL;
- m_triggerUpdateEvents = true ;
}
wxTextCtrl::~wxTextCtrl()
return true;
}
-wxTextWidgetImpl* wxTextCtrl::GetTextPeer() const
-{
- return dynamic_cast<wxTextWidgetImpl*> (m_peer);
-}
-
void wxTextCtrl::MacSuperChangedPosition()
{
wxWindow::MacSuperChangedPosition() ;
return GetTextPeer()->GetLineText(lineNo) ;
}
-void wxTextCtrl::Remove(long from, long to)
-{
- wxTextEntry::Remove(from, to);
- if ( m_triggerUpdateEvents )
- SendTextUpdatedEvent();
-}
-
-void wxTextCtrl::WriteText(const wxString& str)
-{
- wxTextEntry::WriteText( str ) ;
- if ( m_triggerUpdateEvents )
- SendTextUpdatedEvent();
-}
-
-void wxTextCtrl::Clear()
+void wxTextCtrl::Copy()
{
- wxTextEntry::Clear() ;
- SendTextUpdatedEvent();
+ if (CanCopy())
+ {
+ wxClipboardTextEvent evt(wxEVT_COMMAND_TEXT_COPY, GetId());
+ evt.SetEventObject(this);
+ if (!GetEventHandler()->ProcessEvent(evt))
+ {
+ wxTextEntry::Copy();
+ }
+ }
}
void wxTextCtrl::Cut()
{
if (CanCut())
{
- wxTextEntry::Cut() ;
+ wxClipboardTextEvent evt(wxEVT_COMMAND_TEXT_CUT, GetId());
+ evt.SetEventObject(this);
+ if (!GetEventHandler()->ProcessEvent(evt))
+ {
+ wxTextEntry::Cut();
- SendTextUpdatedEvent();
+ SendTextUpdatedEvent();
+ }
}
}
{
if (CanPaste())
{
- wxTextEntry::Paste();
+ wxClipboardTextEvent evt(wxEVT_COMMAND_TEXT_PASTE, GetId());
+ evt.SetEventObject(this);
+ if (!GetEventHandler()->ProcessEvent(evt))
+ {
+ wxTextEntry::Paste();
- // TODO: eventually we should add setting the default style again
- SendTextUpdatedEvent();
+ // TODO: eventually we should add setting the default style again
+ SendTextUpdatedEvent();
+ }
}
}
void wxTextCtrl::OnKeyDown(wxKeyEvent& event)
{
- if ( event.MetaDown() )
+ if ( event.GetModifiers() == wxMOD_CMD )
{
switch( event.GetKeyCode() )
{