#ifndef WX_PRECOMP
#include "wx/textctrl.h"
#include "wx/settings.h"
+#include "wx/brush.h"
+#include "wx/utils.h"
+#include "wx/log.h"
#endif
#if wxUSE_CLIPBOARD
#endif
#include <sys/types.h>
+#ifndef __MWERKS__
#include <sys/stat.h>
+#else
+#include <stat.h>
+#endif
#if defined(__BORLANDC__) && !defined(__WIN32__)
#include <alloc.h>
#else
SubclassWin(GetHWND());
- if ( parent->GetFont() && parent->GetFont()->Ok() )
+ if ( parent->GetFont().Ok() && parent->GetFont().Ok() )
{
- SetFont(* parent->GetFont());
+ SetFont(parent->GetFont());
}
else
{
int cx; // button font dimensions
int cy;
- wxGetCharSize(GetHWND(), &cx, &cy,GetFont());
+ wxGetCharSize(GetHWND(), &cx, &cy, & GetFont());
int control_width, control_height, control_x, control_y;
bool wxTextCtrl::LoadFile(const wxString& file)
{
- if (!FileExists(WXSTRINGCAST file))
+ if (!wxFileExists(WXSTRINGCAST file))
return FALSE;
m_fileName = file;
// or when "endl" is output (Borland 4.5)
//=========================================================================
// Class declaration using multiple inheritance doesn't work properly for
-// Borland. See note in wb_text.h.
+// Borland. See note in textctrl.h.
#ifndef NO_TEXT_WINDOW_STREAM
int wxTextCtrl::overflow(int c)
{
// Make sure there is a holding area
+ // this is not needed in <iostream> usage as it automagically allocates
+ // it, but does someone want to emulate it for safety's sake?
+#if wxUSE_IOSTREAMH
if ( allocate()==EOF )
{
- wxError("Streambuf allocation failed","Internal error");
+ wxLogError("Streambuf allocation failed");
return EOF;
}
+#endif
// Verify that there are no characters in get area
if ( gptr() && gptr() < egptr() )
{
/* This doesn't seem to be fatal so comment out error message */
// wxError("Put area not opened","Internal error");
- setp( base(), base() );
+
+#if wxUSE_IOSTREAMH
+ setp( base(), base() );
+#else
+ setp( pbase(), pbase() );
+#endif
}
// Determine how many characters have been inserted but no consumed
void wxTextCtrl::OnChar(wxKeyEvent& event)
{
+ // Fix by Marcel Rasche to allow Alt-Ctrl insertion of special characters
+ switch(event.KeyCode())
+ {
+ case '{':
+ case '}':
+ case '[':
+ case ']':
+ case '|':
+ case '~':
+ case '\\':
+ {
+ char c=(char)event.KeyCode();
+ *this << c;
+ }
+ break;
+ }
if ( (event.KeyCode() == WXK_RETURN) && (m_windowStyle & wxPROCESS_ENTER))
{
wxCommandEvent event(wxEVT_COMMAND_TEXT_ENTER, m_windowId);
long wxTextCtrl::MSWGetDlgCode()
{
long lRc = DLGC_WANTCHARS | DLGC_WANTARROWS;
- if ( m_windowStyle & wxPROCESS_ENTER )
+ if ( m_windowStyle & wxTE_PROCESS_ENTER )
lRc |= DLGC_WANTMESSAGE;
else if ( m_windowStyle & wxTE_MULTILINE )
lRc |= DLGC_WANTMESSAGE;
+ // ??
+ if ( m_windowStyle & wxTE_PROCESS_TAB )
+ lRc |= DLGC_WANTTAB;
return lRc;
}
: wxEVT_SET_FOCUS,
m_windowId);
event.SetEventObject( this );
- ProcessEvent(event);
+ GetEventHandler()->ProcessEvent(event);
}
break;
event.SetEventObject( this );
event.SetEventType(eventType);
- if ( !ProcessEvent(event) )
+ if ( !GetEventHandler()->ProcessEvent(event) )
return FALSE;
return TRUE;