X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2432b92dd7a837db13d3938a56c1959decd03203..8870c26ecb03e87065fdb3617b8c47ca3c923a53:/src/msw/textctrl.cpp diff --git a/src/msw/textctrl.cpp b/src/msw/textctrl.cpp index abf6eaf5f6..17cd5ae0c6 100644 --- a/src/msw/textctrl.cpp +++ b/src/msw/textctrl.cpp @@ -56,7 +56,7 @@ #if defined(__BORLANDC__) && !defined(__WIN32__) #include #else -#ifndef __GNUWIN32__ +#if !defined(__GNUWIN32__) && !defined(__SALFORDC__) #include #endif #define farmalloc malloc @@ -66,7 +66,13 @@ #include -#if defined(__WIN95__) && !defined(__GNUWIN32__) +#if defined(__WIN95__) && !defined(__TWIN32__) +#define wxUSE_RICHEDIT 1 +#else +#define wxUSE_RICHEDIT 0 +#endif + +#if wxUSE_RICHEDIT && !defined(__GNUWIN32__) #include #endif @@ -152,7 +158,7 @@ bool wxTextCtrl::Create(wxWindow *parent, wxWindowID id, msStyle |= ES_PASSWORD; char *windowClass = "EDIT"; -#if defined(__WIN95__) +#if wxUSE_RICHEDIT if ( m_windowStyle & wxTE_MULTILINE ) { msStyle |= ES_AUTOVSCROLL; @@ -168,7 +174,7 @@ bool wxTextCtrl::Create(wxWindow *parent, wxWindowID id, // If we're in Win95, and we want a simple 2D border, // then make it an EDIT control instead. -#if defined(__WIN95__) +#if wxUSE_RICHEDIT if (m_windowStyle & wxSIMPLE_BORDER) { windowClass = "EDIT"; @@ -196,7 +202,7 @@ bool wxTextCtrl::Create(wxWindow *parent, wxWindowID id, } #endif -#if defined(__WIN95__) +#if wxUSE_RICHEDIT if (m_isRich) { // Have to enable events @@ -244,9 +250,13 @@ void wxTextCtrl::AdoptAttributesFromHWND(void) #else #ifdef UNICODE GetClassNameW((HWND) hWnd, buf, 256); +#else +#ifdef __TWIN32__ + GetClassName((HWND) hWnd, buf, 256); #else GetClassNameA((HWND) hWnd, buf, 256); #endif +#endif #endif wxString str(buf); @@ -335,7 +345,7 @@ void wxTextCtrl::SetSize(int x, int y, int width, int height, int sizeFlags) int cx; // button font dimensions int cy; - wxGetCharSize(GetHWND(), &cx, &cy, & GetFont()); + wxGetCharSize(GetHWND(), &cx, &cy, & this->GetFont()); int control_width, control_height, control_x, control_y; @@ -394,7 +404,7 @@ void wxTextCtrl::SetInsertionPoint(long pos) { HWND hWnd = (HWND) GetHWND(); #ifdef __WIN32__ -#if defined(__WIN95__) +#if wxUSE_RICHEDIT if ( m_isRich) { CHARRANGE range; @@ -424,7 +434,7 @@ void wxTextCtrl::SetInsertionPointEnd(void) long wxTextCtrl::GetInsertionPoint(void) const { -#if defined(__WIN95__) +#if wxUSE_RICHEDIT if (m_isRich) { CHARRANGE range; @@ -535,9 +545,16 @@ bool wxTextCtrl::LoadFile(const wxString& file) // positions as signed shorts. Now load in one chunk... // Note use of 'farmalloc' as in Borland 3.1 'size_t' is 16-bits... +#ifdef __SALFORDC__ + struct _stat stat_buf; + if (stat((char*) (const char*) file, &stat_buf) < 0) + return FALSE; +#else struct stat stat_buf; if (stat(file, &stat_buf) < 0) return FALSE; +#endif + // char *tmp_buffer = (char*)farmalloc(stat_buf.st_size+1); // This may need to be a bigger buffer than the file size suggests, // if it's a UNIX file. Give it an extra 1000 just in case. @@ -747,7 +764,7 @@ void wxTextCtrl::OnDropFiles(wxDropFilesEvent& event) // 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) { @@ -983,10 +1000,13 @@ void wxTextCtrl::OnChar(wxKeyEvent& event) 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; } @@ -1089,7 +1109,7 @@ bool wxTextCtrl::MSWCommand(WXUINT param, WXWORD WXUNUSED(id)) // For Rich Edit controls. Do we need it? #if 0 -#if defined(__WIN95__) +#if wxUSE_RICHEDIT bool wxTextCtrl::MSWNotify(WXWPARAM wParam, WXLPARAM lParam) { wxCommandEvent event(0, m_windowId);