// Name: src/x11/textctrl.cpp
// Purpose:
// Author: Robert Roebling
-// Id: $Id$
// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef WX_PRECOMP
#include "wx/intl.h"
+ #include "wx/log.h"
+ #include "wx/utils.h"
+ #include "wx/panel.h"
+ #include "wx/dcclient.h"
+ #include "wx/settings.h"
#endif
-#include "wx/utils.h"
-#include "wx/log.h"
-#include "wx/settings.h"
-#include "wx/panel.h"
#include "wx/clipbrd.h"
#include "wx/tokenzr.h"
-#include "wx/dcclient.h"
#include "wx/univ/inphand.h"
#include "wx/univ/renderer.h"
// wxTextCtrl
//-----------------------------------------------------------------------------
-IMPLEMENT_DYNAMIC_CLASS(wxTextCtrl,wxControl)
-
-BEGIN_EVENT_TABLE(wxTextCtrl, wxControl)
+BEGIN_EVENT_TABLE(wxTextCtrl, wxTextCtrlBase)
EVT_PAINT(wxTextCtrl::OnPaint)
EVT_ERASE_BACKGROUND(wxTextCtrl::OnEraseBackground)
EVT_CHAR(wxTextCtrl::OnChar)
return ret;
}
-void wxTextCtrl::SetValue(const wxString& value)
+void wxTextCtrl::DoSetValue(const wxString& value, int flags)
{
m_modified = false;
MyAdjustScrollbars();
Refresh();
+
+ if ( flags & SetValue_SendEvent )
+ SendTextUpdatedEvent();
}
int wxTextCtrl::GetLineLength(long lineNo) const
size_t pos = 0;
wxString token( GetNextToken( line, pos ) );
- while (!token.IsNull())
+ while ( !token.empty() )
{
if (m_keywords.Index( token ) != wxNOT_FOUND)
{
{
if (m_windowStyle & wxTE_PROCESS_ENTER)
{
- wxCommandEvent event(wxEVT_COMMAND_TEXT_ENTER, m_windowId);
+ wxCommandEvent event(wxEVT_TEXT_ENTER, m_windowId);
event.SetEventObject(this);
event.SetString(GetValue());
- if (GetEventHandler()->ProcessEvent(event)) return;
+ if (HandleWindowEvent(event)) return;
}
if (IsSingleLine())
}
}
-// ----------------------------------------------------------------------------
-// freeze/thaw
-// ----------------------------------------------------------------------------
-
-void wxTextCtrl::Freeze()
-{
-}
-
-void wxTextCtrl::Thaw()
-{
-}
-
void wxTextCtrl::OnSetFocus( wxFocusEvent& event )
{
// To hide or show caret, as appropriate