// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#include "wx/defs.h"
+#include "wx/wxprec.h"
+
+#ifdef __BORLANDC__
+ #pragma hdrstop
+#endif
#if wxUSE_TEXTCTRL
+#include "wx/textctrl.h"
+
+#ifndef WX_PRECOMP
+ #include "wx/app.h"
+ #include "wx/utils.h"
+ #include "wx/dc.h"
+ #include "wx/button.h"
+ #include "wx/settings.h"
+ #include "wx/msgdlg.h"
+ #include "wx/toplevel.h"
+#endif
+
#ifdef __DARWIN__
- #include <sys/types.h>
- #include <sys/stat.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
#else
- #include <stat.h>
+ #include <stat.h>
#endif
-#include "wx/msgdlg.h"
-
#if wxUSE_STD_IOSTREAM
#if wxUSE_IOSTREAMH
#include <fstream.h>
#endif
#endif
-#include "wx/app.h"
-#include "wx/dc.h"
-#include "wx/button.h"
-#include "wx/toplevel.h"
-#include "wx/textctrl.h"
#include "wx/notebook.h"
#include "wx/tabctrl.h"
-#include "wx/settings.h"
#include "wx/filefn.h"
-#include "wx/utils.h"
#if defined(__BORLANDC__) && !defined(__WIN32__)
- #include <alloc.h>
+ #include <alloc.h>
#elif !defined(__MWERKS__) && !defined(__GNUWIN32) && !defined(__DARWIN__)
- #include <malloc.h>
+ #include <malloc.h>
#endif
#ifndef __DARWIN__
-IMPLEMENT_DYNAMIC_CLASS(wxTextCtrl, wxControl)
+IMPLEMENT_DYNAMIC_CLASS(wxTextCtrl, wxTextCtrlBase)
-BEGIN_EVENT_TABLE(wxTextCtrl, wxControl)
+BEGIN_EVENT_TABLE(wxTextCtrl, wxTextCtrlBase)
EVT_DROP_FILES(wxTextCtrl::OnDropFiles)
EVT_CHAR(wxTextCtrl::OnChar)
EVT_MENU(wxID_CUT, wxTextCtrl::OnCut)
{
#if wxUSE_UNICODE
#if SIZEOF_WCHAR_T == 2
- size_t len = st.Len() ;
+ size_t len = st.length() ;
TXNSetData( txn , kTXNUnicodeTextData, (void*)st.wc_str(), len * 2,
start, end);
#else
}
}
-bool wxTextCtrl::LoadFile(const wxString& file)
-{
- if ( wxTextCtrlBase::LoadFile(file) )
- {
- return true;
- }
-
- return false;
-}
-
void wxTextCtrl::WriteText(const wxString& str)
{
wxString st = str ;
}
if ( !IsEditable() && key != WXK_LEFT && key != WXK_RIGHT && key != WXK_DOWN && key != WXK_UP && key != WXK_TAB &&
- !( key == WXK_RETURN && ( (m_windowStyle & wxPROCESS_ENTER) || (m_windowStyle & wxTE_MULTILINE) ) )
+ !( key == WXK_RETURN && ( (m_windowStyle & wxTE_PROCESS_ENTER) || (m_windowStyle & wxTE_MULTILINE) ) )
/* && key != WXK_PAGEUP && key != WXK_PAGEDOWN && key != WXK_HOME && key != WXK_END */
)
{
switch ( key )
{
case WXK_RETURN:
- if (m_windowStyle & wxPROCESS_ENTER)
+ if (m_windowStyle & wxTE_PROCESS_ENTER)
{
wxCommandEvent event(wxEVT_COMMAND_TEXT_ENTER, m_windowId);
event.SetEventObject( this );
}
if ( !(m_windowStyle & wxTE_MULTILINE) )
{
- wxWindow *parent = GetParent();
- while( parent && !parent->IsTopLevel() && parent->GetDefaultItem() == NULL ) {
- parent = parent->GetParent() ;
- }
- if ( parent && parent->GetDefaultItem() )
+ wxTopLevelWindow *tlw = wxDynamicCast(wxGetTopLevelParent(this), wxTopLevelWindow);
+ if ( tlw && tlw->GetDefaultItem() )
{
- wxButton *def = wxDynamicCast(parent->GetDefaultItem(),
- wxButton);
+ wxButton *def = wxDynamicCast(tlw->GetDefaultItem(), wxButton);
if ( def && def->IsEnabled() )
{
wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, def->GetId() );