X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c085e333984dc079a001cd3f581aeb1f51a1f227..601d9e60e12e417584857fc430113346aecde105:/src/msw/textctrl.cpp diff --git a/src/msw/textctrl.cpp b/src/msw/textctrl.cpp index 65fe3eac81..623a803942 100644 --- a/src/msw/textctrl.cpp +++ b/src/msw/textctrl.cpp @@ -745,11 +745,15 @@ void wxTextCtrl::OnDropFiles(wxDropFilesEvent& event) int wxTextCtrl::overflow(int c) { // Make sure there is a holding area + // this is not needed in 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"); return EOF; } +#endif // Verify that there are no characters in get area if ( gptr() && gptr() < egptr() ) @@ -766,7 +770,12 @@ int wxTextCtrl::overflow(int c) { /* 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 @@ -928,6 +937,22 @@ WXHBRUSH wxTextCtrl::OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor, 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); @@ -1025,7 +1050,7 @@ bool wxTextCtrl::MSWCommand(WXUINT param, WXWORD WXUNUSED(id)) : wxEVT_SET_FOCUS, m_windowId); event.SetEventObject( this ); - ProcessEvent(event); + GetEventHandler()->ProcessEvent(event); } break; @@ -1074,7 +1099,7 @@ bool wxTextCtrl::MSWNotify(WXWPARAM wParam, WXLPARAM lParam) event.SetEventObject( this ); event.SetEventType(eventType); - if ( !ProcessEvent(event) ) + if ( !GetEventHandler()->ProcessEvent(event) ) return FALSE; return TRUE;