X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5fb9fcfc01e19f91f42993d2c3fa2724531df856..2de8030dbe61287fb398057d61dd22fe45078c1d:/src/msw/textctrl.cpp?ds=inline diff --git a/src/msw/textctrl.cpp b/src/msw/textctrl.cpp index c6263deba8..fd62249fe9 100644 --- a/src/msw/textctrl.cpp +++ b/src/msw/textctrl.cpp @@ -39,12 +39,9 @@ #include #if wxUSE_IOSTREAMH -#include +# include #else -#include -# ifdef _MSC_VER - using namespace std; -# endif +# include #endif #include @@ -98,7 +95,6 @@ bool wxTextCtrl::Create(wxWindow *parent, wxWindowID id, const wxValidator& validator, const wxString& name) { - m_fileName = ""; SetName(name); SetValidator(validator); if (parent) parent->AddChild(this); @@ -315,7 +311,7 @@ void wxTextCtrl::SetValue(const wxString& value) SetWindowText((HWND) GetHWND(), (const char *)value); } -void wxTextCtrl::SetSize(int x, int y, int width, int height, int sizeFlags) +void wxTextCtrl::DoSetSize(int x, int y, int width, int height, int sizeFlags) { int currentX, currentY; GetPosition(¤tX, ¤tY); @@ -457,6 +453,7 @@ long wxTextCtrl::GetLastPosition() const void wxTextCtrl::Replace(long from, long to, const wxString& value) { +#if wxUSE_CLIPBOARD HWND hWnd = (HWND) GetHWND(); long fromChar = from; long toChar = to; @@ -474,6 +471,9 @@ void wxTextCtrl::Replace(long from, long to, const wxString& value) // Paste into edit control SendMessage(hWnd, WM_PASTE, (WPARAM)0, (LPARAM)0L); +#else + wxFAIL_MSG("wxTextCtrl::Replace not implemented if wxUSE_CLIPBOARD is 0."); +#endif } void wxTextCtrl::Remove(long from, long to) @@ -708,11 +708,6 @@ void wxTextCtrl::ShowPosition(long pos) int linesToScroll = specifiedLineLineNo - currentLineLineNo; -/* - wxDebugMsg("Caret line: %d; Current visible line: %d; Specified line: %d; lines to scroll: %d\n", - currentLineLineNo1, currentLineLineNo, specifiedLineLineNo, linesToScroll); -*/ - if (linesToScroll != 0) (void)SendMessage(hWnd, EM_LINESCROLL, (WPARAM)0, (LPARAM)MAKELPARAM(linesToScroll, 0)); } @@ -970,14 +965,15 @@ void wxTextCtrl::OnChar(wxKeyEvent& event) case '\\': { char c = (char)event.KeyCode(); - *this << c; + WriteText(c); } break; case WXK_RETURN: + { wxASSERT_MSG( m_windowStyle & wxTE_PROCESS_ENTER, "this text ctrl should never receive return" ); - if ( m_windowStyle & wxTE_MULTILINE == 0 ) + if ( (m_windowStyle & wxTE_MULTILINE) == 0 ) { wxCommandEvent event(wxEVT_COMMAND_TEXT_ENTER, m_windowId); event.SetEventObject( this ); @@ -987,7 +983,7 @@ void wxTextCtrl::OnChar(wxKeyEvent& event) //else: multiline controls need Enter for themselves break; - + } case WXK_TAB: // only produce navigation event if we don't process TAB ourself or // if it's a Shift-Tab keypress (we assume nobody will ever need @@ -1005,12 +1001,14 @@ void wxTextCtrl::OnChar(wxKeyEvent& event) if ( GetEventHandler()->ProcessEvent(eventNav) ) return; } + break; } // don't just call event.Skip() because this will cause TABs and ENTERs // be passed upwards and we don't always want this - instead process it // right here - Default(); + //Default(); + event.Skip(); } long wxTextCtrl::MSWGetDlgCode()